From 43f23f54d91c91143544034356cb42e415da9eb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 11 Jan 2001 00:18:40 +0000 Subject: New function that explains to the user why he can't do the action he 2001-01-10 Jeffrey Stedfast * mail-callbacks.c (configure_mail): New function that explains to the user why he can't do the action he requested and then procedes to ask if he'd like to configure his accounts now. (check_send_configuration): If the user doesn't have configured accounts, don't let him continue and call configure_mail(). (fetch_mail): Same. (send_queued_mail): Same. (send_receieve_mail): Same. * mail-config.c (mail_config_write): Don't save a "is_configured" variable. Instead we'll just check to see if we have accounts - if yes, then configured == TRUE. (mail_config_is_configured): return accounts != NULL. (mail_config_get_default_account): Mark the first account as the default if none are marked. svn path=/trunk/; revision=7377 --- mail/mail-config.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index f67d2c7578..f238207d79 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -35,7 +35,6 @@ #include "mail-ops.h" typedef struct { - gboolean configured; gboolean thread_list; gboolean view_source; gint paned_size; @@ -201,11 +200,6 @@ config_read (void) mail_config_clear (); - /* Configured */ - str = g_strdup_printf ("=%s/config/General=/General/configured", evolution_dir); - config->configured = gnome_config_get_bool (str); - g_free (str); - /* Accounts */ str = g_strdup_printf ("=%s/config/Mail=/Accounts/", evolution_dir); gnome_config_push_prefix (str); @@ -326,13 +320,6 @@ mail_config_write (void) gchar *str; gint len, i; - /* Configured switch */ - str = g_strdup_printf ("=%s/config/General=/General/configured", - evolution_dir); - config->configured = TRUE; - gnome_config_set_bool (str, config->configured); - g_free (str); - /* Accounts */ str = g_strdup_printf ("=%s/config/Mail=/Accounts/", evolution_dir); gnome_config_push_prefix (str); @@ -456,7 +443,7 @@ mail_config_write_on_exit (void) gboolean mail_config_is_configured (void) { - return config->configured; + return config->accounts != NULL; } gboolean @@ -537,8 +524,11 @@ mail_config_get_default_account (void) l = l->next; } - /* non are marked as default so return the first one */ - return (MailConfigAccount *)config->accounts->data; + /* none are marked as default so mark the first one as the default */ + account = config->accounts->data; + mail_config_set_default_account (account); + + return account; } const GSList * -- cgit v1.2.3