diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-16 00:13:49 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-18 19:01:06 +0800 |
commit | c9b1a29662c4a681f7e53a4bdf7477e326b45298 (patch) | |
tree | c04fa5222c3f0b8af10f2a74108d0098746bff50 /src | |
parent | f82cf307e75f0446b4e590b0036a179b64862939 (diff) | |
download | gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar.gz gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar.bz2 gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar.lz gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar.xz gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.tar.zst gsoc2013-empathy-c9b1a29662c4a681f7e53a4bdf7477e326b45298.zip |
accounts-dialog: remember the account and password param when changing protocol (#605532)
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-dialog.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index c1f386b57..c30066a03 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -570,6 +570,8 @@ accounts_dialog_protocol_changed_cb (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; gboolean creating; + EmpathyAccountSettings *settings; + gchar *account = NULL, *password = NULL; /* The "changed" signal is fired during the initiation of the * EmpathyProtocolChooser while populating the widget. Such signals should @@ -587,12 +589,39 @@ accounts_dialog_protocol_changed_cb (GtkWidget *widget, if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; + /* Save "account" and "password" parameters */ + g_object_get (priv->setting_widget_object, "settings", &settings, NULL); + + if (settings != NULL) + { + account = g_strdup (empathy_account_settings_get_string (settings, + "account")); + password = g_strdup (empathy_account_settings_get_string (settings, + "password")); + g_object_unref (settings); + } + /* We are creating a new widget to replace the current one, don't ask * confirmation to the user. */ priv->force_change_row = TRUE; gtk_list_store_remove (GTK_LIST_STORE (model), &iter); accounts_dialog_setup_ui_to_add_account (dialog); + + /* Restore "account" and "password" parameters in the new widget */ + if (account != NULL) + { + empathy_account_widget_set_account_param (priv->setting_widget_object, + account); + g_free (account); + } + + if (password != NULL) + { + empathy_account_widget_set_password_param (priv->setting_widget_object, + password); + g_free (password); + } } static void |