gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Mon Jun 21 05:31:29 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/4cff5aa1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/afd61f74 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ea2a54bf (commit)
	from  https://github.com/Gnucash/gnucash/commit/a13311be (commit)



commit 4cff5aa197107cf4a552d2156b936b0c7b3242af
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Jun 19 13:07:58 2021 +0100

    Refactor gnc_combo_cell_modify_verify to make it clearer.

diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index 40f3104f6..38d162b65 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -633,16 +633,22 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
             return;
         }
         match_str = quickfill_match (box->qf, newval);
-    }
 
-    if (match_str != NULL)
-    {
-        *start_selection = newval_chars;
-        *end_selection = -1;
-        *cursor_position += change_chars;
-        box_str = match_str;
+        if (match_str != NULL) // Do we have a quickfill match
+        {
+            *start_selection = newval_chars;
+            *end_selection = -1;
+            *cursor_position += change_chars;
+            box_str = match_str;
+
+            block_list_signals (cell); // Prevent recursion
+            gnc_item_list_select (box->item_list, match_str);
+            unblock_list_signals (cell);
+        }
     }
-    else if (cell->shared_store)
+
+    // Try using type-ahead
+    if (match_str == NULL && cell->shared_store)
     {
         // No start-of-name match, try type-ahead search, we match any substring of the full account name.
         GtkListStore *store = cell->shared_store;
@@ -650,23 +656,23 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
         *start_selection = newval_chars;
         *end_selection = -1;
         *cursor_position = newval_chars;
+
         // Do not change the string in the type-in box.
         box_str = newval;
     }
 
+    // No type-ahead / quickfill entry found
     if (match_str == NULL)
     {
+        block_list_signals (cell); // Prevent recursion
         if (cell->shared_store && gnc_item_list_using_temp (box->item_list))
         {
-            block_list_signals (cell); //Prevent recursion
             gnc_item_list_set_temp_store (box->item_list, NULL);
             gtk_list_store_clear (box->tmp_store);
-            unblock_list_signals (cell);
         }
-        gnc_basic_cell_set_value_internal (_cell, newval);
-        block_list_signals (cell);
         gnc_item_list_select (box->item_list, NULL);
         unblock_list_signals (cell);
+        gnc_basic_cell_set_value_internal (_cell, newval);
         *cursor_position = *start_selection = newval_chars;
         *end_selection = -1;
         return;
@@ -678,13 +684,6 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
         box->list_popped = TRUE;
     }
 
-    if (!gnc_item_list_using_temp (box->item_list))
-    {
-        block_list_signals (cell);
-        gnc_item_list_select (box->item_list, match_str);
-        unblock_list_signals (cell);
-    }
-
     gnc_basic_cell_set_value_internal (_cell, box_str);
     g_free (match_str);
 }

commit afd61f749337968c30c0c4458dd012e976a02af0
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Jun 19 12:43:34 2021 +0100

    Type ahead not working properly on subsequent key strokes
    
    When in the transfer cell and you are searching for the 'fuel' account,
    entering the 'f' would bring up all accounts containing an 'f' but when
    the next letter 'u' is entered it would show all accounts containing a
    'u'. This is down to the transfer cell being updated to early from a
    gnc_item_list_select which is being used for the quick fill so test for
    quick fill use first.

diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index f3481dd46..40f3104f6 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -678,9 +678,12 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
         box->list_popped = TRUE;
     }
 
-    block_list_signals (cell);
-    gnc_item_list_select (box->item_list, match_str);
-    unblock_list_signals (cell);
+    if (!gnc_item_list_using_temp (box->item_list))
+    {
+        block_list_signals (cell);
+        gnc_item_list_select (box->item_list, match_str);
+        unblock_list_signals (cell);
+    }
 
     gnc_basic_cell_set_value_internal (_cell, box_str);
     g_free (match_str);

commit ea2a54bf9e5440aebb1f999410be9d163fdf6108
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Jun 19 12:43:18 2021 +0100

    Bug 798162 - Type Ahead Initialization Problem
    
    If navigating by the keyboard and you tab to the transfer cell and then
    type a letter, we get to gnc_item_edit_show_popup which starts to
    create and hopefully show the pop up list.
    
    But on first use, cell height obtained by gnc_item_list_get_cell_height
    can be 1 pixel less than required. This should be corrected by the
    check_popup_height_is_true function which calls gnc_item_edit_update
    via an idle function. As part of that function, a check is made for
    item_edit->show_popup being set but that was only getting set in the
    gnc_item_edit_popup_toggled call back so the pop up would not show.
    
    To fix set item_edit->show_popup after setting the toggle button arrow
    direction.

diff --git a/gnucash/register/register-gnome/gnucash-item-edit.c b/gnucash/register/register-gnome/gnucash-item-edit.c
index 3b1d10a02..1c2d6bf43 100644
--- a/gnucash/register/register-gnome/gnucash-item-edit.c
+++ b/gnucash/register/register-gnome/gnucash-item-edit.c
@@ -1082,6 +1082,7 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
 
     // set the popup arrow direction up
     item_edit->popup_toggle.arrow_down = FALSE;
+    item_edit->show_popup = TRUE;
 
     if (item_edit->popup_set_focus)
         item_edit->popup_set_focus (item_edit->popup_item,



Summary of changes:
 gnucash/register/register-gnome/combocell-gnome.c  | 34 ++++++++++++----------
 .../register/register-gnome/gnucash-item-edit.c    |  1 +
 2 files changed, 19 insertions(+), 16 deletions(-)



More information about the gnucash-changes mailing list