diff options
-rw-r--r-- | src/empathy-accounts-dialog.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 87ddba0bb..83179a8b9 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -1774,6 +1774,7 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, const gchar *name; gboolean enabled; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + gboolean selected = FALSE; model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); status = tp_account_get_connection_status (account, NULL); @@ -1783,7 +1784,16 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, settings = empathy_account_settings_new_for_account (account); if (!accounts_dialog_get_account_iter (dialog, account, &iter)) - gtk_list_store_append (GTK_LIST_STORE (model), &iter); + { + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + } + else + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + selected = gtk_tree_selection_iter_is_selected (selection, &iter); + } gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_NAME, name, @@ -1792,6 +1802,14 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog, COL_ACCOUNT_SETTINGS, settings, -1); + if (selected) + { + /* We just modified the selected account. Its display name may have been + * changed and so it's place in the treeview. Scroll to it so it stays + * visible. */ + select_and_scroll_to_iter (dialog, &iter); + } + accounts_dialog_connection_changed_cb (account, 0, status, |