2007-09-01 [wwp] 2.10.0cvs188
authorTristan Chabredier <wwp@claws-mail.org>
Sat, 1 Sep 2007 12:02:34 +0000 (12:02 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Sat, 1 Sep 2007 12:02:34 +0000 (12:02 +0000)
* src/wizard.c
Fix wizard crash when Mailbox dir already exists
(thanks to Colin).

ChangeLog
PATCHSETS
configure.ac
src/wizard.c

index 0249f98d6a5205e4658d7d353966b6bfb913ea74..04ed2a56deae3569fffccfd19cf34ad693cd0b39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-01 [wwp]       2.10.0cvs188
+
+       * src/wizard.c
+               Fix wizard crash when Mailbox dir already exists
+               (thanks to Colin).
+
 2007-08-31 [colin]     2.10.0cvs187
 
        * src/etpan/imap-thread.c
index 7cb70f24f4d87025593c0f68160f63429a5d94ca..99f3c3490c947ac367120e11312f093e16937e06 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.404 -r 1.382.2.405 src/compose.c;  cvs diff -u -r 1.207.2.178 -r 1.207.2.179 src/folderview.c;  cvs diff -u -r 1.115.2.164 -r 1.115.2.165 src/main.c;  cvs diff -u -r 1.43.2.61 -r 1.43.2.62 src/prefs_matcher.c;  cvs diff -u -r 1.12.2.46 -r 1.12.2.47 src/prefs_template.c;  cvs diff -u -r 1.8.2.22 -r 1.8.2.23 src/quote_fmt.c;  cvs diff -u -r 1.17.2.42 -r 1.17.2.43 src/send_message.c;  cvs diff -u -r 1.43.2.81 -r 1.43.2.82 src/toolbar.c;  cvs diff -u -r 1.9.2.53 -r 1.9.2.54 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.33 -r 1.1.2.34 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/plugins/bogofilter/bogofilter_gtk.c;  cvs diff -u -r 1.9.2.26 -r 1.9.2.27 src/plugins/clamav/clamav_plugin_gtk.c;  cvs diff -u -r 1.1.2.47 -r 1.1.2.48 src/plugins/pgpcore/sgpgme.c;  cvs diff -u -r 1.18.2.55 -r 1.18.2.56 src/plugins/spamassassin/spamassassin.c;  cvs diff -u -r 1.23.2.40 -r 1.23.2.41 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 2.10.0cvs185.patchset
 ( cvs diff -u -r 1.207.2.179 -r 1.207.2.180 src/folderview.c;  cvs diff -u -r 1.274.2.208 -r 1.274.2.209 src/mainwindow.c;  cvs diff -u -r 1.94.2.149 -r 1.94.2.150 src/messageview.c;  cvs diff -u -r 1.12.2.40 -r 1.12.2.41 src/gtk/prefswindow.c;  ) > 2.10.0cvs186.patchset
 ( cvs diff -u -r 1.60.2.96 -r 1.60.2.97 src/addressbook.c;  cvs diff -u -r 1.382.2.405 -r 1.382.2.406 src/compose.c;  cvs diff -u -r 1.207.2.180 -r 1.207.2.181 src/folderview.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/image_viewer.c;  cvs diff -u -r 1.83.2.114 -r 1.83.2.115 src/mimeview.c;  cvs diff -u -r 1.395.2.323 -r 1.395.2.324 src/summaryview.c;  cvs diff -u -r 1.1.4.83 -r 1.1.4.84 src/etpan/imap-thread.c;  cvs diff -u -r 1.12.2.41 -r 1.12.2.42 src/gtk/prefswindow.c;  ) > 2.10.0cvs187.patchset
+( cvs diff -u -r 1.1.2.60 -r 1.1.2.61 src/wizard.c;  ) > 2.10.0cvs188.patchset
index d605b1de9f361743dbdd558ae28d5134e4ac3705..5f70c2ec83d788770576d72511a5fd452d679705 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=187
+EXTRA_VERSION=188
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b95eb4c834fca35f0b370eee01875c64f4d44d7d..9a9aada7ef182d6d3198d8f66f997d301210e227 100644 (file)
@@ -573,7 +573,6 @@ static gboolean wizard_write_config(WizardWindow *wizard)
        GList *account_list = NULL;
        GtkWidget *menu, *menuitem;
        gchar *smtp_server, *recv_server;
-       gchar *tmp;
        gint smtp_port, recv_port;
 #ifdef USE_OPENSSL                     
        SSLType smtp_ssl_type, recv_ssl_type;
@@ -596,16 +595,18 @@ static gboolean wizard_write_config(WizardWindow *wizard)
        }
 
 #ifdef MAEMO
