[Xfce4-commits] r30267 - xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings

Nick Schermer nick at xfce.org
Sat Jul 11 10:35:17 CEST 2009


Author: nick
Date: 2009-07-11 08:35:17 +0000 (Sat, 11 Jul 2009)
New Revision: 30267

Modified:
   xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/Makefile.am
   xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/appearance-dialog.glade
   xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/main.c
Log:
Port appearance dialog to Gtkbuilder and 4ui.


Modified: xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/Makefile.am
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/Makefile.am	2009-07-11 08:34:59 UTC (rev 30266)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/Makefile.am	2009-07-11 08:35:17 UTC (rev 30267)
@@ -18,10 +18,7 @@
 
 xfce4_appearance_settings_CFLAGS = \
 	$(GTK_CFLAGS) \
-	$(GLIB_CFLAGS) \
-	$(GLADE_CFLAGS) \
-	$(DBUS_GLIB_CFLAGS) \
-	$(LIBXFCEGUI4_CFLAGS) \
+	$(LIBXFCE4UI_CFLAGS) \
 	$(XFCONF_CFLAGS)
 
 xfce4_appearance_settings_LDFLAGS = \
@@ -30,10 +27,7 @@
 
 xfce4_appearance_settings_LDADD = \
 	$(GTK_LIBS) \
-	$(GLIB_LIBS) \
-	$(GLADE_LIBS) \
-	$(DBUS_GLIB_LIBS) \
-	$(LIBXFCEGUI4_LIBS) \
+	$(LIBXFCE4UI_LIBS) \
 	$(XFCONF_LIBS)
 
 if MAINTAINER_MODE

Modified: xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/appearance-dialog.glade
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/appearance-dialog.glade	2009-07-11 08:34:59 UTC (rev 30266)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/appearance-dialog.glade	2009-07-11 08:35:17 UTC (rev 30267)
@@ -1,143 +1,197 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun Nov 16 15:17:35 2008 -->
-<glade-interface>
-  <requires lib="xfce4"/>
-  <widget class="XfceTitledDialog" id="appearance-settings-dialog">
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires libxfce4ui 4.5 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAdjustment" id="xft_custom_dpi">
+    <property name="value">96</property>
+    <property name="lower">48</property>
+    <property name="upper">1000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkListStore" id="liststore1">
+    <columns>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">None</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Slight</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Medium</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Full</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="liststore2">
+    <columns>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Icons</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Text</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Both</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Both Horizontal</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="xft_rgba_store">
+    <columns>
+      <!-- column-name pixbuf -->
+      <column type="GdkPixbuf"/>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="XfceTitledDialog" id="dialog">
     <property name="title" translatable="yes">Appearance</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="window_position">center-on-parent</property>
     <property name="icon_name">preferences-desktop-theme</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
     <property name="subtitle" translatable="yes">Customize the look of your desktop</property>
     <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
+      <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child>
-          <widget class="GtkNotebook" id="plug-child">
+          <object class="GtkNotebook" id="plug-child">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="border_width">6</property>
             <child>
-              <widget class="GtkScrolledWindow" id="scrolledwindow2">
+              <object class="GtkScrolledWindow" id="scrolledwindow2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="border_width">12</property>
-                <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">etched-in</property>
                 <child>
-                  <widget class="GtkTreeView" id="gtk_theme_treeview">
+                  <object class="GtkTreeView" id="gtk_theme_treeview">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="headers_visible">False</property>
                     <property name="show_expanders">False</property>
-                  </widget>
+                  </object>
                 </child>
-              </widget>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="label1">
+            <child type="tab">
+              <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">St_yle</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
               <packing>
-                <property name="type">tab</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkScrolledWindow" id="scrolledwindow1">
+              <object class="GtkScrolledWindow" id="scrolledwindow1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="border_width">12</property>
-                <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">etched-in</property>
                 <child>
-                  <widget class="GtkTreeView" id="icon_theme_treeview">
+                  <object class="GtkTreeView" id="icon_theme_treeview">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="headers_visible">False</property>
                     <property name="show_expanders">False</property>
-                  </widget>
+                  </object>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <widget class="GtkLabel" id="label2">
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">_Icons</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
               <packing>
-                <property name="type">tab</property>
                 <property name="position">1</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkVBox" id="vbox3">
+              <object class="GtkVBox" id="vbox3">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">12</property>
                 <child>
-                  <widget class="GtkFrame" id="frame3">
+                  <object class="GtkFrame" id="frame3">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment3">
+                      <object class="GtkAlignment" id="alignment3">
                         <property name="visible">True</property>
                         <property name="border_width">6</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkFontButton" id="gtk_fontname_button">
+                          <object class="GtkFontButton" id="gtk_fontname_button">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
-                            <property name="tooltip" translatable="yes">This font will be used as the default font used when drawing user interface text</property>
-                            <property name="response_id">0</property>
+                            <property name="tooltip_text" translatable="yes">This font will be used as the default font used when drawing user interface text</property>
                             <property name="title" translatable="yes">Select a default font</property>
-                          </widget>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label7">
+                    <child type="label">
+                      <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Default Fon_t</b></property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Default Fon_t</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">gtk_fontname_button</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkFrame" id="frame4">
+                  <object class="GtkFrame" id="frame4">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment4">
+                      <object class="GtkAlignment" id="alignment4">
                         <property name="visible">True</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkTable" id="table1">
+                          <object class="GtkTable" id="table1">
                             <property name="visible">True</property>
                             <property name="border_width">6</property>
                             <property name="n_rows">3</property>
@@ -145,11 +199,17 @@
                             <property name="column_spacing">12</property>
                             <property name="row_spacing">6</property>
                             <child>
