Merge branch 'master' of github.com:espruino/BangleApps

pull/2192/head
Gordon Williams 2022-10-21 15:04:06 +01:00
commit 7f886e79c5
3 changed files with 34 additions and 2 deletions

View File

@ -55,4 +55,6 @@
0.48: Allow reading custom themes from files
0.49: Now reloads settings properly after 'Calibrate Battery'
0.50: Add Bangle.js 2 touchscreen calibration - for 2v16 or 2v15 cutting edge builds
0.51: Add option for left-handed users
0.51: Add setting for configuring a launcher
0.52: Add option for left-handed users

View File

@ -1,7 +1,7 @@
{
"id": "setting",
"name": "Settings",
"version": "0.51",
"version": "0.52",
"description": "A menu for setting up Bangle.js",
"icon": "settings.png",
"tags": "tool,system",

View File

@ -87,6 +87,7 @@ function showSystemMenu() {
/*LANG*/'LCD': ()=>showLCDMenu(),
/*LANG*/'Locale': ()=>showLocaleMenu(),
/*LANG*/'Select Clock': ()=>showClockMenu(),
/*LANG*/'Select Launcher': ()=>showLauncherMenu(),
/*LANG*/'Date & Time': ()=>showSetTimeMenu()
};
@ -685,6 +686,35 @@ function showClockMenu() {
}
return E.showMenu(clockMenu);
}
function showLauncherMenu() {
var launcherApps = require("Storage").list(/\.info$/)
.map(app => {var a=storage.readJSON(app, 1);return (a&&a.type == "launch")?a:undefined})
.filter(app => app) // filter out any undefined apps
.sort((a, b) => a.sortorder - b.sortorder);
const launcherMenu = {
'': {
'title': /*LANG*/'Select Launcher',
},
'< Back': ()=>showSystemMenu(),
};
launcherApps.forEach((app, index) => {
var label = app.name;
if ((!settings.launcher && index === 0) || (settings.launcher === app.src)) {
label = "* " + label;
}
launcherMenu[label] = () => {
if (settings.launcher !== app.src) {
settings.launcher = app.src;
updateSettings();
showMainMenu();
}
};
});
if (launcherApps.length === 0) {
launcherMenu[/*LANG*/"No Launchers Found"] = () => { };
}
return E.showMenu(launcherMenu);
}
function showSetTimeMenu() {
d = new Date();