[gthumb] scripts: optionally use a headerbar for dialogs



commit baf3fb3ce5838f7506c9a4fffa5cd880e4b7b4b4
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Aug 13 08:40:48 2016 +0200

    scripts: optionally use a headerbar for dialogs

 extensions/list_tools/data/ui/ask-value.ui         |  209 +++++++-------------
 .../list_tools/data/ui/personalize-scripts.ui      |  174 +++++++----------
 extensions/list_tools/data/ui/script-editor.ui     |   62 +++---
 extensions/list_tools/dlg-personalize-scripts.c    |   19 ++-
 extensions/list_tools/gth-script-editor-dialog.c   |   19 +-
 extensions/list_tools/gth-script.c                 |   27 ++-
 6 files changed, 212 insertions(+), 298 deletions(-)
---
diff --git a/extensions/list_tools/data/ui/ask-value.ui b/extensions/list_tools/data/ui/ask-value.ui
index 7a09df1..a92e0e1 100644
--- a/extensions/list_tools/data/ui/ask-value.ui
+++ b/extensions/list_tools/data/ui/ask-value.ui
@@ -1,129 +1,92 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <object class="GtkDialog" id="ask_value_dialog">
-    <property name="width_request">500</property>
+  <requires lib="gtk+" version="3.14"/>
+  <object class="GtkBox" id="dialog_content">
+    <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox1">
+    <property name="border_width">15</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">2</property>
+    <child>
+      <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
+        <property name="border_width">5</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkBox" id="vbox2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkButton" id="skip_button">
-                <property name="label" translatable="yes">_Skip</property>
-                <property name="use_action_appearance">False</property>
+              <object class="GtkAspectFrame" id="aspectframe1">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_underline">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <child>
+                  <object class="GtkImage" id="request_image">
+                    <property name="width_request">128</property>
+                    <property name="height_request">128</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="stock">gtk-missing-image</property>
+                    <property name="icon_size">6</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">False</property>
+                <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
+              <object class="GtkLabel" id="filename_label">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
+                <property name="can_focus">False</property>
+                <property name="wrap">True</property>
+                <property name="wrap_mode">char</property>
+                <property name="max_width_chars">15</property>
+                <attributes>
+                  <attribute name="size" value="8500"/>
+                </attributes>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">False</property>
+                <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-execute</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkBox" id="vbox1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="border_width">5</property>
-            <property name="spacing">12</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkVBox" id="vbox2">
+              <object class="GtkAlignment" id="alignment1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkAspectFrame" id="aspectframe1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label_xalign">0</property>
-                    <child>
-                      <object class="GtkImage" id="request_image">
-                        <property name="width_request">128</property>
-                        <property name="height_request">128</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="stock">gtk-missing-image</property>
-                        <property name="icon-size">6</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
+                <property name="bottom_padding">12</property>
                 <child>
-                  <object class="GtkLabel" id="filename_label">
+                  <object class="GtkLabel" id="title_label">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="wrap">True</property>
-                    <property name="wrap_mode">char</property>
-                    <property name="max_width_chars">15</property>
+                    <property name="halign">start</property>
                     <attributes>
-                      <attribute name="size" value="8500"/>
+                      <attribute name="weight" value="bold"/>
+                      <attribute name="size" value="12000"/>
                     </attributes>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
               <packing>
@@ -133,65 +96,31 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox1">
+              <object class="GtkLabel" id="request_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkAlignment" id="alignment1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="bottom_padding">12</property>
-                    <child>
-                      <object class="GtkLabel" id="title_label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                          <attribute name="size" value="12000"/>
-                        </attributes>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="request_label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="request_entry">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">●</property>
-                    <property name="activates_default">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
+                <property name="halign">start</property>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkEntry" id="request_entry">
+                <property name="width_request">300</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">●</property>
+                <property name="activates_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
@@ -200,11 +129,11 @@
           </packing>
         </child>
       </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
     </child>
-    <action-widgets>
-      <action-widget response="3">skip_button</action-widget>
-      <action-widget response="1">cancel_button</action-widget>
-      <action-widget response="2">ok_button</action-widget>
-    </action-widgets>
   </object>
 </interface>
diff --git a/extensions/list_tools/data/ui/personalize-scripts.ui 
b/extensions/list_tools/data/ui/personalize-scripts.ui
index 1937701..6d8be8e 100644
--- a/extensions/list_tools/data/ui/personalize-scripts.ui
+++ b/extensions/list_tools/data/ui/personalize-scripts.ui
@@ -1,153 +1,113 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <object class="GtkDialog" id="personalize_scripts_dialog">
+  <object class="GtkBox" id="dialog_content">
+    <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Commands</property>
-    <property name="type_hint">normal</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox">
+    <property name="border_width">15</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">2</property>
+    <child>
+      <object class="GtkBox" id="vbox4">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="border_width">6</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area">
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkBox" id="vbox6">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkButton" id="close_button">
-                <property name="label">gtk-close</property>
-                <property name="use_action_appearance">False</property>
+              <object class="GtkLabel" id="scripts_label">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="label" translatable="yes">Co_mmands:</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">False</property>
+                <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="vbox4">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">6</property>
-            <property name="spacing">12</property>
             <child>
