Rename gnc_main_window_update_menu

Rename the main windoe function gnc_main_window_update_menu to
gnc_main_window_update_menu_and_toolbar as it deals with the menu and
toolbar
pull/1456/head
Robert Fewell 4 years ago
parent d6ae799e74
commit 79285097ff

@ -3704,8 +3704,9 @@ gnc_main_window_update_toolbar (GncMainWindow *window, GncPluginPage *page,
void
gnc_main_window_update_menu (GncMainWindow *window, GncPluginPage *page,
const gchar **ui_updates)
gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
GncPluginPage *page,
const gchar **ui_updates)
{
GncMainWindowPrivate *priv;
const gchar *plugin_page_actions_group_name;
@ -3715,7 +3716,6 @@ gnc_main_window_update_menu (GncMainWindow *window, GncPluginPage *page,
GMenuModel *menu_model_part;
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
g_return_if_fail (GNC_IS_MAIN_WINDOW(window));
g_return_if_fail (page != nullptr);
g_return_if_fail (ui_updates != nullptr);
@ -3748,13 +3748,12 @@ gnc_main_window_update_menu (GncMainWindow *window, GncPluginPage *page,
gnc_main_window_update_toolbar (window, page, menu_qualifier);
PERR("Display Item Hash size %d", g_hash_table_size (priv->display_item_hash)); //FIXMEb temp added
PERR("Display Item Q %d", priv->num_item_q); //FIXMEb temp added
// reset hash table and remove added menu items
g_hash_table_remove_all (priv->display_item_hash);
gnc_menubar_model_remove_items_with_attrib (priv->menubar_model,
gnc_menubar_model_remove_items_with_attrib (priv->menubar_model,
GNC_MENU_ATTRIBUTE_TEMPORARY);
priv->num_item_q = 0; //FIXMEb temp added
@ -3776,9 +3775,8 @@ gnc_main_window_update_menu (GncMainWindow *window, GncPluginPage *page,
gsm->search_action_name = ui_updates[i];
if (gnc_menubar_model_find_item (priv->menubar_model, gsm))
{
g_menu_insert_section (G_MENU(gsm->model), gsm->index, NULL, G_MENU_MODEL(menu_model_part));
}
g_menu_insert_section (G_MENU(gsm->model), gsm->index,
nullptr, G_MENU_MODEL(menu_model_part));
else
PERR("Could not find '%s' in menu model", ui_updates[i]);

@ -463,8 +463,18 @@ GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window); //FIXMEb added
void gnc_main_window_update_menu (GncMainWindow *window, GncPluginPage *page,
const gchar **ui_updates); //FIXMEb added
/** Update the main window menu with the placeholders listed in
* ui_updates and load the page specific toolbar.
*
* @param window The window which should be checked for the action.
*
* @param page The plugin page calling this function.
*
* @param ui_updates A NULL terminated list of placeholders to load
*/
void gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
GncPluginPage *page,
const gchar **ui_updates); //FIXMEb added
/**
* Shows all main windows.

@ -550,8 +550,9 @@ gnc_plugin_page_account_tree_focus_widget (GncPluginPage *account_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(account_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(account_plugin_page->window), account_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(account_plugin_page->window),
account_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(account_plugin_page->window), toolbar_labels);

@ -385,8 +385,9 @@ gnc_plugin_page_budget_focus_widget (GncPluginPage *budget_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(budget_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(budget_plugin_page->window), budget_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(budget_plugin_page->window),
budget_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(budget_plugin_page->window), toolbar_labels);

@ -708,8 +708,9 @@ gnc_plugin_page_invoice_focus_widget (GncPluginPage *invoice_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(invoice_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(invoice_plugin_page->window), invoice_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(invoice_plugin_page->window),
invoice_plugin_page,
gnc_plugin_load_ui_items);
gnc_plugin_page_invoice_update_menus (invoice_plugin_page, priv->is_posted, priv->can_unpost);

@ -325,8 +325,9 @@ gnc_plugin_page_owner_focus_widget (GncPluginPage *owner_plugin_page)
set_menu_and_toolbar_qualifier (owner_plugin_page);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(owner_plugin_page->window), owner_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(owner_plugin_page->window),
owner_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(owner_plugin_page->window), toolbar_labels);

@ -743,14 +743,14 @@ gnc_plugin_page_register_focus_widget (GncPluginPage* register_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(register_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(register_plugin_page->window),
register_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(register_plugin_page->window),
register_plugin_page,
gnc_plugin_load_ui_items);
}
else
{
GtkWidget *toolbar = gnc_window_get_toolbar (gnc_window);
GtkWidget *menubar = gnc_window_get_menubar (gnc_window);
GtkWidget *menubar = gnc_window_get_menubar (gnc_window);
GMenuModel *menubar_model = gnc_window_get_menubar_model (gnc_window);
GtkWidget *statusbar = gnc_window_get_statusbar (gnc_window);
@ -1066,7 +1066,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
found = gnc_menubar_model_update_item (gnc_window_get_menubar_model (gnc_window),
*iter, _(*label_iter), _(*tooltip_iter));
PINFO("split model_item action '%s', found is %d, iter label is '%s'",
PINFO("split model_item action '%s', found is %d, iter label is '%s'",
*iter, found, _(*label_iter));
++label_iter;
@ -1084,7 +1084,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
found = gnc_menubar_model_update_item (gnc_window_get_menubar_model (gnc_window),
*iter, _(*label_iter), _(*tooltip_iter));
PINFO("trans model_item action '%s', found is %d, iter label is '%s'",
PINFO("trans model_item action '%s', found is %d, iter label is '%s'",
*iter, found, _(*label_iter));
++label_iter;
@ -1093,7 +1093,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
}
// need to add the accelerator keys, currently there are none
//FIXMEb
// gnc_add_accelerator_keys_for_menu (gnc_window_get_menubar (gnc_window),
// gnc_add_accelerator_keys_for_menu (gnc_window_get_menubar (gnc_window),
// gnc_plugin_page_get_accel_group (GNC_PLUGIN_PAGE(page)));
}
}

@ -308,8 +308,9 @@ gnc_plugin_page_report_focus_widget (GncPluginPage *report_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(report_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(report_plugin_page->window), report_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(report_plugin_page->window),
report_plugin_page,
gnc_plugin_load_ui_items);
// setup any short toolbar names
gnc_main_window_init_short_names (GNC_MAIN_WINDOW(report_plugin_page->window), toolbar_labels);

@ -184,8 +184,9 @@ gnc_plugin_page_sx_list_focus_widget (GncPluginPage *sx_plugin_page)
action = gnc_main_window_find_action (GNC_MAIN_WINDOW(sx_plugin_page->window), "ScheduledAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
gnc_main_window_update_menu (GNC_MAIN_WINDOW(sx_plugin_page->window), sx_plugin_page,
gnc_plugin_load_ui_items);
gnc_main_window_update_menu_and_toolbar (GNC_MAIN_WINDOW(sx_plugin_page->window),
sx_plugin_page,
gnc_plugin_load_ui_items);
if (GTK_IS_TREE_VIEW(tree_view))
{

Loading…
Cancel
Save