Skip to content

Commit

Permalink
Rename main window toolbar function.
Browse files Browse the repository at this point in the history
Rename the main window function gnc_main_window_toolbar_find_menu_item
to gnc_main_window_toolbar_find_tool_item
  • Loading branch information
Bob-IT committed Nov 5, 2022
1 parent 7abd26f commit ab3ae3f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 8 additions & 2 deletions gnucash/gnome-utils/gnc-main-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3570,9 +3570,15 @@ gnc_main_window_get_action_group (GncMainWindow *window,


GtkWidget *
gnc_main_window_toolbar_find_menu_item (GncMainWindow *window, const gchar *action_name)
gnc_main_window_toolbar_find_tool_item (GncMainWindow *window, const gchar *action_name)
{
GncMainWindowPrivate *priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
GncMainWindowPrivate *priv;

g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr);
g_return_val_if_fail (action_name != nullptr, nullptr);

priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);

return gnc_find_toolbar_item (priv->toolbar, action_name);
}

Expand Down
12 changes: 11 additions & 1 deletion gnucash/gnome-utils/gnc-main-window.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,17 @@ void gnc_main_window_menu_item_vis_by_action (GncMainWindow *window,
GtkWidget *gnc_main_window_menu_find_menu_item (GncMainWindow *window,
const gchar *action_name); //FIXMEb added

GtkWidget * gnc_main_window_toolbar_find_menu_item (GncMainWindow *window,
/** Find the toolbar item with the given action name for the window
* specified.
*
* @param window A pointer to the window whose user interface should
* be updated.
*
* @param action_name The action name of the tool item to find.
*
* @return The found tool item widget or NULL.
*/
GtkWidget * gnc_main_window_toolbar_find_tool_item (GncMainWindow *window,
const gchar *action_name); //FIXMEb added

/** A structure for defining alternate action names for use in the
Expand Down
4 changes: 2 additions & 2 deletions gnucash/gnome/gnc-plugin-page-invoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ gnc_plugin_page_invoice_action_update (GncPluginPage *plugin_page,
if (menu_item)
gtk_menu_item_set_label (GTK_MENU_ITEM(menu_item), _(action_list[i].label));

tool_item = gnc_main_window_toolbar_find_menu_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
tool_item = gnc_main_window_toolbar_find_tool_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
action_list[i].action_name);

if (tool_item)
Expand All @@ -540,7 +540,7 @@ gnc_plugin_page_invoice_action_update (GncPluginPage *plugin_page,
if (menu_item)
gtk_widget_set_tooltip_text (GTK_WIDGET(menu_item), _(tooltip_list[i].label));

tool_item = gnc_main_window_toolbar_find_menu_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
tool_item = gnc_main_window_toolbar_find_tool_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
tooltip_list[i].action_name);

if (tool_item)
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/gnc-plugin-page-report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ gnc_plugin_page_report_menu_update (GncPluginPage *plugin_page,
if (menu_item)
gtk_widget_set_tooltip_text (GTK_WIDGET(menu_item), _(tooltip_list[i].label));

tool_item = gnc_main_window_toolbar_find_menu_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
tool_item = gnc_main_window_toolbar_find_tool_item (GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
tooltip_list[i].action_name);
if (tool_item)
{
Expand Down

0 comments on commit ab3ae3f

Please sign in to comment.