r21392 - gnucash/trunk/src/gnome - Small improvements to the hierarchy assistant:

Geert Janssens gjanssens at code.gnucash.org
Sat Oct 8 09:33:34 EDT 2011


Author: gjanssens
Date: 2011-10-08 09:33:34 -0400 (Sat, 08 Oct 2011)
New Revision: 21392
Trac: http://svn.gnucash.org/trac/changeset/21392

Modified:
   gnucash/trunk/src/gnome/assistant-hierarchy.c
   gnucash/trunk/src/gnome/gtkbuilder/assistant-hierarchy.glade
Log:
Small improvements to the hierarchy assistant:
* Set a default height to the assistant so it gets rid of one of the
scroll bars and make the currency drop down larger to show all text.
* Also make the assistant window stay on top as when it is started from
the new user dialog, the main save window used to hide the assistant
window and could confuse the user
Patch by Robert Fewell

Modified: gnucash/trunk/src/gnome/assistant-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/assistant-hierarchy.c	2011-10-08 09:32:13 UTC (rev 21391)
+++ gnucash/trunk/src/gnome/assistant-hierarchy.c	2011-10-08 13:33:34 UTC (rev 21392)
@@ -1069,6 +1069,10 @@
     dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Hierarchy Assistant"));
     data->dialog = dialog;
 
+    /* If we have a callback, make this window stay on top */
+    if (when_completed != NULL)
+        gtk_window_set_keep_above (GTK_WINDOW(data->dialog), TRUE);
+
     gnc_assistant_set_colors (GTK_ASSISTANT (data->dialog));
 
     /* Enable buttons on first and last page. */
@@ -1089,8 +1093,8 @@
     data->currency_selector = gnc_currency_edit_new();
     gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT(data->currency_selector), gnc_default_currency());
     gtk_widget_show (data->currency_selector);
-    box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_chooser_vbox"));
-    gtk_box_pack_start(GTK_BOX(box), data->currency_selector, FALSE, FALSE, 0);
+    box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_chooser_hbox"));
+    gtk_box_pack_start(GTK_BOX(box), data->currency_selector, TRUE, TRUE, 0);
 
     /* Categories Page */
     tree_view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "account_categories_tree_view"));

Modified: gnucash/trunk/src/gnome/gtkbuilder/assistant-hierarchy.glade
===================================================================
--- gnucash/trunk/src/gnome/gtkbuilder/assistant-hierarchy.glade	2011-10-08 09:32:13 UTC (rev 21391)
+++ gnucash/trunk/src/gnome/gtkbuilder/assistant-hierarchy.glade	2011-10-08 13:33:34 UTC (rev 21392)
@@ -4,13 +4,19 @@
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAssistant" id="Hierarchy Assistant">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <signal name="prepare" handler="on_prepare"/>
-    <signal name="cancel" handler="on_cancel"/>
-    <signal name="close" handler="on_finish"/>
+    <property name="default_height">550</property>
+    <signal name="close" handler="on_finish" swapped="no"/>
+    <signal name="prepare" handler="on_prepare" swapped="no"/>
+    <signal name="cancel" handler="on_cancel" swapped="no"/>
     <child>
+      <placeholder/>
+    </child>
+    <child>
       <object class="GtkLabel" id="intro_page_label">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="label" translatable="yes">This assistant will help you create a set of GnuCash accounts for your assets (such as investments, checking or savings accounts), liabilities (such as loans) and different kinds of income and expenses you might have.
 
 Click 'Cancel'  if you do not wish to create any new accounts now.</property>
@@ -24,12 +30,14 @@
     <child>
       <object class="GtkVBox" id="currency_page_vbox">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <property name="spacing">5</property>
         <child>
           <object class="GtkLabel" id="choose_currency_label">
             <property name="visible">True</property>
-            <property name="label" translatable="yes">Please choose the currency to use for new accounts.</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">
+Please choose the currency to use for new accounts.</property>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -38,25 +46,55 @@
           </packing>
         </child>
         <child>
-          <object class="GtkAlignment" id="currency_chooser_alignment">
+          <object class="GtkHBox" id="currency_chooser_vbox">
             <property name="visible">True</property>
-            <property name="yalign">0</property>
-            <property name="xscale">0</property>
-            <property name="yscale">0</property>
+            <property name="can_focus">False</property>
             <child>
-              <object class="GtkVBox" id="currency_chooser_vbox">
+              <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="currency_chooser_hbox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <child>
                   <placeholder/>
                 </child>
               </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
             <property name="position">1</property>
           </packing>
         </child>
