From 7fe4e842b2d09fbbb222857542400c8302001ee1 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 15 Sep 2006 17:20:17 +0000 Subject: [PATCH] Add a local option for imap to make ecore_con able to use local imap servers, not just remote. SVN revision: 25855 --- e_mod_config_box.c | 15 +++++++++++++-- e_mod_main.c | 1 + e_mod_main.h | 1 + imap.c | 13 +++++++++---- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/e_mod_config_box.c b/e_mod_config_box.c index 9cba14c..14a42c2 100644 --- a/e_mod_config_box.c +++ b/e_mod_config_box.c @@ -8,6 +8,7 @@ struct _E_Config_Dialog_Data int use_exec; char *port; int ssl; + int local; char *host; char *user; char *pass; @@ -70,6 +71,7 @@ _fill_data (Config_Box * cb, E_Config_Dialog_Data * cfdata) cfdata->type = 0; cfdata->ssl = 0; cfdata->use_exec = 0; + cfdata->local = 0; snprintf (buf, sizeof (buf), "110"); cfdata->port = strdup (buf); return; @@ -81,7 +83,8 @@ _fill_data (Config_Box * cb, E_Config_Dialog_Data * cfdata) cfdata->type = cb->type; cfdata->ssl = cb->ssl; cfdata->use_exec = cb->use_exec; - + cfdata->local = cb->local; + snprintf (buf, sizeof (buf), "%d", cb->port); cfdata->port = strdup (buf); @@ -183,8 +186,13 @@ _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, ob = e_widget_entry_add (evas, &cfdata->port); cfdata->port_entry = ob; e_widget_frametable_object_append (of, ob, 1, 1, 1, 1, 0, 0, 1, 0); - e_widget_list_object_append (o, of, 1, 1, 0.5); + ob = e_widget_label_add (evas, D_("Local:")); + e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 0, 0, 1, 0); + ob = e_widget_check_add (evas, "", &(cfdata->local)); + e_widget_frametable_object_append (of, ob, 1, 2, 1, 1, 0, 0, 1, 0); + e_widget_list_object_append (o, of, 1, 1, 0.5); + of = e_widget_frametable_add (evas, D_("Mailbox Settings"), 1); ob = e_widget_label_add (evas, D_("Name:")); e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 0, 0, 1, 0); @@ -250,6 +258,7 @@ _basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) cb->type = 0; cb->port = 110; cb->ssl = 0; + cb->local = 0; is_new = 1; } @@ -263,6 +272,8 @@ _basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) cb->type = cfdata->type; cb->port = atoi (cfdata->port); cb->ssl = cfdata->ssl; + cb->local = cfdata->local; + cb->use_exec = cfdata->use_exec; if (cb->exec) evas_stringshare_del (cb->exec); diff --git a/e_mod_main.c b/e_mod_main.c index d4d0d9e..14c55b9 100644 --- a/e_mod_main.c +++ b/e_mod_main.c @@ -357,6 +357,7 @@ e_modapi_init (E_Module * m) E_CONFIG_VAL (D, T, type, INT); E_CONFIG_VAL (D, T, port, INT); E_CONFIG_VAL (D, T, ssl, UCHAR); + E_CONFIG_VAL (D, T, local, UCHAR); E_CONFIG_VAL (D, T, host, STR); E_CONFIG_VAL (D, T, user, STR); E_CONFIG_VAL (D, T, pass, STR); diff --git a/e_mod_main.h b/e_mod_main.h index 67ecdc5..1bfbab3 100644 --- a/e_mod_main.h +++ b/e_mod_main.h @@ -58,6 +58,7 @@ struct _Config_Box int type; int port; + unsigned char local; unsigned char ssl; const char *host; const char *user; diff --git a/imap.c b/imap.c index f6a7076..393caf5 100644 --- a/imap.c +++ b/imap.c @@ -14,9 +14,9 @@ static Evas_List *iservers; void _mail_imap_check_mail (void *data) { - Ecore_Con_Type type = ECORE_CON_REMOTE_SYSTEM; - Evas_List *l, *j; - ImapClient *ic; + Ecore_Con_Type type; + Evas_List *l, *j; + ImapClient *ic; for (l = iservers; l; l = l->next) { @@ -44,7 +44,12 @@ _mail_imap_check_mail (void *data) ic = j->data; if (!ic->server->server) { - if (ecore_con_ssl_available_get () && (ic->config->ssl)) + if (ic->config->local) + type = ECORE_CON_LOCAL_SYSTEM; + else + type = ECORE_CON_REMOTE_SYSTEM; + + if (ecore_con_ssl_available_get () && (ic->config->ssl)) type |= ECORE_CON_USE_SSL; ic->server->state = IMAP_STATE_DISCONNECTED; ic->server->server =