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
This commit is contained in:
Richard Cohen 2023-03-10 15:19:00 +00:00
parent f6d013847d
commit 8e9c65c1eb

View File

@ -605,11 +605,14 @@ gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple,
GVariant *parameter, GVariant *parameter,
gpointer user_data) 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()) if (!gnc_GWEN_Gui_show_dialog())
{ {
@ -621,7 +624,6 @@ gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple,
{ {
gnc_GWEN_Gui_hide_dialog(); gnc_GWEN_Gui_hide_dialog();
} }
g_variant_unref (state);
} }
static void static void