-                              <widget class="GtkComboBox" id="xft_hinting_style_combo_box">
+                              <object class="GtkComboBox" id="xft_hinting_style_combo_box">
                                 <property name="visible">True</property>
-                                <property name="tooltip" translatable="yes">Many fonts contain information that provides extra hints as to how best draw the font; pick whichever looks best according to personal preference</property>
-                                <property name="items" translatable="yes"></property>
-                              </widget>
+                                <property name="tooltip_text" translatable="yes">Many fonts contain information that provides extra hints as to how best draw the font; pick whichever looks best according to personal preference</property>
+                                <property name="model">liststore1</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                                  <attributes>
+                                    <attribute name="text">0</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
@@ -158,11 +218,23 @@
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkComboBox" id="xft_rgba_combo_box">
+                              <object class="GtkComboBox" id="xft_rgba_combo_box">
                                 <property name="visible">True</property>
-                                <property name="tooltip" translatable="yes">Font quality on a TFT or LCD screen can be greatly improved by choosing the correct sub-pixel order of the screen</property>
-                                <property name="items" translatable="yes"></property>
-                              </widget>
+                                <property name="tooltip_text" translatable="yes">Font quality on a TFT or LCD screen can be greatly improved by choosing the correct sub-pixel order of the screen</property>
+                                <property name="model">xft_rgba_store</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                                  <attributes>
+                                    <attribute name="text">1</attribute>
+                                  </attributes>
+                                </child>
+                                <child>
+                                  <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
+                                  <attributes>
+                                    <attribute name="pixbuf">0</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
@@ -171,13 +243,13 @@
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkLabel" id="label11">
+                              <object class="GtkLabel" id="label11">
                                 <property name="visible">True</property>
                                 <property name="xalign">1</property>
                                 <property name="label" translatable="yes">Sub-_pixel order:</property>
                                 <property name="use_underline">True</property>
                                 <property name="mnemonic_widget">xft_rgba_combo_box</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="top_attach">2</property>
                                 <property name="bottom_attach">3</property>
@@ -185,13 +257,13 @@
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkLabel" id="label10">
+                              <object class="GtkLabel" id="label10">
                                 <property name="visible">True</property>
                                 <property name="xalign">1</property>
                                 <property name="label" translatable="yes">_Hinting:</property>
                                 <property name="use_underline">True</property>
                                 <property name="mnemonic_widget">xft_hinting_style_combo_box</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
@@ -199,339 +271,356 @@
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkCheckButton" id="xft_antialias_check_button">
+                              <object class="GtkCheckButton" id="xft_antialias_check_button">
+                                <property name="label" translatable="yes">Enable _anti-aliasing</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Anti-aliasing, or font smoothing, can improve the look of text on the screen</property>
-                                <property name="label" translatable="yes">Enable _anti-aliasing</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Anti-aliasing, or font smoothing, can improve the look of text on the screen</property>
                                 <property name="use_underline">True</property>
                                 <property name="active">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="right_attach">2</property>
                               </packing>
                             </child>
-                          </widget>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label8">
+                    <child type="label">
+                      <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Rendering</b></property>
-                        <property name="use_markup">True</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <property name="label" translatable="yes">Rendering</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkFrame" id="frame5">
+                  <object class="GtkFrame" id="frame5">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment5">
+                      <object class="GtkAlignment" id="alignment5">
                         <property name="visible">True</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkHBox" id="hbox1">
+                          <object class="GtkHBox" id="hbox1">
                             <property name="visible">True</property>
                             <property name="border_width">6</property>
                             <property name="spacing">12</property>
                             <child>
-                              <widget class="GtkCheckButton" id="xft_custom_dpi_check_button">
+                              <object class="GtkCheckButton" id="xft_custom_dpi_check_button">
+                                <property name="label" translatable="yes">Custom _DPI setting:</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Override the detected monitor resolution if fonts look too large or too small</property>
-                                <property name="label" translatable="yes">Custom _DPI setting:</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Override the detected monitor resolution if fonts look too large or too small</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                                <property name="active">False</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkSpinButton" id="xft_custom_dpi_spin_button">
+                              <object class="GtkSpinButton" id="xft_custom_dpi_spin_button">
                                 <property name="visible">True</property>
+                                <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">96 48 1000 1 10 0</property>
+                                <property name="adjustment">xft_custom_dpi</property>
                                 <property name="snap_to_ticks">True</property>
                                 <property name="numeric">True</property>
-                                <property name="update_policy">GTK_UPDATE_IF_VALID</property>
-                                <property name="sensitive">False</property>
-                              </widget>
+                                <property name="update_policy">if-valid</property>
+                              </object>
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
-                          </widget>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label9">
+                    <child type="label">
+                      <object class="GtkLabel" id="label9">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>DPI</b></property>
-                        <property name="use_markup">True</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <property name="label" translatable="yes">DPI</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="position">2</property>
               </packing>
             </child>
-            <child>
-              <widget class="GtkLabel" id="label3">
+            <child type="tab">
+              <object class="GtkLabel" id="label3">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">_Fonts</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
               <packing>
-                <property name="type">tab</property>
                 <property name="position">2</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkVBox" id="vbox1">
+              <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
-                  <widget class="GtkFrame" id="frame2">
+                  <object class="GtkFrame" id="frame2">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment2">
+                      <object class="GtkAlignment" id="alignment2">
                         <property name="visible">True</property>
                         <property name="border_width">6</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkComboBox" id="gtk_toolbar_style_combo_box">
+                          <object class="GtkComboBox" id="gtk_toolbar_style_combo_box">
                             <property name="visible">True</property>
