diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2014-02-26 11:45:28 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2014-02-26 11:45:28 +0100 |
commit | 7271a160e46b3d29a5623a8478a335fd742f1f9a (patch) | |
tree | adc9fb8509aefa9521e737754a64086eabeaeab0 /menu.c | |
parent | 1c47cf37ca45280df1f17cd1870b82b2bbb48dd5 (diff) | |
download | vdr-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.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 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()); |