-       g_free(prefs_common.data_root);
-       if (gtk_toggle_button_get_active(
-               GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
-               prefs_common.data_root = NULL;
-       else if (gtk_toggle_button_get_active(
-               GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn)))
-               prefs_common.data_root = g_strdup(MMC1_PATH);
-       else if (gtk_toggle_button_get_active(
-               GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn)))
-               prefs_common.data_root = g_strdup(MMC2_PATH);
+       if (wizard->create_mailbox) {
+               g_free(prefs_common.data_root);
+               if (gtk_toggle_button_get_active(
+                       GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
+                       prefs_common.data_root = NULL;
+               else if (gtk_toggle_button_get_active(
+                       GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn)))
+                       prefs_common.data_root = g_strdup(MMC1_PATH);
+               else if (gtk_toggle_button_get_active(
+                       GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn)))
+                       prefs_common.data_root = g_strdup(MMC2_PATH);
+       }
 #endif
 
        if (!mailbox_ok) {
@@ -716,12 +717,19 @@ static gboolean wizard_write_config(WizardWindow *wizard)
                                gtk_entry_get_text(GTK_ENTRY(wizard->organization)));
        prefs_account->smtp_server = g_strdup(smtp_server);
 
-       tmp = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
-       prefs_account->inbox = g_strdup_printf("#mh/%s/inbox",
+       if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
+               gchar *tmp;
+               tmp = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+               prefs_account->inbox = g_strdup_printf("#mh/%s/inbox",
                        (!strcmp("Mail", gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name))))
                                ?_("Mailbox"):tmp);
-       g_free(tmp);
-       prefs_account->local_inbox = g_strdup(prefs_account->inbox);
+               g_free(tmp);
+               prefs_account->local_inbox = g_strdup(prefs_account->inbox);
+       } else if (prefs_account->protocol != A_IMAP4) {
+               if (folder_get_default_inbox())
+                       prefs_account->local_inbox = 
+                               folder_item_get_identifier(folder_get_default_inbox());
+       }
 
        if (prefs_account->protocol != A_LOCAL)
                prefs_account->recv_server = g_strdup(recv_server);
@@ -1267,8 +1275,10 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
-               gtk_widget_show(wizard->mailbox_label);
-               gtk_widget_show(wizard->mailbox_name);
+               if (wizard->create_mailbox) {
+                       gtk_widget_show(wizard->mailbox_label);
+                       gtk_widget_show(wizard->mailbox_name);
+               }
        } else if (protocol == A_IMAP4) {
 #ifdef HAVE_LIBETPAN
                text = get_default_server(wizard, "imap");
@@ -1289,8 +1299,10 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
-               gtk_widget_hide(wizard->mailbox_label);
-               gtk_widget_hide(wizard->mailbox_name);
+               if (wizard->create_mailbox) {
+                       gtk_widget_hide(wizard->mailbox_label);
+                       gtk_widget_hide(wizard->mailbox_name);
+               }
 #else
                gtk_widget_hide(wizard->recv_imap_label);
                gtk_widget_hide(wizard->recv_imap_subdir);
@@ -1300,8 +1312,10 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->recv_username_label);
                gtk_widget_hide(wizard->recv_password_label);
                gtk_widget_show(wizard->no_imap_warning);
-               gtk_widget_hide(wizard->mailbox_label);
-               gtk_widget_hide(wizard->mailbox_name);
+               if (wizard->create_mailbox) {
+                       gtk_widget_hide(wizard->mailbox_label);
+                       gtk_widget_hide(wizard->mailbox_name);
+               }
 #ifdef USE_OPENSSL
                gtk_widget_hide(wizard->recv_use_ssl);
                gtk_widget_hide(wizard->recv_use_tls);
@@ -1324,8 +1338,10 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->recv_use_ssl);
                gtk_widget_hide(wizard->recv_use_tls);
 #endif
-               gtk_widget_show(wizard->mailbox_label);
-               gtk_widget_show(wizard->mailbox_name);
+               if (wizard->create_mailbox) {
+                       gtk_widget_show(wizard->mailbox_label);
+                       gtk_widget_show(wizard->mailbox_name);
+               }
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
        }
 }