mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Automatically closing empty recordings menu page after delete
This commit is contained in:
12
menu.c
12
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;
|
||||
|
Reference in New Issue
Block a user