-              <object class="GtkVBox" id="vbox6">
+              <object class="GtkBox" id="hbox3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="spacing">6</property>
+                <property name="spacing">12</property>
                 <child>
-                  <object class="GtkLabel" id="scripts_label">
+                  <object class="GtkScrolledWindow" id="scripts_scrolledwindow">
+                    <property name="width_request">350</property>
+                    <property name="height_request">300</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Co_mmands:</property>
+                    <property name="can_focus">True</property>
+                    <property name="shadow_type">etched-in</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
+                    <property name="expand">True</property>
                     <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkHBox" id="hbox3">
+                  <object class="GtkButtonBox" id="vbuttonbox3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">12</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <property name="layout_style">start</property>
                     <child>
-                      <object class="GtkScrolledWindow" id="scripts_scrolledwindow">
-                        <property name="width_request">350</property>
-                        <property name="height_request">300</property>
+                      <object class="GtkButton" id="new_button">
+                        <property name="label">gtk-new</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="shadow_type">etched-in</property>
-                        <child>
-                          <placeholder/>
-                        </child>
+                        <property name="receives_default">True</property>
+                        <property name="use_stock">True</property>
                       </object>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkVButtonBox" id="vbuttonbox3">
+                      <object class="GtkButton" id="edit_button">
+                        <property name="label">gtk-edit</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <property name="layout_style">start</property>
-                        <child>
-                          <object class="GtkButton" id="new_button">
-                            <property name="label">gtk-new</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="edit_button">
-                            <property name="label">gtk-edit</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="delete_button">
-                            <property name="label">gtk-remove</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="use_stock">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">True</property>
+                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkButton" id="delete_button">
+                        <property name="label">gtk-remove</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
+                    <property name="expand">False</property>
                     <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
@@ -156,20 +116,22 @@
               <packing>
                 <property name="expand">True</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
     </child>
-    <action-widgets>
-      <action-widget response="0">close_button</action-widget>
-    </action-widgets>
   </object>
 </interface>
diff --git a/extensions/list_tools/data/ui/script-editor.ui b/extensions/list_tools/data/ui/script-editor.ui
index e141ad7..cec4767 100644
--- a/extensions/list_tools/data/ui/script-editor.ui
+++ b/extensions/list_tools/data/ui/script-editor.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.1 -->
+<!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
   <object class="GtkListStore" id="shortcut_liststore">
@@ -10,10 +10,11 @@
       <column type="gboolean"/>
     </columns>
   </object>
-  <object class="GtkVBox" id="script_editor">
+  <object class="GtkBox" id="script_editor">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">6</property>
+    <property name="border_width">15</property>
+    <property name="orientation">vertical</property>
     <property name="spacing">12</property>
     <child>
       <object class="GtkTable" id="table1">
@@ -27,10 +28,10 @@
           <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">1</property>
             <property name="label" translatable="yes">_Name:</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">name_entry</property>
+            <property name="xalign">1</property>
           </object>
           <packing>
             <property name="x_options">GTK_FILL</property>
@@ -105,10 +106,10 @@
           <object class="GtkLabel" id="label23">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">1</property>
             <property name="label" translatable="yes">Sh_ortcut:</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">shortcut_combobox</property>
+            <property name="xalign">1</property>
           </object>
           <packing>
             <property name="top_attach">2</property>
@@ -118,7 +119,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkBox" id="hbox1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="spacing">6</property>
@@ -154,9 +155,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkBox" id="vbox1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkEntry" id="command_entry">
@@ -174,7 +176,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="command_help_box">
+              <object class="GtkBox" id="command_help_box">
                 <property name="can_focus">False</property>
                 <child>
                   <object class="GtkTable" id="table2">
@@ -188,8 +190,8 @@
                       <object class="GtkLabel" id="label3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label">%U</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -204,8 +206,8 @@
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label">%F</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -220,8 +222,8 @@
                       <object class="GtkLabel" id="label6">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label">%B</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -236,8 +238,8 @@
                       <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label">%P</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -252,8 +254,8 @@
                       <object class="GtkLabel" id="label9">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The file uri</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -270,8 +272,8 @@
                       <object class="GtkLabel" id="label10">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The file path</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -288,8 +290,8 @@
                       <object class="GtkLabel" id="label11">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The file basename</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -306,8 +308,8 @@
                       <object class="GtkLabel" id="label12">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The parent folder path</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -324,8 +326,8 @@
                       <object class="GtkLabel" id="label14">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Special code</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                           <attribute name="size" value="8000"/>
