diff options
author | Jason Leach <jleach@ximian.com> | 2001-07-19 09:25:09 +0800 |
---|---|---|
committer | Jacob Leach <jleach@src.gnome.org> | 2001-07-19 09:25:09 +0800 |
commit | c87ef1f0a3302d89aacafcff22de49e442c18dc4 (patch) | |
tree | ade4574bee3d8204047b40ac6881d4cae5a5786b /mail/mail-account-gui.c | |
parent | 150e7c57f8f542baf7e4f71caf38fe0d60c8917b (diff) | |
download | gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.gz gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.tar.zst gsoc2013-evolution-c87ef1f0a3302d89aacafcff22de49e442c18dc4.zip |
[Simplifying how default account is stored and used internally, fixes
2001-07-18 Jason Leach <jleach@ximian.com>
[Simplifying how default account is stored and used internally,
fixes possabilities of having multiple default accounts and things
like deleting the current default account]
* mail-account-gui.c (mail_account_gui_new): Update for new way of
finding out the default account.
(mail_account_gui_save): Ditto.
* mail-accounts.c (load_accounts): Ditto.
* mail-config-druid.c (make_default_account): Ditto.
* mail-config.c: Added an int MailConfig::default_account, to be
used instead of a 'default_account' boolean on each mail account.
(mail_config_set_default_account_num): New function, facilitates
things.
* Mail.idl: removed the Account::default_account boolean.
svn path=/trunk/; revision=11218
Diffstat (limited to 'mail/mail-account-gui.c')
-rw-r--r-- | mail/mail-account-gui.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index 6d32b7527b..6e0e09d444 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -1131,7 +1131,9 @@ mail_account_gui_new (MailConfigAccount *account) gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "management_default")); if (account->name) e_utf8_gtk_entry_set_text (gui->account_name, account->name); - gtk_toggle_button_set_active (gui->default_account, account->default_account); + if (!mail_config_get_default_account() + || (account == mail_config_get_default_account())) + gtk_toggle_button_set_active (gui->default_account, TRUE); /* Identity */ gui->full_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_full_name")); @@ -1531,8 +1533,9 @@ mail_account_gui_save (MailAccountGui *gui) g_free (account->name); account->name = e_utf8_gtk_entry_get_text (gui->account_name); - account->default_account = gtk_toggle_button_get_active (gui->default_account); - + if (gtk_toggle_button_get_active (gui->default_account)) + mail_config_set_default_account (account); + /* construct the identity */ identity_destroy (account->id); account->id = g_new0 (MailConfigIdentity, 1); |