[nautilus-actions] Display a maintainer menu when in maintainer mode



commit 7492d0689f34d824f76b2cd99d7017e7e8c8f61f
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Oct 9 12:03:52 2009 +0200

    Display a maintainer menu when in maintainer mode

 ChangeLog                                     |   10 ++++++++
 src/nact/Makefile.am                          |    1 +
 src/nact/nact-main-menubar.c                  |   31 +++++++++++++++++++++++-
 src/nact/nautilus-actions-config-tool.actions |    1 +
 src/nact/nautilus-actions-maintainer.actions  |    8 ++++++
 5 files changed, 49 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c63cd33..265a291 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,9 +4,19 @@
 	Fix multi-childs insertion.
 	Remove useless do_insert_into_second() function.
 
+	* src/nact/nact-main-menubar.c (nact_main_menubar_runtime_init):
+	Display a Maintainer menu when in maintainer mode.
+
 	* src/nact/nact-tree-model.c (nact_tree_model_insert):
 	Add debug traces.
 
+	* src/nact/nautilus-actions-config-tool.actions:
+	Define a placeholder for the Maintainer menu.
+
+	* src/nact/nautilus-actions-maintainer.actions: New file.
+
+	* src/nact/Makefile.am: Updated accordingly.
+
 2009-10-08 Pierre Wieser <pwieser trychlos org>
 
 	* src/common/na-object-api.h (na_object_remove_item):
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index eb5024a..841a1c6 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -112,6 +112,7 @@ nautilus_actions_config_tool_LDADD = \
 
 pkgdata_DATA = \
 	nautilus-actions-config-tool.actions				\
+	nautilus-actions-maintainer.actions					\
 	nact-assistant-export.ui							\
 	nautilus-actions-config-tool.ui						\
 	$(NULL)
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index ca2049b..942154c 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -117,6 +117,8 @@ static void     on_collapse_all_activated( GtkAction *action, NactMainWindow *wi
 static void     on_import_activated( GtkAction *action, NactMainWindow *window );
 static void     on_export_activated( GtkAction *action, NactMainWindow *window );
 
+static void     on_brief_tree_store_dump_activated( GtkAction *action, NactMainWindow *window );
+
 static void     on_help_activated( GtkAction *action, NactMainWindow *window );
 static void     on_about_activated( GtkAction *action, NactMainWindow *window );
 
@@ -134,6 +136,7 @@ static const GtkActionEntry entries[] = {
 		{ "EditMenu", NULL, N_( "_Edit" ) },
 		{ "ViewMenu", NULL, N_( "_View" ) },
 		{ "ToolsMenu", NULL, N_( "_Tools" ) },
+		{ "MaintainerMenu", NULL, N_( "_Maintainer" ) },
 		{ "HelpMenu", NULL, N_( "_Help" ) },
 
 		{ "NewMenuItem", NULL, N_( "New _menu" ), NULL,
@@ -196,14 +199,18 @@ static const GtkActionEntry entries[] = {
 				/* i18n: tooltip displayed in the status bar when selecting the Collapse all item */
 				N_( "Entirely collapse the items hierarchy" ),
 				G_CALLBACK( on_collapse_all_activated ) },
-		{ "ImportItem" , GTK_STOCK_CONVERT, N_( "_Import assistant.." ), "",
+		{ "ImportItem" , GTK_STOCK_CONVERT, N_( "_Import assistant..." ), "",
 				/* i18n: tooltip displayed in the status bar when selecting the Import item */
 				N_( "Import one or more actions from external (XML) files into your configuration" ),
 				G_CALLBACK( on_import_activated ) },
-		{ "ExportItem", NULL, N_( "E_xport assistant.." ), NULL,
+		{ "ExportItem", NULL, N_( "E_xport assistant..." ), NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the Export item */
 				N_( "Export one or more actions from your configuration to external XML files" ),
 				G_CALLBACK( on_export_activated ) },
+		{ "BriefTreeStoreDumpItem", NULL, N_( "_Brief tree store dump" ), NULL,
+				/* i18n: tooltip displayed in the status bar when selecting the BriefTreeStoreDump item */
+				N_( "Briefly dump the tree store" ),
+				G_CALLBACK( on_brief_tree_store_dump_activated ) },
 		{ "HelpItem" , GTK_STOCK_HELP, NULL, NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the Help item */
 				N_( "Display help about this program" ),
@@ -234,6 +241,7 @@ nact_main_menubar_runtime_init( NactMainWindow *window )
 	GtkWidget *menubar, *vbox;
 	GtkWindow *toplevel;
 	MenubarIndicatorsStruct *mis;
+	gboolean has_maintainer_menu;
 
 	g_debug( "%s: window=%p", thisfn, ( void * ) window );
 
@@ -274,6 +282,19 @@ nact_main_menubar_runtime_init( NactMainWindow *window )
 		g_error_free( error );
 	}
 
+	has_maintainer_menu = FALSE;
+#ifdef NA_MAINTAINER_MODE
+	has_maintainer_menu = TRUE;
+#endif
+
+	if( has_maintainer_menu ){
+		merge_id = gtk_ui_manager_add_ui_from_file( ui_manager, PKGDATADIR "/nautilus-actions-maintainer.actions", &error );
+		if( merge_id == 0 || error ){
+			g_warning( "%s: error=%s", thisfn, error->message );
+			g_error_free( error );
+		}
+	}
+
 	toplevel = base_window_get_toplevel( BASE_WINDOW( window ));
 	accel_group = gtk_ui_manager_get_accel_group( ui_manager );
 	gtk_window_add_accel_group( toplevel, accel_group );
@@ -934,6 +955,12 @@ on_export_activated( GtkAction *gtk_action, NactMainWindow *window )
 }
 
 static void
+on_brief_tree_store_dump_activated( GtkAction *action, NactMainWindow *window )
+{
+
+}
+
+static void
 on_help_activated( GtkAction *gtk_action, NactMainWindow *window )
 {
 }
diff --git a/src/nact/nautilus-actions-config-tool.actions b/src/nact/nautilus-actions-config-tool.actions
index 4641274..ebfc1f8 100644
--- a/src/nact/nautilus-actions-config-tool.actions
+++ b/src/nact/nautilus-actions-config-tool.actions
@@ -29,6 +29,7 @@
             <menuitem action="ImportItem" />
             <menuitem action="ExportItem" />
         </menu>
+        <placeholder name="MaintainerMenu" />
         <menu action="HelpMenu">
             <menuitem action="HelpItem" />
             <separator />
diff --git a/src/nact/nautilus-actions-maintainer.actions b/src/nact/nautilus-actions-maintainer.actions
new file mode 100644
index 0000000..ea39fb0
--- /dev/null
+++ b/src/nact/nautilus-actions-maintainer.actions
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ui>
+    <menubar name="MainMenubar">
+        <menu action="MaintainerMenu">
+            <menuitem action="BriefTreeStoreDumpItem" />
+        </menu>
+    </menubar>
+</ui>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]