summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-02-26 11:45:28 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-02-26 11:45:28 +0100
commit7271a160e46b3d29a5623a8478a335fd742f1f9a (patch)
treeadc9fb8509aefa9521e737754a64086eabeaeab0 /menu.c
parent1c47cf37ca45280df1f17cd1870b82b2bbb48dd5 (diff)
downloadvdr-7271a160e46b3d29a5623a8478a335fd742f1f9a.tar.gz
vdr-7271a160e46b3d29a5623a8478a335fd742f1f9a.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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/menu.c b/menu.c
index 7018741d..c158f02a 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 2.82.1.7 2014/01/30 09:11:46 kls Exp $
+ * $Id: menu.c 2.82.1.8 2014/02/26 11:42:28 kls Exp $
*/
#include "menu.h"
@@ -2189,6 +2189,7 @@ public:
const char *Name(void) { return name; }
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);
};
@@ -2420,6 +2421,7 @@ eOSState cMenuRecordings::Delete(void)
Display();
if (!Count())
return osBack;
+ return osUser2;
}
else
Skins.Message(mtError, tr("Error while deleting recording!"));
@@ -2485,6 +2487,14 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key)
default: break;
}
}
+ 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());