[Gnucash-changes] r12204 - gnucash/trunk - Move the "Sort By" and "Filter By" menu items to the main window so

David Hampton hampton at cvs.gnucash.org
Fri Dec 30 00:07:15 EST 2005


Author: hampton
Date: 2005-12-30 00:07:14 -0500 (Fri, 30 Dec 2005)
New Revision: 12204
Trac: http://svn.gnucash.org/trac/changeset/12204

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
   gnucash/trunk/src/gnome-utils/ui/gnc-main-window-ui.xml
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-register-ui.xml
Log:
Move the "Sort By" and "Filter By" menu items to the main window so
they will always appear in the same place in the menus.  Hide them so
they don't actually appear until a page provides them.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-12-30 05:05:53 UTC (rev 12203)
+++ gnucash/trunk/ChangeLog	2005-12-30 05:07:14 UTC (rev 12204)
@@ -1,5 +1,12 @@
 2005-12-29  David Hampton  <hampton at employees.org>
 
+	* src/gnome-utils/ui/gnc-main-window-ui.xml:
+	* src/gnome-utils/gnc-main-window.c:
+	* src/gnome/ui/gnc-plugin-page-register-ui.xml: Move the "Sort By"
+	and "Filter By" menu items to the main window so they will always
+	appear in the same place in the menus.  Hide them so they don't
+	actually appear until a page provides them.
+
 	* src/engine/gw-engine-spec.scm: Comment out unused function that
 	won't compile with g-wrap 1.9 after the const-ifying of the
 	account functions.

Modified: gnucash/trunk/src/gnome/ui/gnc-plugin-page-register-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-register-ui.xml	2005-12-30 05:05:53 UTC (rev 12203)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-register-ui.xml	2005-12-30 05:07:14 UTC (rev 12204)
@@ -30,10 +30,6 @@
         <separator name="ViewSep44"/>
         <menuitem name="ViewStyleDoubleLine"   	action="ViewStyleDoubleLineAction"/>
       </placeholder>
-      <placeholder name="ViewSortPlaceholder">
-        <menuitem name="ViewSortBy"             action="ViewSortByAction"/>
-        <menuitem name="ViewFilterBy"           action="ViewFilterByAction"/>
-      </placeholder>
     </menu>
 
     <menu name="Actions" action="ActionsAction">

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2005-12-30 05:05:53 UTC (rev 12203)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2005-12-30 05:07:14 UTC (rev 12204)
@@ -244,6 +244,8 @@
 
 	/* View menu */
 
+	{ "ViewSortByAction", NULL, N_("_Sort By..."), NULL, NULL, NULL },
+	{ "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL, NULL },
 	{ "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
 	  N_("Refresh this window"),
 	  G_CALLBACK (gnc_main_window_cmd_view_refresh) },
@@ -343,6 +345,17 @@
 };
 
 
+/** The following are in the main window so they will always be
+ *  present in the menu structure, but they are always hidden.
+ *  These actions should be overridden in child windows where they
+ *  have meaning. */
+static const gchar *always_hidden_actions[] = {
+	"ViewSortByAction",
+	"ViewFilterByAction",
+	NULL
+};
+
+
 /** If a page is flagged as immutable, then the following actions
  *  cannot be performed on that page. */
 static const gchar *immutable_page_actions[] = {
@@ -2368,6 +2381,9 @@
 	gnc_plugin_update_actions(priv->action_group,
 				  always_insensitive_actions,
 				  "sensitive", FALSE);
+	gnc_plugin_update_actions(priv->action_group,
+				  always_hidden_actions,
+				  "visible", FALSE);
 	gnc_plugin_set_important_actions (priv->action_group,
 					  gnc_menu_important_actions);
 	gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);

Modified: gnucash/trunk/src/gnome-utils/ui/gnc-main-window-ui.xml
===================================================================
--- gnucash/trunk/src/gnome-utils/ui/gnc-main-window-ui.xml	2005-12-30 05:05:53 UTC (rev 12203)
+++ gnucash/trunk/src/gnome-utils/ui/gnc-main-window-ui.xml	2005-12-30 05:07:14 UTC (rev 12204)
@@ -58,7 +58,9 @@
       <separator name="ViewSep1"/>
       <placeholder name="ViewContentPlaceholder"/>
       <separator name="ViewSep2"/>
+      <menuitem name="ViewSortBy" action="ViewSortByAction"/>
       <placeholder name="ViewSortPlaceholder"/>
+      <menuitem name="ViewFilterBy" action="ViewFilterByAction"/>
       <placeholder name="ViewFilterPlaceholder"/>
       <separator name="ViewSep3"/>
       <placeholder name="ViewZoomPlaceholder"/>



More information about the gnucash-changes mailing list