diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 3 | ||||
-rw-r--r-- | mail/mail-config-druid.c | 96 | ||||
-rw-r--r-- | mail/mail-config-druid.glade | 60 | ||||
-rw-r--r-- | mail/mail-config-druid.glade.h | 2 | ||||
-rw-r--r-- | mail/mail-config-druid.h | 22 |
5 files changed, 84 insertions, 99 deletions
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. </text> <widget> <class>GtkLabel</class> - <name>identity-name-label</name> - <label>Full Name:</label> + <name>identity-address-label</name> + <label>Email Address:</label> <justify>GTK_JUSTIFY_RIGHT</justify> <wrap>False</wrap> <xalign>1</xalign> @@ -200,8 +200,8 @@ Click "Next" to begin. </text> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> @@ -215,8 +215,8 @@ Click "Next" to begin. </text> <widget> <class>GtkLabel</class> - <name>identity-address-label</name> - <label>Email Address:</label> + <name>identity-name-label</name> + <label>Full Name:</label> <justify>GTK_JUSTIFY_RIGHT</justify> <wrap>False</wrap> <xalign>1</xalign> @@ -226,8 +226,8 @@ Click "Next" to begin. </text> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> @@ -907,8 +907,8 @@ Click "Next" to begin. </text> <initial_choice>0</initial_choice> <child> <padding>0</padding> - <expand>False</expand> - <fill>False</fill> + <expand>True</expand> + <fill>True</fill> </child> </widget> </widget> @@ -1083,14 +1083,18 @@ Click "Next" to begin. </text> </child> <widget> - <class>GtkOptionMenu</class> - <name>omenuTransportType</name> - <can_focus>True</can_focus> - <items></items> - <initial_choice>0</initial_choice> + <class>GtkLabel</class> + <name>transport-type-label</name> + <label>Server Type: </label> + <justify>GTK_JUSTIFY_RIGHT</justify> + <wrap>False</wrap> + <xalign>1</xalign> + <yalign>0.5</yalign> + <xpad>2</xpad> + <ypad>0</ypad> <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> + <left_attach>0</left_attach> + <right_attach>1</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> @@ -1099,29 +1103,25 @@ Click "Next" to begin. </text> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> - <xfill>False</xfill> + <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> - <class>GtkLabel</class> - <name>transport-type-label</name> - <label>Server Type: </label> - <justify>GTK_JUSTIFY_RIGHT</justify> - <wrap>False</wrap> - <xalign>1</xalign> - <yalign>0.5</yalign> - <xpad>2</xpad> - <ypad>0</ypad> + <class>GtkOptionMenu</class> + <name>omenuTransportType</name> + <can_focus>True</can_focus> + <items></items> + <initial_choice>0</initial_choice> <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> + <left_attach>1</left_attach> + <right_attach>2</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>False</xexpand> + <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> 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 } |