From 1529840ddfa801111b2292c99de75d7e32272324 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Tue, 3 Nov 2009 10:38:19 +0000 Subject: 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 --- src/empathy-accounts-dialog.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 860d61531..2a09e277b 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) -- cgit v1.2.3