From 63c43c06ab55e11af6257e910db9f60e279d5e67 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 5 Jan 2001 20:33:11 +0000 Subject: Renamed from _delete_mail (mail_config_druid_get_transport_url): New 2001-01-05 Jeffrey Stedfast * mail-config-druid.c (mail_config_druid_get_incoming_keep_mail): Renamed from _delete_mail (mail_config_druid_get_transport_url): New convenience function that replaces the get_hostname, get_protocol, etc. (mail_config_druid_get_source_url): Same. * mail-config-druid.glade: Changed "Delete mail from server" to "Keep mail on server" as this has a more positive ring to it. Both I and Aaron agree this is the better phrase. svn path=/trunk/; revision=7272 --- mail/ChangeLog | 3 ++ mail/mail-config-druid.c | 96 ++++++++++++++++++++---------------------- mail/mail-config-druid.glade | 60 +++++++++++++------------- mail/mail-config-druid.glade.h | 2 +- mail/mail-config-druid.h | 22 +++------- 5 files changed, 84 insertions(+), 99 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 84cbebf16b..1225491d10 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -2,6 +2,9 @@ * mail-config-druid.c (mail_config_druid_get_incoming_keep_mail): Renamed from _delete_mail + (mail_config_druid_get_transport_url): New convenience function + that replaces the get_hostname, get_protocol, etc. + (mail_config_druid_get_source_url): Same. * mail-config-druid.glade: Changed "Delete mail from server" to "Keep mail on server" as this has a more positive ring to it. Both diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index 7bf7ccc4da..788679b3e3 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -832,41 +832,40 @@ mail_config_druid_get_sigfile (MailConfigDruid *druid) } -int -mail_config_druid_get_incoming_type (MailConfigDruid *druid) -{ - -} - char * -mail_config_druid_get_incoming_hostname (MailConfigDruid *druid) +mail_config_druid_get_source_url (MailConfigDruid *druid) { - g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); + char *source_url, *host, *pport; + CamelURL *url; + int port; - return g_strdup (gtk_entry_get_text (druid->incoming_hostname)); -} - - -char * -mail_config_druid_get_incoming_username (MailConfigDruid *druid) -{ g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->incoming_username)); -} - - -char * -mail_config_druid_get_incoming_path (MailConfigDruid *druid) -{ - g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); + url = g_new0 (CamelURL, 1); + /* FIXME: get the real protocol */ + url->protocol = g_strdup ("pop3"); + url->user = g_strdup (gtk_entry_get_text (druid->incoming_username)); + url->authmech = g_strdup (druid->authmech); + url->passwd = g_strdup (gtk_entry_get_text (druid->password)); + host = g_strdup (gtk_entry_get_text (druid->incoming_hostname)); + if (host && (pport = strchr (host, ':'))) { + port = atoi (pport + 1); + *pport = '\0'; + } + url->host = host; + url->port = port; + url->path = g_strdup (gtk_entry_get_text (druid->incoming_path)); + + /* only 'show password' if we intend to save it */ + source_url = camel_url_to_string (url, GTK_TOGGLE_BUTTON (druid->save_password)->active); + camel_url_free (url); - return g_strdup (gtk_entry_get_text (druid->incoming_path)); + return source_url; } gboolean -mail_config_druid_get_incoming_keep_mail (MailConfigDruid *druid) +mail_config_druid_get_keep_mail_on_server (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), FALSE); @@ -874,24 +873,8 @@ mail_config_druid_get_incoming_keep_mail (MailConfigDruid *druid) } -int -mail_config_druid_get_auth_type (MailConfigDruid *druid) -{ - -} - - -char * -mail_config_druid_get_passwd (MailConfigDruid *druid) -{ - g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - - return g_strdup (gtk_entry_get_text (druid->password)); -} - - gboolean -mail_config_druid_get_save_passwd (MailConfigDruid *druid) +mail_config_druid_get_save_password (MailConfigDruid *druid) { g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), FALSE); @@ -899,19 +882,30 @@ mail_config_druid_get_save_passwd (MailConfigDruid *druid) } -int -mail_config_druid_get_outgoing_type (MailConfigDruid *druid) -{ - -} - - char * -mail_config_druid_get_outgoing_hostname (MailConfigDruid *druid) +mail_config_druid_get_transport_url (MailConfigDruid *druid) { + char *transport_url, *host, *pport; + CamelURL *url; + int port; + g_return_val_if_fail (IS_MAIL_CONFIG_DRUID (druid), NULL); - return g_strdup (gtk_entry_get_text (druid->outgoing_hostname)); + url = g_new0 (CamelURL, 1); + /* FIXME: get the real protocol */ + url->protocol = g_strdup ("smtp"); + host = g_strdup (gtk_entry_get_text (druid->incoming_hostname)); + if (host && (pport = strchr (host, ':'))) { + port = atoi (pport + 1); + *pport = '\0'; + } + url->host = host; + url->port = port; + + transport_url = camel_url_to_string (url, FALSE); + camel_url_free (url); + + return transport_url; } diff --git a/mail/mail-config-druid.glade b/mail/mail-config-druid.glade index 89cbb7eced..51bf799c71 100644 --- a/mail/mail-config-druid.glade +++ b/mail/mail-config-druid.glade @@ -189,8 +189,8 @@ Click "Next" to begin. GtkLabel - identity-name-label - + identity-address-label + GTK_JUSTIFY_RIGHT False 1 @@ -200,8 +200,8 @@ Click "Next" to begin. 0 1 - 0 - 1 + 1 + 2 0 0 False @@ -215,8 +215,8 @@ Click "Next" to begin. GtkLabel - identity-address-label - + identity-name-label + GTK_JUSTIFY_RIGHT False 1 @@ -226,8 +226,8 @@ Click "Next" to begin. 0 1 - 1 - 2 + 0 + 1 0 0 False @@ -907,8 +907,8 @@ Click "Next" to begin. 0 0 - False - False + True + True @@ -1083,14 +1083,18 @@ Click "Next" to begin. - GtkOptionMenu - omenuTransportType - True - - 0 + GtkLabel + transport-type-label + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 2 + 0 - 1 - 2 + 0 + 1 0 1 0 @@ -1099,29 +1103,25 @@ Click "Next" to begin. False False False - False + True False - GtkLabel - transport-type-label - - GTK_JUSTIFY_RIGHT - False - 1 - 0.5 - 2 - 0 + GtkOptionMenu + omenuTransportType + True + + 0 - 0 - 1 + 1 + 2 0 1 0 0 - False + True False False False diff --git a/mail/mail-config-druid.glade.h b/mail/mail-config-druid.glade.h index a0908a12c5..0793e21fa5 100644 --- a/mail/mail-config-druid.glade.h +++ b/mail/mail-config-druid.glade.h @@ -11,8 +11,8 @@ gchar *s = N_("Welcome to the Evolution Mail Configuration Druid.\n" "Click \"Next\" to begin. "); gchar *s = N_("Identity"); gchar *s = N_("Required"); -gchar *s = N_("Full Name:"); gchar *s = N_("Email Address:"); +gchar *s = N_("Full Name:"); gchar *s = N_("Optional"); gchar *s = N_("Organization:"); gchar *s = N_("Signature file:"); diff --git a/mail/mail-config-druid.h b/mail/mail-config-druid.h index 7672636db8..814aafc3a4 100644 --- a/mail/mail-config-druid.h +++ b/mail/mail-config-druid.h @@ -112,27 +112,15 @@ char *mail_config_druid_get_organization (MailConfigDruid *druid); char *mail_config_druid_get_sigfile (MailConfigDruid *druid); -int mail_config_druid_get_incoming_type (MailConfigDruid *druid); +char *mail_config_druid_get_source_url (MailConfigDruid *druid); -char *mail_config_druid_get_incoming_hostname (MailConfigDruid *druid); +gboolean mail_config_druid_get_keep_mail_on_server (MailConfigDruid *druid); -char *mail_config_druid_get_incoming_username (MailConfigDruid *druid); +gboolean mail_config_druid_get_save_password (MailConfigDruid *druid); -char *mail_config_druid_get_incoming_path (MailConfigDruid *druid); +char *mail_config_druid_get_transport_url (MailConfigDruid *druid); -gboolean mail_config_druid_get_incoming_keep_mail (MailConfigDruid *druid); - -int mail_config_druid_get_auth_type (MailConfigDruid *druid); - -char *mail_config_druid_get_passwd (MailConfigDruid *druid); - -gboolean mail_config_druid_get_save_passwd (MailConfigDruid *druid); - -int mail_config_druid_get_outgoing_type (MailConfigDruid *druid); - -char *mail_config_druid_get_outgoing_hostname (MailConfigDruid *druid); - -gboolean mail_config_druid_get_outgoing_requires_auth (MailConfigDruid *druid); +gboolean mail_config_druid_get_transport_requires_auth (MailConfigDruid *druid); #ifdef __cplusplus } -- cgit