From 70ea8df149688d7f45ce2ca4e5dc0da1bc31f7c8 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Wed, 7 Jun 2023 17:57:43 +0100 Subject: [PATCH] multitimer: align with alarm app --- apps/multitimer/ChangeLog | 2 +- apps/multitimer/README.md | 2 +- apps/multitimer/app.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/multitimer/ChangeLog b/apps/multitimer/ChangeLog index c682077e4..3100146e9 100644 --- a/apps/multitimer/ChangeLog +++ b/apps/multitimer/ChangeLog @@ -1,4 +1,4 @@ 0.01: Initial version 0.02: Update for time_utils module 0.03: Use default Bangle formatter for booleans -0.04: Add "Oneshot" setting to delete an alarm/timer after it sounds +0.04: Merge in alarm app's newer changes: diff --git a/apps/multitimer/README.md b/apps/multitimer/README.md index 4dcc4a8fd..d5bf957a6 100644 --- a/apps/multitimer/README.md +++ b/apps/multitimer/README.md @@ -2,7 +2,7 @@ With this app, you can set timers and chronographs (stopwatches) and watch them count down/up in real time. You can also set alarms - swipe left or right to switch between the three functions. "Hard mode" is also available for timers and alarms. It will double the number of buzz counts and you will have to swipe the screen five to eight times correctly - make a mistake, and you will need to start over. -"Oneshot" can be set on timers and alarms to have it delete itself once it's sounded. +"Oneshot" can be set on timers and alarms to have it delete itself once it's sounded (uses the "Delete after expiration" setting from the alarm app). ## WARNING * Editing timers in another app (such as the default Alarm app) is not recommended. Editing alarms should not be a problem (in theory). diff --git a/apps/multitimer/app.js b/apps/multitimer/app.js index b066607be..d8459eaa6 100644 --- a/apps/multitimer/app.js +++ b/apps/multitimer/app.js @@ -228,7 +228,7 @@ function editTimer(idx, a) { else a = timers[idx]; } if (!a.data) { - a.data = { hm: false, oneshot: false }; + a.data = { hm: false }; } var t = decodeTime(a.timer); @@ -295,8 +295,8 @@ function editTimer(idx, a) { }, "Vibrate": require("buzz_menu").pattern(a.vibrate, v => a.vibrate = v), "Oneshot": { - value: !!a.data.oneshot, - onchange: v => a.data.oneshot = v + value: !!a.del, + onchange: v => a.del = v }, "Msg": { value: !a.msg ? "" : a.msg.length > 6 ? a.msg.substring(0, 6)+"..." : a.msg, @@ -584,7 +584,7 @@ function editAlarm(idx, a) { var menu = { "": { "title": "Alarm" }, "< Back": () => { - if (a.data.hm || a.data.oneshot) a.js = "(require('Storage').read('multitimer.alarm.js') !== undefined) ? load('multitimer.alarm.js') : load('sched.js')"; + if (a.data.hm) a.js = "(require('Storage').read('multitimer.alarm.js') !== undefined) ? load('multitimer.alarm.js') : load('sched.js')"; else if (a.js) delete a.js; if (idx >= 0) alarms[alarmIdx[idx]] = a; else alarms.push(a); @@ -624,8 +624,8 @@ function editAlarm(idx, a) { }, "Vibrate": require("buzz_menu").pattern(a.vibrate, v => a.vibrate = v), "Oneshot": { - value: !!a.data.oneshot, - onchange: v => a.data.oneshot = v + value: !!a.del, + onchange: v => a.del = v }, "Auto Snooze": { value: a.as,