[gnome-control-center] privacy: Use header bar in all the dialogs



commit 4a1f62e6dd305bd9ea9874d0ac7e864507c453e8
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Mon Mar 24 09:18:54 2014 +0200

    privacy: Use header bar in all the dialogs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724299

 panels/privacy/cc-privacy-panel.c |   12 --
 panels/privacy/privacy.ui         |  299 +++++++++++++-----------------------
 2 files changed, 108 insertions(+), 203 deletions(-)
---
diff --git a/panels/privacy/cc-privacy-panel.c b/panels/privacy/cc-privacy-panel.c
index 835cb54..3ea7eb1 100644
--- a/panels/privacy/cc-privacy-panel.c
+++ b/panels/privacy/cc-privacy-panel.c
@@ -248,10 +248,7 @@ add_screen_lock (CcPrivacyPanel *self)
   w = get_on_off_label (self->priv->lock_settings, "lock-enabled");
   add_row (self, _("Screen Lock"), "screen_lock_dialog", w);
 
-  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_done"));
   dialog = self->priv->screen_lock_dialog;
-  g_signal_connect_swapped (w, "clicked",
-                            G_CALLBACK (gtk_widget_hide), dialog);
   g_signal_connect (dialog, "delete-event",
                     G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
@@ -361,10 +358,7 @@ add_usage_history (CcPrivacyPanel *self)
   w = get_on_off_label (self->priv->privacy_settings, REMEMBER_RECENT_FILES);
   add_row (self, _("Usage & History"), "recent_dialog", w);
 
-  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_done"));
   dialog = self->priv->recent_dialog;
-  g_signal_connect_swapped (w, "clicked",
-                            G_CALLBACK (gtk_widget_hide), dialog);
   g_signal_connect (dialog, "delete-event",
                     G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
@@ -538,10 +532,7 @@ add_trash_temp (CcPrivacyPanel *self)
   w = get_on_off_label2 (self->priv->privacy_settings, REMOVE_OLD_TRASH_FILES, REMOVE_OLD_TEMP_FILES);
   add_row (self, _("Purge Trash & Temporary Files"), "trash_dialog", w);
 
-  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_done"));
   dialog = self->priv->trash_dialog;
-  g_signal_connect_swapped (w, "clicked",
-                            G_CALLBACK (gtk_widget_hide), dialog);
   g_signal_connect (dialog, "delete-event",
                     G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
@@ -581,10 +572,7 @@ add_software (CcPrivacyPanel *self)
   w = get_on_off_label (self->priv->privacy_settings, SEND_SOFTWARE_USAGE_STATS);
   add_row (self, _("Software Usage"), "software_dialog", w);
 
-  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "software_done"));
   dialog = self->priv->software_dialog;
-  g_signal_connect_swapped (w, "clicked",
-                            G_CALLBACK (gtk_widget_hide), dialog);
   g_signal_connect (dialog, "delete-event",
                     G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
diff --git a/panels/privacy/privacy.ui b/panels/privacy/privacy.ui
index 721d6e4..d07a3fc 100644
--- a/panels/privacy/privacy.ui
+++ b/panels/privacy/privacy.ui
@@ -121,10 +121,11 @@
   </object>
   <object class="GtkDialog" id="recent_dialog">
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
+    <property name="border_width">0</property>
     <property name="type_hint">dialog</property>
     <property name="title" translatable="yes">Usage &amp; History</property>
     <property name="resizable">False</property>
+    <property name="use_header_bar">1</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox5">
         <property name="can_focus">False</property>
@@ -149,50 +150,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area5">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="clear_recent_button">
-                <property name="label" translatable="yes">Cl_ear Recent History</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="secondary">True</property>
-                <property name="non-homogeneous">True</property>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="recent_done">
-                <property name="label" translatable="yes">_Close</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_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</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="GtkGrid" id="grid3">
             <property name="visible">True</property>
@@ -271,42 +228,25 @@
             <property name="position">2</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">clear_recent_button</action-widget>
-      <action-widget response="0">recent_done</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="screen_lock_dialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Screen Lock</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox1">
-        <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">
+        <child>
+          <object class="GtkBox" id="dialog-action_area5">
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="visible">True</property>
+            <property name="margin_start">12</property>
+            <property name="margin_bottom">12</property>
             <child>
-              <object class="GtkButton" id="screen_lock_done">
-                <property name="label" translatable="yes">_Close</property>
+              <object class="GtkButton" id="clear_recent_button">
+                <property name="label" translatable="yes">Cl_ear Recent History</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_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="fill">False</property>
+                <property name="pack_type">start</property>
+                <property name="position">0</property>
               </packing>
             </child>
           </object>
@@ -314,9 +254,27 @@
             <property name="expand">False</property>
             <property name="fill">True</property>
             <property name="pack_type">end</property>
-            <property name="position">0</property>
+            <property name="position">3</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">clear_recent_button</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="screen_lock_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Screen Lock</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <property name="use_header_bar">1</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
         <child>
           <object class="GtkLabel" id="label1">
             <property name="visible">True</property>
@@ -449,85 +407,19 @@
         </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="-1">screen_lock_done</action-widget>
-    </action-widgets>
   </object>
   <object class="GtkDialog" id="trash_dialog">
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
+    <property name="border_width">0</property>
     <property name="title" translatable="yes">Purge Trash &amp; Temporary Files</property>
     <property name="resizable">False</property>
     <property name="type_hint">dialog</property>
+    <property name="use_header_bar">1</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox4">
         <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_area4">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="empty_trash_button">
-                <property name="label" translatable="yes">_Empty Trash</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="halign">center</property>
-                <property name="valign">center</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="secondary">True</property>
-                <property name="non-homogeneous">True</property>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="purge_temp_button">
-                <property name="label" translatable="yes">_Purge Temporary Files</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="halign">center</property>
-                <property name="valign">center</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="secondary">True</property>
-                <property name="non-homogeneous">True</property>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="trash_done">
-                <property name="label" translatable="yes">_Close</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_underline">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">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkLabel" id="label5">
             <property name="visible">True</property>
@@ -658,12 +550,59 @@
             <property name="position">2</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkBox" id="dialog-actions-box">
+            <property name="can_focus">False</property>
+            <property name="orientation">horizontal</property>
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <property name="margin_start">12</property>
+            <property name="margin_end">6</property>
+            <property name="margin_bottom">12</property>
+            <child>
+              <object class="GtkButton" id="empty_trash_button">
+                <property name="label" translatable="yes">_Empty Trash</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="purge_temp_button">
+                <property name="label" translatable="yes">_Purge Temporary Files</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
       </object>
     </child>
     <action-widgets>
       <action-widget response="0">empty_trash_button</action-widget>
       <action-widget response="0">purge_temp_button</action-widget>
-      <action-widget response="0">trash_done</action-widget>
     </action-widgets>
   </object>
   <object class="GtkDialog" id="software_dialog">
@@ -672,7 +611,7 @@
     <property name="title" translatable="yes">Software Usage</property>
     <property name="resizable">False</property>
     <property name="type_hint">dialog</property>
-    <property name="use_header_bar">0</property>
+    <property name="use_header_bar">1</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox9">
         <property name="can_focus">False</property>
@@ -699,51 +638,6 @@ All the information we collect is made anonymous, and we will never share your d
             <property name="position">0</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area9">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkLinkButton" id="software_policy_linkbutton">
-                <property name="label" translatable="yes">Privacy Policy</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="relief">none</property>
-                <property 
name="uri">https://git.gnome.org/browse/gnome-software/plain/doc/privacy-policy.html</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-                <property name="secondary">True</property>
-                <property name="non_homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="software_done">
-                <property name="label" translatable="yes">_Close</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_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</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="GtkGrid" id="grid1">
             <property name="visible">True</property>
@@ -792,11 +686,34 @@ All the information we collect is made anonymous, and we will never share your d
             <property name="position">2</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkBox" id="dialog-action_area9">
+            <property name="can_focus">False</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLinkButton" id="software_policy_linkbutton">
+                <property name="label" translatable="yes">Privacy Policy</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="relief">none</property>
+                <property 
name="uri">https://git.gnome.org/browse/gnome-software/plain/doc/privacy-policy.html</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="0">software_done</action-widget>
-    </action-widgets>
   </object>
       <object class="GtkBox" id="privacy_vbox">
         <property name="visible">True</property>


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