From 9745c007e279afe94a510e56afa7447867e18769 Mon Sep 17 00:00:00 2001 From: Guilherme Salgado Date: Sun, 21 Jul 2013 23:42:54 -0300 Subject: [PATCH] Move the code that updates the sensitivity of immutable page actions from gnc_main_window_switch_page to gnc_main_window_generate_title, thus fixing https://bugzilla.gnome.org/show_bug.cgi?id=629136 --- src/gnome-utils/gnc-main-window.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index ed49127..5a281b0 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -1347,7 +1347,8 @@ gnc_main_window_event_handler (QofInstance *entity, QofEventId event_type, * with the window. * * As a side-effect, the save action is set sensitive iff the book - * is dirty. + * is dirty, and the immutable_page_actions are set sensitive iff the page is + * mutable. * * @param window The window whose title should be generated. * @@ -1362,6 +1363,7 @@ gnc_main_window_generate_title (GncMainWindow *window) GncMainWindowPrivate *priv; GncPluginPage *page; QofBook *book; + gboolean immutable; gchar *filename = NULL; const gchar *book_id = NULL; const gchar *dirty = ""; @@ -1432,6 +1434,12 @@ gnc_main_window_generate_title (GncMainWindow *window) { title = g_strdup_printf("%s%s%s - GnuCash", dirty, filename, readonly); } + /* Update the menus based upon whether this is an "immutable" page. */ + immutable = page && + g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE); + gnc_plugin_update_actions(priv->action_group, + immutable_page_actions, + "sensitive", !immutable); g_free( filename ); g_free(readonly); @@ -3661,12 +3669,6 @@ gnc_main_window_switch_page (GtkNotebook *notebook, priv->usage_order = g_list_prepend (priv->usage_order, page); } - /* Update the menus based upon whether this is an "immutable" page. */ - immutable = page && - g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE); - gnc_plugin_update_actions(priv->action_group, - immutable_page_actions, - "sensitive", !immutable); gnc_plugin_update_actions(priv->action_group, multiple_page_actions, "sensitive", -- 1.8.1.2