diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2024-05-11 18:18:51 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-05-13 18:06:55 +0200 |
commit | f631bfe5b4fb78d676a37583bb4aa8f3d2e3bf1b (patch) | |
tree | 64aa20ca87b55cb7bc5e5ce0fb3ace256dfae552 /apps/menus | |
parent | b8b4fdd999178d6292cb6fef97ad3484a1a2dcef (diff) | |
download | rockbox-f631bfe5b4fb78d676a37583bb4aa8f3d2e3bf1b.tar.gz rockbox-f631bfe5b4fb78d676a37583bb4aa8f3d2e3bf1b.zip |
shortcuts: sleep timer: allow omitting number of minutes
'sleep' can now appear in the data field of a 'time' shortcut
without being followed by a number, allowing you to stop a
running timer, or to start a new one using the default sleep
timer duration (the duration setting can already be added to
the Shortcuts menu as well).
Also see here:
https://forums.rockbox.org/index.php/topic,54312.msg250940.html
Change-Id: I9d0e62ef1b6187c35133067349729a4d94273c7a
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/settings_menu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 191079deb8..03c17b24e5 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -520,8 +520,8 @@ static int seconds_to_min(int secs) | |||
520 | 520 | ||
521 | /* A string representation of either whether a sleep timer will be started or | 521 | /* A string representation of either whether a sleep timer will be started or |
522 | canceled, and how long it will be or how long is remaining in brackets */ | 522 | canceled, and how long it will be or how long is remaining in brackets */ |
523 | static char* sleep_timer_getname(int selected_item, void * data, | 523 | char* sleep_timer_getname(int selected_item, void * data, |
524 | char *buffer, size_t buffer_len) | 524 | char *buffer, size_t buffer_len) |
525 | { | 525 | { |
526 | (void)selected_item; | 526 | (void)selected_item; |
527 | (void)data; | 527 | (void)data; |
@@ -537,7 +537,7 @@ static char* sleep_timer_getname(int selected_item, void * data, | |||
537 | return buffer; | 537 | return buffer; |
538 | } | 538 | } |
539 | 539 | ||
540 | static int sleep_timer_voice(int selected_item, void*data) | 540 | int sleep_timer_voice(int selected_item, void*data) |
541 | { | 541 | { |
542 | (void)selected_item; | 542 | (void)selected_item; |
543 | (void)data; | 543 | (void)data; |
@@ -555,7 +555,7 @@ static int sleep_timer_voice(int selected_item, void*data) | |||
555 | } | 555 | } |
556 | 556 | ||
557 | /* If a sleep timer is running, cancel it, otherwise start one */ | 557 | /* If a sleep timer is running, cancel it, otherwise start one */ |
558 | static int toggle_sleeptimer(void) | 558 | int toggle_sleeptimer(void) |
559 | { | 559 | { |
560 | set_sleeptimer_duration(get_sleep_timer() ? 0 | 560 | set_sleeptimer_duration(get_sleep_timer() ? 0 |
561 | : global_settings.sleeptimer_duration); | 561 | : global_settings.sleeptimer_duration); |