gnucash stable: [import-main-matcher.cpp] After clicking/toggling A/U+C/C checkbox, reselect the row

Christopher Lam clam at code.gnucash.org
Fri Jul 28 05:07:15 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/5ac8ffdd (commit)
	from  https://github.com/Gnucash/gnucash/commit/a2f88f6f (commit)



commit 5ac8ffdd41a0b0076dd31c9947859487ee5f35ca
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Jul 27 19:54:03 2023 +0800

    [import-main-matcher.cpp] After clicking/toggling A/U+C/C checkbox, reselect the row
    
    because it'll be much faster to use keyboard navigation -- use
    up/down/left/right to target desired checkbox, hit <down> <space>
    repeatedly to repeat the same action over several consecutive rows.

diff --git a/gnucash/import-export/import-main-matcher.cpp b/gnucash/import-export/import-main-matcher.cpp
index 76671173b6..dd109c89bc 100644
--- a/gnucash/import-export/import-main-matcher.cpp
+++ b/gnucash/import-export/import-main-matcher.cpp
@@ -673,6 +673,15 @@ run_match_dialog (GNCImportMainMatcher *info,
                                            trans_info, info->pending_matches);
 }
 
+static void
+set_treeview_selection_from_path (GtkTreeView* view, const char* path)
+{
+    auto selection = gtk_tree_view_get_selection (view);
+    auto tree_path = gtk_tree_path_new_from_string (path);
+    gtk_tree_selection_select_path (selection, tree_path);
+    gtk_tree_path_free (tree_path);
+}
+
 static void
 gen_trans_common_toggled_cb (GtkCellRendererToggle *cell_renderer, gchar *path,
                              GNCImportMainMatcher *gui, GNCImportAction action)
@@ -689,6 +698,8 @@ gen_trans_common_toggled_cb (GtkCellRendererToggle *cell_renderer, gchar *path,
     else
         gnc_import_TransInfo_set_action (transaction_info, action);
     refresh_model_row (gui, model, &tree_iter, transaction_info);
+
+    set_treeview_selection_from_path (GTK_TREE_VIEW(gui->view), path);
 }
 
 static void



Summary of changes:
 gnucash/import-export/import-main-matcher.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)



More information about the gnucash-changes mailing list