gnucash maint: Bug 797416 - Enter key does not move to blank tx or next line

Robert Fewell bobit at code.gnucash.org
Mon Sep 23 08:45:50 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/ee260d8e (commit)
	from  https://github.com/Gnucash/gnucash/commit/9832fa39 (commit)



commit ee260d8e3a197a63b394d3a41e9ec502dcf92842
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Sep 23 13:28:34 2019 +0100

    Bug 797416 - Enter key does not move to blank tx or next line
    
    Caused by a previous commit that did not allow for just pressing the
    enter key without changes to move to the next transaction. This was
    part of a change to stop being asked to create a new account many times
    when the transfer cell had been changed and declining it. To fix this
    when gnc_split_reg_record returns false, test for the current cursor
    changed flag being not set to proceed to do the move.

diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index 5291e41bb..41ba0f628 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -2353,15 +2353,21 @@ gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction )
             }
         }
     }
-
     /* First record the transaction. This will perform a refresh. */
     if (!gnc_split_reg_record (gsr))
     {
-        /* make sure the sheet has the focus if the record is FALSE
+        /* we may come here from the transfer cell if we decline to create a
+         * new account, make sure the sheet has the focus if the record is FALSE
          * which results in no cursor movement. */
         gnc_split_reg_focus_on_sheet (gsr);
-        LEAVE(" ");
-        return;
+
+        /* if there are no changes, just enter was pressed, proceed to move
+         * other wise lets not move. */
+        if (gnc_table_current_cursor_changed (sr->table, FALSE))
+        {
+            LEAVE(" ");
+            return;
+        }
     }
 
     if (!goto_blank && next_transaction)



Summary of changes:
 gnucash/gnome/gnc-split-reg.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list