[gnome-control-center/randr-set-as-default: 1/3] Add a 'Make Default' button



commit 8c7020b8324f8c15100a7dff2225958ae3b8f83b
Author: Federico Mena Quintero <federico novell com>
Date:   Wed Mar 10 12:17:53 2010 -0600

    Add a 'Make Default' button
    
    This button will use a PolicyKit helper to save the display configuration
    to a systemwide file.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 capplets/display/display-capplet.ui |   20 ++++++++++++++++++--
 capplets/display/xrandr-capplet.c   |    5 +++++
 2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/capplets/display/display-capplet.ui b/capplets/display/display-capplet.ui
index 0967282..82ed92b 100644
--- a/capplets/display/display-capplet.ui
+++ b/capplets/display/display-capplet.ui
@@ -351,6 +351,21 @@
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="make_default_button">
+                <property name="label" translatable="yes">Make Default</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -365,7 +380,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child>
@@ -380,7 +395,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
           </object>
@@ -394,6 +409,7 @@
     </child>
     <action-widgets>
       <action-widget response="-11">helpbutton1</action-widget>
+      <action-widget response="1">make_default_button</action-widget>
       <action-widget response="-10">apply_button</action-widget>
       <action-widget response="-7">button2</action-widget>
     </action-widgets>
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index aa5917a..9fb95b7 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -77,6 +77,11 @@ struct App
     } apply_configuration_state;
 };
 
+/* Response codes for custom buttons in the main dialog */
+enum {
+    RESPONSE_MAKE_DEFAULT = 1
+};
+
 static void rebuild_gui (App *app);
 static void on_clone_changed (GtkWidget *box, gpointer data);
 static void on_rate_changed (GtkComboBox *box, gpointer data);



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