From c63489710d49a5daa4ce7499be8a59ea1d23ec29 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 25 Mar 2001 08:55:13 +0000 Subject: Allow the authtype to be NULL. (transport_auth_init): If the provider 2001-03-25 Jeffrey Stedfast * mail-account-editor.c (transport_auth_type_changed): Allow the authtype to be NULL. (transport_auth_init): If the provider allows authtypes but doesn't *need* one, create a "None" menu item that the user can choose. This should fix the bug people have been seeing recently since dan removed the no_authtype authmech from the smtp provider. svn path=/trunk/; revision=8926 --- mail/mail-account-editor.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'mail/mail-account-editor.c') diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c index 2c4b2e8e93..751ae57646 100644 --- a/mail/mail-account-editor.c +++ b/mail/mail-account-editor.c @@ -407,9 +407,10 @@ transport_auth_type_changed (GtkWidget *widget, gpointer user_data) authtype = gtk_object_get_data (GTK_OBJECT (widget), "authtype"); - gtk_object_set_data (GTK_OBJECT (editor), "transport_authmech", authtype->authproto); + gtk_object_set_data (GTK_OBJECT (editor), "transport_authmech", + authtype ? authtype->authproto : NULL); - if (authtype->need_password) + if (authtype && authtype->need_password) sensitive = TRUE; else sensitive = FALSE; @@ -443,6 +444,25 @@ transport_auth_init (MailAccountEditor *editor, CamelURL *url) menu = gtk_menu_new (); + if (CAMEL_PROVIDER_ALLOWS (editor->transport, CAMEL_URL_ALLOW_AUTH) && + !CAMEL_PROVIDER_NEEDS (editor->transport, CAMEL_URL_NEED_AUTH)) { + /* It allows auth, but doesn't require it so give the user a + way to say he doesn't need it */ + item = gtk_menu_item_new_with_label (_("None")); + gtk_object_set_data (GTK_OBJECT (item), "authtype", NULL); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (transport_auth_type_changed), + editor); + + gtk_menu_append (GTK_MENU (menu), item); + + gtk_widget_show (item); + + authmech = item; + history = i; + i++; + } + if (authtypes) { GList *l; -- cgit v1.2.3