[nautilus-actions] nautilus-actions-new: add an option for actions working directories



commit 0040b4a0ed25b23b4d717a30dbb4cb38c0c22418
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Jul 17 22:34:28 2014 +0200

    nautilus-actions-new: add an option for actions working directories
    
    Patch provided by Mauricio C Antunes (#730382)

 src/core/na-object-profile-factory.c |    8 ++++----
 src/utils/nautilus-actions-new.c     |    3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/core/na-object-profile-factory.c b/src/core/na-object-profile-factory.c
index b9e04df..aa9bcd3 100644
--- a/src/core/na-object-profile-factory.c
+++ b/src/core/na-object-profile-factory.c
@@ -197,12 +197,12 @@ static NADataDef data_def_profile [] = {
                                FALSE,
                                "working-dir",
                                "Path",
+                               'w',
+                               "working-dir",
                                0,
+                               G_OPTION_ARG_FILENAME,
                                NULL,
-                               0,
-                               0,
-                               NULL,
-                               NULL },
+                               N_( "<PATH>" ) },
 
        { NAFO_DATA_EXECUTION_MODE,
                                TRUE,
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index 9e717e6..d1777c5 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -71,6 +71,7 @@ static gboolean   notoolbar        = FALSE;
 static gchar     *label_toolbar    = "";
 static gchar     *command          = "";
 static gchar     *parameters       = "";
+static gchar     *workingdir       = "";
 static gchar    **basenames_array  = NULL;
 static gboolean   matchcase        = FALSE;
 static gboolean   nocase           = FALSE;
@@ -108,6 +109,7 @@ static const ArgFromDataDef st_arg_from_data_def[] = {
                { 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 },
                { profile_data_groups, NA_FACTORY_OBJECT_PROFILE_GROUP,    NAFO_DATA_PARAMETERS,         
&parameters },
+               { profile_data_groups, NA_FACTORY_OBJECT_PROFILE_GROUP,    NAFO_DATA_WORKING_DIR,        
&workingdir },
                { profile_data_groups, NA_FACTORY_OBJECT_CONDITIONS_GROUP, NAFO_DATA_BASENAMES,          
&basenames_array },
                { profile_data_groups, NA_FACTORY_OBJECT_CONDITIONS_GROUP, NAFO_DATA_MATCHCASE,          
&matchcase },
                { profile_data_groups, NA_FACTORY_OBJECT_CONDITIONS_GROUP, NAFO_DATA_MIMETYPES,          
&mimetypes_array },
@@ -434,6 +436,7 @@ get_action_from_cmdline( void )
 
        na_object_set_path( profile, command );
        na_object_set_parameters( profile, parameters );
+       na_object_set_working_dir( profile, workingdir );
 
        i = 0;
        basenames = NULL;


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