updates and additions
[webos-internals:modifications.git] / top-bar / top-bar-roam-only-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 08f7f75..7569919 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 @@ -166,6 +166,7 @@ var DevicemenuAssistant = Foundations.Class.create({
6                 this.controller.get('imelist').addEventListener(Mojo.Event.listTap,this.handleIMETap.bindAsEventListener(this));
7                 this.controller.get('dm_ime').addEventListener(Mojo.Event.tap, this.toggleIMEList.bindAsEventListener(this));
8                 this.controller.get('ime_pref').addEventListener(Mojo.Event.tap,this.handleIMELaunch.bindAsEventListener(this));
9 +               this.controller.get('dm_roam').addEventListener(Mojo.Event.tap, this.toggleRoam.bindAsEventListener(this));
10  
11                 //Close the App because this is a first launch.
12                 this._stageRef = 1;
13 @@ -302,6 +303,30 @@ var DevicemenuAssistant = Foundations.Class.create({
14                 this.btdeviceList.clear();              
15         },
16         
17 +       toggleRoam: function(event) {
18 +               if(this.roamStatus=="roamonly") {
19 +                       this.roamStatus="any";
20 +               } else {
21 +                       this.roamStatus="roamonly";
22 +               }
23 +               this.controller.serviceRequest('palm://com.palm.telephony', {
24 +                       method: 'roamModeSet',
25 +                       parameters: {
26 +                               mode: this.roamStatus,
27 +                               client: Mojo.appName
28 +                       }
29 +               });
30 +               this.setRoamLabel();
31 +       },
32 +
33 +       setRoamLabel: function() {
34 +               if(this.roamStatus=="roamonly") {
35 +                       this.controller.get('roamStatus').innerText = "On";
36 +               } else {
37 +                       this.controller.get('roamStatus').innerText = "Off";
38 +               }
39 +       },
40 +       
41         //Response from Preferences
42         gotNumOfProfiles: function(payload) {
43                 Mojo.Log.info("Num Of Profile "+ Object.toJSON(payload));
44 @@ -1461,6 +1486,14 @@ var DevicemenuAssistant = Foundations.Class.create({
45                 }
46                 else {
47                         this.isVisible = true;
48 +                       this.controller.serviceRequest('palm://com.palm.telephony', {
49 +                               method: 'roamModeQuery',
50 +                               parameters: {},
51 +                               onSuccess: function(response) {
52 +                                       this.roamStatus = response.extended.mode;
53 +                                       this.setRoamLabel();
54 +                               }.bind(this)
55 +                       });
56                         var date = new Date();          
57                         this.controller.get('dm_date').innerHTML = Mojo.Format.formatDate(date,{date:'EEE '})  +  Mojo.Format.formatDate(date,{date:'long'});
58                         
59 diff --git a/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html b/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
60 index 0e43a60..eb17bdb 100644
61 --- a/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
62 +++ b/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
63 @@ -159,6 +159,15 @@
64                                 </div>  
65                                 
66                                 <div class="palm-section-divider"></div>
67 +
68 +                               <div class="palm-row" id="dm_roam" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
69 +                                       <div class="title truncating-text">
70 +                                               <div class="label right" id="roamStatus">&nbsp;</div>
71 +                                               <span x-mojo-loc=''>Roam Only</span>
72 +                                       </div>
73 +                               </div></div>
74 +
75 +                               <div class="palm-section-divider"></div>
76                                 
77                                 <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
78                                         <div id="dm_airplanemode_status" class="title truncating-text">