[nautilus-actions] Add files src/nact/nact-main-menubar-maintainer.{c, h}



commit aa39763aa5813dd3d9a8eb5531068a34e662aa57
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Mar 1 20:35:46 2010 +0100

    Add files src/nact/nact-main-menubar-maintainer.{c,h}

 ChangeLog                               |    3 +
 src/nact/Makefile.am                    |    2 +
 src/nact/nact-main-menubar-help.c       |    4 +-
 src/nact/nact-main-menubar-help.h       |    4 +-
 src/nact/nact-main-menubar-maintainer.c |  115 +++++++++++++++++++++++++++++++
 src/nact/nact-main-menubar-maintainer.h |   55 +++++++++++++++
 src/nact/nact-main-menubar.c            |   46 ++-----------
 7 files changed, 185 insertions(+), 44 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b1bd5b5..62a4410 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-03-01 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-main-menubar-maintainer.c:
+	* src/nact/nact-main-menubar-maintainer.h: New files.
+
 	* src/nact/nact-main-menubar.c (on_update_sensitivities):
 	Only paste a NAObjectItem into a menu.
 
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 7d37358..05d0fcc 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -108,6 +108,8 @@ nautilus_actions_config_tool_SOURCES = \
 	nact-main-menubar.h									\
 	nact-main-menubar-help.c							\
 	nact-main-menubar-help.h							\
+	nact-main-menubar-maintainer.c						\
+	nact-main-menubar-maintainer.h						\
 	nact-main-statusbar.c								\
 	nact-main-statusbar.h								\
 	nact-main-tab.c										\
