Renamed smiley-faces-in-symbol-box to be mojo category
[webos-internals:imagineer1981s-modifications.git] / luna / luna-show-actual-battery-percent.patch
1 show-actual-battery-percent
2
3 Tested-On: 1.1
4
5 //show actual battery percent in the system user interface.
6 //note: battery @ 100% will only charge on a new charge event or if power is <94%
7 Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
8 ===================================================================
9 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
10 +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
11 @@ -1382,11 +1382,11 @@ handlePowerNotifications: function(paylo
12         
13         Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));       
14         // Is the battery level provided?
15 -       if (payload.percent_ui != undefined) {  
16 +       if (payload.percent != undefined) {     
17                 //Save the Battery Percentage
18 -               this.batteryLevel = payload.percent_ui; 
19 +               this.batteryLevel = payload.percent;    
20                 for (var i = 0; i < this.powerIndicator.length; i++) {
21 -                       if (payload.percent_ui > this.powerIndicator[i]) 
22 +                       if (payload.percent > this.powerIndicator[i]) 
23                                 continue;
24                         this.lastBatteryLevel = i;
25                         this.lastBatteryLevelPayload = payload;
26 @@ -1397,7 +1397,7 @@ handlePowerNotifications: function(paylo
27                                 $('power').className = 'battery-' + i;
28                                 
29                                 //Show Banner Message if the Battery level is below 20%
30 -                               var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); 
31 +                               var batteryalert = $L("#{percent}% battery remaining").interpolate(payload);    
32                                 if(this.batteryLevel <= 5 && !this.batteryLevel5Shown) {
33                                         this.batteryLevel5Shown = true;
34                                         this.showLowBatteryAlert();
35 @@ -1423,7 +1423,7 @@ handlePowerNotifications: function(paylo
36                         }
37                         else {
38                                 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
39 -                               if(payload.percent_ui == 100)
40 +                               if(payload.percent == 100)
41                                         $('power').className = 'battery-charged';
42                                 else
43                                         $('power').className = 'battery-charging-' + i;