From 8e9c65c1ebb593d985a03c67e43c36d64e1e6e35 Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Fri, 10 Mar 2023 15:19:00 +0000 Subject: [PATCH] Fix regression: Actions > Online Actions > Show log window .. does nothing Action activate needs to change the state Note that there is another bug (also present in maint) where the menu entry does nothing the first time it is clicked --- gnucash/import-export/aqb/gnc-plugin-aqbanking.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c index 0d13fa05c4..711425f69c 100644 --- a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c +++ b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c @@ -605,11 +605,14 @@ gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple, GVariant *parameter, gpointer user_data) { - GVariant *state; + GVariant *state = g_action_get_state (G_ACTION(simple)); + gboolean toggle = g_variant_get_boolean (state); + g_variant_unref (state); - state = g_action_get_state (G_ACTION(simple)); + gboolean new_toggle = !toggle; + g_action_change_state (G_ACTION(simple), g_variant_new_boolean (new_toggle)); - if (g_variant_get_boolean (state)) + if (new_toggle) { if (!gnc_GWEN_Gui_show_dialog()) { @@ -621,7 +624,6 @@ gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple, { gnc_GWEN_Gui_hide_dialog(); } - g_variant_unref (state); } static void