aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config-druid.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-06 04:33:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-06 04:33:11 +0800
commit63c43c06ab55e11af6257e910db9f60e279d5e67 (patch)
treec4f4b823bcd5183cfa110d440c00acceea211dcd /mail/mail-config-druid.c
parentfc9fd0c4dd4e41c90e494d25e38b5bc49bb3aeaf (diff)
downloadgsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar.gz
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar.bz2
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar.lz
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar.xz
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.tar.zst
gsoc2013-evolution-63c43c06ab55e11af6257e910db9f60e279d5e67.zip
Renamed from _delete_mail (mail_config_druid_get_transport_url): New
2001-01-05 Jeffrey Stedfast <fejj@helixcode.com> * 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
Diffstat (limited to 'mail/mail-config-druid.c')
-rw-r--r--mail/mail-config-druid.c96
1 files changed, 45 insertions, 51 deletions
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;
}