-                            <property name="tooltip" translatable="yes">Specify what should be displayed in toolbar items</property>
-                            <property name="items" translatable="yes"></property>
-                          </widget>
+                            <property name="tooltip_text" translatable="yes">Specify what should be displayed in toolbar items</property>
+                            <property name="model">liststore2</property>
+                            <child>
+                              <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label6">
+                    <child type="label">
+                      <object class="GtkLabel" id="label6">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>_Toolbar Style</b></property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">_Toolbar Style</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">gtk_toolbar_style_combo_box</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkFrame" id="frame1">
+                  <object class="GtkFrame" id="frame1">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment1">
+                      <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkVBox" id="vbox2">
+                          <object class="GtkVBox" id="vbox2">
                             <property name="visible">True</property>
                             <property name="border_width">6</property>
+                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
-                              <widget class="GtkCheckButton" id="gtk_button_images_check_button">
+                              <object class="GtkCheckButton" id="gtk_button_images_check_button">
+                                <property name="label" translatable="yes">Show images on _buttons</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Specify whether icons should be displayed next to text in buttons</property>
-                                <property name="label" translatable="yes">Show images on _buttons</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Specify whether icons should be displayed next to text in buttons</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
+                              <packing>
+                                <property name="position">0</property>
+                              </packing>
                             </child>
                             <child>
-                              <widget class="GtkCheckButton" id="gtk_menu_images_check_button">
+                              <object class="GtkCheckButton" id="gtk_menu_images_check_button">
+                                <property name="label" translatable="yes">Show images in _menus</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Specify whether icons should be displayed next to items in menus</property>
-                                <property name="label" translatable="yes">Show images in _menus</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Specify whether icons should be displayed next to items in menus</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkCheckButton" id="gtk_caneditaccels_check_button">
+                              <object class="GtkCheckButton" id="gtk_caneditaccels_check_button">
+                                <property name="label" translatable="yes">Enable e_ditable accelerators</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">If selected, keyboard shortcuts for menu items can be changed by hovering the mouse over the menu item and pressing the new key combination for the shortcut</property>
-                                <property name="label" translatable="yes">Enable e_ditable accelerators</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">If selected, keyboard shortcuts for menu items can be changed by hovering the mouse over the menu item and pressing the new key combination for the shortcut</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="position">2</property>
                               </packing>
                             </child>
-                          </widget>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label5">
+                    <child type="label">
+                      <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Menus and Buttons</b></property>
-                        <property name="use_markup">True</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <property name="label" translatable="yes">Menus and Buttons</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkFrame" id="event_sounds_frame">
+                  <object class="GtkFrame" id="event_sounds_frame">
                     <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment6">
+                      <object class="GtkAlignment" id="alignment6">
                         <property name="visible">True</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <widget class="GtkVBox" id="vbox1">
+                          <object class="GtkVBox" id="vbox4">
                             <property name="visible">True</property>
                             <property name="border_width">6</property>
+                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
-                              <widget class="GtkCheckButton" id="enable_event_sounds_check_button">
+                              <object class="GtkCheckButton" id="enable_event_sounds_check_button">
+                                <property name="label" translatable="yes">Enable _event sounds</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Enable or disable event sounds globally (requires "Canberra" support)</property>
-                                <property name="label" translatable="yes">Enable _event sounds</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Enable or disable event sounds globally (requires "Canberra" support)</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
+                              <packing>
+                                <property name="position">0</property>
+                              </packing>
                             </child>
                             <child>
-                              <widget class="GtkCheckButton" id="enable_input_feedback_sounds_button">
+                              <object class="GtkCheckButton" id="enable_input_feedback_sounds_button">
+                                <property name="label" translatable="yes">Enable i_nput feedback sounds</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip" translatable="yes">Specify whether mouse clicks and other user input will cause event sounds to play</property>
-                                <property name="label" translatable="yes">Enable i_nput feedback sounds</property>
+                                <property name="receives_default">False</property>
+                                <property name="tooltip_text" translatable="yes">Specify whether mouse clicks and other user input will cause event sounds to play</property>
                                 <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
                                 <property name="draw_indicator">True</property>
-                              </widget>
+                              </object>
                               <packing>
                                 <property name="position">3</property>
                               </packing>
                             </child>
-                          </widget>
+                          </object>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                    <child>
-                      <widget class="GtkLabel" id="label4">
+                    <child type="label">
+                      <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Event sounds</b></property>
-                        <property name="use_markup">True</property>
-                      </widget>
-                      <packing>
-                        <property name="type">label_item</property>
-                      </packing>
+                        <property name="label" translatable="yes">Event sounds</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="position">2</property>
                   </packing>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="position">3</property>
               </packing>
             </child>
-            <child>
-              <widget class="GtkLabel" id="label12">
+            <child type="tab">
+              <object class="GtkLabel" id="label12">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">_Settings</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
               <packing>
-                <property name="type">tab</property>
                 <property name="position">3</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
-          </widget>
+          </object>
           <packing>
             <property name="position">1</property>
           </packing>
         </child>
         <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
             <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <property name="layout_style">end</property>
             <child>
-              <widget class="GtkButton" id="button1">
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-close</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="label">gtk-close</property>
                 <property name="use_stock">True</property>
-                <property name="response_id">0</property>
-              </widget>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
             </child>
-          </widget>
+          </object>
           <packing>
             <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
-      </widget>
+      </object>
     </child>
-  </widget>
-</glade-interface>
+    <action-widgets>
+      <action-widget response="0">button1</action-widget>
+    </action-widgets>
+  </object>
+</interface>

