Initial 1.3.5 commit. 112 patches apply cleanly from their 1.3.1 state.
[webos-internals:modifications.git] / top-bar / top-bar-roam-only-in-device-menu.patch
1 Name: Roam-Only in Device Menu
2 Version: 1.2.1-1
3 Author: Jason Robitaille
4 Description: Adds a roam-only toggle to the device menu  (MIT license)
5
6 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
7 +++ /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
8 @@ -125,3 +125,4 @@
9                 this.controller.get('scrim').addEventListener(Mojo.Event.tap, this.toggleDeviceMenu.bindAsEventListener(this));
10 +               this.controller.get('dm_roam').addEventListener(Mojo.Event.tap, this.toggleRoam.bindAsEventListener(this));
11                 //Close the App because this is a first launch.
12                 this.toggleDeviceMenu();                                                
13 @@ -222,6 +223,30 @@
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         /*
42          * Handles the Bluetooth Device connect or disconnect when tapped on the device.
43          */
44 @@ -944,2 +969,10 @@
45                         this.isVisible = true;
46 +                       this.controller.serviceRequest('palm://com.palm.telephony', {
47 +                               method: 'roamModeQuery',
48 +                               parameters: {},
49 +                               onSuccess: function(response) {
50 +                                       this.roamStatus = response.extended.mode;
51 +                                       this.setRoamLabel();
52 +                               }.bind(this)
53 +                       });
54                         var date = new Date();          
55 --- .orig/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
56 +++ /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
57 @@ -89,6 +89,15 @@
58                                         
59                                 </div>  
60                                 
61 +                               <div class="palm-section-divider"></div>
62 +
63 +                               <div class="palm-row" id="dm_roam" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
64 +                                       <div class="title truncating-text">
65 +                                               <div class="label right" id="roamStatus">&nbsp;</div>
66 +                                               <span x-mojo-loc=''>Roam Only</span>
67 +                                       </div>
68 +                               </div></div>
69 +
70                                 <div class="palm-section-divider"></div>
71                                 
72                                 <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">