From ba1bf3a99ef7f6867aecccf52e5f6bd90c48107a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 10 Feb 2002 11:36:07 +0100 Subject: Automatically closing empty recordings menu page after delete --- CONTRIBUTORS | 4 ++++ HISTORY | 4 +++- menu.c | 12 +++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 29b20c48..0d08f10b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -196,3 +196,7 @@ Hannu Savolainen Jürgen Schmidt for fixing a problem with 'in_addr_t' on systems with glibc < 2.2. + +Uwe Freese + for suggesting to automatically close an empty recordings page after deleting + an entry diff --git a/HISTORY b/HISTORY index c5bf647f..9c065ce6 100644 --- a/HISTORY +++ b/HISTORY @@ -970,7 +970,7 @@ Video Disk Recorder Revision History - Fixed a problem with the ERR macro defined by ncurses.h (thanks to Artur Skawina). -2002-02-09: Version 0.99pre6 +2002-02-10: Version 0.99pre6 - Fixed a bug in moving timers or channels to the last position in the list (thanks to Matthias Schniedermeyer for helping to debug this one). @@ -983,3 +983,5 @@ Video Disk Recorder Revision History middle between start and end time). - Added a typedef for 'in_addr_t' to make it work with glibc < 2.2 (thanks to Jürgen Schmidt). +- When the last entry in a "Recordings" menu page is deleted, that page is now + automatically closed (suggested by Uwe Freese). 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; -- cgit v1.2.3