diff --git a/src/nact/nact-main-menubar-help.c b/src/nact/nact-main-menubar-help.c
index 00a713c..5711810 100644
--- a/src/nact/nact-main-menubar-help.c
+++ b/src/nact/nact-main-menubar-help.c
@@ -58,7 +58,7 @@ nact_main_menubar_help_on_update_sensitivities( NactMainWindow *window, gpointer
  * @action: the #GtkAction of the item.
  * @window: the #NactMainWindow main application window.
  *
- * Triggers the Help item.
+ * Triggers the "Help/Help" item.
  */
 void
 nact_main_menubar_help_on_help( GtkAction *action, NactMainWindow *window )
@@ -70,7 +70,7 @@ nact_main_menubar_help_on_help( GtkAction *action, NactMainWindow *window )
  * @action: the #GtkAction of the item.
  * @window: the #NactMainWindow main application window.
  *
- * Triggers the About item.
+ * Triggers the "Help/About" item.
  */
 void
 nact_main_menubar_help_on_about( GtkAction *action, NactMainWindow *window )
diff --git a/src/nact/nact-main-menubar-help.h b/src/nact/nact-main-menubar-help.h
index 76b1c3f..6aa0efa 100644
--- a/src/nact/nact-main-menubar-help.h
+++ b/src/nact/nact-main-menubar-help.h
@@ -45,8 +45,8 @@ G_BEGIN_DECLS
 
 void nact_main_menubar_help_on_update_sensitivities( NactMainWindow *window, gpointer user_data );
 
-void nact_main_menubar_help_on_help( GtkAction *gtk_action, NactMainWindow *window );
-void nact_main_menubar_help_on_about( GtkAction *gtk_action, NactMainWindow *window );
+void nact_main_menubar_help_on_help ( GtkAction *action, NactMainWindow *window );
+void nact_main_menubar_help_on_about( GtkAction *action, NactMainWindow *window );
 
 G_END_DECLS
 
diff --git a/src/nact/nact-main-menubar-maintainer.c b/src/nact/nact-main-menubar-maintainer.c
new file mode 100644
index 0000000..87de15d
--- /dev/null
+++ b/src/nact/nact-main-menubar-maintainer.c
@@ -0,0 +1,115 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009, 2010 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <api/na-object-api.h>
+
+#include "nact-iactions-list.h"
+#include "nact-clipboard.h"
+#include "nact-main-menubar.h"
+#include "nact-main-menubar-maintainer.h"
+
+/**
+ * nact_main_menubar_maintainer_on_update_sensitivities:
+ * @window: the #NactMainWindow main application window.
+ * @user_data: user data ?
+ *
+ * Update sensitivities on the Maintainer menu.
+ */
+void
+nact_main_menubar_maintainer_on_update_sensitivities( NactMainWindow *window, gpointer user_data )
+{
+	/* TODO: help temporarily disabled */
+	nact_main_menubar_enable_item( window, "HelpItem", FALSE );
+
+	/* about always enabled */
+}
+
+/**
+ * nact_main_menubar_maintainer_on_dump_selection:
+ * @action: the #GtkAction of the item.
+ * @window: the #NactMainWindow main application window.
+ *
+ * Triggers the "Maintainer/Dump selection" item.
+ */
+void
+nact_main_menubar_maintainer_on_dump_selection( GtkAction *action, NactMainWindow *window )
+{
+	GList *items, *it;
+
+	items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
+	for( it = items ; it ; it = it->next ){
+		na_object_dump( it->data );
+	}
+
+	na_object_unref_selected_items( items );
+}
+
+/**
+ * nact_main_menubar_maintainer_on_brief_tree_store_dump:
+ * @action: the #GtkAction of the item.
+ * @window: the #NactMainWindow main application window.
+ *
+ * Triggers the "Maintainer/Brief treestore dump" item.
+ */
+void
+nact_main_menubar_maintainer_on_brief_tree_store_dump( GtkAction *action, NactMainWindow *window )
+{
+	nact_iactions_list_brief_tree_dump( NACT_IACTIONS_LIST( window ));
+}
+
+/**
+ * nact_main_menubar_maintainer_on_list_modified_items:
+ * @action: the #GtkAction of the item.
+ * @window: the #NactMainWindow main application window.
+ *
+ * Triggers the "Maintainer/List modified items" item.
+ */
+void
+nact_main_menubar_maintainer_on_list_modified_items( GtkAction *action, NactMainWindow *window )
+{
+	nact_iactions_list_bis_list_modified_items( NACT_IACTIONS_LIST( window ));
+}
+
+/**
+ * nact_main_menubar_maintainer_on_dump_clipboard:
+ * @action: the #GtkAction of the item.
+ * @window: the #NactMainWindow main application window.
+ *
+ * Triggers the "Maintainer/Dump clipboard" item.
+ */
+void
+nact_main_menubar_maintainer_on_dump_clipboard( GtkAction *action, NactMainWindow *window )
+{
+	nact_clipboard_dump( nact_main_window_get_clipboard( window ));
+}
diff --git a/src/nact/nact-main-menubar-maintainer.h b/src/nact/nact-main-menubar-maintainer.h
new file mode 100644
index 0000000..f816301
--- /dev/null
+++ b/src/nact/nact-main-menubar-maintainer.h
@@ -0,0 +1,55 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009, 2010 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NACT_MAIN_MENUBAR_MAINTAINER_H__
+#define __NACT_MAIN_MENUBAR_MAINTAINER_H__
+
+/**
+ * SECTION: nact_main_menubar
+ * @short_description: Main menubar Maintainer menu management.
+ * @include: nact/nact-main-menubar-maintainer.h
+ */
+
+#include <gtk/gtk.h>
+
+#include "nact-main-window.h"
+
+G_BEGIN_DECLS
+
+void nact_main_menubar_maintainer_on_update_sensitivities( NactMainWindow *window, gpointer user_data );
+
+void nact_main_menubar_maintainer_on_dump_selection       ( GtkAction *action, NactMainWindow *window );
+void nact_main_menubar_maintainer_on_brief_tree_store_dump( GtkAction *action, NactMainWindow *window );
+void nact_main_menubar_maintainer_on_list_modified_items  ( GtkAction *action, NactMainWindow *window );
+void nact_main_menubar_maintainer_on_dump_clipboard       ( GtkAction *action, NactMainWindow *window );
+
+G_END_DECLS
+
+#endif /* __NACT_NACT_MENUBAR_MAINTAINER_H__ */
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index 9240440..a70d80f 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -52,6 +52,7 @@
 #include "nact-main-toolbar.h"
 #include "nact-main-tab.h"
 #include "nact-main-menubar.h"
+#include "nact-main-menubar-maintainer.h"
 #include "nact-main-menubar-help.h"
 
 #define MENUBAR_PROP_STATUS_CONTEXT			"nact-menubar-status-context"
@@ -144,11 +145,6 @@ static void     on_view_toolbar_activated( GtkToggleAction *action, NactMainWind
 static void     on_import_activated( GtkAction *action, NactMainWindow *window );
 static void     on_export_activated( GtkAction *action, NactMainWindow *window );
 
-static void     on_dump_selection_activated( GtkAction *action, NactMainWindow *window );
-static void     on_brief_tree_store_dump_activated( GtkAction *action, NactMainWindow *window );
-static void     on_list_modified_items_activated( GtkAction *action, NactMainWindow *window );
-static void     on_dump_clipboard_activated( GtkAction *action, NactMainWindow *window );
-
 static gboolean on_delete_event( GtkWidget *toplevel, GdkEvent *event, NactMainWindow *window );
 static void     on_destroy_callback( gpointer data );
 static void     on_menu_item_selected( GtkMenuItem *proxy, NactMainWindow *window );
@@ -238,19 +234,19 @@ static const GtkActionEntry entries[] = {
 		{ "DumpSelectionItem", NULL, N_( "_Dump the selection" ), NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the Dump selection item */
 				N_( "Recursively dump selected items" ),
-				G_CALLBACK( on_dump_selection_activated ) },
+				G_CALLBACK( nact_main_menubar_maintainer_on_dump_selection ) },
 		{ "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 ) },
+				G_CALLBACK( nact_main_menubar_maintainer_on_brief_tree_store_dump ) },
 		{ "ListModifiedItems", NULL, N_( "_List modified items" ), NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the ListModifiedItems item */
 				N_( "List the modified items" ),
-				G_CALLBACK( on_list_modified_items_activated ) },
+				G_CALLBACK( nact_main_menubar_maintainer_on_list_modified_items ) },
 		{ "DumpClipboard", NULL, N_( "_Dump the clipboard" ), NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the DumpClipboard item */
 				N_( "Dump the content of the clipboard object" ),
-				G_CALLBACK( on_dump_clipboard_activated ) },
+				G_CALLBACK( nact_main_menubar_maintainer_on_dump_clipboard ) },
 		{ "HelpItem" , GTK_STOCK_HELP, NULL, NULL,
 				/* i18n: tooltip displayed in the status bar when selecting the Help item */
 				N_( "Display help about this program" ),
@@ -827,6 +823,7 @@ on_update_sensitivities( NactMainWindow *window, gpointer user_data )
 	/* export item enabled if IActionsList store contains actions */
 	nact_main_menubar_enable_item( window, "ExportItem", mis->have_exportables );
 
+	nact_main_menubar_maintainer_on_update_sensitivities( window, user_data );
 	nact_main_menubar_help_on_update_sensitivities( window, user_data );
 
 	na_object_unref_selected_items( selected_items );
@@ -1454,37 +1451,6 @@ on_export_activated( GtkAction *gtk_action, NactMainWindow *window )
 	nact_assistant_export_run( BASE_WINDOW( window ));
 }
 
-static void
-on_dump_selection_activated( GtkAction *action, NactMainWindow *window )
-{
-	GList *items, *it;
-
-	items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
-	for( it = items ; it ; it = it->next ){
-		na_object_dump( it->data );
-	}
-
-	na_object_unref_selected_items( items );
-}
-
-static void
-on_brief_tree_store_dump_activated( GtkAction *action, NactMainWindow *window )
-{
-	nact_iactions_list_brief_tree_dump( NACT_IACTIONS_LIST( window ));
-}
-
-static void
-on_list_modified_items_activated( GtkAction *action, NactMainWindow *window )
-{
-	nact_iactions_list_bis_list_modified_items( NACT_IACTIONS_LIST( window ));
-}
-
-static void
-on_dump_clipboard_activated( GtkAction *action, NactMainWindow *window )
-{
-	nact_clipboard_dump( nact_main_window_get_clipboard( window ));
-}
-
 /**
  * nact_main_menubar_enable_item:
  * @window: the #NactMainWindow main application window.



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