[evolution-data-server] Bug 418954 - Add a separate entry combo for port numbers



commit 446b65e90dd40ef03ebe621694ee504bd8a23f10
Author: Dan Vráti <dvratil redhat com>
Date:   Fri Mar 18 11:34:37 2011 -0400

    Bug 418954 - Add a separate entry combo for port numbers
    
    Adds a new field to CamelProvider for listing standard port numbers with
    descriptions.  Evolution uses this information in its EPortEntry widget.
    
    This breaks ABI in CamelProvider and requires a soname bump.

 camel/camel-provider.c                             |    4 ++++
 camel/camel-provider.h                             |   12 ++++++++++++
 .../providers/groupwise/camel-groupwise-provider.c |    7 +++++++
 camel/providers/imap/camel-imap-provider.c         |    9 +++++++++
 camel/providers/imapx/camel-imapx-provider.c       |    9 +++++++++
 camel/providers/local/camel-local-provider.c       |    5 +++++
 camel/providers/nntp/camel-nntp-provider.c         |   10 +++++++++-
 camel/providers/pop3/camel-pop3-provider.c         |    8 ++++++++
 camel/providers/sendmail/camel-sendmail-provider.c |    2 ++
 camel/providers/smtp/camel-smtp-provider.c         |   11 +++++++++++
 configure.ac                                       |    2 +-
 docs/reference/camel/tmpl/camel-provider.sgml      |    2 ++
 12 files changed, 79 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index a444d69..3340474 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -64,6 +64,10 @@ static CamelProvider vee_provider = {
 	CAMEL_PROVIDER_IS_STORAGE,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 
+	NULL,	/* extra conf */
+
+	NULL,   /* port providers */
+
 	/* ... */
 };
 
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
index 330bd9b..e98dd8c 100644
--- a/camel/camel-provider.h
+++ b/camel/camel-provider.h
@@ -157,6 +157,12 @@ typedef struct {
 	const gchar *text, *value;
 } CamelProviderConfEntry;
 
+typedef struct {
+	gint port;
+	const gchar *desc;
+	gboolean is_ssl;
+} CamelProviderPortEntry;
+
 /* Some defaults */
 #define CAMEL_PROVIDER_CONF_DEFAULT_USERNAME \
 	{ CAMEL_PROVIDER_CONF_LABEL, "username", NULL, N_("User_name:"), NULL }
