Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
voloved committed Feb 22, 2025
1 parent ca66344 commit 72c18fc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/sched/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
0.28: Added an icon for disabled events
0.29: Improve clkinfo startup time by 10ms
0.30: Fix possible bug in toggling an alarm to on, from clkinfo
0.31: Pressing BTN1 behaves the same as pressing Stop
3 changes: 2 additions & 1 deletion apps/sched/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ exports.getSettings = function () {
buzzCount: 10,
buzzIntervalMillis: 3000, // 3 seconds
defaultAlarmPattern: "::",
defaultTimerPattern: "::"
defaultTimerPattern: "::",
btnToStop: true
},
require("Storage").readJSON("sched.settings.json", true) || {}
);
Expand Down
2 changes: 1 addition & 1 deletion apps/sched/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "sched",
"name": "Scheduler",
"version": "0.32",
"version": "0.34",
"description": "Scheduling library for alarms and timers",
"icon": "app.png",
"type": "scheduler",
Expand Down
8 changes: 4 additions & 4 deletions apps/sched/sched.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function showPromptBtnCancel(msg,options) {
Bangle.setUI({mode:"custom", remove: options.remove, redraw: draw, back:options.back,
btn: () => { // Handle physical buttons explicitly
showPromptBtnCancel();
resolve(options.buttons["No"]);
resolve(options.buttons.No);
},
touch:(_,e)=>{
btnPos.forEach((b,i)=>{
Expand All @@ -86,8 +86,8 @@ function showPromptBtnCancel(msg,options) {
});
}

function showCustomPrompt(message, options) {
if (true) {
function showCustomPrompt(message, options, btnToStop) {
if (btnToStop) {
return showPromptBtnCancel(message, options);
} else {
return E.showPrompt(message, options);
Expand Down Expand Up @@ -122,7 +122,7 @@ function showAlarm(alarm) {
showCustomPrompt(message, {
title: alarm.timer ? /*LANG*/"TIMER!" : /*LANG*/"ALARM!",
buttons: { /*LANG*/"Snooze": true, /*LANG*/"Stop": false } // default is sleep so it'll come back in some mins
}).then(function (sleep) {
}, settings.btnToStop).then(function (sleep) {
buzzCount = 0;

if (sleep) {
Expand Down
10 changes: 9 additions & 1 deletion apps/sched/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
/*LANG*/"Default Timer Pattern": require("buzz_menu").pattern(settings.defaultTimerPattern, v => {
settings.defaultTimerPattern = v;
require("sched").setSettings(settings);
})
}),

/*LANG*/"BTN1 to Stop": {
value: settings.btnToStop,
onchange: v => {
settings.btnToStop = v;
require("sched").setSettings(settings);
}
}
});
})
1 change: 1 addition & 0 deletions typescript/types/sched.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ declare module Sched {
buzzIntervalMillis: number,
defaultAlarmPattern: string,
defaultTimerPattern: string,
btnToStop: boolean,
};

function getAlarms(): Sched[];
Expand Down

0 comments on commit 72c18fc

Please sign in to comment.