[nautilus-actions] Fix status check when duplicating a hierarchy



commit 6f01d66be0c026772733ddece19268f55a3f84c0
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Oct 19 06:17:38 2009 +0200

    Fix status check when duplicating a hierarchy

 ChangeLog                                    |    9 +++++++++
 src/nact/nact-main-menubar.c                 |   19 +++++++++++++++++++
 src/nact/nautilus-actions-maintainer.actions |    1 +
 3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0ffe0da..a93e713 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-19 Pierre Wieser <pwieser trychlos org>
+
+	* src/nact/nact-main-menubar.c:
+	* src/nact/nautilus-actions-maintainer.actions:
+	Add a 'Dump selection' item in maintainer menu.
+
+	* src/nact/nact-main-menubar.c (on_duplicate_activated):
+	Check duplicate status after having reinitialized the origin object.
+
 2009-10-18 Pierre Wieser <pwieser trychlos org>
 
 	Open a popup on right click on the treeview.
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index dde5f59..220d700 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -123,6 +123,7 @@ 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_dump_selection_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 );
@@ -213,6 +214,10 @@ static const GtkActionEntry entries[] = {
 				/* 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 ) },
+		{ "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 ) },
 		{ "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" ),
@@ -1006,6 +1011,7 @@ on_duplicate_activated( GtkAction *gtk_action, NactMainWindow *window )
 
 		na_object_prepare_for_paste( obj, pivot, TRUE, action );
 		na_object_set_origin( obj, NULL );
+		na_object_check_status( obj );
 		dup = g_list_prepend( NULL, obj );
 		nact_iactions_list_insert_items( NACT_IACTIONS_LIST( window ), dup, it->data );
 		na_object_free_items_list( dup );
@@ -1104,6 +1110,19 @@ on_export_activated( GtkAction *gtk_action, NactMainWindow *window )
 }
 
 static void
+on_dump_selection_activated( GtkAction *action, NactMainWindow *window )
+{
+	GList *items, *it;
+
+	items = nact_iactions_list_get_selected_items( NACT_IACTIONS_LIST( window ));
+	for( it = items ; it ; it = it->next ){
+		na_object_dump( it->data );
+	}
+
+	na_object_free_items_list( items );
+}
+
+static void
 on_brief_tree_store_dump_activated( GtkAction *action, NactMainWindow *window )
 {
 	nact_iactions_list_brief_tree_dump( NACT_IACTIONS_LIST( window ));
diff --git a/src/nact/nautilus-actions-maintainer.actions b/src/nact/nautilus-actions-maintainer.actions
index dc221d9..c4d6990 100644
--- a/src/nact/nautilus-actions-maintainer.actions
+++ b/src/nact/nautilus-actions-maintainer.actions
@@ -3,6 +3,7 @@
     <menubar name="MainMenubar">
         <placeholder name="MaintainerMenuPlace">
             <menu action="MaintainerMenu">
+                <menuitem action="DumpSelectionItem" />
                 <menuitem action="BriefTreeStoreDumpItem" />
             </menu>
         </placeholder>



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