[gthumb] overwrite dialog: optionally use the headerbar



commit 593a7b7f0c5cafe2b66d7de261a2654235a0fdda
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Aug 13 09:49:10 2016 +0200

    overwrite dialog: optionally use the headerbar

 data/ui/overwrite-dialog.ui   |   58 ++++++++++++++++++----------------------
 gthumb/gth-overwrite-dialog.c |   11 ++++---
 2 files changed, 32 insertions(+), 37 deletions(-)
---
diff --git a/data/ui/overwrite-dialog.ui b/data/ui/overwrite-dialog.ui
index b43d4f9..a99f8c3 100644
--- a/data/ui/overwrite-dialog.ui
+++ b/data/ui/overwrite-dialog.ui
@@ -1,18 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <object class="GtkVBox" id="overwrite_dialog_box">
+  <requires lib="gtk+" version="3.14"/>
+  <object class="GtkBox" id="overwrite_dialog_box">
     <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">6</property>
     <child>
       <object class="GtkLabel" id="label124">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="xalign">0</property>
         <property name="label" translatable="yes">Overwrite the old file with the new one?</property>
         <property name="justify">center</property>
+        <property name="xalign">0</property>
         <attributes>
           <attribute name="weight" value="bold"/>
         </attributes>
@@ -25,14 +27,15 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="hbox46">
+      <object class="GtkBox" id="hbox46">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="spacing">12</property>
         <child>
-          <object class="GtkVBox" id="vbox57">
+          <object class="GtkBox" id="vbox57">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkFrame" id="frame2">
@@ -40,7 +43,7 @@
                 <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <child>
-                  <object class="GtkHBox" id="hbox110">
+                  <object class="GtkBox" id="hbox110">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">6</property>
@@ -96,7 +99,7 @@
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
@@ -110,7 +113,7 @@
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
@@ -121,8 +124,8 @@
                       <object class="GtkLabel" id="old_image_filename_label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="wrap">True</property>
+                        <property name="xalign">0</property>
                       </object>
                     </child>
                   </object>
@@ -137,7 +140,7 @@
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Filename:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -152,7 +155,7 @@
                   <object class="GtkLabel" id="label2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Size:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -169,7 +172,7 @@
                   <object class="GtkLabel" id="label3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Modified:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -197,9 +200,10 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox58">
+          <object class="GtkBox" id="vbox58">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkFrame" id="frame3">
@@ -207,7 +211,7 @@
                 <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <child>
-                  <object class="GtkHBox" id="hbox111">
+                  <object class="GtkBox" id="hbox111">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">6</property>
@@ -263,7 +267,7 @@
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
@@ -277,7 +281,7 @@
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
@@ -288,8 +292,8 @@
                       <object class="GtkLabel" id="new_image_filename_label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="wrap">True</property>
+                        <property name="xalign">0</property>
                       </object>
                     </child>
                   </object>
@@ -304,7 +308,7 @@
                   <object class="GtkLabel" id="new_filename_label">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Filename:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -319,7 +323,7 @@
                   <object class="GtkLabel" id="new_size_label">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Size:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -336,7 +340,7 @@
                   <object class="GtkLabel" id="new_modified_label">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="halign">start</property>
                     <property name="label" translatable="yes">Modified:</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -393,11 +397,9 @@
     <child>
       <object class="GtkRadioButton" id="overwrite_yes_radiobutton">
         <property name="label" translatable="yes">Over_write the old file</property>
-        <property name="use_action_appearance">False</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
-        <property name="use_action_appearance">False</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="active">True</property>
@@ -412,11 +414,9 @@
     <child>
       <object class="GtkRadioButton" id="overwrite_no_radiobutton">
         <property name="label" translatable="yes">Do not overwrite _the old file</property>
-        <property name="use_action_appearance">False</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
-        <property name="use_action_appearance">False</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
@@ -431,11 +431,9 @@
     <child>
       <object class="GtkRadioButton" id="overwrite_all_radiobutton">
         <property name="label" translatable="yes">Overwrite _all files</property>
-        <property name="use_action_appearance">False</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
-        <property name="use_action_appearance">False</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
@@ -450,11 +448,9 @@
     <child>
       <object class="GtkRadioButton" id="overwrite_none_radiobutton">
         <property name="label" translatable="yes">_Do not overwrite any file</property>
-        <property name="use_action_appearance">False</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
-        <property name="use_action_appearance">False</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
@@ -467,18 +463,16 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="hbox112">
+      <object class="GtkBox" id="hbox112">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="spacing">6</property>
         <child>
           <object class="GtkRadioButton" id="overwrite_rename_radiobutton">
             <property name="label" translatable="yes">_Save the new file as:</property>
-            <property name="use_action_appearance">False</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
-            <property name="use_action_appearance">False</property>
             <property name="use_underline">True</property>
             <property name="xalign">0</property>
             <property name="draw_indicator">True</property>
diff --git a/gthumb/gth-overwrite-dialog.c b/gthumb/gth-overwrite-dialog.c
index c4eb4c6..9546a8b 100644
--- a/gthumb/gth-overwrite-dialog.c
+++ b/gthumb/gth-overwrite-dialog.c
@@ -241,14 +241,13 @@ gth_overwrite_dialog_construct (GthOverwriteDialog   *self,
        GtkWidget *overwrite_radiobutton;
        GList     *files;
 
-       gtk_window_set_title (GTK_WINDOW (self), "");
+       gtk_window_set_title (GTK_WINDOW (self), _("Overwrite"));
        gtk_window_set_resizable (GTK_WINDOW (self), TRUE);
-       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_OK, GTK_RESPONSE_OK);
+       gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_EXECUTE, GTK_RESPONSE_OK);
        gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
+       _gtk_dialog_add_class_to_response (GTK_DIALOG (self), GTK_RESPONSE_OK, 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
 
        self->priv->builder = _gtk_builder_new_from_file ("overwrite-dialog.ui", NULL);
        box = _gtk_builder_get_widget (self->priv->builder, "overwrite_dialog_box");
@@ -332,7 +331,9 @@ gth_overwrite_dialog_new (GFile                *source,
 {
        GthOverwriteDialog *self;
 
-       self = g_object_new (GTH_TYPE_OVERWRITE_DIALOG, NULL);
+       self = g_object_new (GTH_TYPE_OVERWRITE_DIALOG,
+                            "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+                            NULL);
        self->priv->source = _g_object_ref (source);
        self->priv->source_image = _g_object_ref (source_image);
        self->priv->destination = g_object_ref (destination);


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