[gnome-nibbles/arnaudb/kill-preferences-dialog: 5/14] Clear Preferences dialog code.



commit 1b45b04f81e979266327a5364719c5f5187457a7
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Jun 3 11:21:36 2020 +0200

    Clear Preferences dialog code.

 data/preferences-dialog.ui  | 51 +++++++++++++++++++++++----------------------
 src/preferences-dialog.vala |  4 +---
 2 files changed, 27 insertions(+), 28 deletions(-)
---
diff --git a/data/preferences-dialog.ui b/data/preferences-dialog.ui
index 36bb9bf..6319960 100644
--- a/data/preferences-dialog.ui
+++ b/data/preferences-dialog.ui
@@ -25,8 +25,9 @@
     <property name="title" translatable="yes">Preferences</property>
     <property name="icon_name">gnome-nibbles</property>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog_vbox">
+      <object class="GtkBox">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <property name="can_focus">False</property>
         <property name="spacing">2</property>
         <child>
@@ -34,14 +35,14 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <child>
-              <object class="GtkBox" id="box_worm_1">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkLabel" id="controls_label_1">
+                  <object class="GtkLabel">
                     <property name="label" translatable="yes">Controls</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -70,7 +71,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkSeparator" id="separator_1">
+                  <object class="GtkSeparator">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">horizontal</property>
@@ -80,14 +81,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="color_grid_1">
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="row_spacing">0</property>
                     <property name="column_spacing">12</property>
                     <property name="border_width">0</property>
                     <child>
-                      <object class="GtkLabel" id="color_label_1">
+                      <object class="GtkLabel">
                         <property name="label" translatable="yes">Worm color</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -118,7 +119,7 @@
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label_worm_1">
+              <object class="GtkLabel">
                 <property name="use-underline">True</property>
                 <property name="label" translatable="yes">Worm _1</property>
                 <property name="visible">True</property>
@@ -129,14 +130,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box_worm_2">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkLabel" id="controls_label_2">
+                  <object class="GtkLabel">
                     <property name="label" translatable="yes">Controls</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -165,7 +166,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkSeparator" id="separator_2">
+                  <object class="GtkSeparator">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">horizontal</property>
@@ -175,14 +176,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="color_grid_2">
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="row_spacing">0</property>
                     <property name="column_spacing">12</property>
                     <property name="border_width">0</property>
                     <child>
-                      <object class="GtkLabel" id="color_label_2">
+                      <object class="GtkLabel">
                         <property name="label" translatable="yes">Worm color</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -213,7 +214,7 @@
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label_worm_2">
+              <object class="GtkLabel">
                 <property name="use-underline">True</property>
                 <property name="label" translatable="yes">Worm _2</property>
                 <property name="visible">True</property>
@@ -224,14 +225,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box_worm_3">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkLabel" id="controls_label_3">
+                  <object class="GtkLabel">
                     <property name="label" translatable="yes">Controls</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -260,7 +261,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkSeparator" id="separator_3">
+                  <object class="GtkSeparator">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">horizontal</property>
@@ -270,14 +271,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="color_grid_3">
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="row_spacing">0</property>
                     <property name="column_spacing">12</property>
                     <property name="border_width">0</property>
                     <child>
-                      <object class="GtkLabel" id="color_label_3">
+                      <object class="GtkLabel">
                         <property name="label" translatable="yes">Worm color</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -308,7 +309,7 @@
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label_worm_3">
+              <object class="GtkLabel">
                 <property name="use-underline">True</property>
                 <property name="label" translatable="yes">Worm _3</property>
                 <property name="visible">True</property>
@@ -319,14 +320,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box_worm_4">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkLabel" id="controls_label_4">
+                  <object class="GtkLabel">
                     <property name="label" translatable="yes">Controls</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -355,7 +356,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkSeparator" id="separator_4">
+                  <object class="GtkSeparator">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">horizontal</property>
@@ -365,14 +366,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="color_grid_4">
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="row_spacing">0</property>
                     <property name="column_spacing">12</property>
                     <property name="border_width">0</property>
                     <child>
-                      <object class="GtkLabel" id="color_label_4">
+                      <object class="GtkLabel">
                         <property name="label" translatable="yes">Worm color</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -403,7 +404,7 @@
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label_worm_4">
+              <object class="GtkLabel">
                 <property name="use-underline">True</property>
                 <property name="label" translatable="yes">Worm _4</property>
                 <property name="visible">True</property>
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 6f0d8cf..85838eb 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -52,9 +52,7 @@ private class PreferencesDialog : Dialog
         this.worm_settings = worm_settings;
         this.window = window;
 
-        this.response.connect (() => {
-            this.destroy ();
-        });
+        this.delete_event.connect (hide_on_delete);
 
         this.set_transient_for (window);
 


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