[gnome-power-manager] Support DKP_DEVICE_STATE_PENDING_x in more places
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-power-manager] Support DKP_DEVICE_STATE_PENDING_x in more places
- Date: Mon, 6 Jul 2009 11:38:38 +0000 (UTC)
commit 2fdbc3c23f39b1e4cabda9d44db8847fd57e6391
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 6 12:37:22 2009 +0100
Support DKP_DEVICE_STATE_PENDING_x in more places
src/gpm-devicekit.c | 13 +++++++++++++
src/gpm-statistics.c | 6 ++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-devicekit.c b/src/gpm-devicekit.c
index 66fdf27..fd612b4 100644
--- a/src/gpm-devicekit.c
+++ b/src/gpm-devicekit.c
@@ -306,6 +306,19 @@ gpm_devicekit_get_object_summary (DkpDevice *device)
type_desc, percentage);
}
+#if DKP_CHECK_VERSION(0x009)
+ } else if (state == DKP_DEVICE_STATE_PENDING_DISCHARGE) {
+
+ /* TRANSLATORS: this is only shown for laptops with multiple batteries */
+ description = g_strdup_printf (_("%s waiting to discharge (%.1f%%)"),
+ type_desc, percentage);
+
+ } else if (state == DKP_DEVICE_STATE_PENDING_CHARGE) {
+
+ /* TRANSLATORS: this is only shown for laptops with multiple batteries */
+ description = g_strdup_printf (_("%s waiting to charge (%.1f%%)"), type_desc, percentage);
+#endif
+
} else {
egg_warning ("in an undefined state we are not charging or "
"discharging and the batteries are also not charged");
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index cd6749a..2b23712 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -593,6 +593,12 @@ gpm_stats_update_info_page_history (DkpDevice *device)
point->color = egg_color_from_rgb (255, 0, 0);
else if (hobj->state == DKP_DEVICE_STATE_DISCHARGING)
point->color = egg_color_from_rgb (0, 0, 255);
+#if DKP_CHECK_VERSION(0x009)
+ else if (hobj->state == DKP_DEVICE_STATE_PENDING_CHARGE)
+ point->color = egg_color_from_rgb (200, 0, 0);
+ else if (hobj->state == DKP_DEVICE_STATE_PENDING_DISCHARGE)
+ point->color = egg_color_from_rgb (0, 0, 200);
+#endif
else {
if (strcmp (history_type, GPM_HISTORY_RATE_VALUE) == 0)
point->color = egg_color_from_rgb (255, 255, 255);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]