[nautilus-actions] Do not paste into a read-only action



commit 3a4dce0af7dd2912334b68b32e34ac684fbc23b9
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Dec 7 21:25:21 2009 +0100

    Do not paste into a read-only action

 ChangeLog                                 |    3 +++
 TODO                                      |    2 --
 nautilus-actions/nact/nact-main-menubar.c |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c2b2400..62aca51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-12-07 Pierre Wieser <pwieser trychlos org>
 
+	* nautilus-actions/nact/nact-main-menubar.c (on_update_sensitivities):
+	Do not paste into a read-only action.
+
 	* nautilus-actions/io-provider-desktop/nadp-desktop-file.c:
 	* nautilus-actions/io-provider-desktop/nadp-desktop-file.h
 	(nadp_desktop_file_get_icon, nadp_desktop_file_get_enabled,
diff --git a/TODO b/TODO
index e941f45..7adaf9b 100644
--- a/TODO
+++ b/TODO
@@ -99,8 +99,6 @@
 
 - nact: copy/paste: only the action is copied without its profiles
 
-- nact: shouldn't be able to paste into a read-only item
-
 - nact: when pasting an item, should reset provider and read-only flag
 
 - desktop provider: fix default toolbar label
diff --git a/nautilus-actions/nact/nact-main-menubar.c b/nautilus-actions/nact/nact-main-menubar.c
index b644ed0..736045e 100644
--- a/nautilus-actions/nact/nact-main-menubar.c
+++ b/nautilus-actions/nact/nact-main-menubar.c
@@ -660,7 +660,7 @@ on_update_sensitivities( NactMainWindow *window, gpointer user_data )
 	if(( mis->treeview_has_focus || mis->popup_handler ) && count_selected <= 1 ){
 		if( !clipboard_is_empty ){
 			if( mis->clipboard_profiles ){
-				paste_enabled = item && NA_IS_OBJECT_ACTION( item );
+				paste_enabled = item && NA_IS_OBJECT_ACTION( item ) && !readonly;
 			} else {
 				paste_enabled = ( item != NULL );
 			}
@@ -677,7 +677,7 @@ on_update_sensitivities( NactMainWindow *window, gpointer user_data )
 		if( mis->selected_menus + mis->selected_actions ){
 			if( !clipboard_is_empty ){
 				if( mis->clipboard_profiles ){
-					paste_into_enabled = item && NA_IS_OBJECT_ACTION( item );
+					paste_into_enabled = item && NA_IS_OBJECT_ACTION( item ) && !readonly;
 				} else {
 					paste_into_enabled = item && NA_IS_OBJECT_MENU( item );
 				}



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