diff options
author | Ali Abdallah <ali.slackware@gmail.com> | 2009-04-14 07:50:24 +0000 |
---|---|---|
committer | Ali Abdallah <ali.slackware@gmail.com> | 2009-04-14 07:50:24 +0000 |
commit | 22322985b1ac9e0b4e07079691431e98299b53af (patch) | |
tree | 7618d0247f9eda2878c2ca33087abf4c7ebde5e4 | |
parent | 8a8c26e524dca0b41ce425714fc38eb7e8f1076c (diff) | |
parent | f2a8cd6e1d4c4dec906d3a28a96aa207755f9b7e (diff) | |
download | ixfce4-power-manager-0.8.0beta2.tar.gz |
0.8.0beta2 tag0.8.0beta2
(Old svn revision: 7197)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | configure.ac.in | 2 | ||||
-rw-r--r-- | src/xfpm-battery.c | 46 | ||||
-rw-r--r-- | src/xfpm-xfconf.c | 4 |
4 files changed, 41 insertions, 14 deletions
@@ -1,4 +1,7 @@ +2009-04-14 9:49 Ali aliov@xfce.org + * : Commit all changes for beta2 + 2009-04-13 21:49 Ali aliov@xfce.org * : Register to some posix signals+put the restart style to never when we exit the power manager diff --git a/configure.ac.in b/configure.ac.in index 0e68fc9a..46cb8b13 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -3,7 +3,7 @@ m4_define([xfpm_version_major], [0]) m4_define([xfpm_version_minor], [8]) m4_define([xfpm_version_micro], [0]) m4_define([xfpm_version_build], []) -m4_define([xfpm_version_tag],[r@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/]) diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index 0a5e8ad7..ff36d106 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -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 @@ xfpm_battery_refresh_icon (XfpmBattery *battery, 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_battery_refresh_icon (XfpmBattery *battery, 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 ) + { + 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 ) { - gchar *icon = g_strdup_printf("%s%s-%s", - battery->priv->icon_prefix, - xfpm_battery_get_icon_index (battery->priv->type, percentage), - "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 @@ xfpm_battery_refresh_icon (XfpmBattery *battery, 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); diff --git a/src/xfpm-xfconf.c b/src/xfpm-xfconf.c index c9d737ee..b67c23f4 100644 --- a/src/xfpm-xfconf.c +++ b/src/xfpm-xfconf.c @@ -632,6 +632,8 @@ gboolean xfpm_xfconf_get_property_bool (XfpmXfconf *conf, const gchar *property) #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 @@ guint8 xfpm_xfconf_get_property_enum (XfpmXfconf *conf, const gchar *property) 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 (); |