r23759 - gnucash/trunk/src/gnome - Bug 721770 - "Choose accounts to create" has no effect

John Ralls jralls at code.gnucash.org
Fri Jan 24 18:04:17 EST 2014


Author: jralls
Date: 2014-01-24 18:04:17 -0500 (Fri, 24 Jan 2014)
New Revision: 23759
Trac: http://svn.gnucash.org/trac/changeset/23759

Modified:
   gnucash/trunk/src/gnome/assistant-hierarchy.c
Log:
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.

Modified: gnucash/trunk/src/gnome/assistant-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/assistant-hierarchy.c	2014-01-24 23:04:09 UTC (rev 23758)
+++ gnucash/trunk/src/gnome/assistant-hierarchy.c	2014-01-24 23:04:17 UTC (rev 23759)
@@ -444,17 +444,15 @@
 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



More information about the gnucash-changes mailing list