mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
When entering text via the numeric keys, the characters are now checked against the allowed characters
This commit is contained in:
parent
50ff4d3b79
commit
dbd4c7329b
@ -2016,6 +2016,8 @@ Norbert Wentz <norbert.wentz@online.de>
|
|||||||
Frank Schmirler <vdr@schmirler.de>
|
Frank Schmirler <vdr@schmirler.de>
|
||||||
for fixing handling client side termination of SVDRP connections
|
for fixing handling client side termination of SVDRP connections
|
||||||
for fixing assigning schedules to channels in case there is no initial EPG information
|
for fixing assigning schedules to channels in case there is no initial EPG information
|
||||||
|
for making entering text via the numeric keys check the characters against the
|
||||||
|
allowed characters
|
||||||
|
|
||||||
Jörn Reder <joern@zyn.de>
|
Jörn Reder <joern@zyn.de>
|
||||||
for reporting that a recording may unnecessarily block a device with a CAM, while
|
for reporting that a recording may unnecessarily block a device with a CAM, while
|
||||||
|
2
HISTORY
2
HISTORY
@ -5021,3 +5021,5 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed a possible segfault if VDR gets terminated while a message is displayed
|
- Fixed a possible segfault if VDR gets terminated while a message is displayed
|
||||||
(thanks to Udo Richter).
|
(thanks to Udo Richter).
|
||||||
- Fixed the INSTALL section on retrying shutdown later (reported by Udo Richter).
|
- Fixed the INSTALL section on retrying shutdown later (reported by Udo Richter).
|
||||||
|
- When entering text via the numeric keys, the characters are now checked against
|
||||||
|
the allowed characters (thanks to Frank Schmirler).
|
||||||
|
28
menuitems.c
28
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.47 2006/07/30 09:09:30 kls Exp $
|
* $Id: menuitems.c 1.48 2007/01/04 13:30:37 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menuitems.h"
|
#include "menuitems.h"
|
||||||
@ -461,13 +461,6 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key)
|
|||||||
AdvancePos();
|
AdvancePos();
|
||||||
currentChar = NULL;
|
currentChar = NULL;
|
||||||
}
|
}
|
||||||
if (insert && newchar) {
|
|
||||||
// create a new character in insert mode
|
|
||||||
if (int(strlen(value)) < length - 1) {
|
|
||||||
memmove(value + pos + 1, value + pos, strlen(value) - pos + 1);
|
|
||||||
value[pos] = ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!currentChar || !*currentChar || *currentChar == '\t') {
|
if (!currentChar || !*currentChar || *currentChar == '\t') {
|
||||||
// find the beginning of the character map entry for Key
|
// find the beginning of the character map entry for Key
|
||||||
int n = NORMALKEY(Key) - k0;
|
int n = NORMALKEY(Key) - k0;
|
||||||
@ -476,15 +469,28 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key)
|
|||||||
if (*currentChar++ == '\t')
|
if (*currentChar++ == '\t')
|
||||||
n--;
|
n--;
|
||||||
}
|
}
|
||||||
|
// find first allowed character
|
||||||
|
while (*currentChar && *currentChar != '\t' && !strchr(allowed, *currentChar))
|
||||||
|
currentChar++;
|
||||||
}
|
}
|
||||||
if (*currentChar && *currentChar != '\t') {
|
if (*currentChar && *currentChar != '\t') {
|
||||||
|
if (insert && newchar) {
|
||||||
|
// create a new character in insert mode
|
||||||
|
if (int(strlen(value)) < length - 1) {
|
||||||
|
memmove(value + pos + 1, value + pos, strlen(value) - pos + 1);
|
||||||
|
value[pos] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
value[pos] = *currentChar;
|
value[pos] = *currentChar;
|
||||||
if (uppercase)
|
if (uppercase)
|
||||||
value[pos] = toupper(value[pos]);
|
value[pos] = toupper(value[pos]);
|
||||||
currentChar++;
|
// find next allowed character
|
||||||
|
do {
|
||||||
|
currentChar++;
|
||||||
|
} while (*currentChar && *currentChar != '\t' && !strchr(allowed, *currentChar));
|
||||||
|
newchar = false;
|
||||||
|
autoAdvanceTimeout.Set(AUTO_ADVANCE_TIMEOUT);
|
||||||
}
|
}
|
||||||
newchar = false;
|
|
||||||
autoAdvanceTimeout.Set(AUTO_ADVANCE_TIMEOUT);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return cMenuEditItem::ProcessKey(Key);
|
return cMenuEditItem::ProcessKey(Key);
|
||||||
|
Loading…
Reference in New Issue
Block a user