diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2014-02-26 11:39:06 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2014-02-26 11:39:06 +0100 |
commit | 927aa495764c0d4dbdd245d112458c8f637040b9 (patch) | |
tree | 411e0fb49410940685ff2ebb68474e66277410a8 /menu.c | |
parent | de1ce0b27d528d06f5b7dabf953ee7064eccb0d5 (diff) | |
download | vdr-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
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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()); |