r23132 - gnucash/trunk/src/gnome-utils - Bug #629136: Move the code that updates the sensitivity of immutable page actions from gnc_main_window_switch_page to gnc_main_window_generate_title.

Christian Stimming cstim at code.gnucash.org
Thu Aug 15 15:44:32 EDT 2013


Author: cstim
Date: 2013-08-15 15:44:32 -0400 (Thu, 15 Aug 2013)
New Revision: 23132
Trac: http://svn.gnucash.org/trac/changeset/23132

Modified:
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
Bug #629136: Move the code that updates the sensitivity of immutable page actions from gnc_main_window_switch_page to gnc_main_window_generate_title.

Patch by Guilherme Salgado.

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2013-08-15 19:44:20 UTC (rev 23131)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2013-08-15 19:44:32 UTC (rev 23132)
@@ -1347,7 +1347,8 @@
  *  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 @@
     GncMainWindowPrivate *priv;
     GncPluginPage *page;
     QofBook *book;
+    gboolean immutable;
     gchar *filename = NULL;
     const gchar *book_id = NULL;
     const gchar *dirty = "";
@@ -1432,6 +1434,12 @@
     {
         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,13 +3669,7 @@
         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",
                               g_list_length(priv->installed_pages) > 1);



More information about the gnucash-changes mailing list