@@ -339,8 +341,8 @@
                       <object class="GtkLabel" id="label15">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Description</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                           <attribute name="size" value="8000"/>
@@ -356,8 +358,8 @@
                       <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" comments="Translate only 'message' and 
'default_value'.">%ask{ message }{ default value }</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -372,8 +374,8 @@
                       <object class="GtkLabel" id="label13">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Ask an input value</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -390,8 +392,8 @@
                       <object class="GtkLabel" id="label1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" comments="Translate only 'attribute 
name'">%attr{ attribute name }</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -406,8 +408,8 @@
                       <object class="GtkLabel" id="label16">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">A file attribute</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -424,8 +426,8 @@
                       <object class="GtkLabel" id="label17">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">%N</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -440,8 +442,8 @@
                       <object class="GtkLabel" id="label18">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The file basename without 
extension</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -458,8 +460,8 @@
                       <object class="GtkLabel" id="label19">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">%E</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -474,8 +476,8 @@
                       <object class="GtkLabel" id="label20">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">The file extension</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -492,8 +494,8 @@
                       <object class="GtkLabel" id="label21">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" comments="Translate only 'text'.">%quote{ 
text }</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -508,8 +510,8 @@
                       <object class="GtkLabel" id="label22">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Quote the text </property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="size" value="8000"/>
                         </attributes>
@@ -554,11 +556,11 @@
               <object class="GtkLabel" id="label4">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">1</property>
-                <property name="yalign">0</property>
                 <property name="label" translatable="yes">_Command:</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">command_entry</property>
+                <property name="xalign">1</property>
+                <property name="yalign">0</property>
               </object>
             </child>
           </object>
diff --git a/extensions/list_tools/dlg-personalize-scripts.c b/extensions/list_tools/dlg-personalize-scripts.c
index 3ed7826..70a67a9 100644
--- a/extensions/list_tools/dlg-personalize-scripts.c
+++ b/extensions/list_tools/dlg-personalize-scripts.c
@@ -545,7 +545,20 @@ dlg_personalize_scripts (GthBrowser *browser)
 
        /* Get the widgets. */
 
-       data->dialog = _gtk_builder_get_widget (data->builder, "personalize_scripts_dialog");
+       data->dialog = g_object_new (GTK_TYPE_DIALOG,
+                                    "title", _("Commands"),
+                                    "transient-for", GTK_WINDOW (browser),
+                                    "modal", FALSE,
+                                    "destroy-with-parent", FALSE,
+                                    "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+                                    NULL);
+       gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (data->dialog))),
+                          _gtk_builder_get_widget (data->builder, "dialog_content"));
+       gtk_dialog_add_buttons (GTK_DIALOG (data->dialog),
+                               _GTK_LABEL_OK, GTK_RESPONSE_CLOSE,
+                               NULL);
+       _gtk_dialog_add_class_to_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_CLOSE, 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
+
        gth_browser_set_dialog (browser, "personalize_scripts", data->dialog);
        g_object_set_data (G_OBJECT (data->dialog), "dialog_data", data);
 
@@ -578,7 +591,7 @@ dlg_personalize_scripts (GthBrowser *browser)
                          "destroy",
                          G_CALLBACK (destroy_cb),
                          data);
-       g_signal_connect_swapped (G_OBJECT (GET_WIDGET ("close_button")),
+       g_signal_connect_swapped (gtk_dialog_get_widget_for_response (GTK_DIALOG (data->dialog), 
GTK_RESPONSE_CLOSE),
                                  "clicked",
                                  G_CALLBACK (gtk_widget_destroy),
                                  G_OBJECT (data->dialog));
@@ -618,7 +631,5 @@ dlg_personalize_scripts (GthBrowser *browser)
 
        /* run dialog. */
 
-       gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (browser));
-       gtk_window_set_modal (GTK_WINDOW (data->dialog), FALSE);
        gtk_widget_show (data->dialog);
 }
