From 84eb0843756b0714aca2d7300c9dbf01b5a86558 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 20 Jul 2023 14:19:48 -0700 Subject: [PATCH] Bug 799020 - widget of gnc-register-list-option disregards user's clicks If the GtkTreeSelection's mode isn't set to GTK_SELECTION_MULTIPLE then each call to gtk_tree_selection_select_path overrides the previous one and only one item is selected. --- gnucash/gnome-utils/gnc-option-gtk-ui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp index d766398211..086faf2b4a 100644 --- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp +++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp @@ -1152,10 +1152,12 @@ class GncGtkListUIItem : public GncOptionGtkUIItem public: GncGtkListUIItem(GtkWidget* widget) : GncOptionGtkUIItem{widget, GncOptionUIType::LIST} {} + void set_ui_item_from_option(GncOption& option) noexcept override { auto widget{GTK_TREE_VIEW(get_widget())}; auto selection{gtk_tree_view_get_selection(widget)}; + gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); g_signal_handlers_block_by_func(selection, (gpointer)list_changed_cb, &option); gtk_tree_selection_unselect_all(selection); for (auto index : option.get_value())