[gnome-power-manager] Add preferences checkboxes for the disk spindown functionality



commit 53943af2c28152cdea2485f2b2586fe11eabdea8
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jun 22 11:01:24 2009 +0100

    Add preferences checkboxes for the disk spindown functionality

 data/gpm-prefs.ui    |    4 ++--
 src/gpm-prefs-core.c |   16 +++++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui
index 47b8352..35ddd01 100644
--- a/data/gpm-prefs.ui
+++ b/data/gpm-prefs.ui
@@ -70,7 +70,7 @@
               <object class="GtkVBox" id="vbox_ac">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
-                <property name="spacing">6</property>
+                <property name="spacing">9</property>
                 <child>
                   <object class="GtkVBox" id="vbox_ac_actions">
                     <property name="visible">True</property>
@@ -331,7 +331,7 @@
               <object class="GtkVBox" id="vbox_battery">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
-                <property name="spacing">6</property>
+                <property name="spacing">9</property>
                 <child>
                   <object class="GtkVBox" id="vbox_battery_actions">
                     <property name="visible">True</property>
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 943e600..5332173 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -644,6 +644,17 @@ gpm_conf_gconf_key_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *e
 		brightness = gconf_value_get_int (value);
 		gtk_range_set_value (GTK_RANGE (widget), brightness);
 	}
+
+	if (strcmp (entry->key, GPM_CONF_DISKS_SPINDOWN_ENABLE_AC) == 0) {
+		widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_ac_spindown"));
+		enabled = gconf_value_get_bool (value);
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), enabled);
+
+	} else if (strcmp (entry->key, GPM_CONF_DISKS_SPINDOWN_ENABLE_BATT) == 0) {
+		widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_battery_spindown"));
+		enabled = gconf_value_get_bool (value);
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), enabled);
+	}
 }
 
 /** setup the notification page */
@@ -755,6 +766,8 @@ prefs_setup_ac (GpmPrefs *prefs)
 
 	gpm_prefs_setup_checkbox (prefs, "checkbutton_ac_display_dim",
 				  GPM_CONF_BACKLIGHT_IDLE_DIM_AC);
+	gpm_prefs_setup_checkbox (prefs, "checkbutton_ac_spindown",
+				  GPM_CONF_DISKS_SPINDOWN_ENABLE_AC);
 
 	set_idle_hscale_stops (prefs, "hscale_ac_computer", prefs->priv->idle_delay);
 
@@ -813,9 +826,10 @@ prefs_setup_battery (GpmPrefs *prefs)
 	/* set up the battery reduce checkbox */
 	gpm_prefs_setup_checkbox (prefs, "checkbutton_battery_display_reduce",
 	  			  GPM_CONF_BACKLIGHT_BATTERY_REDUCE);
-
 	gpm_prefs_setup_checkbox (prefs, "checkbutton_battery_display_dim",
 				  GPM_CONF_BACKLIGHT_IDLE_DIM_BATT);
+	gpm_prefs_setup_checkbox (prefs, "checkbutton_battery_spindown",
+				  GPM_CONF_DISKS_SPINDOWN_ENABLE_BATT);
 
 	set_idle_hscale_stops (prefs, "hscale_battery_computer", prefs->priv->idle_delay);
 



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