mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling min/max borders when entering integer values
This commit is contained in:
parent
c30aeec716
commit
e58802d2a0
@ -243,6 +243,7 @@ Simon Bauschulte <SemiSchwabe@Brutzel.de>
|
|||||||
Andy Grobb <Charly98@01019freenet.de>
|
Andy Grobb <Charly98@01019freenet.de>
|
||||||
for completing storing the current audio volume in the setup.conf file
|
for completing storing the current audio volume in the setup.conf file
|
||||||
for fixing the EPG display in case Setup.ShowInfoOnChSwitch is set to "no"
|
for fixing the EPG display in case Setup.ShowInfoOnChSwitch is set to "no"
|
||||||
|
for reporting a bug in handling min/max borders when entering integer values
|
||||||
|
|
||||||
Thomas Heiligenmann <thomas@heiligenmann.de>
|
Thomas Heiligenmann <thomas@heiligenmann.de>
|
||||||
for implementing the SVDRP commands LSTR and DELR
|
for implementing the SVDRP commands LSTR and DELR
|
||||||
|
4
HISTORY
4
HISTORY
@ -1988,7 +1988,7 @@ Video Disk Recorder Revision History
|
|||||||
reporting this one).
|
reporting this one).
|
||||||
- Fixed support for Viaccess CAMs (thanks to Axel Gruber for helping to debug this).
|
- Fixed support for Viaccess CAMs (thanks to Axel Gruber for helping to debug this).
|
||||||
|
|
||||||
2003-04-06: Version 1.1.27
|
2003-04-12: Version 1.1.27
|
||||||
|
|
||||||
- The CAM is now accessed only if the current channel actually has a non-zero Ca
|
- The CAM is now accessed only if the current channel actually has a non-zero Ca
|
||||||
value, and CAM access is completely suppressed during replay, which avoids
|
value, and CAM access is completely suppressed during replay, which avoids
|
||||||
@ -2015,3 +2015,5 @@ Video Disk Recorder Revision History
|
|||||||
- Avoiding high CPU load in case the connection to LIRC gets lost (thanks to
|
- Avoiding high CPU load in case the connection to LIRC gets lost (thanks to
|
||||||
Ludwig Nussel).
|
Ludwig Nussel).
|
||||||
- Fixed handling repeat function with LIRC (thanks to Ludwig Nussel).
|
- Fixed handling repeat function with LIRC (thanks to Ludwig Nussel).
|
||||||
|
- Fixed handling min/max borders when entering integer values (thanks to Andy
|
||||||
|
Grobb for reporting this one).
|
||||||
|
47
menuitems.c
47
menuitems.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: menuitems.c 1.12 2003/01/18 13:34:40 kls Exp $
|
* $Id: menuitems.c 1.13 2003/04/12 09:21:33 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menuitems.h"
|
#include "menuitems.h"
|
||||||
@ -62,27 +62,30 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key)
|
|||||||
eOSState state = cMenuEditItem::ProcessKey(Key);
|
eOSState state = cMenuEditItem::ProcessKey(Key);
|
||||||
|
|
||||||
if (state == osUnknown) {
|
if (state == osUnknown) {
|
||||||
int newValue;
|
int newValue = *value;
|
||||||
if (k0 <= Key && Key <= k9) {
|
Key = NORMALKEY(Key);
|
||||||
if (fresh) {
|
switch (Key) {
|
||||||
*value = 0;
|
case kNone: break;
|
||||||
fresh = false;
|
case k0 ... k9:
|
||||||
}
|
if (fresh) {
|
||||||
newValue = *value * 10 + (Key - k0);
|
*value = 0;
|
||||||
}
|
fresh = false;
|
||||||
else if (NORMALKEY(Key) == kLeft) { // TODO might want to increase the delta if repeated quickly?
|
}
|
||||||
newValue = *value - 1;
|
newValue = *value * 10 + (Key - k0);
|
||||||
fresh = true;
|
break;
|
||||||
}
|
case kLeft: // TODO might want to increase the delta if repeated quickly?
|
||||||
else if (NORMALKEY(Key) == kRight) {
|
newValue = *value - 1;
|
||||||
newValue = *value + 1;
|
fresh = true;
|
||||||
fresh = true;
|
break;
|
||||||
}
|
case kRight:
|
||||||
else {
|
newValue = *value + 1;
|
||||||
if (*value < min) { *value = min; Set(); }
|
fresh = true;
|
||||||
if (*value > max) { *value = max; Set(); }
|
break;
|
||||||
return state;
|
default:
|
||||||
}
|
if (*value < min) { *value = min; Set(); }
|
||||||
|
if (*value > max) { *value = max; Set(); }
|
||||||
|
return state;
|
||||||
|
}
|
||||||
if ((!fresh || min <= newValue) && newValue <= max) {
|
if ((!fresh || min <= newValue) && newValue <= max) {
|
||||||
*value = newValue;
|
*value = newValue;
|
||||||
Set();
|
Set();
|
||||||
|
Loading…
Reference in New Issue
Block a user