From 4f22dd80e437e159143713a4a6b1c5e6081b99f8 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Mon, 23 Dec 2013 16:43:34 +0100 Subject: [PATCH] Display power percentage This is particularly relevant for Logitech Unifying devices. My test device was a Logitech M185 wireless mouse, which has no power related properties except for "percentage". --- src/xfpm-power-info.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/xfpm-power-info.c b/src/xfpm-power-info.c index e365da9..af735f8 100644 --- a/src/xfpm-power-info.c +++ b/src/xfpm-power-info.c @@ -465,6 +465,19 @@ xfpm_info_add_device_view (XfpmInfo *info, GHashTable *props, const gchar *objec g_free (str); } + /*Percentage*/ + str = xfpm_info_get_energy_property (props, "Percentage", _("%")); + if ( str ) + { + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, &iter, + XFPM_DEVICE_INFO_NAME, _("Percentage"), + XFPM_DEVICE_INFO_VALUE, str, + -1); + i++; + g_free (str); + } + /*Vendor*/ value = g_hash_table_lookup (props, "Vendor"); -- 1.7.9.5