summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY2
-rw-r--r--menu.c22
3 files changed, 23 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 78e1dc0d..c6be5156 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -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
the OSD width
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>
for translating OSD texts to the Finnish language
diff --git a/HISTORY b/HISTORY
index 258f3679..3226c521 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2204,3 +2204,5 @@ Video Disk Recorder Revision History
- The cCiHandler now closes its file handle when it gets destroyed.
- Checking for duplicate recordings with the same file name and disabling the
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).
diff --git a/menu.c b/menu.c
index 9bb9d4c7..3aebd7b2 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -834,6 +834,7 @@ private:
cTimer *timer;
cTimer data;
int channel;
+ bool deleteIfCancelled;
cMenuEditDateItem *firstday;
void SetFirstDayItem(void);
public:
@@ -847,6 +848,7 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
{
firstday = NULL;
timer = Timers.Get(Index);
+ deleteIfCancelled = New;
if (timer) {
data = *timer;
if (New)
@@ -867,6 +869,12 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
cMenuEditTimer::~cMenuEditTimer()
{
+ if (timer && deleteIfCancelled) {
+ int Index = timer->Index();
+ Timers.Del(timer);
+ Timers.Save();
+ isyslog("timer %d deleted", Index + 1);
+ }
Timers.DecBeingEdited();
}
@@ -907,6 +915,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
Timers.Save();
isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
}
+ deleteIfCancelled = false;
}
return osBack;
case kRed:
@@ -1081,6 +1090,8 @@ eOSState cMenuTimers::Summary(void)
eOSState cMenuTimers::ProcessKey(eKeys Key)
{
+ cTimer *ti = HasSubMenu() ? CurrentTimer() : NULL;
+ int TimerNumber = ti ? ti->Index() : -1;
eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) {
@@ -1097,6 +1108,11 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
default: break;
}
}
+ if (TimerNumber >= 0 && !HasSubMenu() && !Timers.Get(TimerNumber)) {
+ // a newly created timer wasn't confirmed with Ok
+ cOsdMenu::Del(Current());
+ Display();
+ }
return state;
}
@@ -1263,7 +1279,7 @@ eOSState cMenuWhatsOn::Record(void)
delete timer;
timer = t;
}
- return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
+ return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
}
return osContinue;
}
@@ -1397,7 +1413,7 @@ eOSState cMenuSchedule::Record(void)
delete timer;
timer = t;
}
- return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
+ return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
}
return osContinue;
}