summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-02-10 11:36:07 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-02-10 11:36:07 +0100
commitba1bf3a99ef7f6867aecccf52e5f6bd90c48107a (patch)
tree1062ae8fc4a22115aa6aeb7c10db075fbeab50ea /menu.c
parent9567629870f59d5768b81428bab3f1405f32498c (diff)
downloadvdr-ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a.tar.gz
vdr-ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a.tar.bz2
Automatically closing empty recordings menu page after delete
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 59ce2aa6..2e787274 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 1.150 2002/02/09 15:25:27 kls Exp $
+ * $Id: menu.c 1.151 2002/02/10 11:25:07 kls Exp $
*/
#include "menu.h"
@@ -1680,6 +1680,8 @@ eOSState cMenuRecordings::Del(void)
cOsdMenu::Del(Current());
Recordings.Del(recording);
Display();
+ if (!Count())
+ return osBack;
}
else
Interface->Error(tr("Error while deleting recording!"));
@@ -1707,6 +1709,7 @@ eOSState cMenuRecordings::Summary(void)
eOSState cMenuRecordings::ProcessKey(eKeys Key)
{
+ bool HadSubMenu = HasSubMenu();
eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) {
@@ -1720,6 +1723,13 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key)
default: break;
}
}
+ if (Key == kYellow && HadSubMenu && !HasSubMenu()) {
+ // the last recording in a subdirectory was deleted, so let's go back up
+ cOsdMenu::Del(Current());
+ if (!Count())
+ return osBack;
+ Display();
+ }
if (!HasSubMenu() && Key != kNone)
SetHelpKeys();
return state;