From d58e0db04c3632f57b7dd927b6b1838b68f4c88c Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Sat, 8 Oct 2005 19:13:41 +0000 Subject: [PATCH] 2005-10-08 [colin] 1.9.15cvs24 * src/wizard.c Fix bug #827 ("Welcome" setup wizard after a permission error gives up & forgets itself.) --- ChangeLog-gtk2.claws | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/wizard.c | 23 +++++++++++++++++++---- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index bd169512a..5a375060c 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -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 diff --git a/PATCHSETS b/PATCHSETS index d2939cdb9..897bb9aba 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -860,3 +860,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index a17aced40..e5f3b0779 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/wizard.c b/src/wizard.c index 11845a941..da101a2d5 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -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, -- 2.25.1