diff options
| author | Brandon Low <lostlogic@rockbox.org> | 2006-04-05 22:36:42 +0000 |
|---|---|---|
| committer | Brandon Low <lostlogic@rockbox.org> | 2006-04-05 22:36:42 +0000 |
| commit | a69c495e5dd91b7404f92f4f44e773ef8cd59683 (patch) | |
| tree | cdf7df205e42493172eff94fcecc0b2786d10e31 /apps/gui | |
| parent | 51deb1d158cc6f136f7839b3a0657fc1b58162fc (diff) | |
| download | rockbox-a69c495e5dd91b7404f92f4f44e773ef8cd59683.zip rockbox-a69c495e5dd91b7404f92f4f44e773ef8cd59683.tar.gz rockbox-a69c495e5dd91b7404f92f4f44e773ef8cd59683.tar.bz2 rockbox-a69c495e5dd91b7404f92f4f44e773ef8cd59683.tar.xz | |
Patches from bug #5001 by Rani Hod, should make settings more resiliant to having 'off-step' values in a general way, but specifically fixes that bug report, and also round the current sleep timer value up when entering settings for sleep timer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9527 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
| -rw-r--r-- | apps/gui/option_select.c | 16 |
1 files changed, 9 insertions, 7 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; |