[gnome-shell] power: Label the PENDING_CHARGE state as "Not Charging"



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

    power: 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".
    
    Closes: #701.

 js/ui/status/power.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index f21693f53..4a6ce2c24 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -70,7 +70,9 @@ var Indicator = new Lang.Class({
             seconds = this._proxy.TimeToFull;
         else if (this._proxy.State == UPower.DeviceState.DISCHARGING)
             seconds = this._proxy.TimeToEmpty;
-        // state is one of PENDING_CHARGING, PENDING_DISCHARGING
+        else if (this._proxy.State == UPower.DeviceState.PENDING_CHARGE)
+            return _("Not Charging");
+        // state is PENDING_DISCHARGE
         else
             return _("Estimating…");
 


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