mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Avoiding multiple definitions of the same timer in the 'Schedule' menu
This commit is contained in:
parent
6bc436aeed
commit
9c499caf87
2
HISTORY
2
HISTORY
@ -276,3 +276,5 @@ Video Disk Recorder Revision History
|
|||||||
add new languages).
|
add new languages).
|
||||||
- Fixed learning keys on the PC keyboard (display oscillated).
|
- Fixed learning keys on the PC keyboard (display oscillated).
|
||||||
- Fixed a timing problem with OSD refresh and SVDRP.
|
- Fixed a timing problem with OSD refresh and SVDRP.
|
||||||
|
- Avoiding multiple definitions of the same timer in the "Schedule" menu (this
|
||||||
|
could happen when pressing the "Red" button while editing the timer).
|
||||||
|
27
menu.c
27
menu.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: menu.c 1.44 2000/11/11 09:58:12 kls Exp $
|
* $Id: menu.c 1.45 2000/11/11 12:55:10 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -909,15 +909,20 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
|
|||||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
eOSState state = cOsdMenu::ProcessKey(Key);
|
||||||
|
|
||||||
if (state == osUnknown) {
|
if (state == osUnknown) {
|
||||||
if (Key == kOk) {
|
switch (Key) {
|
||||||
if (!*data.file)
|
case kOk: if (!*data.file)
|
||||||
strcpy(data.file, Channels.GetChannelNameByNumber(data.channel));
|
strcpy(data.file, Channels.GetChannelNameByNumber(data.channel));
|
||||||
if (timer && memcmp(timer, &data, sizeof(data)) != 0) {
|
if (timer && memcmp(timer, &data, sizeof(data)) != 0) {
|
||||||
*timer = data;
|
*timer = data;
|
||||||
Timers.Save();
|
Timers.Save();
|
||||||
isyslog(LOG_INFO, "timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
|
isyslog(LOG_INFO, "timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
|
||||||
}
|
}
|
||||||
state = osBack;
|
return osBack;
|
||||||
|
case kRed:
|
||||||
|
case kGreen:
|
||||||
|
case kYellow:
|
||||||
|
case kBlue: return osContinue;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
@ -1208,9 +1213,16 @@ eOSState cMenuWhatsOn::Record(void)
|
|||||||
cMenuWhatsOnItem *item = (cMenuWhatsOnItem *)Get(Current());
|
cMenuWhatsOnItem *item = (cMenuWhatsOnItem *)Get(Current());
|
||||||
if (item) {
|
if (item) {
|
||||||
cTimer *timer = new cTimer(item->eventInfo);
|
cTimer *timer = new cTimer(item->eventInfo);
|
||||||
|
cTimer *t = Timers.GetTimer(timer);
|
||||||
|
if (!t) {
|
||||||
Timers.Add(timer);
|
Timers.Add(timer);
|
||||||
Timers.Save();
|
Timers.Save();
|
||||||
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
|
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete timer;
|
||||||
|
timer = t;
|
||||||
|
}
|
||||||
return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
|
return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
|
||||||
}
|
}
|
||||||
return osContinue;
|
return osContinue;
|
||||||
@ -1314,9 +1326,16 @@ eOSState cMenuSchedule::Record(void)
|
|||||||
cMenuScheduleItem *item = (cMenuScheduleItem *)Get(Current());
|
cMenuScheduleItem *item = (cMenuScheduleItem *)Get(Current());
|
||||||
if (item) {
|
if (item) {
|
||||||
cTimer *timer = new cTimer(item->eventInfo);
|
cTimer *timer = new cTimer(item->eventInfo);
|
||||||
|
cTimer *t = Timers.GetTimer(timer);
|
||||||
|
if (!t) {
|
||||||
Timers.Add(timer);
|
Timers.Add(timer);
|
||||||
Timers.Save();
|
Timers.Save();
|
||||||
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
|
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete timer;
|
||||||
|
timer = t;
|
||||||
|
}
|
||||||
return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
|
return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
|
||||||
}
|
}
|
||||||
return osContinue;
|
return osContinue;
|
||||||
|
Loading…
Reference in New Issue
Block a user