+        <child>
+          <placeholder/>
+        </child>
       </object>
       <packing>
         <property name="title" translatable="yes">Choose Currency</property>
@@ -65,11 +103,13 @@
     <child>
       <object class="GtkVBox" id="choose_account_types_vbox">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <child>
           <object class="GtkLabel" id="pickAccountsDescriptionLabel">
             <property name="visible">True</property>
-            <property name="label" translatable="yes">Select categories that correspond to the ways that you will use GnuCash.  Each category you select will cause several accounts to be created.  Select the categories that are relevant to you.  You can always create additional accounts by hand later.</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">
+Select categories that correspond to the ways that you will use GnuCash.  Each category you select will cause several accounts to be created.  Select the categories that are relevant to you.  You can always create additional accounts by hand later.</property>
             <property name="wrap">True</property>
             <property name="width_chars">75</property>
           </object>
@@ -89,18 +129,18 @@
               <object class="GtkVPaned" id="vpaned2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="orientation">vertical</property>
-                <property name="position">150</property>
+                <property name="position">200</property>
                 <property name="position_set">True</property>
                 <child>
                   <object class="GtkVBox" id="vbox7">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="border_width">6</property>
-                    <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkLabel" id="label8477431">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes"><b>Categories</b></property>
                         <property name="use_markup">True</property>
@@ -114,6 +154,7 @@
                     <child>
                       <object class="GtkAlignment" id="alignment11">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkScrolledWindow" id="scrolledwindow1">
@@ -134,16 +175,20 @@
                         </child>
                       </object>
                       <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkAlignment" id="alignment12">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkHButtonBox" id="hbuttonbox3">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
                             <property name="layout_style">spread</property>
                             <child>
@@ -153,8 +198,9 @@
                                 <property name="can_focus">True</property>
                                 <property name="can_default">True</property>
                                 <property name="receives_default">True</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
-                                <signal name="clicked" handler="select_all_clicked"/>
+                                <signal name="clicked" handler="select_all_clicked" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -169,8 +215,9 @@
                                 <property name="can_focus">True</property>
                                 <property name="can_default">True</property>
                                 <property name="receives_default">True</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
-                                <signal name="clicked" handler="clear_all_clicked"/>
+                                <signal name="clicked" handler="clear_all_clicked" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -183,6 +230,7 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="fill">True</property>
                         <property name="position">2</property>
                       </packing>
                     </child>
@@ -195,12 +243,13 @@
                 <child>
                   <object class="GtkVBox" id="vbox130">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="border_width">6</property>
-                    <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkLabel" id="label8477397">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes"><b>Category Description</b></property>
                         <property name="use_markup">True</property>
@@ -214,6 +263,7 @@
                     <child>
                       <object class="GtkAlignment" id="alignment10">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkScrolledWindow" id="scrolledwindow31">
@@ -237,6 +287,8 @@
                         </child>
                       </object>
                       <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -255,12 +307,13 @@
             <child>
               <object class="GtkVBox" id="vbox131">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="accounts_in_category_label">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label"><b>Accounts in %s</b></property>
                     <property name="use_markup">True</property>
@@ -274,6 +327,7 @@
                 <child>
                   <object class="GtkAlignment" id="alignment13">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="left_padding">12</property>
                     <child>
                       <object class="GtkScrolledWindow" id="accounts_in_category">
@@ -289,6 +343,8 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -300,6 +356,8 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -311,13 +369,15 @@
     <child>
       <object class="GtkVBox" id="final_account_vbox">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <child>
           <object class="GtkLabel" id="finalAccountLabel">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="xpad">1</property>
             <property name="ypad">1</property>
-            <property name="label" translatable="yes">If you would like to change an account's name, click on the row containing the account, then click on the account name and change it.
+            <property name="label" translatable="yes">
+If you would like to change an account's name, click on the row containing the account, then click on the account name and change it.
 
 Some accounts are marked as "Placeholder". Placeholder accounts are used to create a hierarchy of accounts and normally do not have transactions or opening balances. If you would like an account to be a placeholder account, click the checkbox for that account.
 
@@ -347,6 +407,8 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -358,6 +420,7 @@
     <child>
       <object class="GtkLabel" id="finish_page_label">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="label" translatable="yes">Press `Apply' to create your new accounts.  You will then be able to save them to a file or database.
 
 Press `Back' to review your selections.



More information about the gnucash-changes mailing list