[nautilus-actions] Add %o/%O no-op parameters



commit d2535bda1b9af69b24c34d3e7b18a74d07a36827
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Nov 25 20:25:27 2010 +0100

    Add %o/%O no-op parameters
    
    According to DES-EMA 0.15, %o/%O are no-op operators which force the
    singular or plural form of execution.

 ChangeLog                                |   16 +++
 doc/nact/C/figures/nact-legend.png       |  Bin 27137 -> 28801 bytes
 doc/nact/C/nact-execution.xml            |   14 +++
 src/core/na-icontext.c                   |    1 +
 src/core/na-object-profile-factory.c     |    2 +
 src/core/na-tokens.c                     |    7 ++
 src/core/na-tokens.h                     |    6 +-
 src/nact/nautilus-actions-config-tool.ui |  161 ++++++++++++++++++++---------
 8 files changed, 156 insertions(+), 51 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c2daebf..aa2a362 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-25 Pierre Wieser <pwieser trychlos org>
+
+	Add %o/%O no-op parameters.
+
+	* doc/nact/C/figures/nact-legend.png: Update legend screenshot.
+	* doc/nact/C/nact-execution.xml: Update parameters description.
+
+	* src/core/na-object-profile-factory.c:
+	* src/core/na-tokens.h: Update comments.
+
+	* src/core/na-tokens.c
+	(is_singular_exec, parse_singular): Update with new parameters.
+
+	* src/nact/nautilus-actions-config-tool.ui:
+	Update legend dialog.
+
 2010-11-24 Pierre Wieser <pwieser trychlos org>
 
 	* doc/des-ema/des-ema-0.12:
diff --git a/doc/nact/C/figures/nact-legend.png b/doc/nact/C/figures/nact-legend.png
index 412e25c..d427d8f 100644
Binary files a/doc/nact/C/figures/nact-legend.png and b/doc/nact/C/figures/nact-legend.png differ
diff --git a/doc/nact/C/nact-execution.xml b/doc/nact/C/nact-execution.xml
index 4f2661e..faddb2b 100644
--- a/doc/nact/C/nact-execution.xml
+++ b/doc/nact/C/nact-execution.xml
@@ -445,6 +445,20 @@
               <entry></entry>
             </row>
             <row>
+              <entry><literal>%o</literal></entry>
+              <entry>no-op operator which forces a singular form of execution</entry>
+              <entry>singular</entry>
+              <entry></entry>
+              <entry></entry>
+            </row>
+            <row>
+              <entry><literal>%O</literal></entry>
+              <entry>no-op operator which forces a plural form of execution</entry>
+              <entry></entry>
+              <entry></entry>
+              <entry>plural</entry>
+            </row>
+            <row>
               <entry><literal>%p</literal></entry>
               <entry>port number of the (first) URI</entry>
               <entry></entry>
diff --git a/src/core/na-icontext.c b/src/core/na-icontext.c
index 3709d76..cad82c9 100644
--- a/src/core/na-icontext.c
+++ b/src/core/na-icontext.c
@@ -425,6 +425,7 @@ is_candidate_for_target( const NAIContext *object, guint target, GList *files )
 
 	if( !ok ){
 		g_debug( "%s: object is not candidate because target doesn't match (asked=%d)", thisfn, target );
+		/*na_object_dump( object );*/
 	}
 
 	return( ok );
