From f39b89c39acf31ea4bdbd0a5bb74f2274434a45b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 9 Jan 2001 21:44:40 +0000 Subject: Gray out the appropriate labels too. (auth_type_changed): And here. 2001-01-09 Jeffrey Stedfast * mail-config-druid.c (incoming_type_changed): Gray out the appropriate labels too. (auth_type_changed): And here. (transport_type_changed): Here too... * mail-account-editor.c (source_check): Gray out the appropriate labels too. (transport_type_changed): And here too. svn path=/trunk/; revision=7340 --- mail/ChangeLog | 11 +++++ mail/mail-account-editor.c | 99 +++++++++++++++++++++++++++++++++++------- mail/mail-account-editor.h | 1 + mail/mail-config-druid.c | 53 +++++++++++++++++----- mail/mail-config-druid.glade | 74 ++++++++++++++++++++++++++----- mail/mail-config-druid.glade.h | 1 + 6 files changed, 200 insertions(+), 39 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 0953d7649e..2056b295b1 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2001-01-09 Jeffrey Stedfast + + * mail-config-druid.c (incoming_type_changed): Gray out the + appropriate labels too. + (auth_type_changed): And here. + (transport_type_changed): Here too... + + * mail-account-editor.c (source_check): Gray out the appropriate + labels too. + (transport_type_changed): And here too. + 2001-01-09 Jeffrey Stedfast * mail-account-editor.c: For all optionmenu's, set the appropriate diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c index efc0ad3855..37da05e4dc 100644 --- a/mail/mail-account-editor.c +++ b/mail/mail-account-editor.c @@ -157,6 +157,9 @@ apply_changes (MailAccountEditor *editor) url->host = host; url->port = port; + g_free (url->path); + url->path = g_strdup (gtk_entry_get_text (editor->source_path)); + account->source->save_passwd = GTK_TOGGLE_BUTTON (editor->save_passwd)->active; account->source->keep_on_server = GTK_TOGGLE_BUTTON (editor->keep_on_server)->active; @@ -286,8 +289,6 @@ source_auth_init (MailAccountEditor *editor, CamelURL *url) while (l) { authtype = l->data; - i++; - item = gtk_menu_item_new_with_label (authtype->name); gtk_object_set_data (GTK_OBJECT (item), "authtype", authtype); gtk_signal_connect (GTK_OBJECT (item), "activate", @@ -304,6 +305,7 @@ source_auth_init (MailAccountEditor *editor, CamelURL *url) } l = l->next; + i++; } if (authmech) { @@ -353,8 +355,6 @@ transport_construct_authmenu (MailAccountEditor *editor, CamelURL *url) while (l) { authtype = l->data; - i++; - item = gtk_menu_item_new_with_label (authtype->name); gtk_object_set_data (GTK_OBJECT (item), "authtype", authtype); gtk_signal_connect (GTK_OBJECT (item), "activate", @@ -374,6 +374,9 @@ transport_construct_authmenu (MailAccountEditor *editor, CamelURL *url) preferred = item; phist = i; } + + l = l->next; + i++; } } @@ -393,21 +396,28 @@ transport_type_changed (GtkWidget *widget, gpointer user_data) { MailAccountEditor *editor = user_data; CamelProvider *provider; + GtkWidget *label; provider = gtk_object_get_data (GTK_OBJECT (widget), "provider"); editor->transport = provider; /* hostname */ - if (provider->url_flags & CAMEL_URL_ALLOW_HOST) + label = glade_xml_get_widget (editor->gui, "lblTransportHost"); + if (provider->url_flags & CAMEL_URL_ALLOW_HOST) { gtk_widget_set_sensitive (GTK_WIDGET (editor->transport_host), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (editor->transport_host), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* auth */ + label = glade_xml_get_widget (editor->gui, "lblTransportAuth"); if (provider->url_flags & CAMEL_URL_ALLOW_AUTH) { CamelURL *url; gtk_widget_set_sensitive (GTK_WIDGET (editor->transport_auth), TRUE); + gtk_widget_set_sensitive (label, TRUE); /* regen the auth list */ url = g_new0 (CamelURL, 1); @@ -417,6 +427,7 @@ transport_type_changed (GtkWidget *widget, gpointer user_data) camel_url_free (url); } else { gtk_widget_set_sensitive (GTK_WIDGET (editor->transport_auth), FALSE); + gtk_widget_set_sensitive (label, FALSE); } } @@ -443,8 +454,6 @@ transport_type_init (MailAccountEditor *editor, CamelURL *url) if (provider->object_types[CAMEL_PROVIDER_TRANSPORT]) { GtkWidget *item; - i++; - item = gtk_menu_item_new_with_label (provider->name); gtk_object_set_data (GTK_OBJECT (item), "provider", provider); gtk_signal_connect (GTK_OBJECT (item), "activate", @@ -459,6 +468,8 @@ transport_type_init (MailAccountEditor *editor, CamelURL *url) xport = item; history = i; } + + i++; } l = l->next; @@ -473,7 +484,7 @@ transport_type_init (MailAccountEditor *editor, CamelURL *url) } static void -keep_mail_check (MailAccountEditor *editor, CamelURL *url) +source_check (MailAccountEditor *editor, CamelURL *url) { GList *providers, *l; @@ -489,10 +500,66 @@ keep_mail_check (MailAccountEditor *editor, CamelURL *url) if (provider->object_types[CAMEL_PROVIDER_STORE] && provider->flags & CAMEL_PROVIDER_IS_SOURCE) { if (!g_strcasecmp (provider->protocol, url->protocol)) { + GtkWidget *label; + + /* keep-on-server */ if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) gtk_widget_set_sensitive (GTK_WIDGET (editor->keep_on_server), TRUE); else gtk_widget_set_sensitive (GTK_WIDGET (editor->keep_on_server), FALSE); + + /* host */ + label = glade_xml_get_widget (editor->gui, "lblSourceHost"); + if (provider->url_flags & CAMEL_URL_ALLOW_HOST) { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_host), TRUE); + gtk_widget_set_sensitive (label, TRUE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_host), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } + + /* user */ + label = glade_xml_get_widget (editor->gui, "lblSourceUser"); + if (provider->url_flags & CAMEL_URL_ALLOW_USER) { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_user), TRUE); + gtk_widget_set_sensitive (label, TRUE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_user), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } + + /* path */ + label = glade_xml_get_widget (editor->gui, "lblSourcePath"); + if (provider->url_flags & CAMEL_URL_ALLOW_PATH) { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_path), TRUE); + gtk_widget_set_sensitive (label, TRUE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_path), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } + + /* auth */ + label = glade_xml_get_widget (editor->gui, "lblSourceAuth"); + if (provider->url_flags & CAMEL_URL_ALLOW_AUTH) { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_auth), TRUE); + gtk_widget_set_sensitive (label, TRUE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_auth), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } + + /* passwd */ + label = glade_xml_get_widget (editor->gui, "lblSourcePasswd"); + if (provider->url_flags & CAMEL_URL_ALLOW_PASSWORD) { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_passwd), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (editor->save_passwd), TRUE); + gtk_widget_set_sensitive (label, TRUE); + } else { + gtk_widget_set_sensitive (GTK_WIDGET (editor->source_passwd), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (editor->save_passwd), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } + break; } } @@ -548,7 +615,7 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) gtk_entry_set_text (editor->email, account->id->address); gtk_signal_connect (GTK_OBJECT (editor->email), "changed", entry_changed, editor); editor->reply_to = GTK_ENTRY (glade_xml_get_widget (gui, "txtReplyTo")); - gtk_entry_set_text (editor->reply_to, account->id->reply_to); + gtk_entry_set_text (editor->reply_to, account->id->reply_to ? account->id->reply_to : ""); editor->organization = GTK_ENTRY (glade_xml_get_widget (gui, "txtOrganization")); gtk_entry_set_text (editor->organization, account->id->organization); editor->signature = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileSignature")); @@ -560,7 +627,7 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) editor->source_type = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourceType")); gtk_entry_set_text (editor->source_type, url->protocol); editor->source_host = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourceHost")); - gtk_entry_set_text (editor->source_host, url->host); + gtk_entry_set_text (editor->source_host, url->host ? url->host : ""); if (url->port) { char port[10]; @@ -568,9 +635,11 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) gtk_entry_append_text (editor->source_host, port); } editor->source_user = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourceUser")); - gtk_entry_set_text (editor->source_user, url->user); + gtk_entry_set_text (editor->source_user, url->user ? url->user : ""); editor->source_passwd = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourcePasswd")); - gtk_entry_set_text (editor->source_passwd, url->passwd); + gtk_entry_set_text (editor->source_passwd, url->passwd ? url->passwd : ""); + editor->source_path = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourcePath")); + gtk_entry_set_text (editor->source_path, url->path); editor->save_passwd = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkSavePasswd")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->save_passwd), account->source->save_passwd); editor->source_auth = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuSourceAuth")); @@ -578,7 +647,7 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->source_ssl), account->source->use_ssl); editor->keep_on_server = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkKeepMailOnServer")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->keep_on_server), account->source->keep_on_server); - keep_mail_check (editor, url); + source_check (editor, url); source_auth_init (editor, url); camel_url_free (url); @@ -586,7 +655,7 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account) url = camel_url_new (account->transport->url, NULL); editor->transport_type = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuTransportType")); editor->transport_host = GTK_ENTRY (glade_xml_get_widget (gui, "txtTransportHost")); - gtk_entry_set_text (editor->transport_host, url->host); + gtk_entry_set_text (editor->transport_host, url->host ? url->host : ""); if (url->port) { char port[10]; diff --git a/mail/mail-account-editor.h b/mail/mail-account-editor.h index 5694e5320d..83504e3fbf 100644 --- a/mail/mail-account-editor.h +++ b/mail/mail-account-editor.h @@ -57,6 +57,7 @@ struct _MailAccountEditor { GtkEntry *source_host; GtkEntry *source_user; GtkEntry *source_passwd; + GtkEntry *source_path; GtkCheckButton *save_passwd; GtkOptionMenu *source_auth; GtkCheckButton *source_ssl; diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index 0dc74375d4..f42e770dc1 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -367,40 +367,61 @@ incoming_type_changed (GtkWidget *widget, gpointer user_data) { MailConfigDruid *druid = user_data; CamelProvider *provider; + GtkWidget *label; provider = gtk_object_get_data (GTK_OBJECT (widget), "provider"); druid->source_provider = provider; /* hostname */ - if (provider->url_flags & CAMEL_URL_ALLOW_HOST) + label = glade_xml_get_widget (druid->gui, "lblSourceHost"); + if (provider->url_flags & CAMEL_URL_ALLOW_HOST) { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_hostname), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_hostname), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* username */ - if (provider->url_flags & CAMEL_URL_ALLOW_USER) + label = glade_xml_get_widget (druid->gui, "lblSourceUser"); + if (provider->url_flags & CAMEL_URL_ALLOW_USER) { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_username), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_username), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* password */ - if (provider->url_flags & CAMEL_URL_ALLOW_PASSWORD) + label = glade_xml_get_widget (druid->gui, "lblSourcePasswd"); + if (provider->url_flags & CAMEL_URL_ALLOW_PASSWORD) { gtk_widget_set_sensitive (GTK_WIDGET (druid->password), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->password), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* auth */ - if (provider->url_flags & CAMEL_URL_ALLOW_AUTH) + label = glade_xml_get_widget (druid->gui, "lblSourceAuth"); + if (provider->url_flags & CAMEL_URL_ALLOW_AUTH) { gtk_widget_set_sensitive (GTK_WIDGET (druid->auth_type), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->auth_type), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* path */ - if (provider->url_flags & CAMEL_URL_ALLOW_PATH) + label = glade_xml_get_widget (druid->gui, "lblSourcePath"); + if (provider->url_flags & CAMEL_URL_ALLOW_PATH) { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_path), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->incoming_path), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* keep mail on server */ if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) @@ -455,6 +476,7 @@ auth_type_changed (GtkWidget *widget, gpointer user_data) { MailConfigDruid *druid = user_data; CamelServiceAuthType *authtype; + GtkWidget *label; gboolean sensitive; authtype = gtk_object_get_data (GTK_OBJECT (widget), "authtype"); @@ -466,8 +488,10 @@ auth_type_changed (GtkWidget *widget, gpointer user_data) else sensitive = FALSE; + label = glade_xml_get_widget (druid->gui, "lblSourcePasswd"); gtk_widget_set_sensitive (GTK_WIDGET (druid->password), sensitive); gtk_widget_set_sensitive (GTK_WIDGET (druid->save_password), sensitive); + gtk_widget_set_sensitive (label, sensitive); authentication_check (druid); } @@ -565,15 +589,20 @@ transport_type_changed (GtkWidget *widget, gpointer user_data) { MailConfigDruid *druid = user_data; CamelProvider *provider; + GtkWidget *label; provider = gtk_object_get_data (GTK_OBJECT (widget), "provider"); druid->transport_provider = provider; /* hostname */ - if (provider->url_flags & CAMEL_URL_ALLOW_HOST) + label = glade_xml_get_widget (druid->gui, "lblTransportHost"); + if (provider->url_flags & CAMEL_URL_ALLOW_HOST) { gtk_widget_set_sensitive (GTK_WIDGET (druid->outgoing_hostname), TRUE); - else + gtk_widget_set_sensitive (label, TRUE); + } else { gtk_widget_set_sensitive (GTK_WIDGET (druid->outgoing_hostname), FALSE); + gtk_widget_set_sensitive (label, FALSE); + } /* auth */ if (provider->url_flags & CAMEL_URL_ALLOW_AUTH) diff --git a/mail/mail-config-druid.glade b/mail/mail-config-druid.glade index bd0923c246..bb7591fb55 100644 --- a/mail/mail-config-druid.glade +++ b/mail/mail-config-druid.glade @@ -597,7 +597,7 @@ Click "Next" to begin. GtkLabel - source-host-label + lblSourceHost GTK_JUSTIFY_RIGHT False @@ -623,7 +623,7 @@ Click "Next" to begin. GtkLabel - source-username-label + lblSourceUser GTK_JUSTIFY_RIGHT False @@ -721,7 +721,7 @@ Click "Next" to begin. GtkLabel - source-path-label + lblSourcePath GTK_JUSTIFY_RIGHT False @@ -954,7 +954,7 @@ Click "Next" to begin. GtkLabel - authentication-password-label + lblSourcePasswd GTK_JUSTIFY_RIGHT False @@ -1166,7 +1166,7 @@ Click "Next" to begin. GtkLabel - transport-host-label + lblTransportHost GTK_JUSTIFY_RIGHT False @@ -2166,7 +2166,7 @@ DIGEST-MD5 GtkLabel - lblIncomingServer + lblSourceHost GTK_JUSTIFY_LEFT False @@ -2192,7 +2192,7 @@ DIGEST-MD5 GtkLabel - lblUsername + lblSourceUser GTK_JUSTIFY_LEFT False @@ -2218,7 +2218,7 @@ DIGEST-MD5 GtkLabel - lblPassword + lblSourcePasswd GTK_JUSTIFY_LEFT False @@ -2244,7 +2244,7 @@ DIGEST-MD5 GtkLabel - lblIncomingAuth + lblSourceAuth GTK_JUSTIFY_LEFT False @@ -2455,7 +2455,7 @@ SMTP GtkLabel - lblOutgoingServer + lblTransportHost GTK_JUSTIFY_LEFT False @@ -2481,7 +2481,7 @@ SMTP GtkLabel - lblOutgoingAuth + lblTransportAuth GTK_JUSTIFY_LEFT False @@ -2554,7 +2554,7 @@ SMTP GtkTable tableServerTimeouts - 2 + 3 10 True 0 @@ -2623,6 +2623,32 @@ SMTP 1 10 + 2 + 3 + 0 + 0 + False + False + False + False + False + False + + + + + GtkLabel + lblSourcePath + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 1 + 3 1 2 0 @@ -2635,6 +2661,30 @@ SMTP False + + + GtkEntry + txtSourcePath + True + True + True + 0 + + + 3 + 10 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + diff --git a/mail/mail-config-druid.glade.h b/mail/mail-config-druid.glade.h index 85c4e5dc84..e5a497a0f0 100644 --- a/mail/mail-config-druid.glade.h +++ b/mail/mail-config-druid.glade.h @@ -83,6 +83,7 @@ gchar *s = N_("This server requires a secure connection (SSL)"); gchar *s = N_("Servers"); gchar *s = N_("Miscellaneous"); gchar *s = N_("Keep mail on server"); +gchar *s = N_("Path:"); gchar *s = N_("Advanced"); gchar *s = N_("Evolution Mail Configuration"); gchar *s = N_("Account"); -- cgit v1.2.3