[Xfce4-commits] <xfce4-power-manager:master> Allow 1% as a minimum critical charge level

Ali Abdallah noreply at xfce.org
Tue Oct 20 09:00:02 CEST 2009


Updating branch refs/heads/master
         to 880b86b85fb9f4024de1cba24a192d8fa7baab7c (commit)
       from abb27c06ad0bf2bc600c0f102cab3f295ef9fb3d (commit)

commit 880b86b85fb9f4024de1cba24a192d8fa7baab7c
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Tue Oct 20 08:26:03 2009 +0000

    Allow 1% as a minimum critical charge level

 NEWS                             |    3 ++-
 data/interfaces/xfpm-settings.ui |    4 ++--
 settings/xfpm-settings.c         |    2 +-
 src/xfpm-xfconf.c                |    2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 2d6c4ea..f1adb1f 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,8 @@
   brightness changes are not reflected to xfpm when keys are pressed, so
   save the actual brightness before dimming the screen on idle to restore it 
   afterword. (bug #5811).
-- 
+- Check if DPMS is enabled before doing action on lid close event (bug #5805).
+- Allow 1% as a minimum critical charge level.
 
 0.8.4
 =======
diff --git a/data/interfaces/xfpm-settings.ui b/data/interfaces/xfpm-settings.ui
index 50c6f7c..1531e12 100644
--- a/data/interfaces/xfpm-settings.ui
+++ b/data/interfaces/xfpm-settings.ui
@@ -54,7 +54,7 @@
   </object>
   <object class="GtkAdjustment" id="adjustment9">
     <property name="value">10</property>
-    <property name="lower">5</property>
+    <property name="lower">1</property>
     <property name="upper">20</property>
     <property name="step_increment">1</property>
   </object>
@@ -264,7 +264,7 @@
                                         <child>
                                           <object class="GtkLabel" id="hibernate-label">
                                             <property name="visible">True</property>
-					    <property name="xalign">0</property>
+                                            <property name="xalign">0</property>
                                             <property name="label" translatable="yes">When hibernate button is pressed:</property>
                                           </object>
                                           <packing>
diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 772edf6..fdfb94e 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -1349,7 +1349,7 @@ xfpm_settings_advanced (XfconfChannel *channel, gboolean system_laptop, gboolean
     
 	val = xfconf_channel_get_uint (channel, PROPERTIES_PREFIX CRITICAL_POWER_LEVEL, 10);
 
-	if ( val > 20 || val < 5)
+	if ( G_UNLIKELY (val > 20) )
 	{
 	    g_critical ("Value %d if out of range for property %s\n", val, CRITICAL_POWER_LEVEL);
 	    gtk_spin_button_set_value (GTK_SPIN_BUTTON(critical_level), 10);
diff --git a/src/xfpm-xfconf.c b/src/xfpm-xfconf.c
index 6a7c601..2152b84 100644
--- a/src/xfpm-xfconf.c
+++ b/src/xfpm-xfconf.c
@@ -237,7 +237,7 @@ xfpm_xfconf_class_init (XfpmXfconfClass *klass)
                                      PROP_CRITICAL_LEVEL,
                                      g_param_spec_uint (CRITICAL_POWER_LEVEL,
                                                         NULL, NULL,
-							5,
+							1,
 							20,
 							10,
                                                         G_PARAM_READWRITE));



More information about the Xfce4-commits mailing list