2005-10-08 [colin] 1.9.15cvs24
authorColin Leroy <colin@colino.net>
Sat, 8 Oct 2005 19:13:41 +0000 (19:13 +0000)
committerColin Leroy <colin@colino.net>
Sat, 8 Oct 2005 19:13:41 +0000 (19:13 +0000)
* src/wizard.c
Fix bug #827 ("Welcome" setup wizard after a
permission error gives up & forgets itself.)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/wizard.c

index bd169512ac4b829a31902ced546bd20e78724631..5a375060cb2374cef29661c6f0c47b7c184afc22 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-08 [colin]     1.9.15cvs24
+
+       * src/wizard.c
+               Fix bug #827 ("Welcome" setup wizard after a 
+               permission error gives up & forgets itself.)
+
 2005-10-08 [colin]     1.9.15cvs23
 
        * src/procmime.c
index d2939cdb9b7511774fd16314ea107e0f7769a668..897bb9aba198f6bb3e3742cf46aeb11a3dbe6af2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.62 -r 1.213.2.63 src/folder.c;  cvs diff -u -r 1.87.2.21 -r 1.87.2.22 src/folder.h;  cvs diff -u -r 1.207.2.69 -r 1.207.2.70 src/folderview.c;  cvs diff -u -r 1.395.2.132 -r 1.395.2.133 src/summaryview.c;  ) > 1.9.15cvs21.patchset
 ( cvs diff -u -r 1.8.2.11 -r 1.8.2.12 src/export.c;  ) > 1.9.15cvs22.patchset
 ( cvs diff -u -r 1.49.2.63 -r 1.49.2.64 src/procmime.c;  ) > 1.9.15cvs23.patchset
+( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/wizard.c;  ) > 1.9.15cvs24.patchset
index a17aced40ec06e4ad4dcee30f64b9f35b46fd8cf..e5f3b0779988184784860b0c45ae0632316d92fc 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=23
+EXTRA_VERSION=24
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 11845a94137d13c2302bd68a523c91f416787ed5..da101a2d555cf926d90a42695461229340d199dd 100644 (file)
@@ -103,7 +103,7 @@ typedef struct
 
 } WizardWindow;
 
-static void wizard_write_config(WizardWindow *wizard)
+static gboolean wizard_write_config(WizardWindow *wizard)
 {
        gboolean mailbox_ok = FALSE;
        PrefsAccount *prefs_account = prefs_account_new();
@@ -118,8 +118,16 @@ static void wizard_write_config(WizardWindow *wizard)
        if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
                mailbox_ok = setup_write_mailbox_path(wizard->mainwin, 
                                gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+       } else
+               mailbox_ok = TRUE;
+
+       if (!mailbox_ok) {
+               gtk_notebook_set_current_page (
+                       GTK_NOTEBOOK(wizard->notebook), 
+                       4);
+               return FALSE;
        }
-
+       
        if (prefs_account->protocol != A_LOCAL)
                prefs_account->account_name = g_strdup_printf("%s@%s",
                                gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)),
@@ -172,6 +180,8 @@ static void wizard_write_config(WizardWindow *wizard)
        prefs_account_write_config_all(account_list);
        prefs_account_free(prefs_account);
        account_read_config_all();
+       
+       return TRUE;
 }
 
 static GtkWidget* create_page (WizardWindow *wizard, const char * title)
@@ -519,6 +529,7 @@ wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
        }
        
        num_pages = g_slist_length(wizard->pages);
+
        current_page = gtk_notebook_get_current_page (
                                GTK_NOTEBOOK(wizard->notebook));
        if (response == CANCEL)
@@ -529,7 +540,11 @@ wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
        }
        else if (response == FINISHED)
        {
-               wizard_write_config(wizard);
+               if (!wizard_write_config(wizard)) {
+                       current_page = gtk_notebook_get_current_page (
+                                       GTK_NOTEBOOK(wizard->notebook));
+                       goto set_sens;
+               }
                wizard->finished = TRUE;
                wizard->result = TRUE;
                gtk_widget_destroy (GTK_WIDGET(dialog));
@@ -562,7 +577,7 @@ wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
                                        current_page);
                        }
                }
-
+set_sens:
                gtk_dialog_set_response_sensitive (dialog, GO_BACK, 
                                current_page > 0);
                gtk_dialog_set_response_sensitive (dialog, GO_FORWARD,