summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-01 11:03:00 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-01 11:03:00 +0200
commit6169802a4bced5d6263caca13775d403bd75a8a4 (patch)
tree09c9dbe0722fed0d6b418defe187354824814db4 /patches
parenta46c7161bddc00b5b11bda0f8a14066b5f837302 (diff)
downloadvdr-plugin-epgsearch-6169802a4bced5d6263caca13775d403bd75a8a4.tar.gz
vdr-plugin-epgsearch-6169802a4bced5d6263caca13775d403bd75a8a4.tar.bz2
Add new exttimeredit patch for VDR 2.3.3+ (thx jasminj)
Diffstat (limited to 'patches')
-rw-r--r--patches/vdr.epgsearch-exttimeredit-2.3.3.diff125
1 files changed, 125 insertions, 0 deletions
diff --git a/patches/vdr.epgsearch-exttimeredit-2.3.3.diff b/patches/vdr.epgsearch-exttimeredit-2.3.3.diff
new file mode 100644
index 0000000..25c3ef7
--- /dev/null
+++ b/patches/vdr.epgsearch-exttimeredit-2.3.3.diff
@@ -0,0 +1,125 @@
+From 5f30c7cbac03c534df40aa437399f45747d9e7ae Mon Sep 17 00:00:00 2001
+From: Jasmin Jessich <jasmin@anw.at>
+Date: Mon, 3 Apr 2017 21:33:33 +0200
+Subject: [PATCH] Patched with vdr.epgsearch-exttimeredit-2.3.1.diff
+
+---
+ menu.c | 56 +++++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 43 insertions(+), 13 deletions(-)
+
+diff --git a/menu.c b/menu.c
+index 02aa7a9..561860c 100644
+--- a/menu.c
++++ b/menu.c
+@@ -1151,6 +1151,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
+ class cMenuTimerItem : public cOsdItem {
+ private:
+ const cTimer *timer;
++ void DoSet(void);
+ public:
+ cMenuTimerItem(const cTimer *Timer);
+ virtual int Compare(const cListObject &ListObject) const;
+@@ -1162,7 +1163,7 @@ public:
+ cMenuTimerItem::cMenuTimerItem(const cTimer *Timer)
+ {
+ timer = Timer;
+- Set();
++ DoSet();
+ }
+
+ int cMenuTimerItem::Compare(const cListObject &ListObject) const
+@@ -1172,6 +1173,19 @@ int cMenuTimerItem::Compare(const cListObject &ListObject) const
+
+ 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);
+@@ -1219,8 +1233,7 @@ private:
+ 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);
+@@ -1312,20 +1325,29 @@ eOSState cMenuTimers::OnOff(void)
+ return osContinue;
+ }
+
+-eOSState cMenuTimers::Edit(void)
++eOSState cMenuTimers::Edit(bool New)
+ {
+- if (HasSubMenu() || Count() == 0)
+- return osContinue;
+- return AddSubMenu(new cMenuEditTimer(GetTimer()));
+-}
+-
+-eOSState cMenuTimers::New(void)
+-{
+- if (HasSubMenu())
++ if (HasSubMenu() || Count() == 0 && !New)
+ return osContinue;
+ cTimer *Timer = new cTimer;
+ if (*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));
+ }
+
+@@ -1382,7 +1404,7 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
+ 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();
+@@ -1396,6 +1418,14 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
+ 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;
+--
+2.7.4