Fixed handling newly created timers in case they are not confirmed with "Ok"

This commit is contained in:
Klaus Schmidinger 2003-05-25 13:58:21 +02:00
parent 0eb11ea3de
commit 7e5878856f
3 changed files with 23 additions and 3 deletions

View File

@ -511,6 +511,8 @@ Gerhard Steiner <steiner@mail.austria.com>
for reporting a bug in displaying messages in the status line in case they exceed for reporting a bug in displaying messages in the status line in case they exceed
the OSD width the OSD width
for fixing resume file handling in case the resume.vdr file can't be written for fixing resume file handling in case the resume.vdr file can't be written
for reporting a problem with newly created timers in case they are not confirmed
with "Ok"
Jaakko Hyvätti <jaakko@hyvatti.iki.fi> Jaakko Hyvätti <jaakko@hyvatti.iki.fi>
for translating OSD texts to the Finnish language for translating OSD texts to the Finnish language

View File

@ -2204,3 +2204,5 @@ Video Disk Recorder Revision History
- The cCiHandler now closes its file handle when it gets destroyed. - The cCiHandler now closes its file handle when it gets destroyed.
- Checking for duplicate recordings with the same file name and disabling the - Checking for duplicate recordings with the same file name and disabling the
second timer (thanks to Peter Bieringer for reporting this one). second timer (thanks to Peter Bieringer for reporting this one).
- Fixed handling newly created timers in case they are not confirmed with "Ok"
(thanks to Gerhard Steiner for reporting this one).

22
menu.c
View File

@ -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.247 2003/05/25 12:47:30 kls Exp $ * $Id: menu.c 1.248 2003/05/25 13:53:53 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -834,6 +834,7 @@ private:
cTimer *timer; cTimer *timer;
cTimer data; cTimer data;
int channel; int channel;
bool deleteIfCancelled;
cMenuEditDateItem *firstday; cMenuEditDateItem *firstday;
void SetFirstDayItem(void); void SetFirstDayItem(void);
public: public:
@ -847,6 +848,7 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
{ {
firstday = NULL; firstday = NULL;
timer = Timers.Get(Index); timer = Timers.Get(Index);
deleteIfCancelled = New;
if (timer) { if (timer) {
data = *timer; data = *timer;
if (New) if (New)
@ -867,6 +869,12 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
cMenuEditTimer::~cMenuEditTimer() cMenuEditTimer::~cMenuEditTimer()
{ {
if (timer && deleteIfCancelled) {
int Index = timer->Index();
Timers.Del(timer);
Timers.Save();
isyslog("timer %d deleted", Index + 1);
}
Timers.DecBeingEdited(); Timers.DecBeingEdited();
} }
@ -907,6 +915,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
Timers.Save(); Timers.Save();
isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive"); isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
} }
deleteIfCancelled = false;
} }
return osBack; return osBack;
case kRed: case kRed:
@ -1081,6 +1090,8 @@ eOSState cMenuTimers::Summary(void)
eOSState cMenuTimers::ProcessKey(eKeys Key) eOSState cMenuTimers::ProcessKey(eKeys Key)
{ {
cTimer *ti = HasSubMenu() ? CurrentTimer() : NULL;
int TimerNumber = ti ? ti->Index() : -1;
eOSState state = cOsdMenu::ProcessKey(Key); eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) { if (state == osUnknown) {
@ -1097,6 +1108,11 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
default: break; default: break;
} }
} }
if (TimerNumber >= 0 && !HasSubMenu() && !Timers.Get(TimerNumber)) {
// a newly created timer wasn't confirmed with Ok
cOsdMenu::Del(Current());
Display();
}
return state; return state;
} }
@ -1263,7 +1279,7 @@ eOSState cMenuWhatsOn::Record(void)
delete timer; delete timer;
timer = t; timer = t;
} }
return AddSubMenu(new cMenuEditTimer(timer->Index(), true)); return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
} }
return osContinue; return osContinue;
} }
@ -1397,7 +1413,7 @@ eOSState cMenuSchedule::Record(void)
delete timer; delete timer;
timer = t; timer = t;
} }
return AddSubMenu(new cMenuEditTimer(timer->Index(), true)); return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
} }
return osContinue; return osContinue;
} }