Set Nautilus-Actions as being the actual official product name
[nautilus-actions.git] / src / core / na-object-action-factory.c
blob1db71e2a3691d5ca17078f5ea87ac63b9cf37c90
1 /*
2 * Nautilus-Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
35 #include <glib/gi18n.h>
37 #include <api/na-ifactory-object-data.h>
38 #include <api/na-data-def.h>
39 #include <api/na-data-types.h>
41 extern NADataDef data_def_id[]; /* defined in na-object-id-factory.c */
42 extern NADataDef data_def_item []; /* defined in na-object-item-factory.c */
43 extern NADataDef data_def_conditions []; /* defined in na-icontext-factory.c */
45 static NADataDef data_def_action [] = {
47 /* this version number, expressed as a string, is obsoleted starting with .desktop
48 * files introduction ; it is replaced by an integer version number, at the item level
50 { NAFO_DATA_VERSION,
51 TRUE,
52 FALSE,
53 TRUE,
54 "Version of the format",
55 "The version of the configuration format that will be used to manage backward compatibility.",
56 NAFD_TYPE_STRING,
57 NULL,
58 FALSE,
59 TRUE,
60 TRUE,
61 FALSE,
62 FALSE,
63 "version",
64 NULL,
66 NULL,
69 NULL,
70 NULL },
72 { NAFO_DATA_TARGET_SELECTION,
73 TRUE,
74 TRUE,
75 TRUE,
76 N_( "Targets the selection context menu (default)" ),
77 N_( "Whether the action targets the selection file manager context menus.\n" \
78 "This used to be the historical behavior.\n" \
79 "Note that menus are always potential candidate to the display in " \
80 "selection context menus provided that they contain at least one action.\n" \
81 "Defaults to TRUE." ),
82 NAFD_TYPE_BOOLEAN,
83 "true",
84 FALSE,
85 TRUE,
86 TRUE,
87 FALSE,
88 FALSE,
89 "target-selection",
90 "TargetContext",
91 'n',
92 "selection",
94 G_OPTION_ARG_NONE,
95 NULL,
96 NULL },
98 { NAFO_DATA_TARGET_LOCATION,
99 TRUE,
100 TRUE,
101 TRUE,
102 N_( "Targets the location context menu" ),
103 N_( "Whether the action targets the file manager context menus " \
104 "when there is no selection, thus applying to current location.\n" \
105 "Note that menus are always potential candidate to the display in " \
106 "selection context menus provided that they contain at least one action.\n" \
107 "Defaults to FALSE" ),
108 NAFD_TYPE_BOOLEAN,
109 "false",
110 FALSE,
111 TRUE,
112 TRUE,
113 FALSE,
114 FALSE,
115 "target-location",
116 "TargetLocation",
117 'N',
118 "location",
120 G_OPTION_ARG_NONE,
121 NULL,
122 NULL },
124 { NAFO_DATA_TARGET_TOOLBAR,
125 TRUE,
126 TRUE,
127 TRUE,
128 N_( "Targets the toolbar" ),
129 N_( "Whether the action is candidate to be displayed in file manager toolbar.\n" \
130 "This only applies to current location.\n" \
131 "Note that menus are never displayed in the toolbar.\n" \
132 "Defaults to FALSE." ),
133 NAFD_TYPE_BOOLEAN,
134 "false",
135 FALSE,
136 TRUE,
137 TRUE,
138 FALSE,
139 FALSE,
140 "target-toolbar",
141 "TargetToolbar",
142 'o',
143 "toolbar",
145 G_OPTION_ARG_NONE,
146 NULL,
147 NULL },
149 { NAFO_DATA_TOOLBAR_LABEL,
150 TRUE,
151 TRUE,
152 TRUE,
153 N_( "Label of the toolbar item" ),
154 N_( "The label displayed besides of the icon in the file manager toolbar.\n" \
155 "Note that actual display may depend of your own Desktop Environment preferences.\n" \
156 "Defaults to label of the context menu when not set or empty."),
157 NAFD_TYPE_LOCALE_STRING,
159 FALSE,
160 TRUE,
161 TRUE,
162 FALSE,
163 TRUE,
164 "toolbar-label",
165 "ToolbarLabel",
166 'L',
167 "toolbar-label",
169 G_OPTION_ARG_STRING,
170 NULL,
171 N_( "<STRING>" ) },
173 /* this data has been introduced in 2.29.1 and has been left up to 2.29.4
174 * it has been removed starting with 2.29.5
175 * it is now only used in the NACT user interface
176 * it is so left readable, but no more writable (obsolete)
178 { NAFO_DATA_TOOLBAR_SAME_LABEL,
179 TRUE,
180 FALSE,
181 TRUE,
182 "Does the toolbar label is the same than the main one ?",
183 "Does the toolbar label is the same than the main one ?",
184 NAFD_TYPE_BOOLEAN,
185 "true",
186 FALSE,
187 TRUE,
188 TRUE,
189 FALSE,
190 FALSE,
191 "toolbar-same-label",
192 NULL,
194 NULL,
197 NULL,
198 NULL },
200 /* dynamic data, so non readable / non writable
202 { NAFO_DATA_LAST_ALLOCATED,
203 FALSE,
204 FALSE,
205 TRUE,
206 "Last allocated profile",
207 "Last allocated profile number in na_object_action_get_new_profile_name(), " \
208 "reset to zero when saving the action.",
209 NAFD_TYPE_UINT,
210 "0",
211 FALSE,
212 TRUE,
213 FALSE,
214 FALSE,
215 FALSE,
216 NULL,
217 NULL,
219 NULL,
222 NULL,
223 NULL },
225 { NULL },
228 /* all these data are pre-profiles data
229 * these are obsoleted since 1.9 (which was a non-official version)
230 * readable but non writable, no default
232 NADataDef data_def_action_v1 [] = {
234 { NAFO_DATA_PATH,
235 TRUE,
236 FALSE,
237 FALSE,
238 "Command path",
239 NULL,
240 NAFD_TYPE_STRING,
241 NULL,
242 FALSE,
243 FALSE,
244 FALSE,
245 FALSE,
246 FALSE,
247 "path",
248 NULL,
250 NULL,
253 NULL,
254 NULL },
256 { NAFO_DATA_PARAMETERS,
257 TRUE,
258 FALSE,
259 FALSE,
260 "Command parameters",
261 NULL,
262 NAFD_TYPE_STRING,
263 NULL,
264 FALSE,
265 FALSE,
266 FALSE,
267 FALSE,
268 FALSE,
269 "parameters",
270 NULL,
272 NULL,
275 NULL,
276 NULL },
278 { NAFO_DATA_BASENAMES,
279 TRUE,
280 FALSE,
281 FALSE,
282 "Basenames",
283 NULL,
284 NAFD_TYPE_STRING_LIST,
285 NULL,
286 FALSE,
287 FALSE,
288 FALSE,
289 FALSE,
290 FALSE,
291 "basenames",
292 NULL,
294 NULL,
297 NULL,
298 NULL },
300 { NAFO_DATA_MATCHCASE,
301 TRUE,
302 FALSE,
303 FALSE,
304 "Case sensitive",
305 NULL,
306 NAFD_TYPE_BOOLEAN,
307 NULL,
308 FALSE,
309 FALSE,
310 FALSE,
311 FALSE,
312 FALSE,
313 "matchcase",
314 NULL,
316 NULL,
319 NULL,
320 NULL },
322 { NAFO_DATA_MIMETYPES,
323 TRUE,
324 FALSE,
325 FALSE,
326 "Mimetypes",
327 NULL,
328 NAFD_TYPE_STRING_LIST,
329 NULL,
330 FALSE,
331 FALSE,
332 FALSE,
333 FALSE,
334 FALSE,
335 "mimetypes",
336 NULL,
338 NULL,
341 NULL,
342 NULL },
344 { NAFO_DATA_ISFILE,
345 TRUE,
346 FALSE,
347 FALSE,
348 "Applies to files only",
349 NULL,
350 NAFD_TYPE_BOOLEAN,
351 NULL,
352 FALSE,
353 FALSE,
354 FALSE,
355 FALSE,
356 FALSE,
357 "isfile",
358 NULL,
360 NULL,
363 NULL,
364 NULL },
366 { NAFO_DATA_ISDIR,
367 TRUE,
368 FALSE,
369 FALSE,
370 "Applies to directories only",
371 NULL,
372 NAFD_TYPE_BOOLEAN,
373 NULL,
374 FALSE,
375 FALSE,
376 FALSE,
377 FALSE,
378 FALSE,
379 "isdir",
380 NULL,
382 NULL,
385 NULL,
386 NULL },
388 { NAFO_DATA_MULTIPLE,
389 TRUE,
390 FALSE,
391 FALSE,
392 "Multiple selection",
393 NULL,
394 NAFD_TYPE_BOOLEAN,
395 NULL,
396 FALSE,
397 FALSE,
398 FALSE,
399 FALSE,
400 FALSE,
401 "accept-multiple-files",
402 NULL,
404 NULL,
407 NULL,
408 NULL },
410 { NAFO_DATA_SCHEMES,
411 TRUE,
412 FALSE,
413 FALSE,
414 "Schemes",
415 NULL,
416 NAFD_TYPE_STRING_LIST,
417 NULL,
418 FALSE,
419 FALSE,
420 FALSE,
421 FALSE,
422 FALSE,
423 "schemes",
424 NULL,
426 NULL,
429 NULL,
430 NULL },
432 { NULL },
435 NADataGroup action_data_groups [] = {
436 { NA_FACTORY_OBJECT_ID_GROUP, data_def_id },
437 { NA_FACTORY_OBJECT_ITEM_GROUP, data_def_item },
438 { NA_FACTORY_OBJECT_ACTION_GROUP, data_def_action },
439 { NA_FACTORY_ACTION_V1_GROUP, data_def_action_v1 },
440 { NA_FACTORY_OBJECT_CONDITIONS_GROUP, data_def_conditions },
441 { NULL }