mirror of https://github.com/espruino/BangleApps
Setting: restructed menus as per forum discussion
parent
d3ccc08209
commit
aa365bc1de
|
@ -167,7 +167,7 @@
|
||||||
{
|
{
|
||||||
"id": "setting",
|
"id": "setting",
|
||||||
"name": "Settings",
|
"name": "Settings",
|
||||||
"version": "0.37",
|
"version": "0.38",
|
||||||
"description": "A menu for setting up Bangle.js",
|
"description": "A menu for setting up Bangle.js",
|
||||||
"icon": "settings.png",
|
"icon": "settings.png",
|
||||||
"tags": "tool,system",
|
"tags": "tool,system",
|
||||||
|
|
|
@ -40,3 +40,4 @@
|
||||||
0.35: Change App/Widget settings to 'App Settings' so it fits on Bangle screen
|
0.35: Change App/Widget settings to 'App Settings' so it fits on Bangle screen
|
||||||
0.36: Added 'Utils' menu with helpful utilities for restoring Bangle.js
|
0.36: Added 'Utils' menu with helpful utilities for restoring Bangle.js
|
||||||
0.37: Going into passkey menu now saves settings with passkey
|
0.37: Going into passkey menu now saves settings with passkey
|
||||||
|
0.38: Restructed menus as per forum discussion
|
||||||
|
|
|
@ -61,6 +61,37 @@ if (!settings) resetSettings();
|
||||||
const boolFormat = v => v ? /*LANG*/"On" : /*LANG*/"Off";
|
const boolFormat = v => v ? /*LANG*/"On" : /*LANG*/"Off";
|
||||||
|
|
||||||
function showMainMenu() {
|
function showMainMenu() {
|
||||||
|
|
||||||
|
const mainmenu = {
|
||||||
|
'': { 'title': 'Settings' },
|
||||||
|
'< Back': ()=>load(),
|
||||||
|
/*LANG*/'Apps': ()=>showAppSettingsMenu(),
|
||||||
|
/*LANG*/'Bluetooth': ()=>showBLEMenu(),
|
||||||
|
/*LANG*/'System': ()=>showSystemMenu(),
|
||||||
|
/*LANG*/'Alerts': ()=>showAlertsMenu(),
|
||||||
|
/*LANG*/'Utils': ()=>showUtilMenu(),
|
||||||
|
/*LANG*/'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() }
|
||||||
|
};
|
||||||
|
|
||||||
|
return E.showMenu(mainmenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSystemMenu() {
|
||||||
|
|
||||||
|
const mainmenu = {
|
||||||
|
'': { 'title': 'System' },
|
||||||
|
'< Back': ()=>showMainMenu(),
|
||||||
|
/*LANG*/'Theme': ()=>showThemeMenu(),
|
||||||
|
/*LANG*/'LCD': ()=>showLCDMenu(),
|
||||||
|
/*LANG*/'Locale': ()=>showLocaleMenu(),
|
||||||
|
/*LANG*/'Select Clock': ()=>showClockMenu(),
|
||||||
|
/*LANG*/'Set Time': ()=>showSetTimeMenu()
|
||||||
|
};
|
||||||
|
|
||||||
|
return E.showMenu(mainmenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showAlertsMenu() {
|
||||||
var beepMenuItem;
|
var beepMenuItem;
|
||||||
if (BANGLEJS2) {
|
if (BANGLEJS2) {
|
||||||
beepMenuItem = {
|
beepMenuItem = {
|
||||||
|
@ -91,12 +122,9 @@ function showMainMenu() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const mainmenu = {
|
const mainmenu = {
|
||||||
'': { 'title': 'Settings' },
|
'': { 'title': 'Alerts' },
|
||||||
'< Back': ()=>load(),
|
'< Back': ()=>showMainMenu(),
|
||||||
/*LANG*/'App Settings': ()=>showAppSettingsMenu(),
|
|
||||||
/*LANG*/'BLE': ()=>showBLEMenu(),
|
|
||||||
/*LANG*/'Beep': beepMenuItem,
|
/*LANG*/'Beep': beepMenuItem,
|
||||||
/*LANG*/'Vibration': {
|
/*LANG*/'Vibration': {
|
||||||
value: settings.vibrate,
|
value: settings.vibrate,
|
||||||
|
@ -119,23 +147,18 @@ function showMainMenu() {
|
||||||
updateOptions();
|
updateOptions();
|
||||||
if ("qmsched" in WIDGETS) WIDGETS["qmsched"].draw();
|
if ("qmsched" in WIDGETS) WIDGETS["qmsched"].draw();
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
/*LANG*/'Locale': ()=>showLocaleMenu(),
|
|
||||||
/*LANG*/'Select Clock': ()=>showClockMenu(),
|
|
||||||
/*LANG*/'Set Time': ()=>showSetTimeMenu(),
|
|
||||||
/*LANG*/'LCD': ()=>showLCDMenu(),
|
|
||||||
/*LANG*/'Theme': ()=>showThemeMenu(),
|
|
||||||
/*LANG*/'Utils': ()=>showUtilMenu(),
|
|
||||||
/*LANG*/'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return E.showMenu(mainmenu);
|
return E.showMenu(mainmenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showBLEMenu() {
|
function showBLEMenu() {
|
||||||
var hidV = [false, "kbmedia", "kb", "joy"];
|
var hidV = [false, "kbmedia", "kb", "joy"];
|
||||||
var hidN = ["Off", "Kbrd & Media", "Kbrd","Joystick"];
|
var hidN = ["Off", "Kbrd & Media", "Kbrd","Joystick"];
|
||||||
E.showMenu({
|
E.showMenu({
|
||||||
|
'': { 'title': 'Bluetooth' },
|
||||||
'< Back': ()=>showMainMenu(),
|
'< Back': ()=>showMainMenu(),
|
||||||
'Make Connectable': ()=>makeConnectable(),
|
'Make Connectable': ()=>makeConnectable(),
|
||||||
'BLE': {
|
'BLE': {
|
||||||
|
@ -190,7 +213,7 @@ function showThemeMenu() {
|
||||||
}
|
}
|
||||||
var m = E.showMenu({
|
var m = E.showMenu({
|
||||||
'':{title:'Theme'},
|
'':{title:'Theme'},
|
||||||
'< Back': ()=>showMainMenu(),
|
'< Back': ()=>showSystemMenu(),
|
||||||
'Dark BW': ()=>{
|
'Dark BW': ()=>{
|
||||||
upd({
|
upd({
|
||||||
fg:cl("#fff"), bg:cl("#000"),
|
fg:cl("#fff"), bg:cl("#000"),
|
||||||
|
@ -335,7 +358,7 @@ function showWhitelistMenu() {
|
||||||
function showLCDMenu() {
|
function showLCDMenu() {
|
||||||
const lcdMenu = {
|
const lcdMenu = {
|
||||||
'': { 'title': 'LCD' },
|
'': { 'title': 'LCD' },
|
||||||
'< Back': ()=>showMainMenu(),
|
'< Back': ()=>showSystemMenu(),
|
||||||
'LCD Brightness': {
|
'LCD Brightness': {
|
||||||
value: settings.brightness,
|
value: settings.brightness,
|
||||||
min: 0.1,
|
min: 0.1,
|
||||||
|
@ -447,7 +470,7 @@ function showLCDMenu() {
|
||||||
function showLocaleMenu() {
|
function showLocaleMenu() {
|
||||||
const localemenu = {
|
const localemenu = {
|
||||||
'': { 'title': 'Locale' },
|
'': { 'title': 'Locale' },
|
||||||
'< Back': ()=>showMainMenu(),
|
'< Back': ()=>showSystemMenu(),
|
||||||
'Time Zone': {
|
'Time Zone': {
|
||||||
value: settings.timezone,
|
value: settings.timezone,
|
||||||
min: -11,
|
min: -11,
|
||||||
|
@ -551,7 +574,7 @@ function showClockMenu() {
|
||||||
'': {
|
'': {
|
||||||
'title': 'Select Clock',
|
'title': 'Select Clock',
|
||||||
},
|
},
|
||||||
'< Back': ()=>showMainMenu(),
|
'< Back': ()=>showSystemMenu(),
|
||||||
};
|
};
|
||||||
clockApps.forEach((app, index) => {
|
clockApps.forEach((app, index) => {
|
||||||
var label = app.name;
|
var label = app.name;
|
||||||
|
@ -578,7 +601,7 @@ function showSetTimeMenu() {
|
||||||
'': { 'title': 'Set Time' },
|
'': { 'title': 'Set Time' },
|
||||||
'< Back': function () {
|
'< Back': function () {
|
||||||
setTime(d.getTime() / 1000);
|
setTime(d.getTime() / 1000);
|
||||||
showMainMenu();
|
showSystemMenu();
|
||||||
},
|
},
|
||||||
'Hour': {
|
'Hour': {
|
||||||
value: d.getHours(),
|
value: d.getHours(),
|
||||||
|
|
Loading…
Reference in New Issue