Patch that provides a new option in the Register preferences to
specify whether, when tab is hit after entering the description for a
memorised transaction in Basic Ledger view, that the cursor  skips to
the value field (as at present) or just tabs to the Transfer field.
The option defaults to skip so gnucash operation is unaffected unless
user modifies the option.

I remember at least one other thought this would be a worthwhile enhancement.
If it gets committed I will update the docs.

There are not any automatic tests for this area that I need to update are there?
I have not done anything with regard to I18N, do I need to?

Colin
diff --git a/src/gnome-utils/glade/preferences.glade b/src/gnome-utils/glade/preferences.glade
index de4fd4a..e7c6230 100644
--- a/src/gnome-utils/glade/preferences.glade
+++ b/src/gnome-utils/glade/preferences.glade
@@ -2535,7 +2535,7 @@
 	    <widget class="GtkTable" id="table3">
 	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
-	      <property name="n_rows">15</property>
+	      <property name="n_rows">16</property>
 	      <property name="n_columns">4</property>
 	      <property name="homogeneous">False</property>
 	      <property name="row_spacing">0</property>
@@ -2666,8 +2666,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">1</property>
-		  <property name="top_attach">4</property>
-		  <property name="bottom_attach">5</property>
+		  <property name="top_attach">5</property>
+		  <property name="bottom_attach">6</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -2694,8 +2694,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">1</property>
-		  <property name="top_attach">9</property>
-		  <property name="bottom_attach">10</property>
+		  <property name="top_attach">10</property>
+		  <property name="bottom_attach">11</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -2717,8 +2717,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">5</property>
-		  <property name="bottom_attach">6</property>
+		  <property name="top_attach">6</property>
+		  <property name="bottom_attach">7</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2741,8 +2741,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">6</property>
-		  <property name="bottom_attach">7</property>
+		  <property name="top_attach">7</property>
+		  <property name="bottom_attach">8</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2765,8 +2765,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">7</property>
-		  <property name="bottom_attach">8</property>
+		  <property name="top_attach">8</property>
+		  <property name="bottom_attach">9</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2789,8 +2789,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">8</property>
-		  <property name="bottom_attach">9</property>
+		  <property name="top_attach">9</property>
+		  <property name="bottom_attach">10</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2813,8 +2813,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">14</property>
-		  <property name="bottom_attach">15</property>
+		  <property name="top_attach">15</property>
+		  <property name="bottom_attach">16</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2837,8 +2837,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">13</property>
-		  <property name="bottom_attach">14</property>
+		  <property name="top_attach">14</property>
+		  <property name="bottom_attach">15</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2861,8 +2861,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">12</property>
-		  <property name="bottom_attach">13</property>
+		  <property name="top_attach">13</property>
+		  <property name="bottom_attach">14</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2885,8 +2885,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">11</property>
-		  <property name="bottom_attach">12</property>
+		  <property name="top_attach">12</property>
+		  <property name="bottom_attach">13</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -2914,8 +2914,60 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">2</property>
-		  <property name="top_attach">10</property>
-		  <property name="bottom_attach">11</property>
+		  <property name="top_attach">11</property>
+		  <property name="bottom_attach">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkCheckButton" id="gconf/general/register/tab_skips_to_value_on_memorised">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Skip to value field when memorised transaction auto filled.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Tab _skips to Value on memorised transaction</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">True</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">4</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label121">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes"></property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">4</property>
+		  <property name="bottom_attach">5</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -2954,7 +3006,7 @@
 	    <widget class="GtkTable" id="table4">
 	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
-	      <property name="n_rows">10</property>
+	      <property name="n_rows">11</property>
 	      <property name="n_columns">4</property>
 	      <property name="homogeneous">False</property>
 	      <property name="row_spacing">0</property>
diff --git a/src/gnome/schemas/apps_gnucash_general.schemas.in b/src/gnome/schemas/apps_gnucash_general.schemas.in
index d3daffa..ac9ab93 100644
--- a/src/gnome/schemas/apps_gnucash_general.schemas.in
+++ b/src/gnome/schemas/apps_gnucash_general.schemas.in
@@ -351,6 +351,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnucash/general/register/tab_skips_to_value_on_memorised</key>
+      <applyto>/apps/gnucash/general/register/tab_skips_to_value_on_memorised</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Skip to value field when memorised transaction auto filled</short>
+        <long>If active then after a memorised transaction is automatically filled in the cursor will skip to the value field</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnucash/general/register/use_new_window</key>
       <applyto>/apps/gnucash/general/register/use_new_window</applyto>
       <owner>gnucash</owner>
diff --git a/src/register/ledger-core/split-register-control.c b/src/register/ledger-core/split-register-control.c
index f9a52fb..c904d0d 100644
--- a/src/register/ledger-core/split-register-control.c
+++ b/src/register/ledger-core/split-register-control.c
@@ -857,13 +857,17 @@ gnc_split_register_auto_completion (SplitRegister *reg,
 
         gnc_resume_gui_refresh ();
 
-        /* now move to the non-empty amount column */
-        amount = xaccSplitGetAmount (blank_split);
-        cell_name = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
-
-        if (gnc_table_get_current_cell_location (reg->table, cell_name,
-                                                 &new_virt_loc))
-          *p_new_virt_loc = new_virt_loc;
+        /* now move to the non-empty amount column unless config setting says not */
+        if ( gnc_gconf_get_bool(GCONF_GENERAL_REGISTER,
+				  "tab_skips_to_value_on_memorised", NULL) )
+        {
+          amount = xaccSplitGetAmount (blank_split);
+          cell_name = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
+  
+          if (gnc_table_get_current_cell_location (reg->table, cell_name,
+                                                   &new_virt_loc))
+            *p_new_virt_loc = new_virt_loc;
+        }
       }
 
     break;
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to