mirror of https://github.com/espruino/BangleApps
Add prompt before shutdown
parent
53aaffab0b
commit
6414859eda
|
@ -1,5 +1,14 @@
|
|||
g.clear();
|
||||
|
||||
E.showPrompt('Are you sure?', {
|
||||
title: 'Power off',
|
||||
buttons: { Yes: true, No: false },
|
||||
}).then((confirm) => {
|
||||
if (!confirm) {
|
||||
setTimeout(load, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
g.setFont("6x8",2).setFontAlign(0,0);
|
||||
var x = g.getWidth()/2;
|
||||
var y = g.getHeight()/2 + 10;
|
||||
|
@ -8,6 +17,7 @@ g.setFont("6x8",2).setFontAlign(0,0);
|
|||
setTimeout(function() {
|
||||
if (Bangle.softOff) Bangle.softOff(); else Bangle.off();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ "id": "poweroff",
|
||||
"name": "Poweroff",
|
||||
"shortName":"Poweroff",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "Simple app to power off your Bangle.js",
|
||||
"icon": "app.png",
|
||||
"tags": "tool, poweroff, shutdown",
|
||||
|
|
Loading…
Reference in New Issue