[nautilus-actions] Restore the target-location indicator



commit fa011cfc2b9a6c79d6f173cc92fe1042d4cee377
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Mar 23 22:49:32 2010 +0100

    Restore the target-location indicator
    
    Was target-background in 2.29.1 through 2.29.4, so update in GConf may be required

 ChangeLog                                |   34 ++++++++++++++++
 src/api/na-ifactory-object-data.h        |    2 +-
 src/api/na-object-api.h                  |    2 +
 src/api/na-object-item.h                 |    2 +-
 src/core/na-icontextual-factory.c        |    4 +-
 src/core/na-icontextual.c                |    8 ++--
 src/core/na-object-action-factory.c      |   54 ++++++++++++-------------
 src/core/na-object-action.c              |    7 +--
 src/core/na-object-item-factory.c        |    2 +-
 src/nact/nact-iaction-tab.c              |   62 ++++++++++++++++++++++++++++-
 src/nact/nautilus-actions-config-tool.ui |   56 ++++++++++++++++++++-------
 src/plugin-menu/nautilus-actions.c       |    4 +-
 src/utils/nautilus-actions-new.c         |    2 +
 13 files changed, 178 insertions(+), 61 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bd81a61..7c640dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2009-03-23 Pierre Wieser <pwieser trychlos org>
+
+	Restore the target-location indicator.
+
+	* src/api/na-ifactory-object-data.h:
+	* src/core/na-object-action-factory.c:
+	Renamed NAFO_DATA_TARGET_BACKGROUND as NAFO_DATA_TARGET_LOCATION.
+
+	* src/api/na-object-api.h
+	(na_object_is_target_location, na_object_set_target_location):
+	New macros.
+
+	* src/api/na-object-item.h:
+	* src/plugin-menu/nautilus-actions.c (menu_provider_get_background_items):
+	Renamed ITEM_TARGET_BACKGROUND as ITEM_TARGET_LOCATION.
+
+	* src/core/na-icontextual-factory.c:
+	* src/core/na-object-action-factory.c:
+	* src/core/na-object-item-factory.c:
+	Update data descriptions.
+
+	* src/core/na-icontextual.c (is_target_background_candidate):
+	Renamed as is_target_location_candidate().
+
+	* src/core/na-object-action.c (na_object_action_is_candidate):
+	Only selects the action if it is candidate for this target.
+
+	* src/nact/nact-iaction-tab.c (on_tab_updatable_selection_changed):
+	* src/nact/nautilus-actions-config-tool.ui:
+	Display the target-location checkbox.
+
+	* src/utils/nautilus-actions-new.c:
+	Let the user select the target-location boolean indicator.
+
 2009-03-22 Pierre Wieser <pwieser trychlos org>
 
 	* src/core/na-icontextual.c
diff --git a/src/api/na-ifactory-object-data.h b/src/api/na-ifactory-object-data.h
index 02c5d22..94aeb97 100644
--- a/src/api/na-ifactory-object-data.h
+++ b/src/api/na-ifactory-object-data.h
@@ -62,7 +62,7 @@ G_BEGIN_DECLS
 #define NA_FACTORY_OBJECT_ACTION_GROUP		"na-factory-group-action"
 #define NAFO_DATA_VERSION					"na-factory-data-version"
 #define NAFO_DATA_TARGET_SELECTION			"na-factory-data-target-selection"
-#define NAFO_DATA_TARGET_BACKGROUND			"na-factory-data-target-background"
+#define NAFO_DATA_TARGET_LOCATION			"na-factory-data-target-location"
 #define NAFO_DATA_TARGET_TOOLBAR			"na-factory-data-target-toolbar"
 #define NAFO_DATA_TOOLBAR_LABEL				"na-factory-data-toolbar-label"
 #define NAFO_DATA_TOOLBAR_SAME_LABEL		"na-factory-data-toolbar-same-label"
diff --git a/src/api/na-object-api.h b/src/api/na-object-api.h
index c67fd9c..4835fc7 100644
--- a/src/api/na-object-api.h
+++ b/src/api/na-object-api.h
@@ -130,6 +130,7 @@ G_BEGIN_DECLS
  */
 #define na_object_get_version( obj )					(( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_VERSION ))
 #define na_object_is_target_selection( obj )			(( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_SELECTION )))
