summaryrefslogtreecommitdiff
path: root/menu_myedittimer.c
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2009-04-21 19:07:52 +0200
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2009-04-21 19:07:52 +0200
commite6bd92773bdd36685070a1e06b677fd6bc539a70 (patch)
tree2551ea5b49384db66aa6406279e195a127d82c92 /menu_myedittimer.c
parent59407d314666e9c334e8af7d8300dcf0198f60ea (diff)
downloadvdr-plugin-epgsearch-e6bd92773bdd36685070a1e06b677fd6bc539a70.tar.gz
vdr-plugin-epgsearch-e6bd92773bdd36685070a1e06b677fd6bc539a70.tar.bz2
direct timer programming in timer edit menu
Diffstat (limited to 'menu_myedittimer.c')
-rw-r--r--menu_myedittimer.c82
1 files changed, 34 insertions, 48 deletions
diff --git a/menu_myedittimer.c b/menu_myedittimer.c
index 0d1b8e8..6445ab5 100644
--- a/menu_myedittimer.c
+++ b/menu_myedittimer.c
@@ -73,6 +73,7 @@ cMenuMyEditTimer::cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* Event,
Set();
SetHelp(addIfConfirmed?NULL:trVDR("Button$Delete"), NULL, NULL, NULL);
}
+ Timers.IncBeingEdited();
}
void cMenuMyEditTimer::SplitFile()
@@ -192,6 +193,7 @@ cMenuMyEditTimer::~cMenuMyEditTimer()
{
if (timer && addIfConfirmed)
delete timer; // apparently it wasn't confirmed
+ Timers.DecBeingEdited();
}
void cMenuMyEditTimer::HandleSubtitle()
@@ -228,7 +230,7 @@ bool cMenuMyEditTimer::IsSingleEvent(void) const
eOSState cMenuMyEditTimer::DeleteTimer()
{
// Check if this timer is active:
- if (timer) {
+ if (timer && !addIfConfirmed) {
if (Interface->Confirm(trVDR("Delete timer?"))) {
if (timer->Recording()) {
if (Interface->Confirm(trVDR("Timer still recording - really delete?"))) {
@@ -240,10 +242,8 @@ eOSState cMenuMyEditTimer::DeleteTimer()
}
LogFile.iSysLog("deleting timer %s", *timer->ToDescr());
Timers.Del(timer);
- gl_timerStatusMonitor->SetConflictCheckAdvised();
- cOsdMenu::Del(Current());
+ gl_timerStatusMonitor->SetConflictCheckAdvised();
Timers.SetModified();
- Display();
return osBack;
}
}
@@ -373,53 +373,39 @@ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
if (strlen(tmpFile) == 0)
tmpFile = strdup(CHANNELNAME(ch));
- if (timer)
- {
- cString cmdbuf;
- if (addIfConfirmed)
- cmdbuf = cString::sprintf("NEWT %d:%d:%s:%04d:%04d:%d:%d:%s%s%s:%s",
- flags,
- ch->Number(),
-#if VDRVERSNUM < 10503
- PRINTDAY(day, weekdays),
-#else
- PRINTDAY(day, weekdays, true),
-#endif
- start,
- stop,
- priority,
- lifetime,
- strlen(tmpDir)>0?tmpDir:"",
- (strlen(tmpDir)>0 && strlen(tmpFile)>0)?"~":"",
- tmpFile,
- fullaux.c_str());
- else
- cmdbuf = cString::sprintf("MODT %d %d:%d:%s:%04d:%04d:%d:%d:%s%s%s:%s",
- timer->Index()+1,
- flags,
- ch->Number(),
+ if (timer)
+ {
+ cString cmdbuf;
+ cmdbuf = cString::sprintf("%d:%d:%s:%04d:%04d:%d:%d:%s%s%s:%s",
+ flags,
+ ch->Number(),
#if VDRVERSNUM < 10503
- PRINTDAY(day, weekdays),
+ PRINTDAY(day, weekdays),
#else
- PRINTDAY(day, weekdays, true),
+ PRINTDAY(day, weekdays, true),
#endif
- start,
- stop,
- priority,
- lifetime,
- strlen(tmpDir)>0?tmpDir:"",
- (strlen(tmpDir)>0 && strlen(tmpFile)>0)?"~":"",
- tmpFile,
- fullaux.c_str());
-
- cTimerThread timerThread;
- timerThread.Init(cmdbuf);
-
- free(tmpFile);
- free(tmpDir);
-
- addIfConfirmed = false;
- }
+ start,
+ stop,
+ priority,
+ lifetime,
+ strlen(tmpDir)>0?tmpDir:"",
+ (strlen(tmpDir)>0 && strlen(tmpFile)>0)?"~":"",
+ tmpFile,
+ fullaux.c_str());
+
+ timer->Parse(cmdbuf);
+
+ free(tmpFile);
+ free(tmpDir);
+
+ if (addIfConfirmed)
+ Timers.Add(timer);
+ timer->SetEventFromSchedule();
+ timer->Matches();
+ gl_timerStatusMonitor->SetConflictCheckAdvised();
+ Timers.SetModified();
+ addIfConfirmed = false;
+ }
}
return osBack;
case kRed: