[GNC-dev] view_selection_function in the main_matcher, why was it added?

jeanl ripngo at gmail.com
Sat May 16 21:56:44 EDT 2020

The view_selection_function in the main_matcher was added at
I'm trying to understand why that was needed. Here's the commit message, but
I'm not sure what the problem was it was trying to solve.
The issue currently is that because of this function, transactions under the
cursor are or are not highlighted in the matching windows, depending on the
action that's selected. This is very confusing as you can move the cursor
up, and you don't see any difference in the display until you hit a
transaction that can be highlighted (based on what view_selection_function()

Author: David Cousens <davidcousens at bigpond.com>
Commit: David Cousens <davidcousens at bigpond.com>

    Add view_selection_function

    view_selection_function added to only allow adding a row to the
selection if GNCImport_Add is set for the transaction.
    Explicit selection clearing

    try explicitly clearing the row in the add, update and clear toggle
callbacks - before refresh row and add debugging info which showed that the
selection is called after exiting the above callbacks and as the
view_selection_function has no knowledge that the add checkbox has just been
toggled it allows the row to be selected. Requires a flag to be set in the
add_toggle_cb which prevents selection in the view_selection_function and is
cleared there.
    Fix row being selected after A(dd)toggled

    When the A is toggled on from U+R or R the row is automatically selected
and if the row is toggled back to U+R or R selected, it cannot be
unselected. Add a global add-toggled flag set in the
gnc_gen_trans_add-toggled_cb and used in the treeview  multiple selection
function to prevent a row being selected immediately after the A has been
    Fix to Multiple selection to ensure the match dialog comes up on double
click on a  reconciled or update row and implement a view_selection_function
so that only rows flagged for addition can be added to a selection

    Fixes requested by Bob-IT

    removed global add_toggled variable and added it to _main_matcher_info
structure. modified gnc_gen_trans_add_toggled_cb and view_selection_function
to use the _main_matcher_info member.

Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html

More information about the gnucash-devel mailing list