Modified: xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/main.c
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/main.c	2009-07-11 08:34:59 UTC (rev 30266)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/appearance-settings/main.c	2009-07-11 08:35:17 UTC (rev 30267)
@@ -31,9 +31,8 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <glade/glade.h>
 
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4util/libxfce4util.h>
 #include <xfconf/xfconf.h>
 
@@ -96,20 +95,20 @@
 static int
 compute_xsettings_dpi (GtkWidget *widget)
 {
-    Screen *xscreen;
+    GdkScreen *screen;
     int width_mm, height_mm;
     int width, height;
     int dpi;
-    
-    xscreen = GDK_SCREEN_XSCREEN (gtk_widget_get_screen (widget));
-    width_mm = WidthMMOfScreen (xscreen);
-    height_mm = HeightMMOfScreen (xscreen);
+
+    screen = gtk_widget_get_screen (widget);
+    width_mm = gdk_screen_get_width_mm (screen);
+    height_mm = gdk_screen_get_height_mm (screen);
     dpi = FALLBACK_DPI;
-    
+
     if (width_mm > 0 && height_mm > 0)
     {
-        width = WidthOfScreen (xscreen);
-        height = HeightOfScreen (xscreen);
+        width = gdk_screen_get_width (screen);
+        height = gdk_screen_get_height (screen);
         dpi = MIN (INCH_MM * width  / width_mm,
                    INCH_MM * height / height_mm);
     }
@@ -502,15 +501,16 @@
 appearance_settings_dialog_channel_property_changed (XfconfChannel *channel,
                                                      const gchar   *property_name,
                                                      const GValue  *value,
-                                                     GladeXML      *gxml)
+                                                     GtkBuilder    *builder)
 {
-    GtkWidget    *widget, *spin;
+    GObject      *object;
     gchar        *str;
     guint         i;
-    gint          antialias;
+    gint          antialias, dpi, custom_dpi;
     GtkTreeModel *model;
 
     g_return_if_fail (property_name != NULL);
+    g_return_if_fail (GTK_IS_BUILDER (builder));
 
     if (strcmp (property_name, "/Xft/RGBA") == 0)
     {
@@ -519,8 +519,8 @@
         {
             if (strcmp (str, xft_rgba_array[i]) == 0)
             {
-                widget = glade_xml_get_widget (gxml, "xft_rgba_combo_box");
-                gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i);
+                object = gtk_builder_get_object (builder, "xft_rgba_combo_box");
+                gtk_combo_box_set_active (GTK_COMBO_BOX (object), i);
                 break;
             }
         }
@@ -533,8 +533,8 @@
         {
             if (strcmp (str, toolbar_styles_array[i]) == 0)
             {
-                widget = glade_xml_get_widget (gxml, "gtk_toolbar_style_combo_box");
-                gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i);
+                object = gtk_builder_get_object (builder, "gtk_toolbar_style_combo_box");
+                gtk_combo_box_set_active (GTK_COMBO_BOX (object), i);
                 break;
             }
         }
@@ -547,8 +547,8 @@
         {
             if (strcmp (str, xft_hint_styles_array[i]) == 0)
             {
-                widget = glade_xml_get_widget (gxml, "xft_hinting_style_combo_box");
-                gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i);
+                object = gtk_builder_get_object (builder, "xft_hinting_style_combo_box");
+                gtk_combo_box_set_active (GTK_COMBO_BOX (object), i);
                 break;
             }
         }
@@ -556,268 +556,209 @@
     }
     else if (strcmp (property_name, "/Xft/Antialias") == 0)
     {
-        widget = glade_xml_get_widget (gxml, "xft_antialias_check_button");
+        object = gtk_builder_get_object (builder, "xft_antialias_check_button");
         antialias = xfconf_channel_get_int (xsettings_channel, property_name, -1);
         switch (antialias)
         {
             case 1:
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (object), TRUE);
                 break;
 
             case 0:
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (object), FALSE);
                 break;
 
             default: /* -1 */
-                gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (widget), TRUE);
+                gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (object), TRUE);
                 break;
         }
     }
     else if (strcmp (property_name, "/Xft/DPI") == 0)
     {
         /* The DPI has changed, so get its value and the last known custom value */
-        gint dpi = xfconf_channel_get_int (xsettings_channel, property_name, FALLBACK_DPI);
-        gint custom_dpi = xfconf_channel_get_int (xsettings_channel, "/Xfce/LastCustomDPI", -1);
-          
+        dpi = xfconf_channel_get_int (xsettings_channel, property_name, FALLBACK_DPI);
+        custom_dpi = xfconf_channel_get_int (xsettings_channel, "/Xfce/LastCustomDPI", -1);
+
         /* Activate the check button if we're using a custom DPI */
-        widget = glade_xml_get_widget (gxml, "xft_custom_dpi_check_button");
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), dpi >= 0);
+        object = gtk_builder_get_object (builder, "xft_custom_dpi_check_button");
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (object), dpi >= 0);
 
         /* If we're not using a custom DPI, compute the future custom DPI automatically */
         if (custom_dpi == -1)
-            custom_dpi = compute_xsettings_dpi (widget);
+            custom_dpi = compute_xsettings_dpi (GTK_WIDGET (object));
 
