summaryrefslogtreecommitdiffstats
path: root/apps/settings/main.cpp
diff options
context:
space:
mode:
authorConfuSomu2021-05-06 09:53:02 -0400
committerConfuSomu2021-05-06 12:35:41 -0400
commit239370ee076e81f392ae124e9543d74dd0500b58 (patch)
treeafdb8b52dddf61ceb4971305c33d4bffa51ff9a5 /apps/settings/main.cpp
parent99e82cde75814b9ddc46218fe98b6d467755f2df (diff)
downloadpico-watch-239370ee076e81f392ae124e9543d74dd0500b58.tar
pico-watch-239370ee076e81f392ae124e9543d74dd0500b58.tar.gz
pico-watch-239370ee076e81f392ae124e9543d74dd0500b58.zip
Add cancel option to date/time setting menu
This allows to not save the settings, to avoid time drift, when just looking at them.
Diffstat (limited to 'apps/settings/main.cpp')
-rw-r--r--apps/settings/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/settings/main.cpp b/apps/settings/main.cpp
index d701d52..36e6cf0 100644
--- a/apps/settings/main.cpp
+++ b/apps/settings/main.cpp
@@ -31,7 +31,7 @@ namespace app_settings {
// Set time
void set0_menu(Api *app_api) {
- static const char *choices[16] = {"Hour", "Minute", "Second", "Year", "Month", "Day", "Day of week", "Apply and close"};
+ static const char *choices[9] = {"Hour", "Minute", "Second", "Year", "Month", "Day", "Day of week", "Apply and close", "Quit without saving"};
uint max_value;
uint min_value;
uint default_value;
@@ -40,7 +40,7 @@ namespace app_settings {
int choice = 0;
while (true) {
- choice = app_api->gui_popup_strchoice(SET0_NAME, SET0_DESC, choices, 8, 0, -1, choice);
+ choice = app_api->gui_popup_strchoice(SET0_NAME, SET0_DESC, choices, 9, 0, -1, choice);
min_value = 0;
switch (choice) {
@@ -68,6 +68,8 @@ namespace app_settings {
case 7: // Apply and exit
app_api->datetime_set(&datetime);
return;
+ case 8: // Quit without saving
+ return;
}
// Display popup for editing value