[nautilus-actions] Do not paste an action into another action



commit e298c608d8213c4d9e1e4ae13a9de726a624041f
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Mar 1 20:20:33 2010 +0100

    Do not paste an action into another action

 ChangeLog                    |    3 +++
 TODO                         |    2 --
 src/nact/nact-main-menubar.c |   18 +++++++++---------
 3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a1cb748..b1bd5b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-03-01 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-main-menubar.c (on_update_sensitivities):
+	Only paste a NAObjectItem into a menu.
+
 	* src/nact/nact-main-menubar-help.c:
 	* src/nact/nact-main-menubar-help.h: New files.
 
diff --git a/TODO b/TODO
index 3ac4bed..468116c 100644
--- a/TODO
+++ b/TODO
@@ -161,5 +161,3 @@
 - icon: is defined as localestring in desktop entry spec
   but path is defined as string in this same spec
   and icon may be a path -> so what to do with this ?
-
-- shouldn't be able to copy an action into an action !
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index 65c73f4..9240440 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -777,25 +777,25 @@ on_update_sensitivities( NactMainWindow *window, gpointer user_data )
 	paste_into_enabled &= !is_clipboard_empty;
 	paste_into_enabled &= count_selected <= 1;
 	if( mis->clipboard_profiles ){
-		paste_enabled &= count_selected == 1;
-		if( paste_enabled ){
+		paste_into_enabled &= count_selected == 1;
+		if( paste_into_enabled ){
 			selected_action = NA_OBJECT( selected_items->data );
-			paste_enabled &= NA_IS_OBJECT_ACTION( selected_action );
-			paste_enabled &= nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( selected_action ), NULL );
+			paste_into_enabled &= NA_IS_OBJECT_ACTION( selected_action );
+			paste_into_enabled &= nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( selected_action ), NULL );
 		}
 	} else {
-		paste_enabled &= has_writable_providers;
+		paste_into_enabled &= has_writable_providers;
 		if( count_selected ){
 			selected_item = NA_OBJECT( selected_items->data );
-			paste_enabled &= NA_IS_OBJECT_MENU( selected_item );
-			if( paste_enabled ){
+			paste_into_enabled &= NA_IS_OBJECT_MENU( selected_item );
+			if( paste_into_enabled ){
 				parent_item = ( NAObject * ) na_object_get_parent( selected_item );
-				paste_enabled &= parent_item
+				paste_into_enabled &= parent_item
 						? nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( parent_item ), NULL )
 						: is_level_zero_writable;
 			}
 		} else {
-			paste_enabled &= is_level_zero_writable;
+			paste_into_enabled &= is_level_zero_writable;
 		}
 	}
 	nact_main_menubar_enable_item( window, "PasteIntoItem", paste_into_enabled );



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