@@ -198,6 +204,12 @@ typedef struct {
 	/* Extra configuration information */
 	CamelProviderConfEntry *extra_conf;
 
+	/* The list of CamelProviderPortEntry structs. Each struct contains 
+	 * port number and a short string description ("Default IMAP port"
+	 * or "POP3 over SSL" etc.
+	 */
+	CamelProviderPortEntry *port_entries;
+
 	/* auto-detection function */
 	CamelProviderAutoDetectFunc auto_detect;
 
diff --git a/camel/providers/groupwise/camel-groupwise-provider.c b/camel/providers/groupwise/camel-groupwise-provider.c
index bace758..681d348 100644
--- a/camel/providers/groupwise/camel-groupwise-provider.c
+++ b/camel/providers/groupwise/camel-groupwise-provider.c
@@ -76,6 +76,11 @@ static CamelProviderConfEntry groupwise_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
+CamelProviderPortEntry groupwise_port_entries[] = {
+							{ 1677, N_("Default GroupWise port"), FALSE },
+							{ 0, NULL, 0 }
+						  };
+
 static CamelProvider groupwise_provider = {
 	"groupwise",
 	N_("Novell GroupWise"),
@@ -91,6 +96,8 @@ static CamelProvider groupwise_provider = {
 
 	groupwise_conf_entries,
 
+	groupwise_port_entries,
+
 	/* ... */
 };
 
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index ab14cb4..bc1d3f7 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -74,6 +74,12 @@ static CamelProviderConfEntry imap_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
+CamelProviderPortEntry imap_port_entries[] = {
+				   		{ 143, N_("IMAP default port"), FALSE },
+						{ 993, N_("IMAP over SSL"), TRUE },
+						{ 0, NULL, 0 }
+			    		     };
+
 static CamelProvider imap_provider = {
 	"imap",
 	N_("IMAP"),
@@ -90,6 +96,8 @@ static CamelProvider imap_provider = {
 
 	imap_conf_entries,
 
+	imap_port_entries,
+
 	/* ... */
 };
 
@@ -100,6 +108,7 @@ CamelServiceAuthType camel_imap_password_authtype = {
 	   "plaintext password."),
 
 	"",
+
 	TRUE
 };
 
diff --git a/camel/providers/imapx/camel-imapx-provider.c b/camel/providers/imapx/camel-imapx-provider.c
index d2ec9b4..e0ded9f 100644
--- a/camel/providers/imapx/camel-imapx-provider.c
+++ b/camel/providers/imapx/camel-imapx-provider.c
@@ -82,12 +82,19 @@ CamelProviderConfEntry imapx_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
+CamelProviderPortEntry imapx_port_entries[] = {
+						{ 143, N_("Defalut IMAP port"), FALSE },
+						{ 993, N_("IMAP over SSL"), TRUE },
+						{ 0, NULL, 0 }
+					      };
+
 static CamelProvider imapx_provider = {
 	"imapx",
 
 	N_("IMAP+"),
 
 	N_("For reading and storing mail on IMAP servers."),
+
 	"mail",
 
 	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
@@ -97,6 +104,8 @@ static CamelProvider imapx_provider = {
 
 	imapx_conf_entries,
 
+	imapx_port_entries,
+
 	/* ... */
 };
 
diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c
index bbaf97c..e452875 100644
--- a/camel/providers/local/camel-local-provider.c
+++ b/camel/providers/local/camel-local-provider.c
@@ -54,6 +54,7 @@ static CamelProvider mh_provider = {
 	CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_NEED_PATH_DIR | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 	mh_conf_entries,
+	NULL,
 	/* ... */
 };
 
@@ -72,6 +73,7 @@ static CamelProvider mbox_provider = {
 	CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 	mbox_conf_entries,
+	NULL,
 	/* ... */
 };
 
@@ -94,6 +96,7 @@ static CamelProvider maildir_provider = {
 	CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_NEED_PATH_DIR | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 	maildir_conf_entries,
+	NULL,
 	/* ... */
 };
 
@@ -114,6 +117,7 @@ static CamelProvider spool_file_provider = {
 	CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 	spool_conf_entries,
+	NULL,
 	/* ... */
 };
 
@@ -125,6 +129,7 @@ static CamelProvider spool_directory_provider = {
 	CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
 	CAMEL_URL_NEED_PATH | CAMEL_URL_NEED_PATH_DIR | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
 	spool_conf_entries,
+	NULL,
 	/* ... */
 };
 
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
index 6c0acd1..88829f0 100644
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ b/camel/providers/nntp/camel-nntp-provider.c
@@ -48,6 +48,12 @@ static CamelProviderConfEntry nntp_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
+CamelProviderPortEntry nntp_port_entries[] = {
+						  { 119, N_("Default NNTP port"), FALSE },
+						  { 563, N_("NNTP over SSL"), TRUE },
+					    	  { 0, NULL, 0 }
+					     };
+
 static CamelProvider news_provider = {
 	"nntp",
 	N_("USENET news"),
@@ -63,7 +69,9 @@ static CamelProvider news_provider = {
 	CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_USER |
 	CAMEL_URL_ALLOW_PASSWORD | CAMEL_URL_ALLOW_AUTH,
 
-	nntp_conf_entries
+	nntp_conf_entries,
+
+	nntp_port_entries,
 
 	/* ... */
 };
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
index 0c8633a..1e68c80 100644
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ b/camel/providers/pop3/camel-pop3-provider.c
@@ -50,6 +50,12 @@ static CamelProviderConfEntry pop3_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
+CamelProviderPortEntry pop3_port_entries[] = {
+						  { 110, N_("Default POP3 port"), FALSE },
+						  { 995, N_("POP3 over SSL"), TRUE },
+						  { 0, NULL, 0 }
+					     };
+
 static CamelProvider pop3_provider = {
 	"pop",
 
@@ -66,6 +72,8 @@ static CamelProvider pop3_provider = {
 
 	pop3_conf_entries,
 
+	pop3_port_entries,
+
 	/* ... */
 };
 
diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c
index 566ea63..4b45fd2 100644
--- a/camel/providers/sendmail/camel-sendmail-provider.c
+++ b/camel/providers/sendmail/camel-sendmail-provider.c
@@ -44,6 +44,8 @@ static CamelProvider sendmail_provider = {
 
 	0, /* url_flags */
 
+	NULL,  /* port entries */
+
 	/* ... */
 };
 
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index 08649db..7a1df0b 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -38,6 +38,13 @@
 static guint smtp_url_hash (gconstpointer key);
 static gint smtp_url_equal (gconstpointer a, gconstpointer b);
 
+CamelProviderPortEntry smtp_port_entries[] = {
+						  { 25, N_("Default SMTP port"), FALSE },
+						  { 465, N_("SMTP over SSL"), TRUE },
+						  { 587, N_("Message submission port"), FALSE },
+						  { 0, NULL, 0 }
+					     };
+
 static CamelProvider smtp_provider = {
 	"smtp",
 	N_("SMTP"),
@@ -51,6 +58,10 @@ static CamelProvider smtp_provider = {
 
 	CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH | CAMEL_URL_ALLOW_USER,
 
+	NULL,
+
+	smtp_port_entries,
+
 	/* ... */
 };
 
diff --git a/configure.ac b/configure.ac
index ff6d292..2d546d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@ LIBEGROUPWISE_CURRENT=13
 LIBEGROUPWISE_REVISION=1
 LIBEGROUPWISE_AGE=0
 
-LIBCAMEL_CURRENT=23
+LIBCAMEL_CURRENT=24
 LIBCAMEL_REVISION=0
 LIBCAMEL_AGE=0
 
diff --git a/docs/reference/camel/tmpl/camel-provider.sgml b/docs/reference/camel/tmpl/camel-provider.sgml
index 7a0962c..92cd567 100644
--- a/docs/reference/camel/tmpl/camel-provider.sgml
+++ b/docs/reference/camel/tmpl/camel-provider.sgml
@@ -32,6 +32,7 @@ camel-provider
 @flags: 
 @url_flags: 
 @extra_conf: 
+ port_entries: 
 @auto_detect: 
 @object_types: 
 @authtypes: 
@@ -263,6 +264,7 @@ camel-provider
 @flags: 
 @url_flags: 
 @extra_conf: 
+ port_entries: 
 @auto_detect: 
 @object_types: 
 @authtypes: 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]