-        spin = glade_xml_get_widget (gxml, "xft_custom_dpi_spin_button");
+        object = gtk_builder_get_object (builder, "xft_custom_dpi_spin_button");
 
         if (dpi > 0)
         {
             /* We're using a custom DPI, so use the current DPI setting for the spin value */
-            gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), dpi);
+            gtk_spin_button_set_value (GTK_SPIN_BUTTON (object), dpi);
         }
         else
         {
             /* Set the spin button value to the last custom DPI */
-            gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), custom_dpi);
+            gtk_spin_button_set_value (GTK_SPIN_BUTTON (object), custom_dpi);
         }
     }
     else if (strcmp (property_name, "/Net/ThemeName") == 0)
     {
-        widget = glade_xml_get_widget (gxml, "gtk_theme_treeview");
-        model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+        object = gtk_builder_get_object (builder, "gtk_theme_treeview");
+        model = gtk_tree_view_get_model (GTK_TREE_VIEW (object));
         gtk_list_store_clear (GTK_LIST_STORE (model));
-        appearance_settings_load_ui_themes (GTK_LIST_STORE (model), GTK_TREE_VIEW (widget));
+        appearance_settings_load_ui_themes (GTK_LIST_STORE (model), GTK_TREE_VIEW (object));
     }
     else if (strcmp (property_name, "/Net/IconThemeName") == 0)
     {
-        widget = glade_xml_get_widget (gxml, "icon_theme_treeview");
-        model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+        object = gtk_builder_get_object (builder, "icon_theme_treeview");
+        model = gtk_tree_view_get_model (GTK_TREE_VIEW (object));
         gtk_list_store_clear (GTK_LIST_STORE (model));
-        appearance_settings_load_icon_themes (GTK_LIST_STORE (model), GTK_TREE_VIEW (widget));
+        appearance_settings_load_icon_themes (GTK_LIST_STORE (model), GTK_TREE_VIEW (object));
     }
 }
 
 static void
-appearance_settings_dialog_configure_widgets (GladeXML *gxml)
+appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
 {
+    GObject          *object, *object2;
     GtkListStore     *list_store;
     GtkCellRenderer  *renderer;
-    GtkTreeSelection *icon_selection, *ui_selection;
     GdkPixbuf        *pixbuf;
-    GtkWidget *ui_theme_treeview;
-    GtkWidget *rgba_combo_box;
-    GtkWidget *caneditaccels_check_button;
-    GtkWidget *menu_images_check_button;
-    GtkWidget *button_images_check_button;
-    GtkWidget *fontname_button;
-    GtkWidget *icon_theme_treeview;
-    GtkWidget *toolbar_style_combo;
-    GtkWidget *antialias_check_button;
-    GtkWidget *custom_dpi_check;
-    GtkWidget *custom_dpi_spin;
-#ifdef ENABLE_SOUND_SETTINGS
-    GtkWidget *event_sounds_frame;
-    GtkWidget *enable_event_sounds_check_button;
-    GtkWidget *enable_input_feedback_sounds_button;
-#endif
-    GtkWidget *hinting_style_combo;
+    GtkTreeSelection *selection;
 
     /* Icon themes list */
-    icon_theme_treeview = glade_xml_get_widget (gxml, "icon_theme_treeview");
+    object = gtk_builder_get_object (builder, "icon_theme_treeview");
 
     list_store = gtk_list_store_new (N_THEME_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
     gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list_store), COLUMN_THEME_DISPLAY_NAME, GTK_SORT_ASCENDING);
-    gtk_tree_view_set_model (GTK_TREE_VIEW (icon_theme_treeview), GTK_TREE_MODEL (list_store));
-#if GTK_CHECK_VERSION (2, 12, 0)
-    gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (icon_theme_treeview), COLUMN_THEME_COMMENT);
-#endif
+    gtk_tree_view_set_model (GTK_TREE_VIEW (object), GTK_TREE_MODEL (list_store));
+    gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (object), COLUMN_THEME_COMMENT);
 
     renderer = gtk_cell_renderer_text_new ();
-    gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (icon_theme_treeview), 0, "", renderer, "text", COLUMN_THEME_DISPLAY_NAME, NULL);
+    gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (object), 0, "", renderer, "text", COLUMN_THEME_DISPLAY_NAME, NULL);
 
-    appearance_settings_load_icon_themes (list_store, GTK_TREE_VIEW (icon_theme_treeview));
+    appearance_settings_load_icon_themes (list_store, GTK_TREE_VIEW (object));
 
     g_object_unref (G_OBJECT (list_store));
 
-    icon_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (icon_theme_treeview));
-    gtk_tree_selection_set_mode (icon_selection, GTK_SELECTION_SINGLE);
-    g_signal_connect (G_OBJECT (icon_selection), "changed", G_CALLBACK (cb_icon_theme_tree_selection_changed), NULL);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (object));
+    gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+    g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_icon_theme_tree_selection_changed), NULL);
 
     /* Gtk (UI) themes */
-    ui_theme_treeview = glade_xml_get_widget (gxml, "gtk_theme_treeview");
+    object = gtk_builder_get_object (builder, "gtk_theme_treeview");
 
     list_store = gtk_list_store_new (N_THEME_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
     gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list_store), COLUMN_THEME_DISPLAY_NAME, GTK_SORT_ASCENDING);
-    gtk_tree_view_set_model (GTK_TREE_VIEW (ui_theme_treeview), GTK_TREE_MODEL (list_store));
-#if GTK_CHECK_VERSION (2, 12, 0)
-    gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (ui_theme_treeview), COLUMN_THEME_COMMENT);
-#endif
+    gtk_tree_view_set_model (GTK_TREE_VIEW (object), GTK_TREE_MODEL (list_store));
+    gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (object), COLUMN_THEME_COMMENT);
 
     renderer = gtk_cell_renderer_text_new();
-    gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui_theme_treeview), 0, "", renderer, "text", COLUMN_THEME_DISPLAY_NAME, NULL);
+    gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (object), 0, "", renderer, "text", COLUMN_THEME_DISPLAY_NAME, NULL);
 
