summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-02-26 11:39:06 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-02-26 11:39:06 +0100
commit927aa495764c0d4dbdd245d112458c8f637040b9 (patch)
tree411e0fb49410940685ff2ebb68474e66277410a8
parentde1ce0b27d528d06f5b7dabf953ee7064eccb0d5 (diff)
downloadvdr-927aa495764c0d4dbdd245d112458c8f637040b9.tar.gz
vdr-927aa495764c0d4dbdd245d112458c8f637040b9.tar.bz2
Fixed keeping the current position in the Recordings menu if a recording was deleted in a sub folder
-rw-r--r--HISTORY4
-rw-r--r--menu.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 3937987e..b94e00ee 100644
--- a/HISTORY
+++ b/HISTORY
@@ -8203,7 +8203,9 @@ Video Disk Recorder Revision History
- Fixed detecting broken video data streams when recording.
- Fixed handling frame detection buffer length (reported by Eike Sauer).
-2014-02-25: Version 2.1.6
+2014-02-26: Version 2.1.6
- Revoked "Fixed some compiler warnings with Clang 3.4.1" from ci.c, because this
did not compile with older versions of gcc (thanks to Sören Moch).
+- Fixed keeping the current position in the Recordings menu if a recording was
+ deleted in a sub folder.
diff --git a/menu.c b/menu.c
index 683a4779..c95d1245 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 3.19 2014/02/08 12:36:12 kls Exp $
+ * $Id: menu.c 3.20 2014/02/26 11:23:28 kls Exp $
*/
#include "menu.h"
@@ -2533,6 +2533,7 @@ public:
int Level(void) { return level; }
cRecording *Recording(void) { return recording; }
bool IsDirectory(void) { return name != NULL; }
+ void SetRecording(cRecording *Recording) { recording = Recording; }
virtual void SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable);
};
@@ -2782,6 +2783,7 @@ eOSState cMenuRecordings::Delete(void)
Display();
if (!Count())
return osBack;
+ return osUser2;
}
else
Skins.Message(mtError, tr("Error while deleting recording!"));
@@ -2861,6 +2863,14 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key)
path = NULL;
fileName = NULL;
}
+ else if (state == osUser2) {
+ // a recording in a sub folder was deleted, so update the current item
+ cOsdMenu *m = HasSubMenu() ? SubMenu() : this;
+ if (cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current())) {
+ if (cMenuRecordingItem *riSub = (cMenuRecordingItem *)m->Get(m->Current()))
+ ri->SetRecording(riSub->Recording());
+ }
+ }
if (Key == kYellow && HadSubMenu && !HasSubMenu()) {
// the last recording in a subdirectory was deleted, so let's go back up
cOsdMenu::Del(Current());