diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-02-10 11:36:07 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-02-10 11:36:07 +0100 |
commit | ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a (patch) | |
tree | 1062ae8fc4a22115aa6aeb7c10db075fbeab50ea /menu.c | |
parent | 9567629870f59d5768b81428bab3f1405f32498c (diff) | |
download | vdr-ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a.tar.gz vdr-ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a.tar.bz2 |
Automatically closing empty recordings menu page after delete
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 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; |