diff --git a/extensions/list_tools/gth-script-editor-dialog.c 
b/extensions/list_tools/gth-script-editor-dialog.c
index 5c11e8d..33d0b98 100644
--- a/extensions/list_tools/gth-script-editor-dialog.c
+++ b/extensions/list_tools/gth-script-editor-dialog.c
@@ -115,7 +115,6 @@ gth_script_editor_dialog_construct (GthScriptEditorDialog *self,
                                    const char            *title,
                                    GtkWindow             *parent)
 {
-       GtkWidget   *content;
        GtkTreeIter  iter;
        int          i;
 
@@ -124,17 +123,15 @@ gth_script_editor_dialog_construct (GthScriptEditorDialog *self,
        if (parent != NULL)
                gtk_window_set_transient_for (GTK_WINDOW (self), parent);
        gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
-       gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 5);
-       gtk_container_set_border_width (GTK_CONTAINER (self), 5);
 
-       gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL);
-       gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_SAVE, GTK_RESPONSE_OK);
+       gtk_dialog_add_buttons (GTK_DIALOG (self),
+                               _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
+                               _GTK_LABEL_SAVE, GTK_RESPONSE_OK,
+                               NULL);
+       _gtk_dialog_add_class_to_response (GTK_DIALOG (self), GTK_RESPONSE_OK, 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
 
        self->priv->builder = gtk_builder_new_from_resource 
("/org/gnome/gThumb/list_tools/data/ui/script-editor.ui");
-
-       content = _gtk_builder_get_widget (self->priv->builder, "script_editor");
-       gtk_container_set_border_width (GTK_CONTAINER (content), 5);
-       gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), content, TRUE, TRUE, 
0);
+       gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 
_gtk_builder_get_widget (self->priv->builder, "script_editor"), TRUE, TRUE, 0);
 
        g_signal_connect (GET_WIDGET ("command_entry"),
                          "icon-press",
@@ -170,7 +167,9 @@ gth_script_editor_dialog_new (const char *title,
 {
        GthScriptEditorDialog *self;
 
-       self = g_object_new (GTH_TYPE_SCRIPT_EDITOR_DIALOG, NULL);
+       self = g_object_new (GTH_TYPE_SCRIPT_EDITOR_DIALOG,
+                            "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+                            NULL);
        gth_script_editor_dialog_construct (self, title, parent);
 
        return (GtkWidget *) self;
diff --git a/extensions/list_tools/gth-script.c b/extensions/list_tools/gth-script.c
index 1e8bb88..1425f8a 100644
--- a/extensions/list_tools/gth-script.c
+++ b/extensions/list_tools/gth-script.c
@@ -619,16 +619,27 @@ ask_value (ReplaceData  *replace_data,
                default_value = "";
 
        builder = gtk_builder_new_from_resource ("/org/gnome/gThumb/list_tools/data/ui/ask-value.ui");
-       dialog = _gtk_builder_get_widget (builder, "ask_value_dialog");
+
+       dialog = g_object_new (GTK_TYPE_DIALOG,
+                              "title", "",
+                              "transient-for", GTK_WINDOW (replace_data->parent),
+                              "modal", TRUE,
+                              "destroy-with-parent", FALSE,
+                              "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+                              "resizable", TRUE,
+                              NULL);
+       gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 
_gtk_builder_get_widget (builder, "dialog_content"));
+       gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+                               _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
+                               _("Execute"), GTK_RESPONSE_OK,
+                               (gth_script_for_each_file (replace_data->script) ? _("_Skip") : NULL), 
GTK_RESPONSE_NO,
+                               NULL);
+       _gtk_dialog_add_class_to_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK, 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
+
        gtk_label_set_text (GTK_LABEL (_gtk_builder_get_widget (builder, "title_label")), 
gth_script_get_display_name (replace_data->script));
        gtk_label_set_text (GTK_LABEL (_gtk_builder_get_widget (builder, "filename_label")), 
g_file_info_get_display_name (file_data->info));
        gtk_label_set_text (GTK_LABEL (_gtk_builder_get_widget (builder, "request_label")), prompt);
        gtk_entry_set_text (GTK_ENTRY (_gtk_builder_get_widget (builder, "request_entry")), default_value);
-       gtk_window_set_title (GTK_WINDOW (dialog), "");
-       gtk_window_set_transient_for (GTK_WINDOW (dialog), replace_data->parent);
-       gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-       if (! gth_script_for_each_file (replace_data->script))
-               gtk_widget_hide (_gtk_builder_get_widget (builder, "skip_button"));
 
        g_object_ref (builder);
        thumb_loader = gth_thumb_loader_new (128);
@@ -639,11 +650,11 @@ ask_value (ReplaceData  *replace_data,
                               builder);
 
        result = gtk_dialog_run (GTK_DIALOG (dialog));
-       if (result == 2) {
+       if (result == GTK_RESPONSE_OK) {
                value = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (_gtk_builder_get_widget (builder, 
"request_entry"))), -1, G_NORMALIZE_NFC);
        }
        else {
-               if (result == 3)
+               if (result == GTK_RESPONSE_NO)
                        *error = g_error_new_literal (GTH_TASK_ERROR, GTH_TASK_ERROR_SKIP_TO_NEXT_FILE, "");
                else
                        *error = g_error_new_literal (GTH_TASK_ERROR, GTH_TASK_ERROR_CANCELLED, "");


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