1 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2 +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
7 - if(!this.deviceLocked) {
8 +/* if(!this.deviceLocked) {
9 var appController = Mojo.Controller.getAppController();
10 var stageController = appController.getStageController("PowerOffAlert");
12 stageController.delegateToSceneAssistant("cancelTimer");
17 isDeviceLocked: function() {
19 if (payload["mode-avail"]) {
20 this.isUSBConnected = true;
21 if (!this.onActiveCall) {
22 - if (this.canUSBAlertDisplayed())
23 - this.showStorageModeAlert();
25 +// if (this.canUSBAlertDisplayed())
26 +// this.showStorageModeAlert();
28 this.createUSBDashboard();
31 @@ -2730,10 +2730,10 @@
32 Mojo.Log.info("SystemUI - USB Is connected(During Init)" + Object.toJSON(payload));
33 this.isUSBConnected = true;
34 if (!this.onActiveCall) {
35 - if (this.updateAvailable)
36 +// if (this.updateAvailable)
37 this.createUSBDashboard();
39 - this.showStorageModeAlert();
41 +// this.showStorageModeAlert();
45 @@ -2807,6 +2807,16 @@
46 * Register to receive power off notifications
48 powerOffInit: function() {
49 + this.powerMenuCfg = {items: ["shutdownDevice", "restartDevice"], allowSleep: true};
51 + var cookieContainer = new Mojo.Model.Cookie("powerMenu");
53 + var cookie = cookieContainer.get();
56 + this.powerMenuCfg.items = cookie.menuItems;
59 this.powerOffNotificationSession = new Mojo.Service.Request('palm://com.palm.bus/signal/', {
62 @@ -2844,21 +2854,39 @@
64 var appController = Mojo.Controller.getAppController();
65 var stageController = appController.getStageController("PowerOffAlert");
67 + if (stageController) {
68 + appController.closeStage("PowerOffAlert");
70 + var f = function(stageController){
71 + stageController.pushScene('poweroffalert',this, this.powerMenuCfg, true);
73 + var params = {name: 'PowerOffAlertEdit', height: 240,lightweight:true};
75 + appController.createStageWithCallback(params,f,'popupalert');
78 + appController.closeStage("PowerOffAlertEdit");
80 // if the window already exists, don't do anything
81 if (!stageController) {
82 // Create a popuo alert
83 var f = function(stageController){
84 - stageController.pushScene('poweroffalert',this);
85 + stageController.pushScene('poweroffalert',this, this.powerMenuCfg, false);
87 - var params = {name: 'PowerOffAlert', height: 175,lightweight:true};
89 + var popupHeight = (this.powerMenuCfg.items.length + 1) * 55 + 10;
91 + var params = {name: 'PowerOffAlert', height: popupHeight,lightweight:true};
92 appController.createStageWithCallback(params,f,'popupalert');
95 //Close the Storage Alert and create a USB dashboard.
96 - var storageAlertStageController = appController.getStageController('StorageModeAlert');
97 +/* var storageAlertStageController = appController.getStageController('StorageModeAlert');
98 if(storageAlertStageController) {
99 storageAlertStageController.delegateToSceneAssistant("closeAndCreateDashboard");
100 this.createUSBDashboard.bind(this).delay(0.5,false);
106 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js
107 +++ /usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js
109 /* Copyright 2009 Palm, Inc. All rights reserved. */
111 var PoweroffalertAssistant = Foundations.Class.create({
112 - initialize: function(barAssistant) {
113 + initialize: function(barAssistant, menuCfg, editMenu) {
114 this.barAssistant = barAssistant;
115 + this.menuCfg = menuCfg;
116 + this.editMenu = editMenu;
120 + if(this.editMenu) {
121 + this.controller.get('powermenu').hide();
122 + this.controller.get('editmenu').show();
124 + for(var i = 0; i < this.menuCfg.items.length; i++)
125 + this.controller.get(this.menuCfg.items[i] + "State").update($L("SHOW"));
128 + for(var i = 0; i < this.menuCfg.items.length; i++)
129 + this.controller.get(this.menuCfg.items[i] + "Button").show();
132 + var luna = this.luna.bindAsEventListener(this);
133 + var sleep = this.sleep.bindAsEventListener(this);
134 + var restart = this.restart.bindAsEventListener(this);
135 var flightMode = this.flightMode.bindAsEventListener(this);
136 - var powerOff = this.powerOff.bindAsEventListener(this);
137 + var powerOff = this.shutdown.bindAsEventListener(this);
138 var cancel = this.cancel.bindAsEventListener(this);
139 var launchAirplaneModeHelp = this.launchAirplaneModeHelp.bindAsEventListener(this);
140 this.flightMode = this.barAssistant.getAirplaneMode();
142 this.controller.get('flightmode').innerHTML = $L('Turn off Airplane Mode');
144 - this.controller.get('flightmode').innerHTML = "<div class='info-icon' id='airplaneInfo' x-mojo-touch-feedback='immediate'></div>" + $L('Airplane Mode');
146 +// this.controller.get('flightmode').innerHTML = "<div class='info-icon' id='airplaneInfo' x-mojo-touch-feedback='immediate'></div>" + $L('Airplane Mode');
147 + if(!this.menuCfg.allowSleep)
148 + this.controller.get('sleep').innerHTML = $L('Enable Device Sleep');
150 + this.controller.get('luna').addEventListener(Mojo.Event.tap, luna);
151 + this.controller.get('sleep').addEventListener(Mojo.Event.tap, sleep);
152 + this.controller.get('restart').addEventListener(Mojo.Event.tap, restart);
153 this.controller.get('poweroff').addEventListener(Mojo.Event.tap, powerOff);
154 this.controller.get('flightmode').addEventListener(Mojo.Event.tap, flightMode);
155 this.controller.get('cancel').addEventListener(Mojo.Event.tap, cancel);
157 this.powerOffAlertCancel = this.cancel.bind(this);
158 this.powerOffAlertTimer = this.controller.window.setTimeout(this.powerOffAlertCancel, 30000);
161 + this.controller.get('airplaneModeEdit').addEventListener(Mojo.Event.tap, this.editToggle.bind(this, "airplaneMode"));
162 + this.controller.get('deviceSleepEdit').addEventListener(Mojo.Event.tap, this.editToggle.bind(this, "deviceSleep"));
163 + this.controller.get('shutdownDeviceEdit').addEventListener(Mojo.Event.tap, this.editToggle.bind(this, "shutdownDevice"));
164 + this.controller.get('restartDeviceEdit').addEventListener(Mojo.Event.tap, this.editToggle.bind(this, "restartDevice"));
165 + this.controller.get('restartLunaEdit').addEventListener(Mojo.Event.tap, this.editToggle.bind(this, "restartLuna"));
168 + editToggle: function(item) {
169 + var index = this.menuCfg.items.indexOf(item);
172 + this.controller.get(item + "State").update($L("SHOW"));
174 + this.menuCfg.items.push(item);
177 + this.controller.get(item + "State").update($L("HIDE"));
179 + this.menuCfg.items.splice(index, 1);
182 + var cookieContainer = new Mojo.Model.Cookie("powerMenu");
185 + menuItems: this.menuCfg.items
188 + cookieContainer.put(cookie);
191 cleanup: function() {
193 this.controller.window.clearTimeout(this.powerOffAlertTimer);
198 + if(!this.lunaRestartTimer)
199 + this.lunaRestartTimer = this.controller.window.setTimeout(this.lunaRestart, 250);
202 + lunaRestart: function() {
203 + var request = new Mojo.Service.Request('palm://org.webosinternals.ipkgservice/', {
204 + method: 'restartLuna'});
207 + sleep: function() {
208 + if(this.menuCfg.allowSleep) {
209 + this.menuCfg.allowSleep = false;
211 + this.request = this.controller.serviceRequest("palm://com.palm.display/control", {
212 + method: "setProperty", parameters: {requestBlock: true, client: "powerMenu"}});
214 + this.request = this.controller.serviceRequest("palm://com.palm.power/com/palm/power", {
215 + method: "activityStart", parameters: {id: "com.palm.systemui", duration_ms: '86400000'}});
218 + this.menuCfg.allowSleep = true;
220 + this.request = this.controller.serviceRequest("palm://com.palm.display/control", {
221 + method: "setProperty", parameters: {requestBlock: false, client: "powerMenu"}});
223 + this.request = this.controller.serviceRequest("palm://com.palm.power/com/palm/power", {
224 + method: "activityEnd", parameters: {id: "com.palm.systemui"}});
227 + this.controller.window.close();
230 + restart: function() {
231 + this.barAssistant.machineReboot("Restart request by User");
232 + this.controller.window.close();
235 + shutdown:function() {
236 + this.barAssistant.machineOffNow("Shutdown request by User");
237 + this.controller.window.close();
240 powerOff:function() {
241 var appController = Mojo.Controller.getAppController();
242 --- .orig/usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html
243 +++ /usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html
245 <div class="system-notification power-off">
246 - <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='flightmode' x-mojo-loc=''></div>
247 - <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='poweroff' x-mojo-loc=''>Power</div>
248 - <div class="palm-notification-button" x-mojo-tap-highlight="immediate" id='cancel' x-mojo-loc=''>Cancel</div>
250 \ No newline at end of file
251 + <div id="powermenu">
252 + <div id="airplaneModeButton" style="display:none;">
253 + <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='flightmode' x-mojo-loc=''>Turn on Airplane Mode</div>
255 + <div id="deviceSleepButton" style="display:none;">
256 + <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='sleep' x-mojo-loc=''>Disable Device Sleep</div>
258 + <div id="shutdownDeviceButton" style="display:none;">
259 + <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='poweroff' x-mojo-loc=''>Shut Down Device</div>
261 + <div id="restartDeviceButton" style="display:none;">
262 + <div class="palm-notification-button alternate" x-mojo-tap-highlight="immediate" id='restart' x-mojo-loc=''>Restart Device</div>
264 + <div id="restartLunaButton" style="display:none;">
265 + <div class="palm-notification-button alternate" x-mojo-tap-highlight="immediate" id='luna' x-mojo-loc=''>Restart Luna</div>
267 + <div id="cancelButton" style="display:block;">
268 + <div class="palm-notification-button" x-mojo-tap-highlight="immediate" id='cancel' x-mojo-loc=''>Cancel</div>
271 + <div id="editmenu" style="display: none;">
272 + <div style="font-size: 20px;text-align:center;padding:6px;">Menu Content Settings</div>
273 + <div style="padding:5px;padding-left:15px;padding-right:15px;"><div style="background:gray;min-height:1px;"></div></div>
275 + <div id="airplaneModeEdit">
276 + <div id="airplaneModeState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
277 + <div style="font-size:16px;padding:8px;padding-left:25px;">Airplane Mode Toggle</div>
279 + <div id="deviceSleepEdit">
280 + <div id="deviceSleepState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
281 + <div style="font-size:16px;padding:8px;padding-left:25px;">Device Sleep Toggle</div>
283 + <div id="shutdownDeviceEdit">
284 + <div id="shutdownDeviceState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
285 + <div style="font-size:16px;padding:8px;padding-left:25px;">Shut Down Device Action</div>
287 + <div id="restartDeviceEdit">
288 + <div id="restartDeviceState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
289 + <div style="font-size:16px;padding:8px;padding-left:25px;">Restart Device Action</div>
291 + <div id="restartLunaEdit">
292 + <div id="restartLunaState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
293 + <div style="font-size:16px;padding:8px;padding-left:25px;">Restart Luna Action</div>
297 --- .orig/usr/lib/luna/system/luna-systemui/resources/es/views/poweroffalert/poweroffalert-scene.html
298 +++ /usr/lib/luna/system/luna-systemui/resources/es/views/poweroffalert/poweroffalert-scene.html
300 <div class="system-notification power-off">
301 - <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='flightmode'></div>
302 - <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='poweroff'>Apagar/Reiniciar</div>
303 - <div class="palm-notification-button" x-mojo-tap-highlight="immediate" id='cancel'>Cancelar</div>
304 + <div id="powermenu">
305 + <div id="airplaneModeButton" style="display:none;">
306 + <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='flightmode' x-mojo-loc=''>Turn on Airplane Mode</div>
308 + <div id="deviceSleepButton" style="display:none;">
309 + <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='sleep' x-mojo-loc=''>Disable Device Sleep</div>
311 + <div id="shutdownDeviceButton" style="display:none;">
312 + <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='poweroff' x-mojo-loc=''>Shut Down Device</div>
314 + <div id="restartDeviceButton" style="display:none;">
315 + <div class="palm-notification-button alternate" x-mojo-tap-highlight="immediate" id='restart' x-mojo-loc=''>Restart Device</div>
317 + <div id="restartLunaButton" style="display:none;">
318 + <div class="palm-notification-button alternate" x-mojo-tap-highlight="immediate" id='luna' x-mojo-loc=''>Restart Luna</div>
320 + <div id="cancelButton" style="display:block;">
321 + <div class="palm-notification-button" x-mojo-tap-highlight="immediate" id='cancel' x-mojo-loc=''>Cancel</div>
324 + <div id="editmenu" style="display: none;">
325 + <div style="font-size: 20px;text-align:center;padding:6px;">Menu Content Settings</div>
326 + <div style="padding:5px;padding-left:15px;padding-right:15px;"><div style="background:gray;min-height:1px;"></div></div>
328 + <div id="airplaneModeEdit">
329 + <div id="airplaneModeState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
330 + <div style="font-size:16px;padding:8px;padding-left:25px;">Airplane Mode Toggle</div>
332 + <div id="deviceSleepEdit">
333 + <div id="deviceSleepState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
334 + <div style="font-size:16px;padding:8px;padding-left:25px;">Device Sleep Toggle</div>
336 + <div id="shutdownDeviceEdit">
337 + <div id="shutdownDeviceState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
338 + <div style="font-size:16px;padding:8px;padding-left:25px;">Shut Down Device Action</div>
340 + <div id="restartDeviceEdit">
341 + <div id="restartDeviceState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
342 + <div style="font-size:16px;padding:8px;padding-left:25px;">Restart Device Action</div>
344 + <div id="restartLunaEdit">
345 + <div id="restartLunaState" style="font-size:12px;float:right;color:gray;padding:8px;padding-top:11px;padding-right:25px;">HIDE</div>
346 + <div style="font-size:16px;padding:8px;padding-left:25px;">Restart Luna Action</div>
350 --- .orig/usr/lib/luna/system/luna-systemui/resources/es/strings.json
351 +++ /usr/lib/luna/system/luna-systemui/resources/es/strings.json
353 "1#The update will start automatically in 1 second, and when your battery is sufficiently charged.|#The update will start automatically in #{counter} seconds, and when your battery is sufficiently charged.": "1#La actualización se iniciará automáticamente en 1 segundo, y cuando la batería esté cargada lo suficiente.|#La actualización se iniciará automáticamente en #{counter}segundos, y cuando la batería esté cargada lo suficiente.",
354 "1#The update will start in 1 minute.|#The update will start in #{counter} minutes.": "1#La actualización se iniciará en 1 minuto.|#La actualización se iniciará en #{counter} minutos.",
355 "1#The update will start in 1 second.|#The update will start in #{counter} seconds.": "1#La actualización se iniciará en 1 segundo.|#La actualización se iniciará en #{counter} segundos.",
356 + "Enable Device Sleep": "",
357 + "Disable Device Sleep": "",
360 "Added \"#{word}\" to dictionary": "Se añadió \"#{word}\" al diccionario",
361 "Adding ringtone failed. File may already exist.": "No se pudo añadir un tono. Puede que ya exista el archivo.",
362 "Airplane Mode": "Modo avión",