aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-account-gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-account-gui.c')
-rw-r--r--mail/mail-account-gui.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 19d7789742..05d2674699 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -222,9 +222,16 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
GList *supported_authtypes, gboolean check_supported)
{
GtkWidget *menu, *item, *first = NULL;
- CamelServiceAuthType *authtype, *sauthtype;
+ CamelServiceAuthType *preferred, *authtype, *sauthtype;
GList *l, *s;
+ if (service->authitem)
+ preferred = gtk_object_get_data (GTK_OBJECT (service->authitem), "authtype");
+ else
+ preferred = NULL;
+
+ service->authitem = NULL;
+
menu = gtk_menu_new ();
for (l = all_authtypes; l; l = l->next) {
@@ -238,6 +245,8 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
}
if (check_supported && !s)
gtk_widget_set_sensitive (item, FALSE);
+ else if (preferred == authtype)
+ first = item;
else if (!first)
first = item;