aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config-druid.c
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-07-19 09:25:09 +0800
committerJacob Leach <jleach@src.gnome.org>2001-07-19 09:25:09 +0800
commitc87ef1f0a3302d89aacafcff22de49e442c18dc4 (patch)
treeade4574bee3d8204047b40ac6881d4cae5a5786b /mail/mail-config-druid.c
parent150e7c57f8f542baf7e4f71caf38fe0d60c8917b (diff)
downloadgsoc2013-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-config-druid.c')
-rw-r--r--mail/mail-config-druid.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 018b220b61..84730f3cf0 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -164,7 +164,6 @@ create_html (const char *name)
static void
druid_cancel (GnomeDruid *druid, gpointer user_data)
{
- /* Cancel the setup of the account */
MailConfigDruid *config = user_data;
gtk_widget_destroy (GTK_WIDGET (config));
@@ -173,17 +172,23 @@ druid_cancel (GnomeDruid *druid, gpointer user_data)
static void
druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data)
{
- /* Cancel the setup of the account */
MailConfigDruid *druid = user_data;
MailAccountGui *gui = druid->gui;
GSList *mini;
-
+
+ /* Add the account to our list (do it first because future
+ steps might want to access config->accounts) */
+ mail_config_add_account (gui->account);
+
+ /* Save the settings for that account */
mail_account_gui_save (gui);
if (gui->account->source)
gui->account->source->enabled = TRUE;
- mail_config_add_account (gui->account);
+
+ /* Write out the config info */
mail_config_write ();
-
+
+ /* Load up this new account */
mini = g_slist_prepend (NULL, gui->account);
mail_load_storages (druid->shell, mini, TRUE);
g_slist_free (mini);
@@ -376,15 +381,13 @@ management_changed (GtkWidget *widget, gpointer data)
static MailConfigAccount *
-make_default_account (void)
+make_account (void)
{
MailConfigAccount *account;
char *name, *user;
struct utsname uts;
account = g_new0 (MailConfigAccount, 1);
- if (!mail_config_get_default_account)
- account->default_account = TRUE;
account->id = g_new0 (MailConfigIdentity, 1);
name = g_get_real_name ();
@@ -450,7 +453,7 @@ construct (MailConfigDruid *druid)
MailConfigAccount *account;
int i;
- account = make_default_account ();
+ account = make_account ();
druid->gui = mail_account_gui_new (account);
/* get our toplevel widget and reparent it */