aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config-druid.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-11 04:30:07 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-11 04:30:07 +0800
commit8592ae36ae9c99fe8a5eae31ec83e046fc245567 (patch)
tree534f16069e009ed3fcfc62f3d3c1f3ffd1228559 /mail/mail-config-druid.c
parent69553dbfdaa03211db615f6cb087236f0fedd8bd (diff)
downloadgsoc2013-evolution-8592ae36ae9c99fe8a5eae31ec83e046fc245567.tar.gz
gsoc2013-evolution-8592ae36ae9c99fe8a5eae31ec83e046fc245567.tar.zst
gsoc2013-evolution-8592ae36ae9c99fe8a5eae31ec83e046fc245567.zip
Clear the password entry if it's not allowed. (transport_type_changed):
2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> * mail-config-druid.c (auth_type_changed): Clear the password entry if it's not allowed. (transport_type_changed): Clear the hostname if it is not allowed by the provider type. * mail-account-editor.c (transport_type_changed): If the hostname is allowed, clear it. * mail-config-druid.c (incoming_type_changed): Clear the contents of the entry boxes that are not to be used. (mail_config_druid_get_source_url): If the text in the entry is emptry string, don't set it' contents in the url. svn path=/trunk/; revision=7369
Diffstat (limited to 'mail/mail-config-druid.c')
-rw-r--r--mail/mail-config-druid.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 9df95c2796..b56bf20295 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -379,6 +379,7 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_hostname), TRUE);
gtk_widget_set_sensitive (label, TRUE);
} else {
+ gtk_entry_set_text (druid->incoming_hostname, "");
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_hostname), FALSE);
gtk_widget_set_sensitive (label, FALSE);
}
@@ -389,6 +390,7 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_username), TRUE);
gtk_widget_set_sensitive (label, TRUE);
} else {
+ gtk_entry_set_text (druid->incoming_username, "");
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_username), FALSE);
gtk_widget_set_sensitive (label, FALSE);
}
@@ -399,6 +401,7 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->password), TRUE);
gtk_widget_set_sensitive (label, TRUE);
} else {
+ gtk_entry_set_text (druid->password, "");
gtk_widget_set_sensitive (GTK_WIDGET (druid->password), FALSE);
gtk_widget_set_sensitive (label, FALSE);
}
@@ -419,6 +422,7 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_path), TRUE);
gtk_widget_set_sensitive (label, TRUE);
} else {
+ gtk_entry_set_text (druid->incoming_path, "");
gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_path), FALSE);
gtk_widget_set_sensitive (label, FALSE);
}
@@ -493,6 +497,9 @@ auth_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->save_password), sensitive);
gtk_widget_set_sensitive (label, sensitive);
+ if (!sensitive)
+ gtk_entry_set_text (druid->password, "");
+
authentication_check (druid);
}
@@ -600,6 +607,7 @@ transport_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (druid->outgoing_hostname), TRUE);
gtk_widget_set_sensitive (label, TRUE);
} else {
+ gtk_entry_set_text (druid->outgoing_hostname, "");
gtk_widget_set_sensitive (GTK_WIDGET (druid->outgoing_hostname), FALSE);
gtk_widget_set_sensitive (label, FALSE);
}
@@ -969,7 +977,7 @@ mail_config_druid_get_sigfile (MailConfigDruid *druid)
char *
mail_config_druid_get_source_url (MailConfigDruid *druid)
{
- char *source_url, *host, *pport, *auth;
+ char *source_url, *host, *pport, *str;
const CamelProvider *provider;
CamelURL *url;
int port = 0;
@@ -980,10 +988,16 @@ mail_config_druid_get_source_url (MailConfigDruid *druid)
url = g_new0 (CamelURL, 1);
url->protocol = g_strdup (provider->protocol);
- url->user = g_strdup (gtk_entry_get_text (druid->incoming_username));
- auth = gtk_object_get_data (GTK_OBJECT (druid), "source_authmech");
- url->authmech = auth && *auth ? g_strdup (auth) : NULL;
- url->passwd = g_strdup (gtk_entry_get_text (druid->password));
+
+ str = gtk_entry_get_text (druid->incoming_username);
+ url->user = str && *str ? g_strdup (str) : NULL;
+
+ str = gtk_object_get_data (GTK_OBJECT (druid), "source_authmech");
+ url->authmech = str && *str ? g_strdup (str) : NULL;
+
+ str = gtk_entry_get_text (druid->password);
+ url->passwd = str && *str ? g_strdup (str) : NULL;
+
host = g_strdup (gtk_entry_get_text (druid->incoming_hostname));
if (host && (pport = strchr (host, ':'))) {
port = atoi (pport + 1);