Add a couple of changes dealing with GtKBuilder object

pull/1456/head
Robert Fewell 4 years ago
parent 007f5fbcdd
commit 4fd868f89e

@ -365,6 +365,8 @@ gnc_embedded_window_new (const gchar *action_group_name,
gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar)); //FIXMEb this may need changing
gtk_widget_show (GTK_WIDGET(priv->toolbar));
g_object_unref (builder);
priv->simple_action_group = g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP(priv->simple_action_group),

@ -4150,6 +4150,8 @@ gnc_main_window_setup_window (GncMainWindow *window)
gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar)); //FIXMEb this may need changing
gtk_widget_show (GTK_WIDGET(priv->toolbar));
g_object_unref (builder);
gnc_plugin_set_actions_enabled (G_ACTION_MAP(window),
initially_insensitive_actions,
FALSE);
@ -4375,7 +4377,7 @@ gnc_main_window_switch_page (GtkNotebook *notebook,
if (page != nullptr)
{
/* Update the user interface (e.g. menus and toolbars */
gnc_plugin_page_merge_actions (page, GTK_WIDGET(window));
gnc_plugin_page_merge_actions (page);
visible = gnc_main_window_show_summarybar (window, nullptr);
gnc_plugin_page_show_summarybar (page, visible);
@ -5502,7 +5504,6 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
LEAVE("no builder");
return;
}
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
if (menu_qualifier)
popup_menu_name = g_strconcat ("mainwin-popup-", menu_qualifier, NULL);
@ -5516,8 +5517,6 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
menu = gtk_menu_new_from_model (menu_model);
//FIXMEb maybe i should save these once built to reuse
if (!menu)
{
LEAVE("no menu");

@ -253,8 +253,7 @@ gnc_plugin_page_recreate_page(GtkWidget *window,
void
gnc_plugin_page_merge_actions (GncPluginPage *page,
GtkWidget *window)
gnc_plugin_page_merge_actions (GncPluginPage *page)
{
GncPluginPagePrivate *priv;
GError *error = NULL;
@ -264,7 +263,8 @@ gnc_plugin_page_merge_actions (GncPluginPage *page,
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->builder = gtk_builder_new ();
if (!priv->builder)
priv->builder = gtk_builder_new ();
resource = g_strconcat ("/org/gnucash/ui/", priv->ui_description, NULL);
@ -1128,7 +1128,7 @@ GSimpleActionGroup *
gnc_plugin_page_create_action_group (GncPluginPage *page, const gchar *group_name)
{
GncPluginPagePrivate *priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
priv->simple_action_group = g_simple_action_group_new ();
priv->simple_action_group_name = group_name;

@ -284,11 +284,8 @@ GncPluginPage *gnc_plugin_page_recreate_page (GtkWidget *window,
*
* @param plugin_page A pointer to the page whose actions should be
* added to the user interface.
*
* @param merge A pointer to the window.
*/
void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page,
GtkWidget *window); //FIXMEb added
void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page); //FIXMEb added
/** Retrieve the textual name of a plugin.

Loading…
Cancel
Save