[gnome-flashback] power-applet: label the PENDING_CHARGE state as "Not Charging"



commit 971813d6967481f751d5b04257ff1a90ee3b2d0d
Author: João Paulo Rechi Vita <jprvita endlessm com>
Date:   Fri Nov 2 13:51:33 2018 -0700

    power-applet: label the PENDING_CHARGE state as "Not Charging"
    
    The pending-charge state means AC power is on but the battery is not
    being charged. This can happen because its charge is above a certain
    threshold, to avoid short charging cycles and prolong the battery's
    life, or because the PSU is not powerful enough to charge the batteries.
    
    Instead of lying to the user about something being estimated, we should
    simply tell the truth and set the label to "Not Charging".
    
    Based on gnome-shell commit:
    https://gitlab.gnome.org/GNOME/gnome-shell/commit/52c59ac0dd7ddbe064

 gnome-flashback/libpower-applet/gf-power-applet.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gnome-flashback/libpower-applet/gf-power-applet.c 
b/gnome-flashback/libpower-applet/gf-power-applet.c
index 4faa60f..bf71aa4 100644
--- a/gnome-flashback/libpower-applet/gf-power-applet.c
+++ b/gnome-flashback/libpower-applet/gf-power-applet.c
@@ -186,6 +186,8 @@ get_tooltip_text (GfPowerApplet *applet)
     seconds = gf_upower_device_get_time_to_full (applet->device);
   else if (state == UP_DEVICE_STATE_DISCHARGING)
     seconds = gf_upower_device_get_time_to_empty (applet->device);
+  else if (state == UP_DEVICE_STATE_PENDING_CHARGE)
+    return g_strdup (_("Not Charging"));
   else
     return g_strdup (_("Estimating..."));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]