[Goodies-commits] r7196 - in xfce4-power-manager/trunk: . src

Ali Abdallah aliov at xfce.org
Tue Apr 14 09:49:27 CEST 2009


Author: aliov
Date: 2009-04-14 07:49:27 +0000 (Tue, 14 Apr 2009)
New Revision: 7196

Modified:
   xfce4-power-manager/trunk/ChangeLog
   xfce4-power-manager/trunk/configure.ac.in
   xfce4-power-manager/trunk/src/xfpm-battery.c
   xfce4-power-manager/trunk/src/xfpm-xfconf.c
Log:
Commit all changes for beta2

Modified: xfce4-power-manager/trunk/ChangeLog
===================================================================
--- xfce4-power-manager/trunk/ChangeLog	2009-04-14 07:49:14 UTC (rev 7195)
+++ xfce4-power-manager/trunk/ChangeLog	2009-04-14 07:49:27 UTC (rev 7196)
@@ -1,4 +1,7 @@
 
+2009-04-14  9:49 Ali aliov at xfce.org 
+	 * : Commit all changes for beta2
+
 2009-04-13 21:49 Ali aliov at xfce.org 
 	 * : Register to some posix signals+put the restart style to never when we exit the power manager
 

Modified: xfce4-power-manager/trunk/configure.ac.in
===================================================================
--- xfce4-power-manager/trunk/configure.ac.in	2009-04-14 07:49:14 UTC (rev 7195)
+++ xfce4-power-manager/trunk/configure.ac.in	2009-04-14 07:49:27 UTC (rev 7196)
@@ -3,7 +3,7 @@
 m4_define([xfpm_version_minor],  [8])
 m4_define([xfpm_version_micro],  [0])
 m4_define([xfpm_version_build],  [])
-m4_define([xfpm_version_tag],[r at REVISION@])
+m4_define([xfpm_version_tag],[beta2])
 m4_define([xfpm_version], [xfpm_version_major().xfpm_version_minor().xfpm_version_micro()ifelse(xfpm_version_tag(), [svn], [xfpm_version_tag().xfpm_version_build()], [xfpm_version_tag()])])
 
 AC_INIT([xfce4-power-manager], [xfpm_version], [http://bugzilla.xfce.org/])

Modified: xfce4-power-manager/trunk/src/xfpm-battery.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-battery.c	2009-04-14 07:49:14 UTC (rev 7195)
+++ xfce4-power-manager/trunk/src/xfpm-battery.c	2009-04-14 07:49:27 UTC (rev 7196)
@@ -46,6 +46,7 @@
 #include "xfpm-xfconf.h"
 #include "xfpm-config.h"
 #include "xfpm-adapter.h"
+#include "xfpm-debug.h"
 
 /* Init */
 static void xfpm_battery_class_init (XfpmBatteryClass *klass);
@@ -158,6 +159,10 @@
 			   guint percentage
 			   )
 {
+    gchar *icon;
+
+    XFPM_DEBUG_ENUM ("battery state", battery->priv->state, XFPM_TYPE_BATTERY_STATE)
+    
     if ( !is_present )
     {
 	xfpm_tray_icon_set_icon (battery->priv->icon, 
@@ -172,19 +177,38 @@
 	    xfpm_tray_icon_set_icon (battery->priv->icon, battery->priv->adapter_present ? "gpm-primary-charged" : "gpm-primary-100");
 	else
 	{
-	    gchar *icon = g_strdup_printf("%s%s", 
-	    			          battery->priv->icon_prefix, 
-	    			          xfpm_battery_get_icon_index (battery->priv->type, percentage));
+	    icon = g_strdup_printf("%s%s", 
+	    		           battery->priv->icon_prefix, 
+	    			   xfpm_battery_get_icon_index (battery->priv->type, percentage));
 	    xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 	    g_free(icon);
 	}
     }
-    else if ( battery->priv->state == BATTERY_IS_CHARGING || battery->priv->state == BATTERY_NOT_FULLY_CHARGED )
+    else if ( battery->priv->state == BATTERY_NOT_FULLY_CHARGED )
     {
-	gchar *icon = g_strdup_printf("%s%s-%s",
-				      battery->priv->icon_prefix, 
-	    			      xfpm_battery_get_icon_index (battery->priv->type, percentage),
-				      "charging");
+	if ( battery->priv->adapter_present )
+	{
+	    icon = g_strdup_printf("%s%s-%s",
+			      battery->priv->icon_prefix, 
+			      xfpm_battery_get_icon_index (battery->priv->type, percentage),
+			      "charging");
+	}
+	else
+	{
+	    icon = g_strdup_printf("%s%s",
+			      battery->priv->icon_prefix, 
+			      xfpm_battery_get_icon_index (battery->priv->type, percentage));
+	}
+	xfpm_tray_icon_set_icon (battery->priv->icon, icon);
+	g_free(icon);
+	
+    }
+    else if ( battery->priv->state == BATTERY_IS_CHARGING )
+    {
+	icon = g_strdup_printf("%s%s-%s",
+			      battery->priv->icon_prefix, 
+			      xfpm_battery_get_icon_index (battery->priv->type, percentage),
+			      "charging");
 				      
 	xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 	g_free(icon);
@@ -192,9 +216,9 @@
     else if ( battery->priv->state == BATTERY_IS_DISCHARGING || battery->priv->state == BATTERY_CHARGE_CRITICAL ||
 	      battery->priv->state == BATTERY_CHARGE_LOW )
     {
-	gchar *icon = g_strdup_printf("%s%s",
-				      battery->priv->icon_prefix, 
-	    			      xfpm_battery_get_icon_index (battery->priv->type, percentage));
+	icon = g_strdup_printf("%s%s",
+			      battery->priv->icon_prefix, 
+			      xfpm_battery_get_icon_index (battery->priv->type, percentage));
 				      
 	xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 	g_free(icon);

Modified: xfce4-power-manager/trunk/src/xfpm-xfconf.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-xfconf.c	2009-04-14 07:49:14 UTC (rev 7195)
+++ xfce4-power-manager/trunk/src/xfpm-xfconf.c	2009-04-14 07:49:27 UTC (rev 7196)
@@ -632,6 +632,8 @@
 #endif /* HAVE_DPMS */
     else if ( xfpm_strequal (property, INACTIVITY_SLEEP_MODE) )
 	return conf->priv->sleep_inactivity;
+    else if ( xfpm_strequal (property, ENABLE_BRIGHTNESS_CONTROL) )
+	return conf->priv->enable_brightness;
     
     g_warn_if_reached ();
 
@@ -656,8 +658,6 @@
 	return conf->priv->power_button;
     else if ( xfpm_strequal (property, HIBERNATE_SWITCH_CFG ) )
 	return conf->priv->hibernate_button;
-    else if ( xfpm_strequal (property, ENABLE_BRIGHTNESS_CONTROL) )
-	return conf->priv->enable_brightness;
     
     g_warn_if_reached ();
 




More information about the Goodies-commits mailing list