diff options
author | Dan Winship <danw@src.gnome.org> | 2001-03-27 13:23:27 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-03-27 13:23:27 +0800 |
commit | 6dd8aabeeee1945c4d96af5e045b75995db56517 (patch) | |
tree | da872e79836a7a5237ed5e37cefe71a789f66ca0 /mail/mail-config.c | |
parent | 0b8af6dc0a87c119bf91b7aa62157d627cf573d0 (diff) | |
download | gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar.gz gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar.bz2 gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar.lz gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar.xz gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.tar.zst gsoc2013-evolution-6dd8aabeeee1945c4d96af5e045b75995db56517.zip |
Probably the very last new config dialog ever. (Ha ha). From Anna, based
* mail-config.glade: Probably the very last new config dialog
ever. (Ha ha). From Anna, based on a story by me.
* mail-account-gui.c: New code for the new mail-config.glade. This
abstracts out all of the common code between the account editor
and the druid. It also handles the spiffy new provider-specific
config stuff.
FIXME: The code to check if a service is ok or not is no longer
there... waiting until the online/offline stuff from the shell
appears.
* mail-account-editor.c, mail-config-druid.c: These are much
smaller now, since most of the interesting bits moved to
mail-account-gui.c
* mail-accounts.c: Add an enabled/disabled column/button to
replace the checkbox that used to be in the editor, because it
really makes more sense to have it out here. This looks ugly.
Probably ought to ETable it...
(load_accounts): Fill in the enabled column.
(mail_select, mail_unselect): toggle the sensitivity and name of
the Enable/Disable button appropriately
(mail_able): Handle the enable/disable button.
* mail-config.c: Remove reply-to from MailConfigIdentity since it
didn't belong there (and wasn't being saved anyway).
(mail_config_check_service): Simplify this a bit. This really
needs to pop up a dialog with a "connecting..." message and a
cancel button.
svn path=/trunk/; revision=8971
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index a4748e35e5..41b1b482bf 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -69,7 +69,6 @@ identity_copy (const MailConfigIdentity *id) new = g_new0 (MailConfigIdentity, 1); new->name = g_strdup (id->name); new->address = g_strdup (id->address); - new->reply_to = g_strdup (id->reply_to); new->organization = g_strdup (id->organization); new->signature = g_strdup (id->signature); @@ -84,7 +83,6 @@ identity_destroy (MailConfigIdentity *id) g_free (id->name); g_free (id->address); - g_free (id->reply_to); g_free (id->organization); g_free (id->signature); @@ -238,9 +236,6 @@ config_read (void) path = g_strdup_printf ("identity_name_%d", i); id->name = gnome_config_get_string (path); g_free (path); - path = g_strdup_printf ("identity_replyto_%d", i); - id->reply_to = gnome_config_get_string (path); - g_free (path); path = g_strdup_printf ("identity_address_%d", i); id->address = gnome_config_get_string (path); g_free (path); @@ -309,6 +304,7 @@ config_read (void) } gnome_config_pop_prefix (); +#ifdef ENABLE_NNTP /* News */ str = g_strdup_printf ("=%s/config/News=/Sources/", evolution_dir); gnome_config_push_prefix (str); @@ -328,6 +324,7 @@ config_read (void) config->news = g_slist_append (config->news, n); } gnome_config_pop_prefix (); +#endif /* Format */ str = g_strdup_printf ("=%s/config/Mail=/Format/send_html", @@ -472,6 +469,7 @@ mail_config_write (void) } gnome_config_pop_prefix (); +#ifdef ENABLE_NNTP /* News */ str = g_strdup_printf ("=%s/config/News=/Sources/", evolution_dir); gnome_config_push_prefix (str); @@ -490,6 +488,7 @@ mail_config_write (void) g_free (path); } gnome_config_pop_prefix (); +#endif gnome_config_sync (); } @@ -880,9 +879,8 @@ mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix) struct _check_msg { struct _mail_msg msg; - char *url; + const char *url; CamelProviderType type; - gboolean connect; GList **authtypes; gboolean *success; }; @@ -891,66 +889,49 @@ static void check_service_check(struct _mail_msg *mm) { struct _check_msg *m = (struct _check_msg *)mm; CamelService *service = NULL; - - if (m->authtypes) { - service = camel_session_get_service (session, m->url, m->type, &mm->ex); - if (!service) - return; - if (m->connect) - *m->authtypes = camel_service_query_auth_types (service, &mm->ex); - else - *m->authtypes = g_list_copy (service->provider->authtypes); - } else if (m->connect) { - service = camel_session_get_service_connected (session, m->url, m->type, &mm->ex); - } - if (service) - camel_object_unref (CAMEL_OBJECT (service)); - *m->success = !camel_exception_is_set(&mm->ex); -} + service = camel_session_get_service (session, m->url, m->type, &mm->ex); + if (!service) + return; -static void check_service_free(struct _mail_msg *mm) -{ - struct _check_msg *m = (struct _check_msg *)mm; + if (m->authtypes) + *m->authtypes = camel_service_query_auth_types (service, &mm->ex); + else + camel_service_connect (service, &mm->ex); - g_free(m->url); + camel_object_unref (CAMEL_OBJECT (service)); + *m->success = !camel_exception_is_set(&mm->ex); } static struct _mail_msg_op check_service_op = { NULL, check_service_check, NULL, - check_service_free + NULL }; /** * mail_config_check_service: * @url: service url * @type: provider type - * @connect: whether or not the check service should connect - * @authtypes: list of auth types gathered by this method - * - * Checks the service for validity. If @connect is TRUE then a - * connection with the server is attempted and if successful will fill - * in the @authtypes list. If @connect is FALSE then @authtypes will - * be generated without a connection and thus will not necessarily - * reflect what the server supports. + * @authtypes: set to list of supported authtypes on return if non-%NULL. * - * Returns TRUE on success or FALSE on error. + * Checks the service for validity. If @authtypes is non-%NULL, it will + * be filled in with a list of supported authtypes. * + * Return value: %TRUE on success or %FALSE on error. **/ gboolean -mail_config_check_service (CamelURL *url, CamelProviderType type, gboolean connect, GList **authtypes) +mail_config_check_service (const char *url, CamelProviderType type, GList **authtypes) { gboolean ret = FALSE; struct _check_msg *m; int id; m = mail_msg_new(&check_service_op, NULL, sizeof(*m)); - m->url = camel_url_to_string(url, TRUE); + m->url = url; m->type = type; - m->connect = connect; m->authtypes = authtypes; m->success = &ret; |