diff options
author | Timo Eskola <timo@tolleri.net> | 2018-09-05 09:06:24 +0300 |
---|---|---|
committer | Timo Eskola <timo@tolleri.net> | 2018-09-05 09:06:24 +0300 |
commit | 78522d4e06383a20294ad74f2d3351479862a449 (patch) | |
tree | a7dd208203bb71659c48cd669510c4b46d9d7776 | |
parent | ce02eaf6c6d679458256c21d0efdc514f537d288 (diff) | |
parent | bad9290d3d3cfd335fca6ac38d5eefbee976b33e (diff) | |
download | vdr-plugin-duplicates-78522d4e06383a20294ad74f2d3351479862a449.tar.gz vdr-plugin-duplicates-78522d4e06383a20294ad74f2d3351479862a449.tar.bz2 |
Merge branch 'master' into vdr2.4.0
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | menu.c | 27 |
2 files changed, 25 insertions, 3 deletions
@@ -12,6 +12,7 @@ VDR Plugin 'duplicates' Revision History - Added missing recordings lock release. - Simplified toggle hidden. - Fixed recordings locking sequence. +- Check for vanished recorgins in info menu. 2018-08-30: Version 0.2.1 @@ -43,6 +43,9 @@ eOSState cDuplicatesReplayControl::ProcessKey(eKeys Key) { class cMenuDuplicate : public cOsdMenu { private: const cRecording *recording; + cString originalFileName; + cStateKey recordingsStateKey; + bool RefreshRecording(void); public: cMenuDuplicate(const cRecording *Recording); virtual void Display(void); @@ -53,9 +56,25 @@ cMenuDuplicate::cMenuDuplicate(const cRecording *Recording) :cOsdMenu(trVDR("Recording info")) { SetMenuCategory(mcRecording); recording = Recording; + originalFileName = recording->FileName(); SetHelp(trVDR("Button$Play")); } +bool cMenuDuplicate::RefreshRecording(void) +{ + if (const cRecordings *Recordings = cRecordings::GetRecordingsRead(recordingsStateKey)) { + if ((recording = Recordings->GetByName(originalFileName)) != NULL) + Display(); + else { + recordingsStateKey.Remove(); + Skins.Message(mtWarning, trVDR("Recording vanished!")); + return false; + } + recordingsStateKey.Remove(); + } + return true; +} + void cMenuDuplicate::Display(void) { cOsdMenu::Display(); DisplayMenu()->SetRecording(recording); @@ -63,8 +82,9 @@ void cMenuDuplicate::Display(void) { cStatus::MsgOsdTextItem(recording->Info()->Description()); } -eOSState cMenuDuplicate::ProcessKey(eKeys Key) -{ +eOSState cMenuDuplicate::ProcessKey(eKeys Key) { + if (!RefreshRecording()) + return osBack; // the recording has vanished, so close this menu switch (int(Key)) { case kUp|k_Repeat: case kUp: @@ -325,8 +345,9 @@ eOSState cMenuDuplicates::Info(void) { const cRecordings *Recordings = cRecordings::GetRecordingsRead(stateKey); const cRecording *recording = Recordings->GetByName(ri->FileName()); if (recording && recording->Info()->Title()) { + cMenuDuplicate *MenuDuplicate = new cMenuDuplicate(recording); stateKey.Remove(); - return AddSubMenu(new cMenuDuplicate(recording)); + return AddSubMenu(MenuDuplicate); } else stateKey.Remove(); } |