Updating branch refs/heads/eric/bugzilla-patches
         to bb1b43e8f608daf05110432f30dd3c4d411470ad (commit)
       from 1e2b996f5e9c6da6fd2f6ba1ad5d82a3552adf89 (commit)

commit bb1b43e8f608daf05110432f30dd3c4d411470ad
Author: Stefan Seyfried <seife+...@b1-systems.com>
Date:   Fri Apr 27 11:38:59 2012 +0200

    xfpm-power-info: add current percentage of batteries
    
    a bluetooth mouse's battery might not have any Energy* properties (all
    zero), but a Percentage property, so it might be useful to show that.
    
    Signed-off-by: Eric Koegel <eric.koe...@gmail.com>

 src/xfpm-power-info.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/xfpm-power-info.c b/src/xfpm-power-info.c
index f0c9e50..a53a6be 100644
--- a/src/xfpm-power-info.c
+++ b/src/xfpm-power-info.c
@@ -410,6 +410,20 @@ xfpm_info_add_device_view (XfpmInfo *info, GHashTable 
*props, const gchar *objec
            i++;
        }
        
+       value = g_hash_table_lookup (props, "Percentage");
+
+       if ( value )
+       {
+           str = g_strdup_printf("%d", (guint) g_value_get_double (value));
+           gtk_list_store_append (list_store, &iter);
+           gtk_list_store_set (list_store, &iter,
+                               XFPM_DEVICE_INFO_NAME, _("Energy percent"),
+                               XFPM_DEVICE_INFO_VALUE, str,
+                               -1);
+           i++;
+           g_free(str);
+       }
+
        /* TRANSLATORS: Unit here is What hour*/
        str = xfpm_info_get_energy_property (props, "EnergyFullDesign", 
_("Wh"));
        
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to