[Xfce4-commits] <xfce4-settings:xrandr-display-settings> Change the on/off radiobuttons into a checkbox

Jérôme Guelfucci noreply at xfce.org
Sun Jul 4 12:16:02 CEST 2010


Updating branch refs/heads/xrandr-display-settings
         to 9efda2563de00f9c2728451a61c73cf5c83590b2 (commit)
       from 68e0edda4a1f5308d0749c0d930922a9ad5ced3f (commit)

commit 9efda2563de00f9c2728451a61c73cf5c83590b2
Author: Lionel Le Folgoc <mrpouit at gmail.com>
Date:   Sat Jul 3 19:25:47 2010 +0200

    Change the on/off radiobuttons into a checkbox

 dialogs/display-settings/display-dialog.glade |  242 ++++++++++++-------------
 dialogs/display-settings/main.c               |   31 +---
 2 files changed, 121 insertions(+), 152 deletions(-)

diff --git a/dialogs/display-settings/display-dialog.glade b/dialogs/display-settings/display-dialog.glade
index e492f7a..e0ddf8c 100644
--- a/dialogs/display-settings/display-dialog.glade
+++ b/dialogs/display-settings/display-dialog.glade
@@ -45,148 +45,130 @@
               </packing>
             </child>
             <child>
-              <object class="GtkTable" id="table1">
+              <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
-                <property name="n_rows">5</property>
-                <property name="n_columns">2</property>
-                <property name="column_spacing">12</property>
-                <property name="row_spacing">6</property>
+                <property name="border_width">12</property>
+                <property name="spacing">12</property>
                 <child>
-                  <object class="GtkLabel" id="label-reflection">
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Ref_lection:</property>
+                  <object class="GtkCheckButton" id="output-on">
+                    <property name="label" translatable="yes">_Use this output</property>
                     <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">randr-reflection</property>
                   </object>
-                  <packing>
-                    <property name="top_attach">4</property>
-                    <property name="bottom_attach">5</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label5">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Ro_tation:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">randr-rotation</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Refresh _rate:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">randr-refresh-rate</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">R_esolution:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">randr-resolution</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkRadioButton" id="randr-on">
-                    <property name="label" translatable="yes">O_n</property>
-                    <property name="can_focus">False</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="randr-reflection"/>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">4</property>
-                    <property name="bottom_attach">5</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="randr-rotation">
-                    <property name="visible">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
                 </child>
                 <child>
-                  <object class="GtkComboBox" id="randr-refresh-rate">
+                  <object class="GtkTable" id="table1">
                     <property name="visible">True</property>
+                    <property name="n_rows">4</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label-reflection">
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Ref_lection:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">randr-reflection</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label5">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Ro_tation:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">randr-rotation</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label4">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Refresh _rate:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">randr-refresh-rate</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label3">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">R_esolution:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">randr-resolution</property>
+                      </object>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="randr-reflection"/>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="randr-rotation">
+                        <property name="visible">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="randr-refresh-rate">
+                        <property name="visible">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="randr-resolution">
+                        <property name="visible">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="randr-resolution">
-                    <property name="visible">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkRadioButton" id="randr-off">
-                    <property name="label" translatable="yes">Of_f</property>
-                    <property name="can_focus">False</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="group">randr-on</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
             </child>
           </object>
           <packing>
diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 3b92454..c6e18f1 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -854,7 +854,7 @@ display_setting_output_toggled (GtkToggleButton *togglebutton,
 static void
 display_setting_output_status_populate (GtkBuilder *builder)
 {
-    GObject *radio_on, *radio_off;
+    GObject *check;
 
     if (!xfce_randr)
         return;
@@ -862,13 +862,10 @@ display_setting_output_status_populate (GtkBuilder *builder)
     if (xfce_randr->noutput <= 1)
         return;
 
-    radio_on = gtk_builder_get_object (builder, "randr-on");
-    radio_off = gtk_builder_get_object (builder, "randr-off");
+    check = gtk_builder_get_object (builder, "output-on");
 
-    if (XFCE_RANDR_MODE (xfce_randr) != None)
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_on), TRUE);
-    else
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_off), TRUE);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
+                                  XFCE_RANDR_MODE (xfce_randr) != None);
 }
 #endif
 
@@ -1057,7 +1054,7 @@ display_settings_dialog_new (GtkBuilder *builder)
     GtkTreeSelection *selection;
     GObject          *combobox;
 #ifdef HAS_RANDR_ONE_POINT_TWO
-    GObject          *label, *radio;
+    GObject          *label, *check;
 #endif
 
     /* get the treeview */
@@ -1083,25 +1080,15 @@ display_settings_dialog_new (GtkBuilder *builder)
 #ifdef HAS_RANDR_ONE_POINT_TWO
     if (xfce_randr != NULL)
     {
-        radio = gtk_builder_get_object (builder, "randr-on");
-        if (xfce_randr->noutput > 1)
-        {
-            gtk_widget_show (GTK_WIDGET (radio));
-            g_signal_connect (G_OBJECT (radio), "toggled", G_CALLBACK (display_setting_output_toggled), builder);
-        }
-        else
-        {
-            gtk_widget_hide (GTK_WIDGET (radio));
-        }
-
-        radio = gtk_builder_get_object (builder, "randr-off");
+        check = gtk_builder_get_object (builder, "output-on");
         if (xfce_randr->noutput > 1)
         {
-            gtk_widget_show (GTK_WIDGET (radio));
+            gtk_widget_show (GTK_WIDGET (check));
+            g_signal_connect (G_OBJECT (check), "toggled", G_CALLBACK (display_setting_output_toggled), builder);
         }
         else
         {
-            gtk_widget_hide (GTK_WIDGET (radio));
+            gtk_widget_hide (GTK_WIDGET (check));
         }
 
         label = gtk_builder_get_object (builder, "label-reflection");



More information about the Xfce4-commits mailing list