[gnome-color-manager] trivial: Contruct the GtkSizeGroup in the glade file, not in C



commit 2948c94c17ea0b223664d2ba8389528788832c41
Author: Richard Hughes <richard hughsie com>
Date:   Sun Apr 18 22:01:52 2010 +0100

    trivial: Contruct the GtkSizeGroup in the glade file, not in C

 data/gcm-prefs.ui |   49 +++++++++++++++++++++++++++++++-----------
 src/gcm-prefs.c   |   60 -----------------------------------------------------
 2 files changed, 36 insertions(+), 73 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 1b72ede..a238281 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -168,7 +168,7 @@
                                         <child>
                                           <object class="GtkHBox" id="hbox_manufacturer">
                                             <property name="visible">True</property>
-                                            <property name="spacing">6</property>
+                                            <property name="spacing">12</property>
                                             <child>
                                               <object class="GtkHBox" id="hbox21">
                                                 <property name="visible">True</property>
@@ -184,6 +184,7 @@
                                                 </child>
                                               </object>
                                               <packing>
+                                                <property name="expand">False</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
@@ -215,7 +216,7 @@
                                         <child>
                                           <object class="GtkHBox" id="hbox_model">
                                             <property name="visible">True</property>
-                                            <property name="spacing">6</property>
+                                            <property name="spacing">12</property>
                                             <child>
                                               <object class="GtkHBox" id="hbox22">
                                                 <property name="visible">True</property>
@@ -231,6 +232,7 @@
                                                 </child>
                                               </object>
                                               <packing>
+                                                <property name="expand">False</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
@@ -262,7 +264,7 @@
                                         <child>
                                           <object class="GtkHBox" id="hbox_serial">
                                             <property name="visible">True</property>
-                                            <property name="spacing">6</property>
+                                            <property name="spacing">12</property>
                                             <child>
                                               <object class="GtkHBox" id="hbox23">
                                                 <property name="visible">True</property>
@@ -278,6 +280,7 @@
                                                 </child>
                                               </object>
                                               <packing>
+                                                <property name="expand">False</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
@@ -312,7 +315,7 @@
                                             <child>
                                               <object class="GtkLabel" id="label_problems">
                                                 <property name="visible">True</property>
-                                                <property name="label">problems</property>
+                                                <property name="label">Problems</property>
                                                 <property name="selectable">True</property>
                                               </object>
                                               <packing>
@@ -718,7 +721,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_type">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox6">
                                                     <property name="visible">True</property>
@@ -770,7 +773,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_colorspace">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox39">
                                                     <property name="visible">True</property>
@@ -822,7 +825,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_datetime">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox36">
                                                     <property name="visible">True</property>
@@ -874,7 +877,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_profile_manufacturer">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox5">
                                                     <property name="visible">True</property>
@@ -926,7 +929,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_profile_model">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox34">
                                                     <property name="visible">True</property>
@@ -978,7 +981,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_vcgt">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox48">
                                                     <property name="visible">True</property>
@@ -1030,7 +1033,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_copyright">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox10">
                                                     <property name="visible">True</property>
@@ -1082,7 +1085,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_size">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox30">
                                                     <property name="visible">True</property>
@@ -1134,7 +1137,7 @@
                                             <child>
                                               <object class="GtkHBox" id="hbox_filename">
                                                 <property name="visible">True</property>
-                                                <property name="spacing">9</property>
+                                                <property name="spacing">12</property>
                                                 <child>
                                                   <object class="GtkHBox" id="hbox32">
                                                     <property name="visible">True</property>
@@ -1964,4 +1967,24 @@
       <widget name="hbox17"/>
     </widgets>
   </object>
+  <object class="GtkSizeGroup" id="sizegroup_devices">
+    <widgets>
+      <widget name="hbox21"/>
+      <widget name="hbox22"/>
+      <widget name="hbox23"/>
+    </widgets>
+  </object>
+  <object class="GtkSizeGroup" id="sizegroup_profiles">
+    <widgets>
+      <widget name="hbox6"/>
+      <widget name="hbox39"/>
+      <widget name="hbox36"/>
+      <widget name="hbox5"/>
+      <widget name="hbox34"/>
+      <widget name="hbox48"/>
+      <widget name="hbox10"/>
+      <widget name="hbox30"/>
+      <widget name="hbox32"/>
+    </widgets>
+  </object>
 </interface>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 2dd6c73..cb16cd8 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -2704,8 +2704,6 @@ main (int argc, char **argv)
 	GtkWidget *info_bar_loading_label;
 	GtkWidget *info_bar_vcgt_label;
 	GtkWidget *info_bar_profiles_label;
-	GtkSizeGroup *size_group = NULL;
-	GtkSizeGroup *size_group2 = NULL;
 	GdkScreen *screen;
 
 	const GOptionEntry options[] = {
@@ -2904,60 +2902,6 @@ main (int argc, char **argv)
 	gtk_range_set_range (GTK_RANGE (widget), 0.1f, 1.0f);
 //	gtk_scale_add_mark (GTK_SCALE (widget), 1.0f, GTK_POS_TOP, "");
 
-	/* set alignment for left */
-	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox5"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox10"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox6"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox21"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox22"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox23"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox30"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox32"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox34"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox36"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox39"));
-	gtk_size_group_add_widget (size_group, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox48"));
-	gtk_size_group_add_widget (size_group, widget);
-
-	/* set alignment for right */
-	size_group2 = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox24"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox25"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox26"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox11"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox12"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox18"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox31"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox33"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox35"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox37"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox40"));
-	gtk_size_group_add_widget (size_group2, widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox49"));
-	gtk_size_group_add_widget (size_group2, widget);
-
 	/* use a device client array */
 	gcm_client = gcm_client_new ();
 	gcm_client_set_use_threads (gcm_client, TRUE);
@@ -3085,10 +3029,6 @@ main (int argc, char **argv)
 out:
 	g_object_unref (unique_app);
 	g_main_loop_unref (loop);
-	if (size_group != NULL)
-		g_object_unref (size_group);
-	if (size_group2 != NULL)
-		g_object_unref (size_group2);
 	if (current_device != NULL)
 		g_object_unref (current_device);
 	if (colorimeter != NULL)



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