From 6cfa8ea4b4cdcb94f431915245f95831b037384b Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 24 Jan 2014 23:04:17 +0000 Subject: [PATCH] Bug 721770 - "Choose accounts to create" has no effect "Common Accounts" always created Conditionally adjust the page number selection in the on_prepare function to account for the extra page. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23759 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/assistant-hierarchy.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gnome/assistant-hierarchy.c b/src/gnome/assistant-hierarchy.c index 1a5a4dad22..da0d5af6be 100644 --- a/src/gnome/assistant-hierarchy.c +++ b/src/gnome/assistant-hierarchy.c @@ -444,17 +444,15 @@ account_categories_tree_view_prepare (hierarchy_data *data) void on_prepare (GtkAssistant *assistant, GtkWidget *page, hierarchy_data *data) { - switch (gtk_assistant_get_current_page(assistant)) - { - case 2: - /* Current page is account selection */ + const int selection_page = data->new_book ? 3 : 2; + const int final_page = data->new_book ? 4 : 3; + const int current_page = gtk_assistant_get_current_page (assistant); + + if (current_page == selection_page) on_choose_account_categories_prepare(data); - break; - case 3: - /* Current page is final account page */ + + if (current_page == final_page) on_final_account_prepare (data); - break; - } } void