Initial 1.3.5 commit. 112 patches apply cleanly from their 1.3.1 state.
[webos-internals:modifications.git] / top-bar / top-bar-data-in-device-menu.patch
1 Name: Data Toggle in Device Menu
2 Version: 1.2.1-1
3 Author: Jason Robitaille
4 Description: Adds a data connection (ex. EVDO/1X) 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 @@ -122,2 +122,3 @@
9                 this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));
10 +               this.controller.get('dm_data').addEventListener(Mojo.Event.tap, this.toggleData.bindAsEventListener(this));
11                 this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));
12 @@ -889,6 +890,25 @@
13                 this.controller.modelChanged(this.spinnerModel);                        
14         },
15         
16 +       toggleData: function(event) {
17 +               if(this.dataDisabled=="on") {
18 +                       this.dataDisabled = "off";
19 +               } else {
20 +                       this.dataDisabled = "on";
21 +               }
22 +               this.controller.serviceRequest('palm://com.palm.wan', {
23 +                       method: 'set',
24 +                       parameters: {
25 +                               disablewan: this.dataDisabled
26 +                       }
27 +               });
28 +               this.setDataLabel();
29 +       },
30 +
31 +       setDataLabel: function() {
32 +               if(this.dataDisabled=="off") {this.controller.get('dataStatus').innerText = "on";} else {this.controller.get('dataStatus').innerText = "off";}
33 +       },
34 +       
35         close: function() {
36                 
37                 if (this.btdrawer.mojo.getOpenState()) {
38 @@ -941,6 +961,18 @@
39                         //this.controller.stageController.deactivate();
40                 }
41                 else {
42 +                       this.controller.serviceRequest('palm://com.palm.connectionmanager', {
43 +                               method: 'getstatus',
44 +                               parameters: {},
45 +                               onSuccess: function(response) {
46 +                                       if(response.wan.state === "disconnected") {
47 +                                               this.dataDisabled = "on";
48 +                                       } else if(response.wan.state === "connected") {
49 +                                               this.dataDisabled = "off";
50 +                                       }
51 +                                       this.setDataLabel();
52 +                               }.bind(this)
53 +                       });
54                         this.isVisible = true;
55                         var date = new Date();          
56                         this.controller.get('dm_date').innerHTML = Mojo.Format.formatDate(date,{date:'EEE '})  +  Mojo.Format.formatDate(date,{date:'long'});
57 --- .orig/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
58 +++ /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
59 @@ -89,6 +89,15 @@
60                                         
61                                 </div>  
62                                 
63 +                               <div class="palm-section-divider"></div>
64 +
65 +                               <div class="palm-row" id="dm_data" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
66 +                                       <div class="title truncating-text">
67 +                                               <div class="label right" id="dataStatus">&nbsp;</div>
68 +                                               <span x-mojo-loc=''>Data Connection</span>
69 +                                       </div>
70 +                               </div></div>
71 +
72                                 <div class="palm-section-divider"></div>
73                                 
74                                 <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">