-    appearance_settings_load_ui_themes (list_store, GTK_TREE_VIEW (ui_theme_treeview));
+    appearance_settings_load_ui_themes (list_store, GTK_TREE_VIEW (object));
 
     g_object_unref (G_OBJECT (list_store));
 
-    ui_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui_theme_treeview));
-    gtk_tree_selection_set_mode (ui_selection, GTK_SELECTION_SINGLE);
-    g_signal_connect (G_OBJECT (ui_selection), "changed", G_CALLBACK (cb_ui_theme_tree_selection_changed), NULL);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (object));
+    gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+    g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (cb_ui_theme_tree_selection_changed), NULL);
 
     /* Subpixel (rgba) hinting Combo */
-    rgba_combo_box = glade_xml_get_widget (gxml, "xft_rgba_combo_box");
+    object = gtk_builder_get_object (builder, "xft_rgba_store");
 
-    list_store = gtk_list_store_new (N_RGBA_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
-
     pixbuf = gdk_pixbuf_new_from_xpm_data (rgba_image_none_xpm);
-    gtk_list_store_insert_with_values (list_store, NULL, 0, COLUMN_RGBA_PIXBUF, pixbuf, COLUMN_RGBA_NAME, _("None"), -1);
+    gtk_list_store_insert_with_values (GTK_LIST_STORE (object), NULL, 0, 0, pixbuf, 1, _("None"), -1);
     g_object_unref (G_OBJECT (pixbuf));
 
     pixbuf = gdk_pixbuf_new_from_xpm_data (rgba_image_rgb_xpm);
-    gtk_list_store_insert_with_values (list_store, NULL, 1, COLUMN_RGBA_PIXBUF, pixbuf, COLUMN_RGBA_NAME, _("RGB"), -1);
+    gtk_list_store_insert_with_values (GTK_LIST_STORE (object), NULL, 1, 0, pixbuf, 1, _("RGB"), -1);
     g_object_unref (G_OBJECT (pixbuf));
 
     pixbuf = gdk_pixbuf_new_from_xpm_data (rgba_image_bgr_xpm);
-    gtk_list_store_insert_with_values (list_store, NULL, 2, COLUMN_RGBA_PIXBUF, pixbuf, COLUMN_RGBA_NAME, _("BGR"), -1);
+    gtk_list_store_insert_with_values (GTK_LIST_STORE (object), NULL, 2, 0, pixbuf, 1, _("BGR"), -1);
     g_object_unref (G_OBJECT (pixbuf));
 
     pixbuf = gdk_pixbuf_new_from_xpm_data (rgba_image_vrgb_xpm);
-    gtk_list_store_insert_with_values (list_store, NULL, 3, COLUMN_RGBA_PIXBUF, pixbuf, COLUMN_RGBA_NAME, _("Vertical RGB"), -1);
+    gtk_list_store_insert_with_values (GTK_LIST_STORE (object), NULL, 3, 0, pixbuf, 1, _("Vertical RGB"), -1);
     g_object_unref (G_OBJECT (pixbuf));
 
     pixbuf = gdk_pixbuf_new_from_xpm_data (rgba_image_vbgr_xpm);
-    gtk_list_store_insert_with_values (list_store, NULL, 4, COLUMN_RGBA_PIXBUF, pixbuf, COLUMN_RGBA_NAME, _("Vertical BGR"), -1);
+    gtk_list_store_insert_with_values (GTK_LIST_STORE (object), NULL, 4, 0, pixbuf, 1, _("Vertical BGR"), -1);
     g_object_unref (G_OBJECT (pixbuf));
 
-    renderer = gtk_cell_renderer_pixbuf_new ();
-    gtk_cell_layout_clear (GTK_CELL_LAYOUT (rgba_combo_box));
-    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (rgba_combo_box), renderer, FALSE);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (rgba_combo_box), renderer, "pixbuf", COLUMN_RGBA_PIXBUF);
+    object = gtk_builder_get_object (builder, "xft_rgba_combo_box");
+    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/RGBA", NULL, builder);
+    g_signal_connect (G_OBJECT (object), "changed", G_CALLBACK (cb_rgba_style_combo_changed), NULL);
 
-    renderer = gtk_cell_renderer_text_new ();
-    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (rgba_combo_box), renderer, TRUE);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (rgba_combo_box), renderer, "text", COLUMN_RGBA_NAME);
-
-    gtk_combo_box_set_model (GTK_COMBO_BOX (rgba_combo_box), GTK_TREE_MODEL (list_store));
-    g_object_unref (G_OBJECT (list_store));
-    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/RGBA", NULL, gxml);
-    g_signal_connect (G_OBJECT (rgba_combo_box), "changed", G_CALLBACK (cb_rgba_style_combo_changed), NULL);
-
     /* Enable editable menu accelerators */
-    caneditaccels_check_button = glade_xml_get_widget (gxml, "gtk_caneditaccels_check_button");
+    object = gtk_builder_get_object (builder, "gtk_caneditaccels_check_button");
     xfconf_g_property_bind (xsettings_channel, "/Gtk/CanChangeAccels", G_TYPE_BOOLEAN,
-                            G_OBJECT (caneditaccels_check_button), "active");
+                            G_OBJECT (object), "active");
 
     /* Show menu images */
-    menu_images_check_button = glade_xml_get_widget (gxml, "gtk_menu_images_check_button");
+    object = gtk_builder_get_object (builder, "gtk_menu_images_check_button");
     xfconf_g_property_bind (xsettings_channel, "/Gtk/MenuImages", G_TYPE_BOOLEAN,
-                            G_OBJECT (menu_images_check_button), "active");
+                            G_OBJECT (object), "active");
 
     /* Show button images */
