diff options
author | Peter Williams <peterw@src.gnome.org> | 2000-08-26 05:09:53 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2000-08-26 05:09:53 +0800 |
commit | dbce630738f44e6687db9b2ca8dc4b5aae37be3c (patch) | |
tree | 0e2df615971887f57b5f7452d6b3e5c222c476d9 /mail/mail-config-gui.c | |
parent | 10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4 (diff) | |
download | gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar.gz gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar.bz2 gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar.lz gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar.xz gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.tar.zst gsoc2013-evolution-dbce630738f44e6687db9b2ca8dc4b5aae37be3c.zip |
Add support for specifying on which port to connect to a server; fix a potential infinite loop in unicode.
svn path=/trunk/; revision=5041
Diffstat (limited to 'mail/mail-config-gui.c')
-rw-r--r-- | mail/mail-config-gui.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/mail-config-gui.c b/mail/mail-config-gui.c index cbfb587122..1770967014 100644 --- a/mail/mail-config-gui.c +++ b/mail/mail-config-gui.c @@ -76,6 +76,7 @@ typedef struct gboolean userneed; GtkWidget *host; gboolean hostneed; + GtkWidget *port; GtkWidget *path; gboolean pathneed; GtkWidget *auth_optionmenu; @@ -84,6 +85,7 @@ typedef struct GtkWidget *auth_detect; GtkWidget *keep_on_server; gint pnum; + gint default_port; } MailDialogServicePageItem; struct _MailDialogServicePage @@ -588,6 +590,18 @@ service_page_get_url (MailDialogServicePage *page) url->user = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (spitem->user), 0, -1); if (spitem->host) url->host = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (spitem->host), 0, -1); + if (spitem->port) { + gchar *val; + + val = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (spitem->port), 0, -1); + + if (*val) + url->port = atoi (val); + else + url->port = 0; + + g_free (val); + } if (spitem->path) { gchar *path; path = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (spitem->path), @@ -647,6 +661,21 @@ service_page_set_url (MailDialogServicePage *page, MailConfigService *service) if (spitem->host && url && url->host) e_utf8_gtk_entry_set_text (GTK_ENTRY (spitem->host), url->host); + if (spitem->port) { + gchar *tmp; + + if (url && url->port) { + tmp = g_strdup_printf ("%d", url->port); + } else if (spitem->default_port) { + tmp = g_strdup_printf ("%d", spitem->default_port); + } else { + tmp = g_strdup (""); + } + + e_utf8_gtk_entry_set_text (GTK_ENTRY (spitem->port), tmp); + g_free (tmp); + } + if (spitem->path && url && url->path) { if (url->host && *url->path) e_utf8_gtk_entry_set_text (GTK_ENTRY (spitem->path), @@ -901,6 +930,8 @@ service_page_item_new (MailDialogServicePage *page, MailService *mcs) item->host = service_page_add_elem (page, table, row++, _("Server:")); item->hostneed = ((service_flags & CAMEL_SERVICE_URL_NEED_HOST) == CAMEL_SERVICE_URL_NEED_HOST); + item->port = service_page_add_elem (page, table, row++, _("Port:")); + item->default_port = mcs->provider->default_ports[mcs->type]; } if (service_flags & CAMEL_SERVICE_URL_ALLOW_USER) { |