[empathy] accounts-dialog: don't always select the first account automatically
- From: Jonny Lamb <jonnylamb src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] accounts-dialog: don't always select the first account automatically
- Date: Tue, 3 Nov 2009 10:49:13 +0000 (UTC)
commit 1529840ddfa801111b2292c99de75d7e32272324
Author: Jonny Lamb <jonnylamb gnome org>
Date: Tue Nov 3 10:38:19 2009 +0000
accounts-dialog: don't always select the first account automatically
Sometimes it takes a while to get all account details, but getting the
account names is fairly quick. What tends to happen is that the tree
view of account names is populated immediately, but the account widget
is just grey until all details are retrieved. This time is enough to
select an account in the tree view for editing.
However, previously, once all details are retrieved, the first account
is automatically selected. This is of course sensible if the user has
not selected an account, but it's pretty annoying if you've already
selected your seventeenth jabber account and then it plonks you back
to number one.
This patch only selects the first account if there is not one already
selected.
Signed-off-by: Jonny Lamb <jonnylamb gnome org>
src/empathy-accounts-dialog.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 860d615..2a09e27 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -542,14 +542,19 @@ accounts_dialog_update_settings (EmpathyAccountsDialog *dialog,
{
GtkTreeView *view;
GtkTreeModel *model;
+ GtkTreeSelection *selection;
view = GTK_TREE_VIEW (priv->treeview);
model = gtk_tree_view_get_model (view);
+ selection = gtk_tree_view_get_selection (view);
if (gtk_tree_model_iter_n_children (model, NULL) > 0)
{
- /* We have configured accounts, select the first one */
- accounts_dialog_model_select_first (dialog);
+ /* We have configured accounts, select the first one if there
+ * is no other account selected already. */
+ if (!gtk_tree_selection_get_selected (selection, NULL, NULL))
+ accounts_dialog_model_select_first (dialog);
+
return;
}
if (empathy_connection_managers_get_cms_num (priv->cms) > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]