[gnome-control-center] power: Use the correct item in the combo boxes when sleep-when-inactive is disabled



commit 147dfcbb452d722c1367b5c867f24b47a9720d53
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Sep 27 16:08:37 2011 +0200

    power: Use the correct item in the combo boxes when sleep-when-inactive is disabled

 panels/power/cc-power-panel.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index c069187..92b2e85 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -602,6 +602,10 @@ cc_power_panel_init (CcPowerPanel *self)
 
   /* auto-sleep time */
   value = g_settings_get_int (self->priv->gsd_settings, "sleep-inactive-ac-timeout");
+  if (!g_settings_get_boolean (self->priv->gsd_settings, "sleep-inactive-ac"))
+    {
+      value = 0;
+    }
   widget = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
                                                "combobox_sleep_ac"));
   set_value_for_combo (GTK_COMBO_BOX (widget), value);
@@ -610,6 +614,10 @@ cc_power_panel_init (CcPowerPanel *self)
                     G_CALLBACK (combo_time_changed_cb),
                     self);
   value = g_settings_get_int (self->priv->gsd_settings, "sleep-inactive-battery-timeout");
+  if (!g_settings_get_boolean (self->priv->gsd_settings, "sleep-inactive-battery"))
+    {
+      value = 0;
+    }
   widget = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
                                                "combobox_sleep_battery"));
   set_value_for_combo (GTK_COMBO_BOX (widget), value);



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