aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-26 05:09:53 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-26 05:09:53 +0800
commitdbce630738f44e6687db9b2ca8dc4b5aae37be3c (patch)
tree0e2df615971887f57b5f7452d6b3e5c222c476d9
parent10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4 (diff)
downloadgsoc2013-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
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/camel-provider.h1
-rw-r--r--camel/camel.c3
-rw-r--r--camel/providers/imap/camel-imap-provider.c1
-rw-r--r--camel/providers/mbox/camel-mbox-provider.c1
-rw-r--r--camel/providers/mh/camel-mh-provider.c1
-rw-r--r--camel/providers/nntp/camel-nntp-provider.c2
-rw-r--r--camel/providers/pop3/camel-pop3-provider.c1
-rw-r--r--camel/providers/sendmail/camel-sendmail-provider.c1
-rw-r--r--camel/providers/smtp/camel-smtp-provider.c1
-rw-r--r--camel/providers/vee/camel-vee-provider.c1
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/mail-config-gui.c31
13 files changed, 67 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0baaf4af78..a5edabe6e9 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,16 @@
+2000-08-25 Peter Williams <peterw@helixcode.com>
+
+ * camel.c (camel_init): Don't call unicode_init; code in e-util
+ will do it, and if unicode_init is called twice, you get an
+ infinite loop when looking up nonexistant encodings (patch
+ has been submitted to libunicode's maintainer).
+
+ * camel-provider.h: Add a new field, default_ports, which
+ helps the configuration code guess about how to make CamelURL's
+ from providers.
+
+ * providers/*/camel-*-provider.c: Specify default ports.
+
2000-08-25 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-folder.c
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
index 00375029db..d77ae6e23a 100644
--- a/camel/camel-provider.h
+++ b/camel/camel-provider.h
@@ -79,6 +79,7 @@ typedef struct {
int flags;
CamelType object_types [CAMEL_NUM_PROVIDER_TYPES];
+ gint default_ports [CAMEL_NUM_PROVIDER_TYPES];
GHashTable *service_cache;
diff --git a/camel/camel.c b/camel/camel.c
index 0121c1082f..dd46295e63 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -40,7 +40,8 @@ camel_init(void)
#endif /* G_THREADS_ENABLED */
#endif /* ENABLE_THREADS */
- unicode_init ();
+ /* Taken care of by e-util/e-unicode.c */
+ /*unicode_init ();*/
return 0;
}
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index 21452d5cee..a0a6279340 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -45,6 +45,7 @@ static CamelProvider imap_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
+ { 143, 0 },
NULL
};
diff --git a/camel/providers/mbox/camel-mbox-provider.c b/camel/providers/mbox/camel-mbox-provider.c
index d4048e1be3..0a73f13ab4 100644
--- a/camel/providers/mbox/camel-mbox-provider.c
+++ b/camel/providers/mbox/camel-mbox-provider.c
@@ -41,6 +41,7 @@ static CamelProvider mbox_provider = {
CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
+ { 0, 0 },
NULL
};
diff --git a/camel/providers/mh/camel-mh-provider.c b/camel/providers/mh/camel-mh-provider.c
index 58e97eed30..e7315ce849 100644
--- a/camel/providers/mh/camel-mh-provider.c
+++ b/camel/providers/mh/camel-mh-provider.c
@@ -40,6 +40,7 @@ static CamelProvider mh_provider = {
CAMEL_PROVIDER_IS_STORAGE,
{0, 0},
+ {0, 0},
NULL
};
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
index 214fd4b0fa..6cd7d96978 100644
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ b/camel/providers/nntp/camel-nntp-provider.c
@@ -39,6 +39,7 @@ static CamelProvider news_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
+ { 119, 0 },
NULL
};
@@ -55,6 +56,7 @@ static CamelProvider nntp_provider = {
CAMEL_PROVIDER_IS_REMOTE,
{ 0, 0 },
+ { 119, 0 },
NULL
};
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
index 52399c99ec..3a82f65232 100644
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ b/camel/providers/pop3/camel-pop3-provider.c
@@ -42,6 +42,7 @@ static CamelProvider pop3_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE,
{ 0, 0 },
+ { 110, 0 },
NULL
};
diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c
index 3b0b35dd72..8da50cf426 100644
--- a/camel/providers/sendmail/camel-sendmail-provider.c
+++ b/camel/providers/sendmail/camel-sendmail-provider.c
@@ -41,6 +41,7 @@ static CamelProvider sendmail_provider = {
0,
{ 0, 0 },
+ { 0, 0 },
NULL
};
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index 1d18e445cc..ea5aec70cc 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -40,6 +40,7 @@ static CamelProvider smtp_provider = {
0,
{ 0, 0 },
+ { 0, 25 },
NULL
};
diff --git a/camel/providers/vee/camel-vee-provider.c b/camel/providers/vee/camel-vee-provider.c
index e36e7fcff1..cbec03d58d 100644
--- a/camel/providers/vee/camel-vee-provider.c
+++ b/camel/providers/vee/camel-vee-provider.c
@@ -36,6 +36,7 @@ static CamelProvider vee_provider = {
0,
{ 0, 0 },
+ { 0, 0 },
NULL
};
diff --git a/mail/ChangeLog b/mail/ChangeLog
index fed4ebcd20..e3b84523ea 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+2000-08-25 Peter Williams <peterw@helixcode.com>
+
+ * mail-config-gui.c (service_page_item_new): If the service wants
+ a host, also let the user specify a port.
+ (MailDialogServicePageItem): Add members for the port GtkEntry and
+ the default port.
+ (service_page_get_url): Translate the port in the entry back into
+ the CamelURL.
+ (service_page_set_url): Read in the port from the URL or use
+ the default.
+
2000-08-25 Jeffrey Stedfast <fejj@helixcode.com>
* mail-crypto.c (mail_crypto_openpgp_encrypt): Implemented PGP 2.x
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) {