Skip to content

Commit

Permalink
Make struct GtkMainWindow private with accessor for just_plugin_prefs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Dec 12, 2024
1 parent 81e11f7 commit 8331f99
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
14 changes: 13 additions & 1 deletion gnucash/gnome-utils/gnc-main-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,16 @@ static void gnc_quartz_set_menu (GncMainWindow* window);
#endif
static void gnc_main_window_init_menu_updaters (GncMainWindow *window);

struct _GncMainWindow
{
GtkApplicationWindow gtk_application_window; /**< The parent object for a main window. */
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
};

/** The instance private data structure for an embedded window
* object. */
typedef struct GncMainWindowPrivate
typedef struct
{
/** The dock (vbox) at the top of the window containing the
* menubar and toolbar. These items are generated by the UI
Expand Down Expand Up @@ -5666,5 +5672,11 @@ gnc_main_window_get_menu_model (GncMainWindow *window)
return priv->menubar_model;
}

gboolean
gnc_main_window_just_plugin_prefs (GncMainWindow* window)
{
return window->just_plugin_prefs;
}

/** @} */
/** @} */
9 changes: 3 additions & 6 deletions gnucash/gnome-utils/gnc-main-window.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ typedef struct
} GncMenuUpdate;

/** The instance data structure for a main window object. */
typedef struct GncMainWindow
{
GtkApplicationWindow gtk_application_window; /**< The parent object for a main window. */
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
} GncMainWindow;
typedef struct _GncMainWindow GncMainWindow;

/** The class data structure for a main window object. */
typedef struct
Expand Down Expand Up @@ -545,6 +540,8 @@ void gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
**/
void gnc_main_window_show_all_windows(void);

gboolean gnc_main_window_just_plugin_prefs (GncMainWindow* window);

/**
* Opens the Book Options dialog.
*
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-plugin-menu-additions.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin,
* actions name is installed into the plugin class. */
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);

if (simple_action_group && !window->just_plugin_prefs)
if (simple_action_group && !gnc_main_window_just_plugin_prefs (window))
gtk_widget_insert_action_group (GTK_WIDGET(window), PLUGIN_ACTIONS_NAME, NULL);

LEAVE(" ");
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ gnc_plugin_remove_from_window (GncPlugin *plugin,
/*
* Update window to remove UI items
*/
if (klass->actions_name && !window->just_plugin_prefs)
if (klass->actions_name && !gnc_main_window_just_plugin_prefs (window))
{
DEBUG ("%s: %d actions to unmerge",
klass->actions_name, (klass->n_actions));
Expand Down

0 comments on commit 8331f99

Please sign in to comment.