All Jason\'s updates
[webos-internals:skurriers-modifications.git] / top-bar / top-bar-temperature-for-device-menu-megamix.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..f1861d6 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 temperature label
10 +               var phone = this.controller.get("dm_phone");
11 +               phone.id = "batteryRow";
12 +               phone.innerHTML = '<span id="dm_phone">' + phone.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,31 @@ var DevicemenuAssistant = Class.create({
19                                 this.btspinnerModel.spinning = true;
20                                 this.controller.modelChanged(this.btspinnerModel);
21                         }
22 +                       this.controller.serviceRequest('palm://ca.canucksoftware.systoolsmgr', {
23 +                               method: 'cpuTemperature',
24 +                               onSuccess: function(payload) {
25 +                                       if(payload.value) {
26 +                                               this.controller.get("tempmsg").innerHTML = payload.value + "&deg;C";
27 +                                       }
28 +                               }.bind(this),
29 +                               onFailure: function(err) {
30 +                                       this.controller.serviceRequest('palm://com.palm.bus/signal/', {
31 +                                               method: 'addmatch',
32 +                                               parameters: {
33 +                                                       "category":"/com/palm/power",
34 +                                                       "method":"batteryStatus"
35 +                                               },
36 +                                               onSuccess: function(payload2) {
37 +                                                       if(payload2.temperature_C) {
38 +                                                               this.controller.get("tempmsg").innerHTML = payload2.temperature_C + "&deg;C";
39 +                                                       }
40 +                                               }.bind(this)
41 +                                       });
42 +                                       this.controller.serviceRequest('palm://com.palm.power/com/palm/power/', {
43 +                                               method: 'batteryStatusQuery'
44 +                                       });
45 +                               }.bind(this)
46 +                       });
47                         this.controller.stageController.activate();
48                         
49                         var animateDialog = function(){