All of Jason\'s updates
[webos-internals:shivaramv-modifications.git] / top-bar / top-bar-temperature-with-battery-in-device-menu.patch
1 diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
2 index 335a73c..88be90a 100644
3 --- a/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
4 +++ b/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
5 @@ -112,6 +112,12 @@ var DevicemenuAssistant = Class.create({
6                         this.controller.hideWidgetContainer(this.controller.get('dm_wifi'));
7                 }
8                 
9 +               //setup battery temperature label
10 +               var battery = this.controller.get("dm_battery");
11 +               battery.id = "batteryRow";
12 +               battery.innerHTML = '<span id="dm_battery">' + battery.innerHTML + '</span>' +
13 +                               '<div class="label right" id="tempmsg" style="font-size:0.9em;">&nbsp;</div>';
14 +               
15                 //set up the the menu div
16                 this.scrim = this.controller.sceneElement.querySelector('div[x-mojo-scrim]');
17                 this.systemmenu = this.controller.sceneElement.querySelector('div[x-mojo-dialog]');
18 @@ -1078,6 +1084,21 @@ var DevicemenuAssistant = Class.create({
19                                 this.btspinnerModel.spinning = true;
20                                 this.controller.modelChanged(this.btspinnerModel);
21                         }
22 +                       this.controller.serviceRequest('palm://com.palm.bus/signal/', {
23 +                               method: 'addmatch',
24 +                               parameters: {
25 +                                       "category":"/com/palm/power",
26 +                                       "method":"batteryStatus"
27 +                               },
28 +                               onSuccess: function(payload) {
29 +                                       if(payload.temperature_C) {
30 +                                               this.controller.get("tempmsg").innerHTML = payload.temperature_C + "&deg;C";
31 +                                       }
32 +                               }.bind(this)
33 +                       });
34 +                       this.controller.serviceRequest('palm://com.palm.power/com/palm/power/', {
35 +                               method: 'batteryStatusQuery'
36 +                       });
37                         this.controller.stageController.activate();
38                         
39                         var animateDialog = function(){