1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Implemented handling of number keys in the 'Timers' menu for toggling days

This commit is contained in:
Klaus Schmidinger 2004-11-14 16:27:27 +01:00
parent 1ed36b04bc
commit ac8e03a89c
6 changed files with 49 additions and 10 deletions

View File

@ -1146,3 +1146,6 @@ Mogens Elneff <mogens@elneff.dk>
Joachim Wilke <vdr@joachim-wilke.de>
for reporting missing calls to cStatus::MsgOsdClear() in cSkins::Message()
Sascha Klek <sklek@gmx.de>
for reporting a problem with the '0' key in the "Day" item of the "Timers" menu

View File

@ -3134,3 +3134,7 @@ Video Disk Recorder Revision History
- Added missing initialization of cEvent::seen.
- Checking PID language codes for ISO 639 compliance to avoid problems with
funny characters. Invalid language codes will be stored as "???".
- The '0' key now toggles the "Day" item in the "Timers" menu between "single
shot" and "repeating". The keys '1'...'7' can be used to toggle the individual
days ('1' is monday). Thanks to Sascha Klek for reporting a problem with the
'0' key in the "Day" item of the "Timers" menu.

8
MANUAL
View File

@ -24,7 +24,7 @@ Version 1.2
Green - Language New New Ins/Ovr Rewind Skip -60s
Yellow - Pause live Delete Delete Delete Delete Skip +60s
Blue - Stop/Resume Mark On/Off(1) - Summary Stop
0..9 Ch select - Sort(3) - Numeric inp. Exec cmd(2) Editing
0..9 Ch select - Sort(3) Day(4) Numeric inp. Exec cmd(2) Editing
In a numerical input field (like the response to a CAM enquiry) the keys 0..9
are used to enter the data, and the Left key can be used to delete the last
@ -73,6 +73,9 @@ Version 1.2
(2) See "Processing Recordings" below.
(3) In the "Channels" menu the '0' key switches the sort mode through "by number",
"by name" and "by provider".
(4) In the "Timers" menu, when on the "Day" item, the '0' key toggles between
a single shot and a repeating timer. If "Day" indicates a repeating timer,
the keys '1'...'7' can be used to toggle the individual days ('1' is monday).
* Navigating through the On Screen Menus
@ -369,6 +372,9 @@ Version 1.2
by listing the days of the week on which they shall record.
For example, a timer that shall record every monday and wednesday
would have a Day setting of "M-W----".
The '0' key toggles between a single shot and a repeating timer.
If "Day" indicates a repeating timer, the keys '1'...'7' can be
used to toggle the individual days ('1' is monday).
Start: The start time of the timer in hh:mm as 24 hour ("military") time.
Stop: The stop time of the timer.
VPS: Defines whether the timer shall use VPS (if available). If this

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menuitems.c 1.19 2004/06/19 09:45:45 kls Exp $
* $Id: menuitems.c 1.20 2004/11/14 16:16:21 kls Exp $
*/
#include "menuitems.h"
@ -606,7 +606,33 @@ eOSState cMenuEditDayItem::ProcessKey(eKeys Key)
return cMenuEditIntItem::ProcessKey(Key);
Set();
break;
default : return cMenuEditIntItem::ProcessKey(Key);
default: {
if (d >= 0) {
if (k1 <= Key && Key <= k7) {
int v = *value ^ (1 << (Key - k1));
if ((v & 0xFF) != 0) {
*value = v; // can't let this become all 0
Set();
}
break;
}
}
int v = *value;
eOSState result = cMenuEditIntItem::ProcessKey(Key);
if (result == osContinue && Key == k0) {
if (d >= 0) {
*value = cTimer::GetMDay(time(NULL));
d = -1;
Set();
}
else if (*value == 0 || *value == v) {
d = cTimer::GetWDay(time(NULL));
*value = days[d];
Set();
}
}
return result;
}
}
return osContinue;
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: timers.c 1.16 2004/10/31 16:41:30 kls Exp $
* $Id: timers.c 1.17 2004/11/14 16:02:42 kls Exp $
*/
#include "timers.h"
@ -256,13 +256,13 @@ bool cTimer::IsSingleEvent(void) const
return (day & 0x80000000) == 0;
}
int cTimer::GetMDay(time_t t) const
int cTimer::GetMDay(time_t t)
{
struct tm tm_r;
return localtime_r(&t, &tm_r)->tm_mday;
}
int cTimer::GetWDay(time_t t) const
int cTimer::GetWDay(time_t t)
{
struct tm tm_r;
int weekday = localtime_r(&t, &tm_r)->tm_wday;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: timers.h 1.10 2004/10/31 16:41:17 kls Exp $
* $Id: timers.h 1.11 2004/11/14 16:02:28 kls Exp $
*/
#ifndef __TIMERS_H
@ -64,8 +64,8 @@ public:
bool Parse(const char *s);
bool Save(FILE *f);
bool IsSingleEvent(void) const;
int GetMDay(time_t t) const;
int GetWDay(time_t t) const;
static int GetMDay(time_t t);
static int GetWDay(time_t t);
bool DayMatches(time_t t) const;
static time_t IncDay(time_t t, int Days);
static time_t SetTime(time_t t, int SecondsFromMidnight);