[nautilus-actions] Define ArgFromDataDef structure to handle command-line arguments



commit 1a7240c1c3d80dcd626b03dfb132026d51c1c543
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Mar 10 22:08:47 2010 +0100

    Define ArgFromDataDef structure to handle command-line arguments

 ChangeLog                        |    3 +++
 src/utils/nautilus-actions-new.c |   27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9adb9dd..dfc2772 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-03-10 Pierre Wieser <pwieser trychlos org>
 
+	* src/utils/nautilus-actions-new.c:
+	Define a structure to host NADataDef argument definitions.
+
 	* src/api/na-data-def.h:
 	Add parameters to be able to manage command-line arguments.
 
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index dd2ebac..9547502 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -47,6 +47,12 @@
 
 #include "console-utils.h"
 
+typedef struct {
+	gchar *name;
+	void  *arg_data;
+}
+	ArgFromDataDef;
+
 static gchar     *label            = "";
 static gchar     *tooltip          = "";
 static gchar     *icon             = "";
@@ -69,6 +75,27 @@ static gchar     *output_dir       = NULL;
 static gboolean   output_gconf     = FALSE;
 static gboolean   version          = FALSE;
 
+static const ArgFromDataDef st_arg_from_data_def[] = {
+		{ NAFO_DATA_LABEL, &label },
+		{ NAFO_DATA_TOOLTIP, &tooltip },
+		{ NAFO_DATA_ICON, &icon },
+		{ NAFO_DATA_ENABLED, &enabled },
+		{ NAFO_DATA_TARGET_SELECTION, &target_selection },
+		{ NAFO_DATA_TARGET_TOOLBAR, &target_toolbar },
+		{ NAFO_DATA_TOOLBAR_LABEL, &label_toolbar },
+		{ NAFO_DATA_PATH, &command },
+		{ NAFO_DATA_PARAMETERS, &parameters },
+		{ NAFO_DATA_BASENAMES, &basenames_array },
+		{ NAFO_DATA_MATCHCASE, &matchcase },
+		{ NAFO_DATA_MIMETYPES, &mimetypes_array },
+		{ NAFO_DATA_ISFILE, &isfile },
+		{ NAFO_DATA_ISDIR, &isdir },
+		{ NAFO_DATA_MULTIPLE, &accept_multiple },
+		{ NAFO_DATA_SCHEMES, &schemes_array },
+		{ NAFO_DATA_FOLDERS, &folders_array },
+		{ NULL }
+};
+
 static GOptionEntry entries[] = {
 
 	{ "label"                , 'l', 0, G_OPTION_ARG_STRING      , &label,



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