aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-account-editor.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-12-21 15:19:20 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-12-21 15:19:20 +0800
commit01f34bc9d7024efdb038b3881bf7650c9a5cd9dc (patch)
treeb5a3f8f1bb47da123a9e6fb19d9be0b07278427d /mail/em-account-editor.c
parent27b1a02bd076736c2b7785e7d248ea80a755e7b8 (diff)
downloadgsoc2013-evolution-01f34bc9d7024efdb038b3881bf7650c9a5cd9dc.tar.gz
gsoc2013-evolution-01f34bc9d7024efdb038b3881bf7650c9a5cd9dc.tar.zst
gsoc2013-evolution-01f34bc9d7024efdb038b3881bf7650c9a5cd9dc.zip
if we're turned on, then record the current authtype setting on the
2004-12-21 Not Zed <NotZed@Ximian.com> * em-account-editor.c (emae_needs_auth): if we're turned on, then record the current authtype setting on the widgets, if we're turned off, clear the authmech setting. (emae_setup_service): setup the needs auth after the authtype, and get setting from url->authmech. (emae_service_provider_changed): only clear the url->authmech if we don't have the current one in our list. svn path=/trunk/; revision=28159
Diffstat (limited to 'mail/em-account-editor.c')
-rw-r--r--mail/em-account-editor.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index febdb2aa79..a6f17fc546 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -1069,7 +1069,16 @@ emae_needs_auth(GtkToggleButton *toggle, EMAccountEditorService *service)
w = glade_xml_get_widget(service->emae->priv->xml, emae_service_info[service->type].auth_frame);
gtk_widget_set_sensitive(w, need);
- /* if need ; service_changed? */
+
+ if (need)
+ emae_authtype_changed(service->authtype, service);
+ else {
+ CamelURL *url = emae_account_url(service->emae, emae_service_info[service->type].account_uri_key);
+
+ camel_url_set_authmech(url, NULL);
+ emae_uri_changed(service, url);
+ camel_url_free(url);
+ }
}
static int
@@ -1161,7 +1170,21 @@ emae_service_provider_changed(EMAccountEditorService *service)
gtk_widget_grab_focus(dwidget);
if (CAMEL_PROVIDER_ALLOWS(service->provider, CAMEL_URL_PART_AUTH)) {
- camel_url_set_authmech(url, NULL);
+ GList *ll;
+
+ /* try to keep the authmech from the current url, or clear it */
+ if (url->authmech) {
+ if (service->provider->authtypes) {
+ for (ll = service->provider->authtypes;ll;ll = g_list_next(ll))
+ if (!strcmp(url->authmech, ((CamelServiceAuthType *)ll->data)->authproto))
+ break;
+ if (ll == NULL)
+ camel_url_set_authmech(url, NULL);
+ } else {
+ camel_url_set_authmech(url, NULL);
+ }
+ }
+
emae_setup_authtype(service->emae, service);
if (service->needs_auth && !CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_AUTH))
gtk_widget_show((GtkWidget *)service->needs_auth);
@@ -1507,7 +1530,6 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service)
break;
}
}
- camel_url_free(url);
g_signal_connect (service->hostname, "changed", G_CALLBACK (emae_hostname_changed), service);
g_signal_connect (service->username, "changed", G_CALLBACK (emae_username_changed), service);
@@ -1519,21 +1541,24 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service)
service->auth_frame = glade_xml_get_widget(gui->xml, info->auth_frame);
service->remember = emae_account_toggle(emae, info->remember_password, info->save_passwd_key);
service->check_supported = (GtkButton *)glade_xml_get_widget(gui->xml, info->authtype_check);
+ emae_setup_providers(emae, service);
+ service->authtype = (GtkComboBox *)emae_setup_authtype(emae, service);
+
if (info->needs_auth) {
service->needs_auth = (GtkToggleButton *)glade_xml_get_widget (gui->xml, info->needs_auth);
+ gtk_toggle_button_set_active(service->needs_auth, url->authmech != NULL);
g_signal_connect(service->needs_auth, "toggled", G_CALLBACK(emae_needs_auth), service);
emae_needs_auth(service->needs_auth, service);
}
- emae_setup_providers(emae, service);
- service->authtype = (GtkComboBox *)emae_setup_authtype(emae, service);
-
if (!e_account_writable (emae->account, info->account_uri_key))
gtk_widget_set_sensitive(service->container, FALSE);
else
gtk_widget_set_sensitive(service->container, TRUE);
emae_service_provider_changed(service);
+
+ camel_url_free(url);
}
static struct {
@@ -1644,8 +1669,6 @@ emae_option_toggle(EMAccountEditorService *service, CamelURL *url, const char *t
g_signal_connect(w, "toggled", G_CALLBACK(emae_option_toggle_changed), service);
gtk_widget_show(w);
- printf("adding option toggle '%s'\n", text);
-
return w;
}