+#define na_object_is_target_location( obj )				(( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_LOCATION )))
 #define na_object_is_target_toolbar( obj )				(( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_TOOLBAR )))
 #define na_object_get_toolbar_label( obj )				(( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_LABEL ))
 #define na_object_is_toolbar_same_label( obj )			(( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_SAME_LABEL )))
@@ -137,6 +138,7 @@ G_BEGIN_DECLS
 
 #define na_object_set_version( obj, version )			na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_VERSION, ( const void * )( version ))
 #define na_object_set_target_selection( obj, target )	na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_SELECTION, ( const void * ) GUINT_TO_POINTER( target ))
+#define na_object_set_target_location( obj, target )	na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_LOCATION, ( const void * ) GUINT_TO_POINTER( target ))
 #define na_object_set_target_toolbar( obj, target )		na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_TOOLBAR, ( const void * ) GUINT_TO_POINTER( target ))
 #define na_object_set_toolbar_label( obj, label )		na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_LABEL, ( const void * )( label ))
 #define na_object_set_toolbar_same_label( obj, same )	na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_SAME_LABEL, ( const void * ) GUINT_TO_POINTER( same ))
diff --git a/src/api/na-object-item.h b/src/api/na-object-item.h
index 9f73191..1d72fb1 100644
--- a/src/api/na-object-item.h
+++ b/src/api/na-object-item.h
@@ -71,7 +71,7 @@ typedef struct {
  */
 enum {
 	ITEM_TARGET_SELECTION = 1,
-	ITEM_TARGET_BACKGROUND,
+	ITEM_TARGET_LOCATION,
 	ITEM_TARGET_TOOLBAR
 };
 
diff --git a/src/core/na-icontextual-factory.c b/src/core/na-icontextual-factory.c
index 0e4cdc0..f5c0ec1 100644
--- a/src/core/na-icontextual-factory.c
+++ b/src/core/na-icontextual-factory.c
@@ -216,7 +216,8 @@ NADataDef data_def_conditions [] = {
 					"'smb': files accessed via Samba (Windows share)\n" \
 					"'dav': files accessed via WebDAV.\n" \
 					"All schemes used by your favorite file manager may be used here.\n" \
-					"This obviously only applies when there is a selection.\n" \
+					"This obviously only applies when there is a selection, " \
+					"or when targeting the special 'x-nautilus-desktop' scheme.\n" \
 					"Defaults to 'file'." ),
 				NAFD_TYPE_STRING_LIST,
 				"[file]",
@@ -240,7 +241,6 @@ NADataDef data_def_conditions [] = {
 				N_( "List of folders" ),
 				N_( "Defines the list of valid paths to be matched against the current folder.\n " \
 					"All folders 'under' the specified path are considered valid.\n" \
-					"This is only used when there is no selection, or the selection only contains directories.\n" \
 					"Defaults to '/'." ),
 				NAFD_TYPE_STRING_LIST,
 				"[/]",
diff --git a/src/core/na-icontextual.c b/src/core/na-icontextual.c
index 7f1b7a8..91c9069 100644
--- a/src/core/na-icontextual.c
+++ b/src/core/na-icontextual.c
@@ -57,7 +57,7 @@ static void     interface_base_finalize( NAIContextualInterface *klass );
 
 static gboolean v_is_candidate( NAIContextual *object, guint target, GList *selection );
 
-static gboolean is_target_background_candidate( const NAIContextual *object, NASelectedInfo *current_folder );
+static gboolean is_target_location_candidate( const NAIContextual *object, NASelectedInfo *current_folder );
 static gboolean is_target_toolbar_candidate( const NAIContextual *object, NASelectedInfo *current_folder );
 static gboolean is_current_folder_inside( const NAIContextual *object, NASelectedInfo *current_folder );
 static gboolean is_target_selection_candidate( const NAIContextual *object, GList *files );
@@ -172,8 +172,8 @@ na_icontextual_is_candidate( const NAIContextual *object, guint target, GList *f
 	is_candidate = v_is_candidate( NA_ICONTEXTUAL( object ), target, files );
 
 	switch( target ){
-		case ITEM_TARGET_BACKGROUND:
-			is_candidate = is_target_background_candidate( object, ( NASelectedInfo * ) files->data );
+		case ITEM_TARGET_LOCATION:
+			is_candidate = is_target_location_candidate( object, ( NASelectedInfo * ) files->data );
 			break;
 
 		case ITEM_TARGET_TOOLBAR:
@@ -285,7 +285,7 @@ v_is_candidate( NAIContextual *object, guint target, GList *selection )
 }
 
 static gboolean
-is_target_background_candidate( const NAIContextual *object, NASelectedInfo *current_folder )
+is_target_location_candidate( const NAIContextual *object, NASelectedInfo *current_folder )
 {
 	gboolean is_candidate;
 
diff --git a/src/core/na-object-action-factory.c b/src/core/na-object-action-factory.c
index 2c9820c..9605e71 100644
--- a/src/core/na-object-action-factory.c
+++ b/src/core/na-object-action-factory.c
@@ -68,10 +68,11 @@ static NADataDef data_def_action [] = {
 				TRUE,
 				TRUE,
 				TRUE,
-				N_( "Targets the context menu (default)" ),
-				N_( "Whether the action of the menu targets the selection file manager " \
-					"context menus.\n" \
+				N_( "Targets the selection context menu (default)" ),
+				N_( "Whether the action targets the selection file manager context menus.\n" \
 					"This used to be the historical behavior.\n" \
+					"Note that menus are always potential candidate to the display in " \
+					"selection context menus provided that they contain at least one action.\n" \
 					"Defaults to TRUE." ),
 				NAFD_TYPE_BOOLEAN,
 				"true",
@@ -80,39 +81,34 @@ static NADataDef data_def_action [] = {
 				FALSE,
 				FALSE,
 				"target-selection",
-				'c',
-				"context",
+				'n',
+				"selection",
 				0,
 				G_OPTION_ARG_NONE,
 				NULL,
 				NULL },
 
-	/* this data has been introduced in 2.29.1 and has been left up to 2.29.4
-	 * it has been removed starting with 2.29.5
-	 * it is no more used anywhere
-	 * it is so no more readable (it doesn't take anymore any useful information)
-	 * nor writable (obsolete)
-	 *
-	 * we now consider that the folders condition is to be met every time
-	 * a selection contains folders
-	 */
-	{ NAFO_DATA_TARGET_BACKGROUND,
-				FALSE,
-				FALSE,
-				FALSE,
-				"Target the folder context menu",
-				"Does the action target the context menu when there is no selection ?",
+	{ NAFO_DATA_TARGET_LOCATION,
+				TRUE,
+				TRUE,
+				TRUE,
+				N_( "Targets the location context menu" ),
+				N_( "Whether the action targets the file manager context menus " \
+					"when there is no selection, thus applying to current location.\n" \
+					"Note that menus are always potential candidate to the display in " \
+					"selection context menus provided that they contain at least one action.\n" \
+					"Defaults to FALSE" ),
 				NAFD_TYPE_BOOLEAN,
-				"true",
-				FALSE,
-				FALSE,
+				"false",
+				TRUE,
+				TRUE,
 				FALSE,
 				FALSE,
-				"target-background",
-				0,
-				NULL,
-				0,
+				"target-location",
+				'N',
+				"location",
 				0,
+				G_OPTION_ARG_NONE,
 				NULL,
 				NULL },
 
@@ -122,7 +118,9 @@ static NADataDef data_def_action [] = {
 				TRUE,
 				N_( "Targets the toolbar" ),
 				N_( "Whether the action is candidate to be displayed in file manager toolbar.\n" \
-					"Note, that as of Nautilus 2.26, menus cannot be candidate to toolbar display." ),
+					"This only applies to current location.\n" \
+					"Note that menus are never displayed in the toolbar.\n" \
+					"Defaults to FALSE." ),
 				NAFD_TYPE_BOOLEAN,
 				"false",
 				TRUE,
diff --git a/src/core/na-object-action.c b/src/core/na-object-action.c
index 873cc54..33a5842 100644
--- a/src/core/na-object-action.c
+++ b/src/core/na-object-action.c
@@ -701,10 +701,9 @@ na_object_action_is_candidate( const NAObjectAction *action, guint target, GList
 	if( !action->private->dispose_has_run ){
 
 		is_candidate =
-			( na_object_is_target_selection( action ) &&
-					( target == ITEM_TARGET_BACKGROUND || target == ITEM_TARGET_SELECTION )) ||
-			( na_object_is_target_toolbar( action ) &&
-						target == ITEM_TARGET_TOOLBAR );
+			( na_object_is_target_selection( action ) && target == ITEM_TARGET_SELECTION ) ||
+			( na_object_is_target_location( action ) && target == ITEM_TARGET_LOCATION ) ||
+			( na_object_is_target_toolbar( action ) && target == ITEM_TARGET_TOOLBAR );
 	}
 
 	return( is_candidate );
diff --git a/src/core/na-object-item-factory.c b/src/core/na-object-item-factory.c
index 488f9ab..210dd3b 100644
--- a/src/core/na-object-item-factory.c
+++ b/src/core/na-object-item-factory.c
@@ -279,7 +279,7 @@ NADataDef data_def_item [] = {
 				NULL,
 				NULL },
 
-	/* dynamic data, so non readable / non writable
+	/* dynamic data, so non readable / non writable (but has property)
 	 * is left at the NAIIOProvider disposition
 	 */
 	{ NAFO_DATA_PROVIDER_DATA,
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index cc3ae5d..4f6d79c 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -78,6 +78,7 @@ static void          on_tab_updatable_selection_changed( NactIActionTab *instanc
 static void          on_tab_updatable_provider_changed( NactIActionTab *instance, NAObjectItem *item );
 
 static void          on_target_selection_toggled( GtkToggleButton *button, NactIActionTab *instance );
+static void          on_target_location_toggled( GtkToggleButton *button, NactIActionTab *instance );
 
 static void          check_for_label( NactIActionTab *instance, GtkEntry *entry, const gchar *label );
 static void          on_label_changed( GtkEntry *entry, NactIActionTab *instance );
@@ -258,6 +259,13 @@ nact_iaction_tab_runtime_init_toplevel( NactIActionTab *instance )
 				"toggled",
 				G_CALLBACK( on_target_selection_toggled ));
 
+		button = base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetLocationButton" );
+		base_window_signal_connect(
+				BASE_WINDOW( instance ),
+				G_OBJECT( button ),
+				"toggled",
+				G_CALLBACK( on_target_location_toggled ));
+
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" );
 		base_window_signal_connect(
 				BASE_WINDOW( instance ),
@@ -398,7 +406,7 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 	static const gchar *thisfn = "nact_iaction_tab_on_tab_updatable_selection_changed";
 	NAObjectItem *item;
 	gboolean enable_tab;
-	gboolean target_selection, target_toolbar;
+	gboolean target_selection, target_location, target_toolbar;
 	gboolean enable_label;
 	gboolean same_label;
 	GtkWidget *label_widget, *tooltip_widget, *icon_widget, *title_widget;
@@ -432,7 +440,11 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 		nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_ACTION, enable_tab );
 
 		target_selection = ( item && (
-				( NA_IS_OBJECT_ACTION( item ) && na_object_is_target_selection( NA_OBJECT_ACTION( item ))) ||
+				( NA_IS_OBJECT_ACTION( item ) && na_object_is_target_selection( item )) ||
+				( NA_IS_OBJECT_MENU( item ))));
+
+		target_location = ( item && (
+				( NA_IS_OBJECT_ACTION( item ) && na_object_is_target_location( item )) ||
 				( NA_IS_OBJECT_MENU( item ))));
 
 		target_toolbar = ( item && (
@@ -443,7 +455,12 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item ));
 		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
 
-		enable_label = ( item && ( NA_IS_OBJECT_MENU( item ) || target_selection ));
+		toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetLocationButton" ));
+		gtk_toggle_button_set_active( toggle, target_location );
+		gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item ));
+		nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
+
+		enable_label = ( item && ( NA_IS_OBJECT_MENU( item ) || target_selection || target_location ));
 		label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" );
 		label = item ? na_object_get_label( item ) : g_strdup( "" );
 		gtk_entry_set_text( GTK_ENTRY( label_widget ), label );
@@ -582,6 +599,45 @@ on_target_selection_toggled( GtkToggleButton *button, NactIActionTab *instance )
 }
 
 static void
+on_target_location_toggled( GtkToggleButton *button, NactIActionTab *instance )
+{
+	static const gchar *thisfn = "nact_iaction_tab_on_target_location_toggled";
+	NAObjectAction *action;
+	gboolean is_target;
+	gboolean editable;
+
+	if( !st_on_selection_change ){
+		g_debug( "%s: button=%p, instance=%p", thisfn, ( void * ) button, ( void * ) instance );
+
+		g_object_get(
+				G_OBJECT( instance ),
+				TAB_UPDATABLE_PROP_EDITED_ACTION, &action,
+				TAB_UPDATABLE_PROP_EDITABLE, &editable,
+				NULL );
+
+		g_debug( "%s: item=%p (%s), editable=%s",
+				thisfn, ( void * ) action, action ? G_OBJECT_TYPE_NAME( action ) : "(null)",
+				editable ? "True":"False" );
+
+		if( action && NA_IS_OBJECT_ACTION( action )){
+
+			is_target = gtk_toggle_button_get_active( button );
+
+			if( editable ){
+				na_object_set_target_location( action, is_target );
+				g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ENABLE_TAB, action );
+				g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, action, FALSE );
+
+			} else {
+				g_signal_handlers_block_by_func(( gpointer ) button, on_target_location_toggled, instance );
+				gtk_toggle_button_set_active( button, !is_target );
+				g_signal_handlers_unblock_by_func(( gpointer ) button, on_target_location_toggled, instance );
+			}
+		}
+	}
+}
+
+static void
 check_for_label( NactIActionTab *instance, GtkEntry *entry, const gchar *label )
 {
 	NAObjectItem *edited;
diff --git a/src/nact/nautilus-actions-config-tool.ui b/src/nact/nautilus-actions-config-tool.ui
index 47243cc..090bbfa 100644
--- a/src/nact/nautilus-actions-config-tool.ui
+++ b/src/nact/nautilus-actions-config-tool.ui
@@ -113,7 +113,7 @@
                                     <child>
                                       <object class="GtkTable" id="table7">
                                         <property name="visible">True</property>
-                                        <property name="n_rows">2</property>
+                                        <property name="n_rows">3</property>
                                         <property name="n_columns">2</property>
                                         <property name="column_spacing">5</property>
                                         <child>
@@ -122,7 +122,8 @@
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
                                             <property name="receives_default">False</property>
-                                            <property name="tooltip_text" translatable="yes">When checked, the action will be candidate to be displayed in Nautilus context menus when there is a selection. It thus applies to selected objects. The item will also appear in Nautilus Edit menu.</property>
+                                            <property name="tooltip_text" translatable="yes">When checked, the action will be candidate to be displayed in Nautilus context menus when there is a selection. It thus applies to selected objects. The item will also appear in Nautilus Edit menu.
+Menus are always candidate if they contain at least one action.</property>
                                             <property name="use_underline">True</property>
                                             <property name="draw_indicator">True</property>
                                           </object>
@@ -141,8 +142,8 @@
                                           <packing>
                                             <property name="left_attach">1</property>
                                             <property name="right_attach">2</property>
-                                            <property name="top_attach">1</property>
-                                            <property name="bottom_attach">2</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
                                           </packing>
                                         </child>
                                         <child>
@@ -154,8 +155,8 @@
                                             <property name="mnemonic_widget">ActionMenuLabelEntry</property>
                                           </object>
                                           <packing>
-                                            <property name="top_attach">1</property>
-                                            <property name="bottom_attach">2</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
                                             <property name="x_options">GTK_FILL</property>
                                             <property name="y_options"></property>
                                           </packing>
@@ -163,6 +164,27 @@
                                         <child>
                                           <placeholder/>
                                         </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <object class="GtkCheckButton" id="ActionTargetLocationButton">
+                                            <property name="label" translatable="yes">Display item in _location context menu</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="tooltip_text" translatable="yes">When checked, the action will be candidate to be displayed in Nautilus context menus when there is no selection. It thus applies to current location. The item will also appear in Nautilus File menu.
+Menus are always candidate if they contain at least one action.</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">1</property>
+                                            <property name="bottom_attach">2</property>
+                                          </packing>
+                                        </child>
                                       </object>
                                       <packing>
                                         <property name="position">0</property>
@@ -179,11 +201,12 @@
                                         <property name="column_spacing">5</property>
                                         <child>
                                           <object class="GtkCheckButton" id="ActionTargetToolbarButton">
-                                            <property name="label" translatable="yes">Display item as an icon in the _toolbar</property>
+                                            <property name="label" translatable="yes">Display item in the _toolbar</property>
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
                                             <property name="receives_default">False</property>
-                                            <property name="tooltip_text" translatable="yes">When checked, the action will be displayed in Nautilus toolbar. It applies to current folder when there is no selection.</property>
+                                            <property name="tooltip_text" translatable="yes">When checked, the action will be displayed in Nautilus toolbar. It applies to current folder when there is no selection.
+Menus are never displayed in the toolbar.</property>
                                             <property name="use_underline">True</property>
                                             <property name="draw_indicator">True</property>
                                           </object>
@@ -1333,6 +1356,9 @@ Defining several profiles lets you have several commands, each applying with a d
       <placeholder/>
     </child>
     <child>
+      <placeholder/>
+    </child>
+    <child>
       <object class="GtkLabel" id="label3">
         <property name="visible">True</property>
         <property name="label" translatable="yes">This assistant will guide you through the process of importing items, actions or menus.</property>
@@ -2130,24 +2156,24 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
   </object>
   <object class="GtkSizeGroup" id="CommandLabelSizeGroup">
     <widgets>
-      <widget name="CommandParametersLabel"/>
-      <widget name="CommandPathLabel"/>
       <widget name="ProfileLabelLabel"/>
+      <widget name="CommandPathLabel"/>
+      <widget name="CommandParametersLabel"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="CommandButtonSizeGroup">
     <widgets>
-      <widget name="CommandLegendButton"/>
       <widget name="CommandPathButton"/>
+      <widget name="CommandLegendButton"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="ActionLabelSizeGroup">
     <widgets>
-      <widget name="ActionIconLabel"/>
-      <widget name="ActionTooltipLabel"/>
-      <widget name="ActionIdLabel"/>
-      <widget name="ActionMenuLabelLabel"/>
       <widget name="ActionToolbarLabelLabel"/>
+      <widget name="ActionMenuLabelLabel"/>
+      <widget name="ActionIdLabel"/>
+      <widget name="ActionTooltipLabel"/>
+      <widget name="ActionIconLabel"/>
     </widgets>
   </object>
 </interface>
diff --git a/src/plugin-menu/nautilus-actions.c b/src/plugin-menu/nautilus-actions.c
index f117a3d..21e5b2c 100644
--- a/src/plugin-menu/nautilus-actions.c
+++ b/src/plugin-menu/nautilus-actions.c
@@ -412,7 +412,7 @@ menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *w
 		g_free( uri );
 
 		nautilus_menus_list = get_file_or_background_items(
-				NAUTILUS_ACTIONS( provider ), ITEM_TARGET_BACKGROUND, ( void * ) current_folder );
+				NAUTILUS_ACTIONS( provider ), ITEM_TARGET_LOCATION, ( void * ) current_folder );
 	}
 
 	return( nautilus_menus_list );
@@ -496,7 +496,7 @@ get_file_or_background_items( NautilusActions *plugin, guint target, void *selec
 
 	pivot_tree = na_pivot_get_items( plugin->private->pivot );
 
-	if( target == ITEM_TARGET_BACKGROUND ){
+	if( target == ITEM_TARGET_LOCATION ){
 		g_return_val_if_fail( NAUTILUS_IS_FILE_INFO( selection ), NULL );
 		selected = na_selected_info_get_list_from_item( NAUTILUS_FILE_INFO( selection ));
 
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index e1443f5..b922b24 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -66,6 +66,7 @@ static gchar     *icon             = "";
 static gboolean   enabled          = FALSE;
 static gboolean   disabled         = FALSE;
 static gboolean   target_selection = FALSE;
+static gboolean   target_location  = FALSE;
 static gboolean   nocontext        = FALSE;
 static gboolean   target_toolbar   = FALSE;
 static gboolean   notoolbar        = FALSE;
@@ -94,6 +95,7 @@ static const ArgFromDataDef st_arg_from_data_def[] = {
 		{ action_data_groups,  NA_FACTORY_OBJECT_ITEM_GROUP,       NAFO_DATA_ICON,             &icon },
 		{ action_data_groups,  NA_FACTORY_OBJECT_ITEM_GROUP,       NAFO_DATA_ENABLED,          &enabled },
 		{ action_data_groups,  NA_FACTORY_OBJECT_ACTION_GROUP,     NAFO_DATA_TARGET_SELECTION, &target_selection },
+		{ action_data_groups,  NA_FACTORY_OBJECT_ACTION_GROUP,     NAFO_DATA_TARGET_LOCATION,  &target_location },
 		{ action_data_groups,  NA_FACTORY_OBJECT_ACTION_GROUP,     NAFO_DATA_TARGET_TOOLBAR,   &target_toolbar },
 		{ action_data_groups,  NA_FACTORY_OBJECT_ACTION_GROUP,     NAFO_DATA_TOOLBAR_LABEL,    &label_toolbar },
 		{ profile_data_groups, NA_FACTORY_OBJECT_PROFILE_GROUP,    NAFO_DATA_PATH,             &command },



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