-    button_images_check_button = glade_xml_get_widget (gxml, "gtk_button_images_check_button");
+    object = gtk_builder_get_object (builder, "gtk_button_images_check_button");
     xfconf_g_property_bind (xsettings_channel, "/Gtk/ButtonImages", G_TYPE_BOOLEAN,
-                            G_OBJECT (button_images_check_button), "active");
+                            G_OBJECT (object), "active");
 
     /* Font name */
-    fontname_button = glade_xml_get_widget (gxml, "gtk_fontname_button");
+    object = gtk_builder_get_object (builder, "gtk_fontname_button");
     xfconf_g_property_bind (xsettings_channel,  "/Gtk/FontName", G_TYPE_STRING,
-                            G_OBJECT (fontname_button), "font-name");
+                            G_OBJECT (object), "font-name");
 
     /* Toolbar style */
-    toolbar_style_combo = glade_xml_get_widget (gxml, "gtk_toolbar_style_combo_box");
+    object = gtk_builder_get_object (builder, "gtk_toolbar_style_combo_box");
+    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Gtk/ToolbarStyle", NULL, builder);
+    g_signal_connect (G_OBJECT (object), "changed", G_CALLBACK(cb_toolbar_style_combo_changed), NULL);
 
-    list_store = gtk_list_store_new (1, G_TYPE_STRING);
-    gtk_list_store_insert_with_values (list_store, NULL, 0, 0, _("Icons"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 1, 0, _("Text"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 2, 0, _("Both"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 3, 0, _("Both Horizontal"), -1);
-
-    renderer = gtk_cell_renderer_text_new ();
-    gtk_cell_layout_clear (GTK_CELL_LAYOUT (toolbar_style_combo));
-    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (toolbar_style_combo), renderer, TRUE);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (toolbar_style_combo), renderer, "text", 0);
-    gtk_combo_box_set_model (GTK_COMBO_BOX (toolbar_style_combo), GTK_TREE_MODEL (list_store));
-    g_object_unref (G_OBJECT (list_store));
-    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Gtk/ToolbarStyle", NULL, gxml);
-    g_signal_connect (G_OBJECT (toolbar_style_combo), "changed", G_CALLBACK(cb_toolbar_style_combo_changed), NULL);
-
     /* Hinting style */
-    hinting_style_combo = glade_xml_get_widget (gxml, "xft_hinting_style_combo_box");
+    object = gtk_builder_get_object (builder, "xft_hinting_style_combo_box");
+    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/HintStyle", NULL, builder);
+    g_signal_connect (G_OBJECT (object), "changed", G_CALLBACK (cb_hinting_style_combo_changed), NULL);
 
-    list_store = gtk_list_store_new (1, G_TYPE_STRING);
-    gtk_list_store_insert_with_values (list_store, NULL, 0, 0, _("None"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 1, 0, _("Slight"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 2, 0, _("Medium"), -1);
-    gtk_list_store_insert_with_values (list_store, NULL, 3, 0, _("Full"), -1);
-
-    renderer = gtk_cell_renderer_text_new ();
-    gtk_cell_layout_clear (GTK_CELL_LAYOUT (hinting_style_combo));
-    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (hinting_style_combo), renderer, TRUE);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (hinting_style_combo), renderer, "text", 0);
-    gtk_combo_box_set_model (GTK_COMBO_BOX (hinting_style_combo), GTK_TREE_MODEL (list_store));
-    g_object_unref (G_OBJECT (list_store));
-    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/HintStyle", NULL, gxml);
-    g_signal_connect (G_OBJECT (hinting_style_combo), "changed", G_CALLBACK (cb_hinting_style_combo_changed), NULL);
-
     /* Hinting */
-    antialias_check_button = glade_xml_get_widget (gxml, "xft_antialias_check_button");
-    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/Antialias", NULL, gxml);
-    g_signal_connect (G_OBJECT (antialias_check_button), "toggled", G_CALLBACK (cb_antialias_check_button_toggled), NULL);
+    object = gtk_builder_get_object (builder, "xft_antialias_check_button");
+    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/Antialias", NULL, builder);
+    g_signal_connect (G_OBJECT (object), "toggled", G_CALLBACK (cb_antialias_check_button_toggled), NULL);
 
     /* DPI */
-    custom_dpi_check = glade_xml_get_widget (gxml, "xft_custom_dpi_check_button");
-    custom_dpi_spin = glade_xml_get_widget (gxml, "xft_custom_dpi_spin_button");
-    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/DPI", NULL, gxml);
-    g_signal_connect (custom_dpi_check, "toggled", G_CALLBACK (cb_custom_dpi_check_button_toggled), custom_dpi_spin);
-    g_signal_connect (custom_dpi_spin, "value-changed", G_CALLBACK (cb_custom_dpi_spin_button_changed), custom_dpi_check);
+    object = gtk_builder_get_object (builder, "xft_custom_dpi_check_button");
+    object2 = gtk_builder_get_object (builder, "xft_custom_dpi_spin_button");
+    appearance_settings_dialog_channel_property_changed (xsettings_channel, "/Xft/DPI", NULL, builder);
+    g_signal_connect (G_OBJECT (object), "toggled", G_CALLBACK (cb_custom_dpi_check_button_toggled), object2);
+    g_signal_connect (G_OBJECT (object2), "value-changed", G_CALLBACK (cb_custom_dpi_spin_button_changed), object);
 
 #ifdef ENABLE_SOUND_SETTINGS
     /* Sounds */
-    event_sounds_frame = glade_xml_get_widget (gxml, "event_sounds_frame");
-    enable_event_sounds_check_button = glade_xml_get_widget (gxml, "enable_event_sounds_check_button");
-    enable_input_feedback_sounds_button  = glade_xml_get_widget (gxml, "enable_input_feedback_sounds_button");
+    object = gtk_builder_get_object (builder, "event_sounds_frame");
+    gtk_widget_show (GTK_WIDGET (object));
 
-    gtk_widget_show (event_sounds_frame);
-    g_signal_connect (G_OBJECT (enable_event_sounds_check_button),
-                      "toggled",
-                      G_CALLBACK (cb_enable_event_sounds_check_button_toggled),
-                      enable_input_feedback_sounds_button);
+    object = gtk_builder_get_object (builder, "enable_event_sounds_check_button");
+    object2  = gtk_builder_get_object (builder, "enable_input_feedback_sounds_button");
+
+    g_signal_connect (G_OBJECT (object), "toggled",
+                      G_CALLBACK (cb_enable_event_sounds_check_button_toggled), object2);
+
     xfconf_g_property_bind (xsettings_channel, "/Net/EnableEventSounds", G_TYPE_BOOLEAN,
-                            G_OBJECT (enable_event_sounds_check_button), "active");
+                            G_OBJECT (object), "active");
     xfconf_g_property_bind (xsettings_channel, "/Net/EnableInputFeedbackSounds", G_TYPE_BOOLEAN,
-                            G_OBJECT (enable_input_feedback_sounds_button), "active");
-    gtk_widget_set_sensitive (GTK_BUTTON (enable_input_feedback_sounds_button),
-                              gtk_toggle_button_get_active (enable_event_sounds_check_button));
+                            G_OBJECT (object2), "active");
+
+    gtk_widget_set_sensitive (GTK_WIDGET (object), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (object2)));
 #endif
 }
 
 gint
 main(gint argc, gchar **argv)
 {
-    GtkWidget *dialog;
-    GtkWidget *plug;
-    GtkWidget *plug_child;
-    GladeXML  *gxml;
-    GError    *error = NULL;
+    GObject    *dialog, *plug_child;
+    GtkWidget  *plug;
+    GtkBuilder *builder;
+    GError     *error = NULL;
 
     /* setup translation domain */
     xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
@@ -847,7 +788,7 @@
     if (G_UNLIKELY (opt_version))
     {
         g_print ("%s %s (Xfce %s)\n\n", G_LOG_DOMAIN, PACKAGE_VERSION, xfce_version_string ());
-        g_print ("%s\n", "Copyright (c) 2004-2008");
+        g_print ("%s\n", "Copyright (c) 2004-2009");
         g_print ("\t%s\n\n", _("The Xfce development team. All rights reserved."));
         g_print (_("Please report bugs to <%s>."), PACKAGE_BUGREPORT);
         g_print ("\n");
@@ -869,26 +810,28 @@
     xsettings_channel = xfconf_channel_new ("xsettings");
     if (G_LIKELY (xsettings_channel))
     {
-        /* load the dialog glade xml */
-        gxml = glade_xml_new_from_buffer (appearance_dialog_glade, appearance_dialog_glade_length, NULL, NULL);
-        if (G_LIKELY (gxml))
-        {
+        /* hook to make sure the libxfce4ui library is linked */
+        if (xfce_titled_dialog_get_type () == 0)
+            return EXIT_FAILURE;
+
+        /* load the glade interface */
+        builder = gtk_builder_new ();
+        if (gtk_builder_add_from_string (builder, appearance_dialog_glade,
+                                         appearance_dialog_glade_length, &error) != 0)
+          {
             /* connect signal to monitor the channel */
-            g_signal_connect (G_OBJECT (xsettings_channel), "property-changed", 
-                              G_CALLBACK (appearance_settings_dialog_channel_property_changed), gxml);
+            g_signal_connect (G_OBJECT (xsettings_channel), "property-changed",
+                G_CALLBACK (appearance_settings_dialog_channel_property_changed), builder);
 
-            appearance_settings_dialog_configure_widgets (gxml);
+            appearance_settings_dialog_configure_widgets (builder);
 
             if (G_UNLIKELY (opt_socket_id == 0))
             {
                 /* build the dialog */
-                dialog = glade_xml_get_widget (gxml, "appearance-settings-dialog");
+                dialog = gtk_builder_get_object (builder, "dialog");
 
                 /* run the dialog */
                 gtk_dialog_run (GTK_DIALOG (dialog));
-
-                /* destroy the dialog */
-                gtk_widget_destroy (dialog);
             }
             else
             {
@@ -901,18 +844,23 @@
                 gdk_notify_startup_complete ();
 
                 /* Get plug child widget */
-                plug_child = glade_xml_get_widget (gxml, "plug-child");
-                gtk_widget_reparent (plug_child, plug);
-                gtk_widget_show (plug_child);
+                plug_child = gtk_builder_get_object (builder, "plug-child");
+                gtk_widget_reparent (GTK_WIDGET (plug_child), plug);
+                gtk_widget_show (GTK_WIDGET (plug_child));
 
                 /* Enter main loop */
                 gtk_main ();
             }
-
-            /* release the glade xml */
-            g_object_unref (G_OBJECT (gxml));
         }
+        else
+        {
+            g_error ("Failed to load the glade file: %s.", error->message);
+            g_error_free (error);
+        }
 
+        /* Release Builder */
+        g_object_unref (G_OBJECT (builder));
+
         /* release the channel */
         g_object_unref (G_OBJECT (xsettings_channel));
     }




More information about the Xfce4-commits mailing list