[Gnucash-changes] Duplicate a couple of the toolbar buttons as menu items.

David Hampton hampton at cvs.gnucash.org
Sat Jul 2 19:08:55 EDT 2005


Log Message:
-----------
Duplicate a couple of the toolbar buttons as menu items.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/report/report-gnome:
        gnc-plugin-page-report-ui.xml
        gnc-plugin-page-report.c

Revision Data
-------------
Index: gnc-plugin-page-report-ui.xml
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-gnome/Attic/gnc-plugin-page-report-ui.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/report/report-gnome/gnc-plugin-page-report-ui.xml -Lsrc/report/report-gnome/gnc-plugin-page-report-ui.xml -u -r1.1.2.1 -r1.1.2.2
--- src/report/report-gnome/gnc-plugin-page-report-ui.xml
+++ src/report/report-gnome/gnc-plugin-page-report-ui.xml
@@ -1,4 +1,20 @@
 <ui>
+  <menubar>
+    <menu name="File" action="FileAction">
+      <menu name="FileExport" action="FileExportAction">
+        <placeholder name="FileExportPlaceholder">
+          <menuitem name="FileReportExport" action="ReportExportAction" />
+        </placeholder>
+      </menu>
+    </menu>
+
+    <menu name="Edit" action="EditAction">
+      <placeholder name="EditStyleSheetsPlaceholder">
+        <menuitem name="EditReportOptions" action="ReportOptionsAction" />
+      </placeholder>
+    </menu>
+  </menubar>
+
   <toolbar name="DefaultToolbar">
     <placeholder name="DefaultToolbarPlaceholder">
       <separator name="ReportToolbarSep0" />
@@ -9,7 +25,7 @@
       <separator name="ReportToolbarSep1" />
       <toolitem name="ReportToolbarExport" action="ReportExportAction" />
       <toolitem name="ReportToolbarOptions" action="ReportOptionsAction" />
-      <toolitem name="ReportToolbarPrint" action="ReportPrintAction" />
+      <toolitem name="ReportToolbarPrint" action="FilePrintAction" />
     </placeholder>
   </toolbar>
-</ui>
\ No newline at end of file
+</ui>
Index: gnc-plugin-page-report.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-gnome/Attic/gnc-plugin-page-report.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -Lsrc/report/report-gnome/gnc-plugin-page-report.c -Lsrc/report/report-gnome/gnc-plugin-page-report.c -u -r1.1.2.10 -r1.1.2.11
--- src/report/report-gnome/gnc-plugin-page-report.c
+++ src/report/report-gnome/gnc-plugin-page-report.c
@@ -54,7 +54,6 @@
 static short module = MOD_GUI; // MOD_GUI; // MOD_REPORT;?
 
 static GObjectClass *parent_class = NULL;
-static GList *active_pages = NULL;
 
 // Property-id values.
 enum {
@@ -265,8 +264,6 @@
 	priv = page->priv;
 	g_return_if_fail (priv != NULL);
 
-	active_pages = g_list_remove (active_pages, page);
-
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 	LEAVE(" ");
 }
@@ -642,6 +639,13 @@
 
 static GtkActionEntry report_actions[] =
 {
+        { "FilePrintAction", GTK_STOCK_PRINT, N_("Print Report..."), NULL, NULL,
+          G_CALLBACK(gnc_plugin_page_report_print_cb) },
+        { "ReportExportAction", GTK_STOCK_CONVERT, N_("Export Report"), NULL, NULL,
+          G_CALLBACK(gnc_plugin_page_report_export_cb) },
+        { "ReportOptionsAction", GTK_STOCK_PROPERTIES, N_("Report Options"), NULL, NULL,
+          G_CALLBACK(gnc_plugin_page_report_options_cb) },
+
         { "ReportBackAction", GTK_STOCK_GO_BACK, N_("Back"), NULL, NULL,
           G_CALLBACK(gnc_plugin_page_report_back_cb) },
         { "ReportForwAction", GTK_STOCK_GO_FORWARD, N_("Forward"), NULL, NULL,
@@ -650,16 +654,17 @@
           G_CALLBACK(gnc_plugin_page_report_reload_cb) },
         { "ReportStopAction", GTK_STOCK_STOP, N_("Stop"), NULL, NULL,
           G_CALLBACK(gnc_plugin_page_report_stop_cb) },
-
-        { "ReportExportAction", GTK_STOCK_SAVE, N_("Export"), NULL, NULL,
-          G_CALLBACK(gnc_plugin_page_report_export_cb) },
-        { "ReportOptionsAction", GTK_STOCK_PROPERTIES, N_("Options"), NULL, NULL,
-          G_CALLBACK(gnc_plugin_page_report_options_cb) },
-        { "ReportPrintAction", GTK_STOCK_PRINT, N_("Print"), NULL, NULL,
-          G_CALLBACK(gnc_plugin_page_report_print_cb) },
 };
 static guint num_report_actions = G_N_ELEMENTS( report_actions );
 
+static action_short_labels short_labels[] = {
+  { "FilePrintAction", 	    N_("Print") },
+  { "ReportExportAction",   N_("Export") },
+  { "ReportOptionsAction",  N_("Options") },
+  { NULL, NULL },
+};
+
+
 static void
 gnc_plugin_page_report_init ( GncPluginPageReport *plugin_page )
 {
@@ -699,7 +704,7 @@
 				      report_actions,
 				      num_report_actions,
 				      plugin_page );
-	active_pages = g_list_append (active_pages, plugin_page);
+	gnc_plugin_init_short_names (action_group, short_labels);
 }
 
 GncPluginPage*


More information about the gnucash-changes mailing list