From 946343d4804ec5c09ff13c69ae161cd616f2f514 Mon Sep 17 00:00:00 2001 From: Sankar P Date: Fri, 24 Feb 2006 05:08:52 +0000 Subject: Added code to handle the case if the account is marked as default. Fixes 2006-02-24 Sankar P * em-account-editor.c: (emae_check_complete) (emae_identity_page): Added code to handle the case if the account is marked as default. Fixes #332034 svn path=/trunk/; revision=31573 --- mail/em-account-editor.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mail/em-account-editor.c') diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 23a9f5a15c..ba51b4e741 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -1744,8 +1744,9 @@ emae_identity_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "management_default")); if (!mail_config_get_default_account () - || (account == mail_config_get_default_account ())) - gtk_toggle_button_set_active (gui->default_account, TRUE); + || (account == mail_config_get_default_account ()) + || (GPOINTER_TO_INT(g_object_get_data (emae->account, "default_flagged"))) ) + gtk_toggle_button_set_active (gui->default_account, TRUE); if (emae->do_signature) { emae_setup_signatures(emae, xml); @@ -2581,6 +2582,14 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data) } } + /* + Setting a flag on the Account if it is marked as default. It is done in this way instead of + using a temporary variable so as to keep track of which account is marked as default in case of + editing multiple accounts at a time + */ + if (gtk_toggle_button_get_active(emae->priv->default_account)) + g_object_set_data (emae->account, "default_flagged", GINT_TO_POINTER(1)); + if (pageid == NULL || !strcmp(pageid, "00.identity")) { /* TODO: check the account name is set, and unique in the account list */ ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_NAME)) -- cgit v1.2.3