diff --git a/src/core/na-object-profile-factory.c b/src/core/na-object-profile-factory.c
index cc590df..4e7c2c4 100644
--- a/src/core/na-object-profile-factory.c
+++ b/src/core/na-object-profile-factory.c
@@ -137,6 +137,8 @@ static NADataDef data_def_profile [] = {
 					"  %h: hostname of the URI\n" \
 					"  %m: space-separated list of the basenames of the selected file(s)/folder(s)\n" \
 					"  %M: space-separated list of the selected file(s)/folder(s), with their full paths\n" \
+					"  %o: no-op operator which forces a singular form of execution\n" \
+					"  %O: no-op operator which forces a plural form of execution\n" \
 					"  %p: port number of the first URI\n" \
 					"  %R: space-separated list of selected URIs\n" \
 					"  %s: scheme of the URI\n" \
diff --git a/src/core/na-tokens.c b/src/core/na-tokens.c
index 12b3825..90bff5c 100644
--- a/src/core/na-tokens.c
+++ b/src/core/na-tokens.c
@@ -470,6 +470,7 @@ is_singular_exec( const NATokens *tokens, const gchar *exec )
 			case 'd':
 			case 'f':
 			case 'm':
+			case 'o':
 			case 'u':
 			case 'w':
 			case 'x':
@@ -481,6 +482,7 @@ is_singular_exec( const NATokens *tokens, const gchar *exec )
 			case 'D':
 			case 'F':
 			case 'M':
+			case 'O':
 			case 'U':
 			case 'W':
 			case 'X':
@@ -630,6 +632,11 @@ parse_singular( const NATokens *tokens, const gchar *input, guint i, gboolean ut
 				}
 				break;
 
+			/* no-op operators */
+			case 'o':
+			case 'O':
+				break;
+
 			case 'n':
 				if( tokens->private->username ){
 					tmp = g_shell_quote( tokens->private->username );
diff --git a/src/core/na-tokens.h b/src/core/na-tokens.h
index f4b89d1..113477f 100644
--- a/src/core/na-tokens.h
+++ b/src/core/na-tokens.h
@@ -47,7 +47,9 @@
  * factorize this parsing one time for each new selection in the Nautilus
  * plugin, attaching the result to each item in the context menu.
  *
- * Adding a parameter requires updating of :
+ * Adding a parameter requires updating of:
+ * - doc/nact/C/figures/nact-legend.png screenshot
+ * - doc/nact/C/nact-execution.xml "Multiple execution" paragraph
  * - src/core/na-tokens.c::is_singular_exec() function
  * - src/core/na-tokens.c::parse_singular() function
  * - src/nact/nautilus-actions-config-tool.ui:LegendDialog labels
@@ -66,6 +68,8 @@
  * %m: (first) mimetype
  * %M: space-separated list of mimetypes
  * %n: username of the (first) URI
+ * %o: no-op operator which forces a singular form of execution
+ * %O: no-op operator which forces a plural form of execution
  * %p: port number of the (first) URI
  * %s: scheme of the (first) URI
  * %u: (first) URI
diff --git a/src/nact/nautilus-actions-config-tool.ui b/src/nact/nautilus-actions-config-tool.ui
index 90bf9c5..c8d1282 100644
--- a/src/nact/nautilus-actions-config-tool.ui
+++ b/src/nact/nautilus-actions-config-tool.ui
@@ -2780,6 +2780,9 @@ If the command is not found, or does not display the correct result, your item w
       <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>
@@ -2795,8 +2798,8 @@ If the command is not found, or does not display the correct result, your item w
         <child>
           <object class="GtkFileChooserWidget" id="ImportFileChooser">
             <property name="visible">True</property>
-            <property name="select_multiple">True</property>
             <property name="preview_widget_active">False</property>
+            <property name="select_multiple">True</property>
             <property name="local_only">False</property>
             <property name="use_preview_label">False</property>
           </object>
@@ -3152,7 +3155,7 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
         <child>
           <object class="GtkTable" id="table5">
             <property name="visible">True</property>
-            <property name="n_rows">20</property>
+            <property name="n_rows">22</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">2</property>
             <property name="row_spacing">6</property>
@@ -3233,8 +3236,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">11</property>
-                <property name="bottom_attach">12</property>
+                <property name="top_attach">13</property>
+                <property name="bottom_attach">14</property>
                 <property name="x_options">GTK_SHRINK | GTK_FILL</property>
               </packing>
             </child>
@@ -3247,8 +3250,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">12</property>
-                <property name="bottom_attach">13</property>
+                <property name="top_attach">14</property>
+                <property name="bottom_attach">15</property>
                 <property name="x_options">GTK_SHRINK | GTK_FILL</property>
               </packing>
             </child>
@@ -3261,8 +3264,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">13</property>
-                <property name="bottom_attach">14</property>
+                <property name="top_attach">15</property>
+                <property name="bottom_attach">16</property>
                 <property name="x_options">GTK_SHRINK | GTK_FILL</property>
               </packing>
             </child>
@@ -3275,8 +3278,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">14</property>
-                <property name="bottom_attach">15</property>
+                <property name="top_attach">16</property>
+                <property name="bottom_attach">17</property>
                 <property name="x_options">GTK_SHRINK | GTK_FILL</property>
               </packing>
             </child>
@@ -3289,8 +3292,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">19</property>
-                <property name="bottom_attach">20</property>
+                <property name="top_attach">21</property>
+                <property name="bottom_attach">22</property>
                 <property name="x_options">GTK_SHRINK | GTK_FILL</property>
               </packing>
             </child>
@@ -3377,8 +3380,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">11</property>
-                <property name="bottom_attach">12</property>
+                <property name="top_attach">13</property>
+                <property name="bottom_attach">14</property>
                 <property name="x_options">GTK_FILL</property>
               </packing>
             </child>
@@ -3392,8 +3395,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">12</property>
-                <property name="bottom_attach">13</property>
+                <property name="top_attach">14</property>
+                <property name="bottom_attach">15</property>
                 <property name="x_options">GTK_FILL</property>
               </packing>
             </child>
@@ -3407,8 +3410,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">13</property>
-                <property name="bottom_attach">14</property>
+                <property name="top_attach">15</property>
+                <property name="bottom_attach">16</property>
                 <property name="x_options">GTK_FILL</property>
               </packing>
             </child>
@@ -3422,8 +3425,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">14</property>
-                <property name="bottom_attach">15</property>
+                <property name="top_attach">16</property>
+                <property name="bottom_attach">17</property>
                 <property name="x_options">GTK_FILL</property>
               </packing>
             </child>
@@ -3437,8 +3440,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">19</property>
-                <property name="bottom_attach">20</property>
+                <property name="top_attach">21</property>
+                <property name="bottom_attach">22</property>
                 <property name="x_options">GTK_FILL</property>
               </packing>
             </child>
@@ -3551,8 +3554,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">15</property>
-                <property name="bottom_attach">16</property>
+                <property name="top_attach">17</property>
+                <property name="bottom_attach">18</property>
               </packing>
             </child>
             <child>
@@ -3564,8 +3567,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">16</property>
-                <property name="bottom_attach">17</property>
+                <property name="top_attach">18</property>
+                <property name="bottom_attach">19</property>
               </packing>
             </child>
             <child>
@@ -3577,8 +3580,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">17</property>
-                <property name="bottom_attach">18</property>
+                <property name="top_attach">19</property>
+                <property name="bottom_attach">20</property>
               </packing>
             </child>
             <child>
@@ -3590,8 +3593,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">18</property>
-                <property name="bottom_attach">19</property>
+                <property name="top_attach">20</property>
+                <property name="bottom_attach">21</property>
               </packing>
             </child>
             <child>
@@ -3602,8 +3605,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">15</property>
-                <property name="bottom_attach">16</property>
+                <property name="top_attach">17</property>
+                <property name="bottom_attach">18</property>
               </packing>
             </child>
             <child>
@@ -3614,8 +3617,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">16</property>
-                <property name="bottom_attach">17</property>
+                <property name="top_attach">18</property>
+                <property name="bottom_attach">19</property>
               </packing>
             </child>
             <child>
@@ -3626,8 +3629,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">17</property>
-                <property name="bottom_attach">18</property>
+                <property name="top_attach">19</property>
+                <property name="bottom_attach">20</property>
               </packing>
             </child>
             <child>
@@ -3638,8 +3641,8 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="use_markup">True</property>
               </object>
               <packing>
-                <property name="top_attach">18</property>
-                <property name="bottom_attach">19</property>
+                <property name="top_attach">20</property>
+                <property name="bottom_attach">21</property>
               </packing>
             </child>
             <child>
@@ -3692,6 +3695,64 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                 <property name="bottom_attach">10</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label88">
+                <property name="visible">True</property>
+                <property name="xalign">1</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%o&lt;/b&gt; :</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="top_attach">11</property>
+                <property name="bottom_attach">12</property>
+                <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label89">
+                <property name="visible">True</property>
+                <property name="xalign">1</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%O&lt;/b&gt; :</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
+                <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label90">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">no-op operator which forces a singular form of execution.</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">11</property>
+                <property name="bottom_attach">12</property>
+                <property name="x_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label91">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">no-op operator which forces a plural form of execution.</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">12</property>
+                <property name="bottom_attach">13</property>
+                <property name="x_options">GTK_FILL</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -3826,39 +3887,39 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
   </object>
   <object class="GtkSizeGroup" id="CommandLabelSizeGroup">
     <widgets>
-      <widget name="label4"/>
-      <widget name="CommandParametersLabel"/>
-      <widget name="CommandPathLabel"/>
       <widget name="ProfileLabelLabel"/>
+      <widget name="CommandPathLabel"/>
+      <widget name="CommandParametersLabel"/>
+      <widget name="label4"/>
     </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="ActionMenuLabelLabel"/>
-      <widget name="ActionToolbarLabelLabel"/>
-      <widget name="ActionTooltipLabel"/>
       <widget name="ActionIconLabel"/>
+      <widget name="ActionTooltipLabel"/>
+      <widget name="ActionToolbarLabelLabel"/>
+      <widget name="ActionMenuLabelLabel"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="ExecutionModeSizeGroup">
     <widgets>
-      <widget name="label43"/>
-      <widget name="label44"/>
       <widget name="label45"/>
+      <widget name="label44"/>
+      <widget name="label43"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="PropertiesLabelSizeGroup">
     <widgets>
-      <widget name="label18"/>
-      <widget name="label39"/>
-      <widget name="label49"/>
       <widget name="label19"/>
+      <widget name="label49"/>
+      <widget name="label39"/>
+      <widget name="label18"/>
     </widgets>
   </object>
 </interface>



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