diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/gui/option_select.c | 16 | ||||
| -rw-r--r-- | apps/settings_menu.c | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index d482bd2..045f557 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -78,13 +78,15 @@ void option_select_prev(struct option_select * opt) { if(opt->option - opt->step < opt->min_value) { - if(!opt->limit_loop) - { - if(opt->option==opt->min_value) - opt->option=opt->max_value-1; - else - opt->option=opt->min_value; - } + /* the dissimilarity to option_select_next() arises from the + * sleep timer problem (bug #5000 and #5001): + * there we have min=0, step = 5 but the value itself might + * not be a multiple of 5 -- as time elapsed; + * We need to be able to set timer to 0 (= Off) nevertheless. */ + if(opt->option!=opt->min_value) + opt->option=opt->min_value; + else if(!opt->limit_loop) + opt->option=opt->max_value-1; } else opt->option-=opt->step; diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 987994a..04f8c0c 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -827,7 +827,7 @@ static void sleep_timer_set(int minutes) static bool sleep_timer(void) { - int minutes = get_sleep_timer() / 60; + int minutes = (get_sleep_timer() + 59) / 60; /* round up */ return set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes, &sleep_timer_set, 5, 0, 300, sleep_timer_formatter); |