From 9c929f1d1e82fa29b24b22c7b16297c4d8f6b604 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Mon, 11 Dec 2006 18:08:20 +0000 Subject: [PATCH] 2006-12-11 [colin] 2.6.1cvs16 * src/prefs_account.c Check for existence of inbox for local accounts too * src/wizard.c Allow setting the port to use for servers by using the usual "server.example.com:port" syntax. Fixes bug 1077, 'sylpheed-claws does not start when IMAP server is unavailable' --- ChangeLog | 11 +++++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/prefs_account.c | 2 +- src/wizard.c | 37 ++++++++++++++++++++++++++++++------- 5 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 675e95a83..de1e5fd1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-12-11 [colin] 2.6.1cvs16 + + * src/prefs_account.c + Check for existence of inbox for local + accounts too + * src/wizard.c + Allow setting the port to use for servers + by using the usual "server.example.com:port" + syntax. Fixes bug 1077, 'sylpheed-claws does + not start when IMAP server is unavailable' + 2006-12-11 [colin] 2.6.1cvs15 * src/prefs_account.c diff --git a/PATCHSETS b/PATCHSETS index 7cdcfeb2f..d1a12752d 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2123,3 +2123,4 @@ ( cvs diff -u -r 1.1.2.35 -r 1.1.2.36 manual/advanced.xml; cvs diff -u -r 1.204.2.111 -r 1.204.2.112 src/prefs_common.c; cvs diff -u -r 1.103.2.69 -r 1.103.2.70 src/prefs_common.h; cvs diff -u -r 1.4.2.14 -r 1.4.2.15 src/common/ssl_certificate.c; ) > 2.6.1cvs13.patchset ( cvs diff -u -r 1.105.2.70 -r 1.105.2.71 src/prefs_account.c; ) > 2.6.1cvs14.patchset ( cvs diff -u -r 1.105.2.71 -r 1.105.2.72 src/prefs_account.c; ) > 2.6.1cvs15.patchset +( cvs diff -u -r 1.1.2.40 -r 1.1.2.41 src/wizard.c; cvs diff -u -r 1.105.2.72 -r 1.105.2.73 src/prefs_account.c; ) > 2.6.1cvs16.patchset diff --git a/configure.ac b/configure.ac index d8a4d8347..01a594320 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=6 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=15 +EXTRA_VERSION=16 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/prefs_account.c b/src/prefs_account.c index dd7742cf3..001ea408b 100644 --- a/src/prefs_account.c +++ b/src/prefs_account.c @@ -2521,7 +2521,7 @@ static gint prefs_account_apply(void) alertpanel_error(_("POP3 server is not entered.")); return -1; } - if (protocol == A_POP3) { + if (protocol == A_POP3 || protocol == A_LOCAL) { const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(receive.inbox_entry)); FolderItem *inbox = folder_find_item_from_identifier(mailbox); if (inbox == NULL) { diff --git a/src/wizard.c b/src/wizard.c index 746811035..840cfbb70 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -545,7 +545,9 @@ static gboolean wizard_write_config(WizardWindow *wizard) PrefsAccount *prefs_account = prefs_account_new(); GList *account_list = NULL; GtkWidget *menu, *menuitem; - + gchar *smtp_server, *recv_server; + gint smtp_port, recv_port; + menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(wizard->recv_type)); menuitem = gtk_menu_get_active(GTK_MENU(menu)); prefs_account->protocol = GPOINTER_TO_INT @@ -641,21 +643,42 @@ static gboolean wizard_write_config(WizardWindow *wizard) prefs_account->account_name = g_strdup_printf("%s", gtk_entry_get_text(GTK_ENTRY(wizard->recv_server))); + recv_server = g_strdup(gtk_entry_get_text(GTK_ENTRY(wizard->recv_server))); + smtp_server = g_strdup(gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server))); + + if (prefs_account->protocol != A_LOCAL && strstr(recv_server, ":")) { + recv_port = atoi(strstr(recv_server, ":")+1); + *(strstr(recv_server, ":")) = '\0'; + if (prefs_account->protocol == A_IMAP4) { + prefs_account->set_imapport = TRUE; + prefs_account->imapport = recv_port; + } else if (prefs_account->protocol == A_POP3) { + prefs_account->set_popport = TRUE; + prefs_account->popport = recv_port; + } + } + if (strstr(smtp_server, ":")) { + smtp_port = atoi(strstr(smtp_server, ":")+1); + *(strstr(smtp_server, ":")) = '\0'; + prefs_account->set_smtpport = TRUE; + prefs_account->smtpport = smtp_port; + } + prefs_account->name = g_strdup( gtk_entry_get_text(GTK_ENTRY(wizard->full_name))); prefs_account->address = g_strdup( gtk_entry_get_text(GTK_ENTRY(wizard->email))); prefs_account->organization = g_strdup( gtk_entry_get_text(GTK_ENTRY(wizard->organization))); - prefs_account->smtp_server = g_strdup( - gtk_entry_get_text(GTK_ENTRY(wizard->smtp_server))); + prefs_account->smtp_server = g_strdup(smtp_server); if (prefs_account->protocol != A_LOCAL) - prefs_account->recv_server = g_strdup( - gtk_entry_get_text(GTK_ENTRY(wizard->recv_server))); + prefs_account->recv_server = g_strdup(recv_server); else - prefs_account->local_mbox = g_strdup( - gtk_entry_get_text(GTK_ENTRY(wizard->recv_server))); + prefs_account->local_mbox = g_strdup(recv_server); + + g_free(recv_server); + g_free(smtp_server); prefs_account->userid = g_strdup( gtk_entry_get_text(GTK_ENTRY(wizard->recv_username))); -- 2.25.1