updates and additions
[webos-internals:modifications.git] / notifications / notifications-reset-options-on-power-button-hold.patch
1 diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2 index 0e239cc..a1d802b 100644
3 --- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4 +++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5 @@ -2921,7 +2921,7 @@ showPowerOffAlert: function() {
6                     var f = function(stageController){
7                       stageController.pushScene('poweroffalert',this);
8                     }.bind(this);
9 -                   var params = {name: 'PowerOffAlert', height: 175,lightweight:true};                     
10 +                   var params = {name: 'PowerOffAlert', height: 230,lightweight:true};
11                     appController.createStageWithCallback(params,f,'popupalert');
12          }
13         //Close the Storage Alert and create a USB dashboard.
14 diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js
15 index de1ec12..b33f456 100644
16 --- a/usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js
17 +++ b/usr/lib/luna/system/luna-systemui/app/controllers/poweroffalert-assistant.js
18 @@ -7,7 +7,8 @@ var PoweroffalertAssistant = Foundations.Class.create({
19      
20      setup: function() {                
21                 var flightMode = this.flightMode.bindAsEventListener(this);
22 -               var powerOff = this.powerOff.bindAsEventListener(this);
23 +               var restart = this.restart.bindAsEventListener(this);
24 +               var shutdown = this.shutdown.bindAsEventListener(this);
25                 var cancel = this.cancel.bindAsEventListener(this);
26                 var launchAirplaneModeHelp = this.launchAirplaneModeHelp.bindAsEventListener(this);
27                 this.flightMode = this.barAssistant.getAirplaneMode();
28 @@ -16,8 +17,9 @@ var PoweroffalertAssistant = Foundations.Class.create({
29                 else
30                         this.controller.get('flightmode').innerHTML = "<div class='info-icon' id='airplaneInfo' x-mojo-touch-feedback='immediate'></div>" + $L('Airplane Mode');
31                         
32 -               this.controller.get('poweroff').addEventListener(Mojo.Event.tap, powerOff);
33                 this.controller.get('flightmode').addEventListener(Mojo.Event.tap, flightMode);
34 +               this.controller.get('restart').addEventListener(Mojo.Event.tap, restart);
35 +               this.controller.get('shutdown').addEventListener(Mojo.Event.tap, shutdown);
36                 this.controller.get('cancel').addEventListener(Mojo.Event.tap, cancel);
37                 if(this.controller.get('airplaneInfo'))
38                         this.controller.get('airplaneInfo').addEventListener(Mojo.Event.tap, launchAirplaneModeHelp);
39 @@ -47,6 +49,16 @@ var PoweroffalertAssistant = Foundations.Class.create({
40                 this.controller.window.close();
41         },
42         
43 +       restart: function() {
44 +               this.barAssistant.machineReboot("Restart selected by User in PowerOff Dialog");
45 +               this.controller.window.close();
46 +       },
47 +       
48 +       shutdown:function() {
49 +               this.barAssistant.machineOffNow("Shutdown request by User");
50 +               this.controller.window.close();
51 +       },
52 +       
53         flightMode:function(event) {
54                 
55                 var targetId = event.target.id;
56 diff --git a/usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html b/usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html
57 index dfb04c1..7ff0194 100644
58 --- a/usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html
59 +++ b/usr/lib/luna/system/luna-systemui/app/views/poweroffalert/poweroffalert-scene.html
60 @@ -1,5 +1,6 @@
61  <div class="system-notification power-off">
62                 <div class="palm-notification-button affirmative" x-mojo-tap-highlight="immediate" id='flightmode' x-mojo-loc=''></div>
63 -               <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='poweroff' x-mojo-loc=''>Power</div>
64 +               <div class="palm-notification-button alternate" x-mojo-tap-highlight="immediate" id='restart' x-mojo-loc=''>Restart</div>
65 +               <div class="palm-notification-button negative" x-mojo-tap-highlight="immediate" id='shutdown' x-mojo-loc=''>Shut Down</div>
66                 <div class="palm-notification-button" x-mojo-tap-highlight="immediate" id='cancel' x-mojo-loc=''>Cancel</div>
67  </div>
68 \ No newline at end of file