[empathy/more-accounts-fixes: 1/4] Don't create some extra "ghost" account if we're creating our first account and we change protocols



commit d5ae581b39fd3532e8a8e90d383164039b2fafc7
Author: Travis Reitter <treitter gmail com>
Date:   Fri Feb 26 12:08:27 2010 -0800

    Don't create some extra "ghost" account if we're creating our first account and we change protocols in the protocol combo box.

 src/empathy-accounts-dialog.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index e34903f..6501914 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -625,8 +625,17 @@ accounts_dialog_protocol_changed_cb (GtkWidget *widget,
   /* We are creating a new widget to replace the current one, don't ask
    * confirmation to the user. */
   priv->force_change_row = TRUE;
+
+  /* We'll update the selection after we create the new account widgets;
+   * updating it right now causes problems for the # of accounts = zero case */
+  g_signal_handlers_block_by_func (selection,
+      accounts_dialog_model_selection_changed, dialog);
+
   gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
 
+  g_signal_handlers_unblock_by_func (selection,
+      accounts_dialog_model_selection_changed, dialog);
+
   accounts_dialog_setup_ui_to_add_account (dialog);
 
   /* Restore "account" and "password" parameters in the new widget */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]