1 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
2 +++ /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
4 /* Copyright 2009 Palm, Inc. All rights reserved. */
6 -var RadioState = new Hash({wifi: undefined, bluetooth: undefined});
7 +var ConnState = new Hash({phone: undefined, data: undefined});
9 +var RoamState = new Hash({phone: undefined, data: undefined});
11 +var RadioState = new Hash({wifi: undefined, bluetooth: undefined, gps: undefined});
13 var DevicemenuAssistant = Foundations.Class.create({
16 this.btProfileStatus = btProfileStatus;
17 this.turningOnBtRadio = false;
20 + this.isVisible = true;
21 + this.noClosing = false;
22 + this.isEditing = false;
24 + this.prevDrawer = null;
26 + this.editItems = new Array();
28 + this.volumeSlider = "ringtone";
30 + this.quickAction = "LED Flashlight";
31 + this.hiddenItems = new Array("Device", "Security", "Network", "Phone", "Data", "VPN");
33 + this.menus = ["Device", "Security", "Network", "Phone", "Data", "Wi-Fi", "Bluetooth", "GPS", "VPN"];
35 + this.item_ids = ["dm_device", "dm_security", "dm_network", "dm_phone", "dm_data", "dm_wifi",
36 + "dm_bluetooth", "dm_gps", "dm_vpn"];
38 + this.menuActions = ["LED Flashlight", "Phone Connection", "Voice Roaming", "Data Connection",
39 + "Data Roaming", "Wi-Fi Connection", "BT Connection", "GPS Connection", "Airplane Mode"];
44 //Add a touchable row class
45 this.controller.get('palm-device-menu').addClassName('palm-touch-rows-'+Mojo.Environment.DeviceInfo.touchableRows);
47 - var date = new Date();
48 +/* var date = new Date();
49 this.controller.get('dm_date').innerHTML = Mojo.Format.formatDate(date,{date:'EEE '}) + Mojo.Format.formatDate(date,{date:'long'});
50 var msg = $L("Battery: #{batlevel}");
51 - this.controller.get('dm_battery').innerHTML = new Template(msg).evaluate({"batlevel": Mojo.Format.formatPercent(this.barAssistant.getBatteryLevel())});
52 + this.controller.get('dm_battery').innerHTML = new Template(msg).evaluate({"batlevel": Mojo.Format.formatPercent(this.barAssistant.getBatteryLevel())}); */
54 this.modesModel = {scrollbars: false, mode: "vertical"},
55 this.controller.setupWidget('devicescroller', {}, this.modesModel);
56 this.menuscroller = this.controller.get('devicescroller');
58 + this.modelFlashlight = {value: false, disabled: false};
60 + this.controller.setupWidget("flashlight_toggle", {falseValue: false, trueValue: true}, this.modelFlashlight);
62 + this.modelBrightness = {value: 50};
64 + this.controller.setupWidget('brightness_slider', {minValue: 0, maxValue: 100}, this.modelBrightness);
66 + this.modelVolume = {value: 50};
68 + this.controller.setupWidget('volume_slider', {minValue: 0, maxValue: 100}, this.modelVolume);
70 + this.modelEditItems = {'items': this.editItems};
72 + this.controller.setupWidget('edit_items',
73 + {itemTemplate:'devicemenu/listitem-edit'},
74 + this.modelEditItems);
76 this.drawerModel = {myOpenProperty:false};
77 + this.controller.setupWidget('devicedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
78 + this.controller.setupWidget('securitydetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
79 + this.controller.setupWidget('networkdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
80 + this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
81 + this.controller.setupWidget('datadetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
82 + this.controller.setupWidget('gpsdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
83 this.controller.setupWidget('imedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
84 this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
85 this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
86 this.controller.setupWidget('vpndetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
87 + this.devicedrawer = this.controller.get('devicedetails');
88 + this.securitydrawer = this.controller.get('securitydetails');
89 + this.networkdrawer = this.controller.get('networkdetails');
90 + this.phonedrawer = this.controller.get('phonedetails');
91 + this.datadrawer = this.controller.get('datadetails');
92 + this.gpsdrawer = this.controller.get('gpsdetails');
93 this.imedrawer = this.controller.get('imedetails');
94 this.wifidrawer = this.controller.get('wifidetails');
95 this.btdrawer = this.controller.get('btdetails');
98 this.controller.setupWidget('btSpinner', this.spinnerAttrs, this.btspinnerModel);
100 - if(this.barAssistant.getAirplaneMode())
101 +/* if(this.barAssistant.getAirplaneMode())
102 this.controller.get('dm_airplanemode_status').innerHTML = $L('Turn off Airplane Mode');
104 this.controller.get('dm_airplanemode_status').innerHTML = $L('Turn on Airplane Mode');
107 this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML();
109 - this.isVisible = true;
110 + this.isVisible = true; */
112 //Hide WiFi Menu if WiFi is not present.
113 if(!Mojo.Environment.DeviceInfo.wifiAvailable) {
114 @@ -147,10 +202,56 @@
115 setText: this.altCharSelected.bind(this)
119 + this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));
121 + // Load preferences for the menu
123 + this.cookieContainer = new Mojo.Model.Cookie("deviceMenu");
125 + var cookie = this.cookieContainer.get();
128 + this.hiddenItems = cookie.hiddenItems;
129 + this.quickAction = cookie.quickAction;
130 + this.volumeSlider = cookie.volumeSlider;
134 activate: function() {
135 - this.controller.get('dm_airplanemode').addEventListener(Mojo.Event.tap, this.toggleAirplaneMode.bind(this));
136 + this.controller.get('menu_action').addEventListener(Mojo.Event.tap, this.handleActionTap.bindAsEventListener(this));
137 + this.controller.get('edit_items').addEventListener(Mojo.Event.listTap, this.handleItemTap.bindAsEventListener(this));
139 + this.controller.get('dm_device').addEventListener(Mojo.Event.tap, this.toggleDeviceList.bindAsEventListener(this));
140 + this.controller.get('volume_toggle').addEventListener(Mojo.Event.tap, this.handleVolumeToggle.bindAsEventListener(this));
141 + this.controller.get('flashlight_toggle').addEventListener(Mojo.Event.propertyChange, this.handleFlashlightToggle.bindAsEventListener(this));
142 + this.controller.get('brightness_slider').addEventListener(Mojo.Event.propertyChange, this.handleBrightnessSlider.bindAsEventListener(this));
143 + this.controller.get('volume_slider').addEventListener(Mojo.Event.propertyChange, this.handleVolumeSlider.bindAsEventListener(this));
145 + this.controller.get('dm_security').addEventListener(Mojo.Event.tap, this.toggleSecurityList.bindAsEventListener(this));
146 + this.controller.get('security_none').addEventListener(Mojo.Event.tap, this.changeSecurityState.bindAsEventListener(this));
147 + this.controller.get('security_pin').addEventListener(Mojo.Event.tap, this.changeSecurityState.bindAsEventListener(this));
148 + this.controller.get('security_pw').addEventListener(Mojo.Event.tap, this.changeSecurityState.bindAsEventListener(this));
150 + this.controller.get('dm_network').addEventListener(Mojo.Event.tap, this.toggleNetworkList.bindAsEventListener(this));
151 + this.controller.get('network_2g').addEventListener(Mojo.Event.tap, this.changeNetworkState.bindAsEventListener(this));
152 + this.controller.get('network_3g').addEventListener(Mojo.Event.tap, this.changeNetworkState.bindAsEventListener(this));
153 + this.controller.get('network_auto').addEventListener(Mojo.Event.tap, this.changeNetworkState.bindAsEventListener(this));
155 + this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));
156 + this.controller.get('phone_conn').addEventListener(Mojo.Event.tap, this.togglePhoneConn.bindAsEventListener(this));
157 + this.controller.get('phone_roam').addEventListener(Mojo.Event.tap, this.togglePhoneRoam.bindAsEventListener(this));
158 + this.controller.get('phone_pref').addEventListener(Mojo.Event.tap,this.handlePhoneLaunch.bindAsEventListener(this));
160 + this.controller.get('dm_data').addEventListener(Mojo.Event.tap, this.toggleDataList.bindAsEventListener(this));
161 + this.controller.get('data_conn').addEventListener(Mojo.Event.tap, this.toggleDataConn.bindAsEventListener(this));
162 + this.controller.get('data_roam').addEventListener(Mojo.Event.tap, this.toggleDataRoam.bindAsEventListener(this));
163 + this.controller.get('data_pref').addEventListener(Mojo.Event.tap,this.handlePhoneLaunch.bindAsEventListener(this));
165 + this.controller.get('dm_gps').addEventListener(Mojo.Event.tap, this.toggleGpsList.bindAsEventListener(this));
166 + this.controller.get('gps_radio').addEventListener(Mojo.Event.tap, this.toggleGpsRadio.bindAsEventListener(this));
167 + this.controller.get('gps_pref').addEventListener(Mojo.Event.tap,this.handleGpsLaunch.bindAsEventListener(this));
169 this.controller.get('wifilist').addEventListener(Mojo.Event.listTap,this.handleWiFiTap.bind(this));
170 this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bind(this));
171 this.controller.get('vpnlist').addEventListener(Mojo.Event.listTap,this.handleVPNTap.bind(this));
172 @@ -188,64 +289,934 @@
173 * The Airplan Mode setting gets stored in the System Preferences.
176 - toggleAirplaneMode: function() {
177 + toggleAirplaneMode: function(event) {
179 //Ignore the tap event if Airplane Mode is in Progress
180 - if(this.apModeInProgress)
182 +// if(this.apModeInProgress)
185 //this.apSpinnerModel.spinning = true;
186 //this.controller.modelChanged(this.apSpinnerModel);
188 if(this.barAssistant.getAirplaneMode()) {
189 Mojo.Log.info("SystemUI - Turning off Airplane Mode - Device Menu");
190 + if(this.quickAction == "Airplane Mode")
191 + this.controller.get('menu_action').innerHTML = $L('Turning off Airplane Mode');
192 this.barAssistant.setAirplaneMode(false);
193 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turning off Airplane Mode');
196 Mojo.Log.info("SystemUI - Turning on Airplane Mode - Device Menu");
197 + if(this.quickAction == "Airplane Mode")
198 + this.controller.get('menu_action').innerHTML = $L('Turning on Airplane Mode');
199 this.barAssistant.setAirplaneMode(true);
200 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turning on Airplane Mode');
202 - this.apModeInProgress = true;
203 - this.toggleDeviceMenu.delay(0.2);
204 +// this.apModeInProgress = true;
206 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
207 + this.toggleDeviceMenu.delay(0.2);
211 updateAirplaneModeSettings: function() {
213 + if(this.quickAction != "Airplane Mode")
216 //this.apSpinnerModel.spinning = false;
217 //this.controller.modelChanged(this.apSpinnerModel);
219 if(this.barAssistant.getAirplaneMode()) {
220 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turn off Airplane Mode');
221 + this.controller.get('menu_action').innerHTML = $L('Turn off Airplane Mode');
224 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turn on Airplane Mode');
225 + this.controller.get('menu_action').innerHTML = $L('Turn on Airplane Mode');
227 - this.apModeInProgress = false;
228 +// this.apModeInProgress = false;
231 updateAirplaneModeProgress: function() {
232 + if(this.quickAction != "Airplane Mode")
235 if(this.barAssistant.getAirplaneMode()) {
236 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turning on Airplane Mode');
237 + this.controller.get('menu_action').innerHTML = $L('Turning on Airplane Mode');
240 - this.controller.get('dm_airplanemode_status').innerHTML = $L('Turning off Airplane Mode');
241 + this.controller.get('menu_action').innerHTML = $L('Turning off Airplane Mode');
243 +// this.apModeInProgress = true;
246 + savePreferences: function() {
247 + this.hiddenItems.clear();
249 + for(var i = 0; i < this.editItems.length ; i++) {
250 + if(this.editItems[i].label == "hide")
251 + this.hiddenItems.push(this.editItems[i].title);
256 + hiddenItems: this.hiddenItems,
257 + quickAction: this.quickAction,
258 + volumeSlider: this.volumeSlider
261 + this.cookieContainer.put(cookie);
264 + handlePreferences: function(payload) {
265 + if(payload != undefined) {
266 + if(payload.deviceMenuCfg != undefined) {
267 + this.hiddenItems = payload.deviceMenuCfg.hidden;
268 + this.quickAction = payload.deviceMenuCfg.action;
273 + handleActionTap: function(event) {
274 + if(this.isEditing) {
275 + if((event.up) && ( event.up.altKey || event.up.metaKey))
276 + this.menuActions.reverse();
278 + for(var i = 0; i < this.menuActions.length; i++) {
279 + if(this.menuActions[i] == this.quickAction) {
280 + if((i+1) < this.menuActions.length)
281 + this.quickAction = this.menuActions[i+1];
283 + this.quickAction = this.menuActions[0];
289 + if((event.up) && ( event.up.altKey || event.up.metaKey))
290 + this.menuActions.reverse();
291 + this.controller.get('menu_action').innerHTML = $L("Toggle " + this.quickAction);
293 + this.savePreferences();
296 + if(this.quickAction == "LED Flashlight")
297 + this.toggleFlashlightLed(event);
298 + else if(this.quickAction == "Phone Connection")
299 + this.togglePhoneConn(event);
300 + else if(this.quickAction == "Voice Roaming")
301 + this.togglePhoneRoam(event);
302 + else if(this.quickAction == "Data Connection")
303 + this.toggleDataConn(event);
304 + else if(this.quickAction == "Data Roaming")
305 + this.toggleDataRoam(event);
306 + else if(this.quickAction == "Wi-Fi Connection")
307 + this.toggleWifiRadio(event);
308 + else if(this.quickAction == "BT Connection")
309 + this.toggleBTRadio(event);
310 + else if(this.quickAction == "GPS Connection")
311 + this.toggleGpsRadio(event);
312 + else if(this.quickAction == "Airplane Mode")
313 + this.toggleAirplaneMode(event);
317 + handleItemTap: function(event) {
318 + if(this.isEditing) {
319 + var index = this.modelEditItems.items.indexOf(event.item);
321 + if(this.modelEditItems.items[index].label == "hide")
322 + this.modelEditItems.items[index].label = "show";
324 + this.modelEditItems.items[index].label = "hide";
326 + this.controller.modelChanged(this.modelEditItems, this);
328 + this.savePreferences();
332 + toggleDeviceList: function(event) {
333 + if((event.up) && ( event.up.altKey || event.up.metaKey))
334 + this.toggleFlashlightLed(event);
336 + if(this.devicedrawer.mojo.getOpenState()) {
337 + this.prevDrawer = null;
339 + this.controller.hideWidgetContainer(this.controller.get('devicedetails'));
342 + if(this.prevDrawer)
343 + this.prevDrawer.mojo.setOpenState(false);
345 + this.prevDrawer = this.devicedrawer;
347 + this.controller.showWidgetContainer(this.controller.get('devicedetails'));
350 + this.devicedrawer.mojo.setOpenState(!this.devicedrawer.mojo.getOpenState());
354 + toggleFlashlightLed: function(event) {
355 + if(!this.modelFlashlight.value) {
356 + var ledState = "enabled";
357 + this.modelFlashlight.value = true;
360 + var ledState = "disabled";
361 + this.modelFlashlight.value = false;
364 + this.controller.modelChanged(this.modelFlashlight, this);
366 + this.controller.serviceRequest('palm://org.e.lnx.wee.ledctl.service/', {
367 + method: 'ledState', parameters: {state: ledState}});
369 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
370 + this.toggleDeviceMenu.bind(this).delay(0.2);
372 + if(this.quickAction == "LED Flashlight") {
373 + if(ledState == "disabled")
374 + this.controller.get('menu_action').innerHTML = $L('Turn on LED Flashlight');
376 + this.controller.get('menu_action').innerHTML = $L('Turn off LED Flashlight');
381 + handleFlashlightToggle: function(event) {
382 + // BUG in toggle button widget!
384 + if(this.modelFlashlight.value)
385 + var ledState = "enabled";
387 + var ledState = "disabled";
389 + if(this.quickAction == "LED Flashlight") {
390 + if(ledState == "disabled")
391 + this.controller.get('menu_action').innerHTML = $L('Turn on LED Flashlight');
393 + this.controller.get('menu_action').innerHTML = $L('Turn off LED Flashlight');
396 + this.controller.serviceRequest('palm://org.e.lnx.wee.ledctl.service/', {
397 + method: 'ledState', parameters: {state: ledState}
401 + handleBrightnessSlider: function(event) {
402 + this.controller.serviceRequest('palm://com.palm.display/control', {
403 + method: 'setProperty', parameters:{maximumBrightness: Math.round(event.value)}
406 + this.controller.get('dm_brightness').innerHTML = Math.round(event.value);
409 + handleVolumeSlider: function(event) {
410 + this.controller.serviceRequest('palm://com.palm.audio/' + this.volumeSlider, {
411 + method: 'setVolume', parameters:{volume: Math.round(event.value)}
414 + this.controller.get('dm_volume').innerHTML = Math.round(event.value);
417 + handleVolumeToggle: function(event) {
418 + if(this.controller.get('volume_toggle').innerHTML == $L("Ringtone Volume"))
419 + this.volumeSlider = "system";
420 + else if(this.controller.get('volume_toggle').innerHTML == $L("System Volume"))
421 + this.volumeSlider = "media";
423 + this.volumeSlider = "ringtone";
425 + this.updateVolumeState();
428 + updateFlashState: function() {
429 + if(this.quickAction == "LED Flashlight")
430 + this.controller.get('menu_action').innerHTML = $L('Turn on LED Flashlight');
432 + this.controller.serviceRequest('palm://org.e.lnx.wee.ledctl.service/', {
433 + method: 'ledState',
435 + onSuccess: function(response) {
436 + if(response.state == "enabled") {
437 + this.modelFlashlight.value = true;
439 + if(this.quickAction == "LED Flashlight")
440 + this.controller.get('menu_action').innerHTML = $L('Turn off LED Flashlight');
443 + this.modelFlashlight.value = false;
445 + this.controller.modelChanged(this.modelFlashlight, this);
450 + updateScreenState: function() {
451 + this.controller.serviceRequest('palm://com.palm.display/control', {
452 + method: 'getProperty',
453 + parameters:{properties:['maximumBrightness']},
454 + onSuccess: function(response) {
455 + if(response.maximumBrightness != undefined) {
456 + this.modelBrightness.value = parseInt(response.maximumBrightness);
457 + this.controller.modelChanged(this.modelBrightness);
459 + this.controller.get('dm_brightness').innerHTML = response.maximumBrightness;
461 + this.controller.get('dm_brightness').innerHTML = "??";
467 + updateVolumeState: function() {
468 + if(this.volumeSlider == "ringtone")
469 + this.controller.get('volume_toggle').innerHTML = $L("Ringtone Volume");
470 + else if(this.volumeSlider == "system")
471 + this.controller.get('volume_toggle').innerHTML = $L("System Volume");
472 + else if(this.volumeSlider == "media")
473 + this.controller.get('volume_toggle').innerHTML = $L("Media Volume");
475 + this.controller.serviceRequest('palm://com.palm.audio/' + this.volumeSlider, {
476 + method: 'getVolume',
478 + onSuccess: function(response) {
479 + if(response.volume != undefined) {
480 + this.modelVolume.value = parseInt(response.volume);
481 + this.controller.modelChanged(this.modelVolume);
483 + this.controller.get('dm_volume').innerHTML = response.volume;
485 + this.controller.get('dm_volume').innerHTML = "??";
491 + toggleSecurityList: function(event) {
492 + if((event.up) && ( event.up.altKey || event.up.metaKey)) {
493 + this.serviceRequest = new Mojo.Service.Request('palm://com.palm.applicationManager', {
495 + parameters: {'id': 'com.palm.app.screenlock','params':{mode: "none"}}
499 + if(this.securitydrawer.mojo.getOpenState()) {
500 + this.prevDrawer = null;
502 + this.controller.hideWidgetContainer(this.controller.get('securitydetails'));
505 + if(this.prevDrawer)
506 + this.prevDrawer.mojo.setOpenState(false);
508 + this.prevDrawer = this.securitydrawer;
510 + this.controller.showWidgetContainer(this.controller.get('securitydetails'));
513 + this.securitydrawer.mojo.setOpenState(!this.securitydrawer.mojo.getOpenState());
517 + changeSecurityState: function(event) {
518 + if(event.target.id == "security_pin")
519 + var security = "pin";
520 + else if(event.target.id == "security_pw")
521 + var security = "password";
523 + var security = "none";
525 + this.serviceRequest = new Mojo.Service.Request('palm://com.palm.applicationManager', {
527 + parameters: {'id': 'com.palm.app.screenlock','params':{mode: security}}
531 + updateSecurityState: function() {
532 + this.controller.serviceRequest('palm://com.palm.systemmanager/', {
533 + method: "getDeviceLockMode",
534 + onComplete: function(response) {
535 + if(response && response.lockMode) {
536 + if(response.lockMode === 'pin')
537 + this.controller.get('securitymsg').innerHTML = $L('PIN');
538 + else if(response.lockMode === 'password')
539 + this.controller.get('securitymsg').innerHTML = $L('PW');
541 + this.controller.get('securitymsg').innerHTML = $L('None');
547 + toggleNetworkList: function(event) {
548 + if((event.up) && ( event.up.altKey || event.up.metaKey)) {
549 + this.controller.serviceRequest('palm://com.palm.telephony/', {
550 + method: "ratSet", parameters: {"mode": "automatic"}
554 + if(this.networkdrawer.mojo.getOpenState()) {
555 + this.prevDrawer = null;
557 + this.controller.hideWidgetContainer(this.controller.get('networkdetails'));
560 + if(this.prevDrawer)
561 + this.prevDrawer.mojo.setOpenState(false);
563 + this.prevDrawer = this.networkdrawer;
565 + this.controller.showWidgetContainer(this.controller.get('networkdetails'));
568 + this.networkdrawer.mojo.setOpenState(!this.networkdrawer.mojo.getOpenState());
570 - this.apModeInProgress = true;
573 + changeNetworkState: function(event) {
574 + if(event.target.id == "network_2g")
575 + var network = "gsm";
576 + else if(event.target.id == "network_3g")
577 + var network = "umts";
579 + var network = "automatic";
581 + this.controller.serviceRequest('palm://com.palm.telephony/', {
582 + method: "ratSet", parameters: {"mode": network},
583 + onComplete: this.updateNetworkState.bind(this) });
585 + this.toggleDeviceMenu.bind(this).delay(0.2);
588 + updateNetworkState: function() {
589 + this.controller.serviceRequest('palm://com.palm.telephony/', {
590 + method: "ratQuery",
591 + onComplete: function(response) {
592 + if(response && response.extended && response.extended.mode) {
593 + if(response.extended.mode === 'gsm')
594 + this.controller.get('networkmsg').innerHTML = $L('2G');
595 + else if(response.extended.mode === 'umts')
596 + this.controller.get('networkmsg').innerHTML = $L('3G');
598 + this.controller.get('networkmsg').innerHTML = $L('Auto');
601 + this.controller.get('networkmsg').innerHTML = $L('Auto');
606 + togglePhoneList: function(event) {
607 + //Ignore the tap event if Airplane Mode is on
608 + if(this.barAssistant.getAirplaneMode())
611 + if((event.up) && ( event.up.altKey || event.up.metaKey))
612 + this.togglePhoneConn(event);
614 + if(this.phonedrawer.mojo.getOpenState()) {
615 + this.prevDrawer = null;
617 + this.controller.hideWidgetContainer(this.controller.get('phonedetails'));
620 + if(this.prevDrawer)
621 + this.prevDrawer.mojo.setOpenState(false);
623 + this.prevDrawer = this.phonedrawer;
625 + this.controller.showWidgetContainer(this.controller.get('phonedetails'));
628 + this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState());
632 + togglePhoneConn: function(event) {
633 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
634 + this.toggleDeviceMenu.bind(this).delay(0.2);
636 + if(ConnState.get('phone')) {
637 + this.controller.get('phone_conn').innerHTML = $L('Turning off Phone');
639 + if(this.quickAction == "Phone Connection")
640 + this.controller.get('menu_action').innerHTML = $L('Turning off Phone Connection');
643 + this.controller.get('phone_conn').innerHTML = $L('Turning on Phone');
645 + if(this.quickAction == "Phone Connection")
646 + this.controller.get('menu_action').innerHTML = $L('Turning on Phone Connection');
650 + if(ConnState.get('phone')) {
651 + this.controller.serviceRequest("palm://com.palm.telephony", {'method': "powerSet",
652 + 'parameters': {'state': "off"}});
655 + this.controller.serviceRequest("palm://com.palm.telephony", {'method': "powerSet",
656 + 'parameters': {'state': "on"}});
660 + togglePhoneRoam: function(event) {
661 + var roamstate = RoamState.get('phone');
663 + if((event.up) && ( event.up.altKey || event.up.metaKey)) {
664 + if(roamstate === 'any')
665 + var state = 'roamonly';
670 + if(roamstate === 'any')
671 + var state = 'homeonly';
676 + this.controller.serviceRequest('palm://com.palm.telephony', {
677 + method: 'roamModeSet',
678 + parameters: {mode: state, client: Mojo.appName}
681 + this.toggleDeviceMenu.bind(this).delay(0.2);
684 + handlePhoneLaunch: function(event) {
685 + this.launchPhonePrefs.bind(this).delay(0.2);
688 + launchPhonePrefs: function(toggleMenu) {
689 + this.serviceRequest = new Mojo.Service.Request('palm://com.palm.applicationManager', {
691 + parameters: {'id': 'com.palm.app.phoneprefs','params':{}}
694 + this.toggleDeviceMenu();
697 + updatePhoneState: function() {
698 + var phonestate = this.barAssistant.getCurrentPhoneState();
700 + if(phonestate === 'Off') {
701 + ConnState.set('phone', false);
703 + this.controller.get('phonemsg').innerHTML = $L('Off');
705 + this.controller.get('phone_conn').innerHTML = $L('Turn on Phone');
707 + if(this.quickAction == "Phone Connection")
708 + this.controller.get('menu_action').innerHTML = $L('Turn on Phone Connection');
711 + ConnState.set('phone', true);
713 + if(phonestate === 'On')
714 + this.controller.get('phonemsg').innerHTML = $L('On');
716 + this.controller.get('phonemsg').innerHTML = phonestate.escapeHTML();
718 + this.controller.get('phone_conn').innerHTML = $L('Turn off Phone');
720 + if(this.quickAction == "Phone Connection")
721 + this.controller.get('menu_action').innerHTML = $L("Turn off Phone Connection");
724 + this.controller.get('phone_roam').innerHTML = $L('Roaming Enabled');
726 + this.controller.serviceRequest('palm://com.palm.telephony/', {
727 + method: 'roamModeQuery', parameters: {},
728 + onSuccess: function(response) {
729 + RoamState.set('phone', response.extended.mode);
731 + var roamstate = RoamState.get('phone');
733 + if(roamstate=='roamonly') {
734 + this.controller.get('phone_roam').innerHTML = $L('Roaming Forced');
736 + if(this.quickAction == "Voice Roaming")
737 + this.controller.get('menu_action').innerHTML = $L("Enable Voice Roaming");
739 + else if (roamstate=="homeonly") {
740 + this.controller.get('phone_roam').innerHTML = $L('Roaming Disabled');
742 + if(this.quickAction == "Voice Roaming")
743 + this.controller.get('menu_action').innerHTML = $L("Enable Voice Roaming");
746 + this.controller.get('phone_roam').innerHTML = $L('Roaming Enabled');
748 + if(this.quickAction == "Voice Roaming")
749 + this.controller.get('menu_action').innerHTML = $L("Disable Voice Roaming");
755 + toggleDataList: function(event) {
756 + //Ignore the tap event if Airplane Mode is on
757 + if(this.barAssistant.getAirplaneMode())
760 + if((event.up) && ( event.up.altKey || event.up.metaKey))
761 + this.toggleDataConn(event);
763 + if(this.datadrawer.mojo.getOpenState()) {
764 + this.prevDrawer = null;
766 + this.controller.hideWidgetContainer(this.controller.get('datadetails'));
769 + if(this.prevDrawer)
770 + this.prevDrawer.mojo.setOpenState(false);
772 + this.prevDrawer = this.datadrawer;
774 + this.controller.showWidgetContainer(this.controller.get('datadetails'));
777 + this.datadrawer.mojo.setOpenState(!this.datadrawer.mojo.getOpenState());
781 + toggleDataConn: function(event) {
782 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
783 + this.toggleDeviceMenu.bind(this).delay(0.2);
785 + if(ConnState.get('data')) {
786 + this.controller.get('data_conn').innerHTML = $L('Turning off Data');
788 + if(this.quickAction == "Data Connection")
789 + this.controller.get('menu_action').innerHTML = $L('Turn off Data Connection');
792 + this.controller.get('data_conn').innerHTML = $L('Turn on Data');
794 + if(this.quickAction == "Data Connection")
795 + this.controller.get('menu_action').innerHTML = $L('Turn on Data Connection');
799 + if(ConnState.get('data'))
804 + this.controller.serviceRequest('palm://com.palm.wan/', {
805 + method: 'set', parameters: {disablewan: state} });
808 + toggleDataRoam: function(event) {
809 + var roamstate = RoamState.get('data');
811 + if(roamstate === true)
812 + var state = "enable";
814 + var state = "disable";
816 + this.controller.serviceRequest('palm://com.palm.wan/', {
818 + parameters: {roamguard: state},
821 + this.toggleDeviceMenu.bind(this).delay(0.2);
824 + updateDataState: function() {
825 + var datastate = this.barAssistant.getCurrentDataState();
827 + if(datastate === 'Off') {
828 + ConnState.set('data', false);
830 + this.controller.get('datamsg').innerHTML = $L('Off');
832 + this.controller.get('data_conn').innerHTML = $L('Turn on Data');
834 + if(this.quickAction == "Data Connection")
835 + this.controller.get('menu_action').innerHTML = $L('Turn on Data Connection');
838 + ConnState.set('data', true);
840 + if(datastate === 'On')
841 + this.controller.get('datamsg').innerHTML = $L('On');
843 + this.controller.get('datamsg').innerHTML = datastate.escapeHTML();
845 + this.controller.get('data_conn').innerHTML = $L('Turn off Data');
847 + if(this.quickAction == "Data Connection")
848 + this.controller.get('menu_action').innerHTML = $L("Turn off Data Connection");
851 + var roamstate = this.barAssistant.getRoamingDataState();
853 + if(roamstate === 'Off') {
854 + RoamState.set('data', false);
856 + this.controller.get('data_roam').innerHTML = $L('Roaming Disabled');
858 + if(this.quickAction == "Data Roaming")
859 + this.controller.get('menu_action').innerHTML = $L("Enable Data Roaming");
862 + RoamState.set('data', true);
864 + this.controller.get('data_roam').innerHTML = $L('Roaming Enabled');
866 + if(this.quickAction == "Data Roaming")
867 + this.controller.get('menu_action').innerHTML = $L("Disable Data Roaming");
871 + updateWiFiState: function() {
872 + var wifistate = this.barAssistant.getCurrentWiFiState();
874 + if(wifistate === 'Off') {
875 + RadioState.set('wifi',false);
877 + this.controller.get('wifimsg').innerHTML = $L('Off');
879 + this.controller.get('wifi_radio').innerHTML = $L('Turn on Wi-Fi');
881 + if(this.quickAction == "Wi-Fi Connection")
882 + this.controller.get('menu_action').innerHTML = $L("Turn on Wi-Fi Connection");
885 + RadioState.set('wifi',true);
887 + if(wifistate === 'On')
888 + this.controller.get('wifimsg').innerHTML = $L('On');
890 + this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML();
892 + this.controller.get('wifi_radio').innerHTML = $L('Turn off Wi-Fi');
894 + if(this.quickAction == "Wi-Fi Connection")
895 + this.controller.get('menu_action').innerHTML = $L("Turn off Wi-Fi Connection");
899 + updateBTState: function() {
900 + var btstate = this.barAssistant.getCurrentBluetoothState();
902 + if(btstate === 'Off') {
903 + RadioState.set('bluetooth',false);
905 + this.controller.get('btmsg').innerHTML = $L('Off');
907 + this.controller.get('bt_radio').innerHTML = $L('Turn on Bluetooth');
909 + if(this.quickAction == "BT Connection")
910 + this.controller.get('menu_action').innerHTML = $L("Turn on BT Connection");
913 + RadioState.set('bluetooth',true);
915 + if(btstate === 'On')
916 + this.controller.get('btmsg').innerHTML = $L('On');
918 + this.controller.get('btmsg').innerHTML = btstate.escapeHTML();
920 + this.controller.get('bt_radio').innerHTML = $L('Turn off Bluetooth');
922 + if(this.quickAction == "BT Connection")
923 + this.controller.get('menu_action').innerHTML = $L("Turn off BT Connection");
926 + if(this.turningOnBtRadio) {
927 + this.btspinnerModel.spinning = true;
928 + this.controller.modelChanged(this.btspinnerModel);
932 + updateGPSState: function() {
933 + var gpsstate = this.barAssistant.getCurrentGpsState();
935 + if(gpsstate === 'Off') {
936 + RadioState.set('gps',false);
938 + this.controller.get('gpsmsg').innerHTML = $L('Off');
940 + this.controller.get('gps_radio').innerHTML = $L('Turn on GPS');
942 + if(this.quickAction == "GPS Connection")
943 + this.controller.get('menu_action').innerHTML = $L("Turn on GPS Connection");
946 + RadioState.set('gps',true);
948 + if(gpsstate === 'On')
949 + this.controller.get('gpsmsg').innerHTML = $L('On');
951 + this.controller.get('gpsmsg').innerHTML = gpsstate.escapeHTML();
953 + this.controller.get('gps_radio').innerHTML = $L('Turn off GPS');
955 + if(this.quickAction == "GPS Connection")
956 + this.controller.get('menu_action').innerHTML = $L("Turn off GPS Connection");
960 + updateMenuItems: function() {
961 + var msg = $L("Battery: #{batlevel}, #{batstate}");
963 + this.controller.get('menu_header').innerHTML = new Template(msg).evaluate({"batlevel": Mojo.Format.formatPercent(this.barAssistant.getBatteryLevel()), "batstate": this.barAssistant.getBatteryState()});
965 + for(var i = 0; i < this.menus.length; i++) {
966 + if(this.hiddenItems.indexOf(this.menus[i]) == -1)
967 + this.controller.get(this.item_ids[i]).show();
969 + this.controller.get(this.item_ids[i]).hide();
972 + this.controller.modelChanged(this.modesModel, this);
974 + var temp = this.barAssistant.getBatteryTemp();
976 + this.controller.get("devicemsg").innerHTML = temp + "°C";
978 + this.updateFlashState();
979 + this.updateScreenState();
980 + this.updateVolumeState();
982 + this.updateSecurityState();
984 + this.updateNetworkState();
986 + this.updatePhoneState();
988 + this.updateDataState();
990 + this.updateWiFiState();
992 + this.updateBTState();
994 + this.updateGPSState();
996 + this.updateAirplaneModeSettings();
999 + updateEditItems: function() {
1000 + this.controller.get('menu_header').innerHTML = $L("Menu Content Settings");
1002 + this.controller.get('menu_action').innerHTML = $L("Toggle " + this.quickAction);
1004 + this.editItems.clear();
1006 + for(var i = 0; i < this.menus.length; i++) {
1007 + if(this.hiddenItems.indexOf(this.menus[i]) == -1)
1008 + this.editItems.push({title: this.menus[i], label: "show"});
1010 + this.editItems.push({title: this.menus[i], label: "hide"});
1013 + this.controller.modelChanged(this.modelEditItems, this);
1016 + toggleGpsRadio: function(event) {
1017 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
1018 + this.toggleDeviceMenu.bind(this).delay(0.2);
1020 + if(RadioState.get('gps')) {
1021 + this.controller.get('gps_radio').innerHTML = $L('Turning off GPS');
1023 + if(this.quickAction == "GPS Connection")
1024 + this.controller.get('menu_action').innerHTML = $L("Turning off GPS Connection");
1027 + this.controller.get('gps_radio').innerHTML = $L('Turning on GPS');
1029 + if(this.quickAction == "GPS Connection")
1030 + this.controller.get('menu_action').innerHTML = $L("Turning on GPS Connection");
1034 + if(RadioState.get('gps')) {
1035 + this.controller.serviceRequest('palm://com.palm.location/', {
1036 + method: 'setUseGps', parameters: {useGps: false},
1037 + onSuccess: this.barAssistant.gpsGetRadioStatus.bind(this)});
1040 + this.controller.serviceRequest('palm://com.palm.location/', {
1041 + method: 'setUseGps', parameters: {useGps: true},
1042 + onSuccess: this.barAssistant.gpsGetRadioStatus.bind(this)});
1047 + * Toggles the GPS List to show and hide when tapping on the GPS Row.
1050 + toggleGpsList: function(event) {
1052 + //Ignore the tap event if Airplane Mode is on
1053 + if(this.barAssistant.getAirplaneMode())
1056 + if((event.up) && ( event.up.altKey || event.up.metaKey))
1057 + this.toggleGpsRadio(event);
1059 + if (this.gpsdrawer.mojo.getOpenState()) {
1060 + this.prevDrawer = null;
1062 + this.controller.hideWidgetContainer(this.controller.get('gpsdetails'));
1065 + if(this.prevDrawer)
1066 + this.prevDrawer.mojo.setOpenState(false);
1068 + this.prevDrawer = this.gpsdrawer;
1070 + this.controller.showWidgetContainer(this.controller.get('gpsdetails'));
1072 + this.gpsdrawer.mojo.setOpenState(!this.gpsdrawer.mojo.getOpenState());
1076 + handleGpsLaunch: function(event) {
1077 + this.launchGps.bind(this).delay(0.2,true);
1080 + launchGps: function(toggleMenu) {
1081 + this.serviceRequest = new Mojo.Service.Request('palm://com.palm.applicationManager', {
1083 + parameters: {'id': 'com.palm.app.location','params':{}}
1086 + this.toggleDeviceMenu();
1089 toggleBTRadio: function(event) {
1091 if(this.turningOnBtRadio)
1094 if(RadioState.get('bluetooth')) {
1095 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
1096 + this.toggleDeviceMenu.delay(0.2);
1098 + this.controller.get('bt_radio').innerHTML = $L('Turning off Bluetooth');
1100 + if(this.quickAction == "BT Connection")
1101 + this.controller.get('menu_action').innerHTML = $L("Turning off BT Connection");
1104 BtService.radiooff(null,null);
1105 - this.toggleDeviceMenu.delay(0.2);
1109 + if((event.up) && (event.up.altKey || event.up.metaKey))
1110 + this.noClosing = true;
1112 + this.controller.get('bt_radio').innerHTML = $L('Turning on Bluetooth');
1114 + if(this.quickAction == "BT Connection")
1115 + this.controller.get('menu_action').innerHTML = $L("Turning on BT Connection");
1118 this.btRadioOnServiceReq = BtService.radioon(this.btRadioTurnedOn.bind(this),null);
1122 btRadioTurnedOn: function(payload) {
1123 @@ -262,10 +1233,49 @@
1124 togglebluetoothList: function(event) {
1126 //Ignore the tap event if Airplane Mode is in Progress
1127 - if(this.apModeInProgress)
1128 + if(this.barAssistant.getAirplaneMode())
1131 + if((event.up) && ( event.up.altKey || event.up.metaKey))
1132 + this.toggleBTRadio(event);
1134 + this.clearBTList();
1135 + if (this.btdrawer.mojo.getOpenState()) {
1136 + this.prevDrawer = null;
1138 + this.controller.get('btlist').hide();
1139 + this.controller.hideWidgetContainer(this.controller.get('btdetails'));
1142 + if(this.prevDrawer)
1143 + this.prevDrawer.mojo.setOpenState(false);
1145 + this.prevDrawer = this.btdrawer;
1147 + if (RadioState.get('bluetooth')) {
1148 + this.controller.get('bt_radio').innerHTML = $L('Turn off Bluetooth');
1149 + if (this.btTrustedListReq) {
1150 + this.btTrustedListReq.cancel();
1151 + this.btTrustedListReq = undefined;
1153 + this.btTrustedListReq = BtService.getTrustedList(this.BtDevicesHandler.bind(this), this.BtDevicesHandler.bind(this));
1156 + this.getNumBTProfileReq = BtService.getNumOfProfiles(this.gotNumOfProfiles.bind(this));
1157 + if(this.turningOnBtRadio) {
1158 + this.controller.get('bt_radio').innerHTML = $L('Turning on Bluetooth');
1161 + this.controller.get('bt_radio').innerHTML = $L('Turn on Bluetooth');
1164 + this.controller.get('btlist').show();
1165 + this.controller.showWidgetContainer(this.controller.get('btdetails'));
1167 + this.btdrawer.mojo.setOpenState(!this.btdrawer.mojo.getOpenState());
1170 - this.clearBTList();
1171 +/* this.clearBTList();
1172 if (this.btdrawer.mojo.getOpenState()) {
1173 this.controller.get('btlist').hide();
1174 this.controller.hideWidgetContainer(this.controller.get('btdetails'));
1175 @@ -292,7 +1302,7 @@
1176 this.controller.get('btlist').show();
1177 this.controller.showWidgetContainer(this.controller.get('btdetails'));
1179 - this.btdrawer.mojo.setOpenState(!this.btdrawer.mojo.getOpenState());
1180 + this.btdrawer.mojo.setOpenState(!this.btdrawer.mojo.getOpenState()); */
1183 //Clear the Bluetooth List Array and List Model.
1184 @@ -343,7 +1353,7 @@
1185 device.CONNECTSTATE = 'disconnected';
1186 device.showConnected = 'none';
1187 this.btListWidget.mojo.invalidateItems(deviceIndex,1);
1188 - if(this.isVisible)
1189 + if((this.isVisible) && (!this.noClosing))
1190 this.toggleDeviceMenu();
1193 @@ -469,6 +1479,7 @@
1194 if(!payload || !payload.returnValue ||!payload.trusteddevices)
1197 + if(payload.trusteddevices) {
1198 for (var i = 0; i < payload.trusteddevices.length; i++) {
1200 DISPNAME: payload.trusteddevices[i].name,
1201 @@ -503,6 +1514,7 @@
1202 this.btListWidget.mojo.noticeAddedItems(this.btListWidget.mojo.getLength(), items);
1209 @@ -581,7 +1593,7 @@
1213 - if(this.isVisible && this.btConnectedDeviceAddr != payload.address)
1214 + if(this.isVisible && !this.noClosing && this.btConnectedDeviceAddr != payload.address)
1215 this.toggleDeviceMenu.delay(1);
1216 this.btConnectedDeviceAddr = payload.address;
1218 @@ -680,7 +1692,7 @@
1220 else if(value === 'turningon') {
1221 this.turningOnBtRadio = true;
1222 - this.controller.get('bt_radio').innerHTML = $L('Turning on Bluetooth...');
1223 + this.controller.get('bt_radio').innerHTML = $L('Turning on Bluetooth');
1224 if (this.isVisible) {
1225 this.btspinnerModel.spinning = true;
1226 this.controller.modelChanged(this.btspinnerModel);
1227 @@ -724,11 +1736,29 @@
1229 toggleWifiRadio: function(event) {
1230 if(RadioState.get('wifi')) {
1231 + if((!event.up) || (!event.up.altKey && !event.up.metaKey))
1232 + this.toggleDeviceMenu.delay(0.2);
1234 + this.controller.get('wifi_radio').innerHTML = $L('Turning off Wi-Fi');
1236 + if(this.quickAction == "Wi-Fi Connection")
1237 + this.controller.get('menu_action').innerHTML = $L("Turning off Wi-Fi Connection");
1240 WiFiService.setState("disabled",null,null);
1241 - this.toggleDeviceMenu.delay(0.2);
1246 + if((event.up) && (event.up.altKey || event.up.metaKey))
1247 + this.noClosing = true;
1249 + this.controller.get('wifi_radio').innerHTML = $L('Turning on Wi-Fi');
1251 + if(this.quickAction == "Wi-Fi Connection")
1252 + this.controller.get('menu_action').innerHTML = $L("Turning on Wi-Fi Connection");
1255 WiFiService.setState("enabled",null,null);
1258 @@ -737,10 +1767,43 @@
1259 togglewifiList: function(event) {
1261 //Ignore the tap event if Airplane Mode is in Progress
1262 - if(this.apModeInProgress)
1263 + if(this.barAssistant.getAirplaneMode())
1266 - this.clearWiFiList();
1267 + if((event.up) && ( event.up.altKey || event.up.metaKey))
1268 + this.toggleWifiRadio(event);
1270 + this.clearWiFiList();
1271 + if(this.wifidrawer.mojo.getOpenState()) {
1272 + this.prevDrawer = null;
1274 + this.clearWiFiList();
1275 + this.controller.get('wifilist').hide();
1276 + this.controller.hideWidgetContainer(this.controller.get('wifidetails'));
1279 + if(this.prevDrawer)
1280 + this.prevDrawer.mojo.setOpenState(false);
1282 + this.prevDrawer = this.wifidrawer;
1284 + if(RadioState.get('wifi')) {
1287 + if(this.wifiFindNetworksReq) {
1288 + this.wifiFindNetworksReq.cancel();
1289 + this.wifiFindNetworksReq = undefined;
1291 + this.wifiFindNetworksReq = WiFiService.findNetworks(this.wifiListCb.bind(this),this.wifiListCb.bind(this));
1294 + this.controller.get('wifilist').show();
1295 + this.controller.showWidgetContainer(this.controller.get('wifidetails'));
1297 + this.wifidrawer.mojo.setOpenState(!this.wifidrawer.mojo.getOpenState());
1300 +/* this.clearWiFiList();
1301 if(this.wifidrawer.mojo.getOpenState()) {
1302 this.clearWiFiList();
1303 this.controller.get('wifilist').hide();
1304 @@ -763,7 +1826,7 @@
1305 this.controller.get('wifilist').show();
1306 this.controller.showWidgetContainer(this.controller.get('wifidetails'));
1308 - this.wifidrawer.mojo.setOpenState(!this.wifidrawer.mojo.getOpenState());
1309 + this.wifidrawer.mojo.setOpenState(!this.wifidrawer.mojo.getOpenState()); */
1313 @@ -1124,6 +2187,9 @@
1316 handleVPNTap: function(event) {
1317 + if((event.up) && (event.up.altKey || event.up.metaKey))
1318 + this.noClosing = true;
1320 var item = event.item;
1321 var itemIndex = event.index;
1323 @@ -1392,12 +2458,19 @@
1327 - toggleDeviceMenu: function() {
1328 + toggleDeviceMenu: function(edit) {
1329 + this.noClosing = false;
1331 + this.barAssistant.gpsGetRadioStatus();
1333 this.clearAllAnimations();
1335 if(this.isVisible) {
1336 this.isVisible = false;
1338 + if(this.prevDrawer)
1339 + this.prevDrawer.mojo.setOpenState(false);
1341 if (this.btspinnerModel.spinning) {
1342 this.btspinnerModel.spinning = false;
1343 this.controller.modelChanged(this.btspinnerModel);
1344 @@ -1405,8 +2478,8 @@
1345 //animate the submenu onto the scene
1346 var animateScrim = function(){
1347 Mojo.Animation.animateStyle(this.scrim, 'opacity', 'bezier', {
1355 @@ -1435,13 +2508,31 @@
1358 this.isVisible = true;
1359 - var date = new Date();
1360 +/* var date = new Date();
1361 this.controller.get('dm_date').innerHTML = Mojo.Format.formatDate(date,{date:'EEE '}) + Mojo.Format.formatDate(date,{date:'long'});
1363 if(this.turningOnBtRadio) {
1364 this.btspinnerModel.spinning = true;
1365 this.controller.modelChanged(this.btspinnerModel);
1369 + this.isEditing = true;
1371 + this.controller.get('menu_items').hide();
1372 + this.controller.get('edit_items').show();
1374 + this.updateEditItems();
1377 + this.isEditing = false;
1379 + this.controller.get('menu_items').show();
1380 + this.controller.get('edit_items').hide();
1382 + this.updateMenuItems();
1385 this.activateStage();
1387 var animateDialog = function(){
1388 @@ -1504,12 +2595,22 @@
1392 - updateBatteryLevel: function(batlevel) {
1393 +/* updateBatteryLevel: function(batlevel) {
1394 var msg = $L("Battery: #{batlevel}");
1395 this.controller.get('dm_battery').innerHTML = new Template(msg).evaluate({
1396 "batlevel": Mojo.Format.formatPercent(batlevel)
1401 + updateBatteryInfo: function(batlevel, batstate) {
1402 + if(!this.isEditing) {
1403 + var msg = $L("Battery: #{batlevel}, #{batstate}");
1404 + this.controller.get('menu_header').innerHTML = new Template(msg).evaluate({
1405 + "batlevel": Mojo.Format.formatPercent(batlevel),
1406 + "batstate": batstate
1411 appMenuClosed: function(e) {
1412 this.deactivateStage();
1413 --- .orig/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
1414 +++ /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
1416 <div id="devicescroller" class="palm-popup-content" x-mojo-element="Scroller">
1417 <div class="palm-list">
1419 - <div class="palm-row first"><div class="palm-row-wrapper">
1420 - <div id="dm_date" class="title dim"></div>
1421 + <div class="palm-row first menu-start"><div class="palm-row-wrapper">
1422 + <div id="menu_header" class="title dim"></div>
1425 + <div class="palm-section-divider"></div>
1427 + <div id="menu_items">
1429 + <div class="palm-row" id="dm_device" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1430 + <div class="title truncating-text">
1431 + <div class="label right" id="devicemsg"> </div>
1432 + <span x-mojo-loc=''>Device</span>
1436 + <div id='devicedetails' x-mojo-element="Drawer">
1438 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1439 + <div style="padding: 5px 0px 5px 0px;">
1440 + <div id="flashlight_toggle" class="right" x-mojo-element="ToggleButton"></div>
1441 + <div class="title truncating-text" >LED Flashlight</div>
1445 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1446 + <div id="dm_brightness" style="float:right;padding-top:16px;padding-right: 22px;font-weight:bold;">50</div>
1447 + <div class="title">Screen Brightness</div>
1449 + <div x-mojo-element="Slider" id="brightness_slider" style="padding: 1px 3px 0px 0px; height: 40px;"></div>
1452 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1453 + <div id="dm_volume" style="float:right;padding-top:16px;padding-right: 22px;font-weight:bold;">50</div>
1454 + <div id="volume_toggle" class="title">Ringtone Volume</div>
1456 + <div x-mojo-element="Slider" id="volume_slider" style="padding-top: 1px 3px 0px 0px; height: 40px;"></div>
1460 <div class="palm-section-divider">
1463 - <div class="palm-row"><div class="palm-row-wrapper">
1464 - <div id="dm_battery" class="title dim"></div>
1466 + <div class="palm-row" id="dm_security" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1467 + <div class="title truncating-text">
1468 + <div class="label right" id="securitymsg"> </div>
1469 + <span x-mojo-loc=''>Security</span>
1473 + <div id="securitydetails" x-mojo-element="Drawer">
1475 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1476 + <div id="security_none" class="title truncating-text">Secure Unlock Off</div>
1479 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1480 + <div id="security_pin" class="title truncating-text">Simple PIN Unlock</div>
1483 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1484 + <div id="security_pw" class="title truncating-text">Password Unlock</div>
1489 <div class="palm-section-divider"></div>
1492 <div class="title truncating-text">
1493 <div class="label right" id="imemsg"> </div>
1494 <div class="ime-container">
1495 - <span x-mojo-loc=''>Input Methods</span>
1496 + <span x-mojo-loc=''>Input</span>
1504 + <div class="palm-section-divider"></div>
1506 + <div class="palm-row" id="dm_network" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1507 + <div class="title truncating-text">
1508 + <div class="label right" id="networkmsg"> </div>
1509 + <span x-mojo-loc=''>Network</span>
1513 + <div id="networkdetails" x-mojo-element="Drawer">
1515 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1516 + <div id="network_auto" class="title truncating-text">
1521 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1522 + <div id="network_2g" class="title truncating-text">
1527 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1528 + <div id="network_3g" class="title truncating-text">
1535 + <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1536 + <div class="title truncating-text">
1537 + <div class="label right" id="phonemsg"> </div>
1538 + <span x-mojo-loc=''>Phone</span>
1542 + <div id="phonedetails" x-mojo-element="Drawer">
1544 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1545 + <div id="phone_conn" class="title truncating-text"></div>
1548 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1549 + <div id="phone_roam" class="title truncating-text"></div>
1552 + <div id="phone_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1553 + <div class="title truncating-text">
1554 + <span x-mojo-loc=''>Phone Preferences</span>
1560 + <div class="palm-section-divider"></div>
1562 + <div class="palm-row" id="dm_data" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1563 + <div class="title truncating-text">
1564 + <div class="label right" id="datamsg"> </div>
1565 + <span x-mojo-loc=''>Data</span>
1569 + <div id="datadetails" x-mojo-element="Drawer">
1571 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1572 + <div id="data_conn" class="title truncating-text"></div>
1575 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1576 + <div id="data_roam" class="title truncating-text"></div>
1579 + <div id="data_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1580 + <div class="title truncating-text">
1581 + <span x-mojo-loc=''>Data Preferences</span>
1587 <div class="palm-section-divider">
1594 - <div class="palm-section-divider"></div>
1596 - <div class="palm-row" id="dm_vpn" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1597 - <div class="title truncating-text">
1598 - <div class="label right" id="vpnmsg"> </div>
1599 - <div class="vpn-container">
1600 - <span x-mojo-loc=''>VPN</span>
1605 - <div id='vpndetails' x-mojo-element="Drawer">
1607 - <div id="vpnlist" x-mojo-element="IndexedList" class="in-drawer-list">
1610 - <div class="palm-section-divider"></div>
1613 - <div id="vpn_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1614 - <div class="title truncating-text">
1615 - <span x-mojo-loc=''>VPN Preferences</span>
1622 <div class="palm-section-divider"></div>
1624 <div class="palm-row" id="dm_bluetooth" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1625 @@ -159,9 +268,63 @@
1627 <div class="palm-section-divider"></div>
1629 - <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1630 - <div id="dm_airplanemode_status" class="title truncating-text">
1632 + <div class="palm-row" id="dm_gps" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1633 + <div class="title truncating-text">
1634 + <div class="label right" id="gpsmsg"> </div>
1635 + <span x-mojo-loc=''>GPS</span>
1639 + <div id="gpsdetails" x-mojo-element="Drawer">
1641 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1642 + <div id="gps_radio" class="title truncating-text">
1646 + <div id="gps_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1647 + <div class="title truncating-text">
1648 + <span x-mojo-loc=''>GPS Preferences</span>
1654 + <div class="palm-section-divider"></div>
1656 + <div class="palm-row" id="dm_vpn" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1657 + <div class="title truncating-text">
1658 + <div class="label right" id="vpnmsg"> </div>
1659 + <div class="vpn-container">
1660 + <span x-mojo-loc=''>VPN</span>
1665 + <div id='vpndetails' x-mojo-element="Drawer">
1667 + <div id="vpnlist" x-mojo-element="IndexedList" class="in-drawer-list">
1670 + <div class="palm-section-divider"></div>
1673 + <div id="vpn_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1674 + <div class="title truncating-text">
1675 + <span x-mojo-loc=''>VPN Preferences</span>
1683 + <div id="edit_items" x-mojo-element="IndexedList"></div>
1685 + <div class="palm-section-divider"></div>
1687 + <div class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1688 + <div id="menu_action" class="title truncating-text"></div>
1692 --- .orig/usr/palm/applications/com.palm.app.screenlock/index.html
1693 +++ /usr/palm/applications/com.palm.app.screenlock/index.html
1695 Mojo.loadScript('app/controllers/app-assistant.js');
1696 Mojo.loadScript('app/controllers/securityconfig-assistant.js');
1697 Mojo.loadScript('app/controllers/pin-assistant.js');
1698 + Mojo.loadScript('app/controllers/password-assistant.js');
1699 Mojo.loadScript('app/models/SystemService.js');
1701 <link href="stylesheets/screenlock.css" media="screen" rel="stylesheet" type="text/css" />
1702 --- .orig/etc/jail_triton-inst.conf
1703 +++ /etc/jail_triton-inst.conf
1704 @@ -104,6 +104,11 @@
1711 +mount:rw:/sys/class/i2c-adapter
1715 mkdir:/media/cryptofs
1716 --- .orig/usr/lib/luna/system/luna-systemui/resources/es/views/devicemenu/devicemenu-scene.html
1717 +++ /usr/lib/luna/system/luna-systemui/resources/es/views/devicemenu/devicemenu-scene.html
1719 <div id="devicescroller" class="palm-popup-content" x-mojo-element="Scroller">
1720 <div class="palm-list">
1722 - <div class="palm-row first"><div class="palm-row-wrapper">
1723 - <div id="dm_date" class="title dim"></div>
1724 + <div class="palm-row first menu-start"><div class="palm-row-wrapper">
1725 + <div id="menu_header" class="title dim"></div>
1728 + <div class="palm-section-divider"></div>
1730 + <div id="menu_items">
1732 + <div class="palm-row" id="dm_device" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1733 + <div class="title truncating-text">
1734 + <div class="label right" id="devicemsg"> </div>
1735 + <span x-mojo-loc=''>Device</span>
1739 + <div id='devicedetails' x-mojo-element="Drawer">
1741 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1742 + <div style="padding: 5px 0px 5px 0px;">
1743 + <div id="flashlight_toggle" class="right" x-mojo-element="ToggleButton"></div>
1744 + <div class="title truncating-text" >LED Flashlight</div>
1748 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1749 + <div id="dm_brightness" style="float:right;padding-top:16px;padding-right: 22px;font-weight:bold;">50</div>
1750 + <div class="title">Screen Brightness</div>
1752 + <div x-mojo-element="Slider" id="brightness_slider" style="padding: 1px 3px 0px 0px; height: 40px;"></div>
1755 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1756 + <div id="dm_volume" style="float:right;padding-top:16px;padding-right: 22px;font-weight:bold;">50</div>
1757 + <div id="volume_toggle" class="title">Ringtone Volume</div>
1759 + <div x-mojo-element="Slider" id="volume_slider" style="padding-top: 1px 3px 0px 0px; height: 40px;"></div>
1763 <div class="palm-section-divider">
1766 - <div class="palm-row"><div class="palm-row-wrapper">
1767 - <div id="dm_battery" class="title dim"></div>
1769 + <div class="palm-row" id="dm_security" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1770 + <div class="title truncating-text">
1771 + <div class="label right" id="securitymsg"> </div>
1772 + <span x-mojo-loc=''>Security</span>
1776 + <div id="securitydetails" x-mojo-element="Drawer">
1778 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1779 + <div id="security_none" class="title truncating-text">Secure Unlock Off</div>
1782 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1783 + <div id="security_pin" class="title truncating-text">Simple PIN Unlock</div>
1786 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1787 + <div id="security_pw" class="title truncating-text">Password Unlock</div>
1792 <div class="palm-section-divider"></div>
1798 + <div class="palm-section-divider"></div>
1800 + <div class="palm-row" id="dm_network" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1801 + <div class="title truncating-text">
1802 + <div class="label right" id="networkmsg"> </div>
1803 + <span x-mojo-loc=''>Network</span>
1807 + <div id="networkdetails" x-mojo-element="Drawer">
1809 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1810 + <div id="network_auto" class="title truncating-text">
1815 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1816 + <div id="network_2g" class="title truncating-text">
1821 + <div class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1822 + <div id="network_3g" class="title truncating-text">
1829 + <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1830 + <div class="title truncating-text">
1831 + <div class="label right" id="phonemsg"> </div>
1832 + <span x-mojo-loc=''>Phone</span>
1836 + <div id="phonedetails" x-mojo-element="Drawer">
1838 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1839 + <div id="phone_conn" class="title truncating-text"></div>
1842 + <div class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1843 + <div id="phone_roam" class="title truncating-text"></div>
1846 + <div id="phone_pref" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1847 + <div class="title truncating-text">
1848 + <span x-mojo-loc=''>Phone Preferences</span>
1854 + <div class="palm-section-divider"></div>
1856 + <div class="palm-row" id="dm_data" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1857 + <div class="title truncating-text">
1858 + <div class="label right" id="datamsg"> </div>
1859 + <span x-mojo-loc=''>Data</span>
1863 + <div id="datadetails" x-mojo-element="Drawer">
1865 + <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
1866 + <div id="data_conn" class="title truncating-text"></div>