aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-account-gui.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-26 02:27:47 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-26 02:27:47 +0800
commit32e9b0c2020c7ed6ef0aac891e811e0547956337 (patch)
treee1fdfd77529592a3c21a4a8d57cf20974b88e27c /mail/mail-account-gui.c
parentee16607d42149ca7472f9b95d3b4bbb676e229c4 (diff)
downloadgsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar.gz
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar.bz2
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar.lz
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar.xz
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.tar.zst
gsoc2013-evolution-32e9b0c2020c7ed6ef0aac891e811e0547956337.zip
Now takes a check_supported gboolean argument saying whether or not to
2001-07-25 Jeffrey Stedfast <fejj@ximian.com> * mail-account-gui.c (build_auth_menu): Now takes a check_supported gboolean argument saying whether or not to disable non-supported authtypes. (source_type_changed): Update for build_auth_menu. (transport_type_changed): Same. (service_check_supported): Pass in TRUE for the disable non-supported authtypes to build_auth_menu and also disable check-supported button and the authtype menu if we get a NULL supported auth list. svn path=/trunk/; revision=11404
Diffstat (limited to 'mail/mail-account-gui.c')
-rw-r--r--mail/mail-account-gui.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index d3e25a1cd3..34ed21c5f8 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -218,8 +218,8 @@ service_authtype_changed (GtkWidget *widget, gpointer user_data)
}
static void
-build_auth_menu (MailAccountGuiService *service,
- GList *all_authtypes, GList *supported_authtypes)
+build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
+ GList *supported_authtypes, gboolean check_supported)
{
GtkWidget *menu, *item, *first = NULL;
CamelServiceAuthType *authtype, *sauthtype;
@@ -236,7 +236,7 @@ build_auth_menu (MailAccountGuiService *service,
if (!strcmp (authtype->name, sauthtype->name))
break;
}
- if (supported_authtypes && !s)
+ if (check_supported && !s)
gtk_widget_set_sensitive (item, FALSE);
else if (!first)
first = item;
@@ -345,7 +345,7 @@ source_type_changed (GtkWidget *widget, gpointer user_data)
/* auth */
frame = glade_xml_get_widget (gui->xml, "source_auth_frame");
if (provider && CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_AUTH)) {
- build_auth_menu (&gui->source, provider->authtypes, NULL);
+ build_auth_menu (&gui->source, provider->authtypes, NULL, FALSE);
gtk_widget_show (frame);
} else
gtk_widget_hide (frame);
@@ -437,7 +437,7 @@ transport_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_hide (label);
}
- build_auth_menu (&gui->transport, provider->authtypes, NULL);
+ build_auth_menu (&gui->transport, provider->authtypes, NULL, FALSE);
transport_needs_auth_toggled (gui->transport_needs_auth, gui);
} else
gtk_widget_hide (frame);
@@ -465,7 +465,12 @@ service_check_supported (GtkButton *button, gpointer user_data)
save_service (gsvc, NULL, service);
if (mail_config_check_service (service->url, gsvc->provider_type, &authtypes)) {
- build_auth_menu (gsvc, gsvc->provider->authtypes, authtypes);
+ build_auth_menu (gsvc, gsvc->provider->authtypes, authtypes, TRUE);
+ if (!authtypes) {
+ /* the provider doesn't support any authtypes so we can disable these */
+ gtk_widget_set_sensitive (GTK_WIDGET (gsvc->check_supported), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (gsvc->authtype), FALSE);
+ }
g_list_free (authtypes);
}
@@ -1485,7 +1490,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
CamelServiceAuthType *authtype;
authtype = gtk_object_get_data (GTK_OBJECT (gsvc->authitem), "authtype");
- if (authtype->authproto && *authtype->authproto)
+ if (authtype && authtype->authproto && *authtype->authproto)
url->authmech = g_strdup (authtype->authproto);
service->save_passwd = gtk_toggle_button_get_active (gsvc->remember);
@@ -1515,7 +1520,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
if (gtk_toggle_button_get_active (gsvc->use_ssl))
camel_url_set_param (url, "use_ssl", "");
}
-
+
if (extra_config)
extract_values (gsvc, extra_config, url);