summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDietmar Spingler <d_spingler@gmx.de>2017-05-26 11:52:27 (GMT)
committerFrank Neumann <fnu@yavdr.org>2017-05-26 11:52:27 (GMT)
commitf403d91af0e848958ffa7cfd4324cb15c075a603 (patch)
treef5ff9053a44e22568276a7150307cc0211334f76
parent5bbd4374d11d03ceca85c5b54691a80a4f897c47 (diff)
downloadvdr-plugin-epgsearch-f403d91af0e848958ffa7cfd4324cb15c075a603.tar.gz
vdr-plugin-epgsearch-f403d91af0e848958ffa7cfd4324cb15c075a603.tar.bz2
Add patches/vdr.epgsearch-exttimeredit-2.3.5.diff
-rw-r--r--patches/vdr.epgsearch-exttimeredit-2.3.5.diff113
1 files changed, 113 insertions, 0 deletions
diff --git a/patches/vdr.epgsearch-exttimeredit-2.3.5.diff b/patches/vdr.epgsearch-exttimeredit-2.3.5.diff
new file mode 100644
index 0000000..d74eb44
--- /dev/null
+++ b/patches/vdr.epgsearch-exttimeredit-2.3.5.diff
@@ -0,0 +1,113 @@
+diff -Naur vdr-2.3.5.orig/menu.c vdr-2.3.5/menu.c
+--- vdr-2.3.5.orig/menu.c 2017-05-25 12:38:36.926338810 +0200
++++ vdr-2.3.5/menu.c 2017-05-25 13:01:51.773814628 +0200
+@@ -1155,6 +1155,7 @@
+ class cMenuTimerItem : public cOsdItem {
+ private:
+ const cTimer *timer;
++ void DoSet(void);
+ public:
+ cMenuTimerItem(const cTimer *Timer);
+ virtual int Compare(const cListObject &ListObject) const;
+@@ -1166,7 +1167,7 @@
+ cMenuTimerItem::cMenuTimerItem(const cTimer *Timer)
+ {
+ timer = Timer;
+- Set();
++ DoSet();
+ }
+
+ int cMenuTimerItem::Compare(const cListObject &ListObject) const
+@@ -1176,6 +1177,19 @@
+
+ void cMenuTimerItem::Set(void)
+ {
++ // check for deleted timer
++ LOCK_TIMERS_READ;
++ for (const cTimer *t = Timers->First(); ; t = Timers->Next(t)) {
++ if (t == timer)
++ break; // timer still there
++ if (t == NULL)
++ return; // no matching timer found
++ }
++ DoSet();
++}
++
++void cMenuTimerItem::DoSet(void)
++{
+ cString day, name("");
+ if (timer->WeekDays())
+ day = timer->PrintDay(0, timer->WeekDays(), false);
+@@ -1223,8 +1237,7 @@
+ cStateKey timersStateKey;
+ int helpKeys;
+ void Set(void);
+- eOSState Edit(void);
+- eOSState New(void);
++ eOSState Edit(bool New = false);
+ eOSState Delete(void);
+ eOSState OnOff(void);
+ eOSState Info(void);
+@@ -1316,20 +1329,29 @@
+ return osContinue;
+ }
+
+-eOSState cMenuTimers::Edit(void)
+-{
+- if (HasSubMenu() || Count() == 0)
+- return osContinue;
+- return AddSubMenu(new cMenuEditTimer(GetTimer()));
+-}
+-
+-eOSState cMenuTimers::New(void)
++eOSState cMenuTimers::Edit(bool New)
+ {
+- if (HasSubMenu())
++ if (HasSubMenu() || Count() == 0 && !New)
+ return osContinue;
+ cTimer *Timer = new cTimer;
+ if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost)
+ Timer->SetRemote(Setup.SVDRPDefaultHost);
++ // Data structure for service "Epgsearch-exttimeredit-v1.0"
++ struct Epgsearch_exttimeredit_v1_0
++ {
++ // in
++ cTimer* timer; // pointer to the timer to edit
++ bool bNew; // flag that indicates, if this is a new timer or an existing one
++ const cEvent* event; // pointer to the event corresponding to this timer (may be NULL)
++ // out
++ cOsdMenu* pTimerMenu; // pointer to the menu of results
++ } exttimeredit;
++ exttimeredit.timer = New ? (new cTimer) : GetTimer();
++ exttimeredit.bNew = New;
++ exttimeredit.event = exttimeredit.timer->Event();
++ if (cPluginManager::CallFirstService("Epgsearch-exttimeredit-v1.0", &exttimeredit))
++ return AddSubMenu(exttimeredit.pTimerMenu);
++
+ return AddSubMenu(new cMenuEditTimer(Timer, true));
+ }
+
+@@ -1386,7 +1408,7 @@
+ switch (Key) {
+ case kOk: return Edit();
+ case kRed: state = OnOff(); break; // must go through SetHelpKeys()!
+- case kGreen: return New();
++ case kGreen: return Edit(true);
+ case kYellow: state = Delete(); break;
+ case kInfo:
+ case kBlue: return Info();
+@@ -1400,6 +1422,14 @@
+ Add(new cMenuTimerItem(Timer), true);
+ Display();
+ }
++ if (!HasSubMenu()) {
++ LOCK_TIMERS_READ;
++ if (Timers->Count()<Count()) {
++ // timer was deleted
++ cOsdMenu::Del(Current());
++ Display();
++ }
++ }
+ if (Key != kNone)
+ SetHelpKeys();
+ return state;