The "Menu" key now behaves consistently

This commit is contained in:
Klaus Schmidinger 2006-01-04 13:22:53 +01:00
parent fa0af7065e
commit b1836290c9
4 changed files with 17 additions and 30 deletions

View File

@ -1433,6 +1433,7 @@ Chris Warren <dvb@ixalon.net>
Luca Olivetti <luca@ventoso.org> Luca Olivetti <luca@ventoso.org>
for making cDevice::AttachPlayer() keep the track language codes and descriptions for making cDevice::AttachPlayer() keep the track language codes and descriptions
in Transfer Mode in Transfer Mode
for suggesting to make the "Menu" key behave consistently
Mikko Salo <mikko.salo@ppe.inet.fi> Mikko Salo <mikko.salo@ppe.inet.fi>
for suggesting to make the setup option "DVB/Video display format" available only for suggesting to make the setup option "DVB/Video display format" available only

View File

@ -4079,3 +4079,7 @@ Video Disk Recorder Revision History
- Added cMenuEditStrItem::InEditMode() (suggested by Christian Wieninger). - Added cMenuEditStrItem::InEditMode() (suggested by Christian Wieninger).
- Now using FE_READ_STATUS to read the current frontend status (suggested by - Now using FE_READ_STATUS to read the current frontend status (suggested by
Holger Wächtler). Holger Wächtler).
- The "Menu" key now behaves consistently. If there is anything on the OSD, it
is closed when the "Menu" key is pressed, and if there is nothing on the OSD,
the "Menu" key opens the main menu (suggested by Luca Olivetti).

2
MANUAL
View File

@ -18,7 +18,7 @@ Version 1.2
Left Prev group - Page up Page up Decrement Page up Search back Sel. channel Left Prev group - Page up Page up Decrement Page up Search back Sel. channel
Right Next group - Page down Page down Increment Page down Search forward Sel. channel Right Next group - Page down Page down Increment Page down Search forward Sel. channel
Ok Ch display Select Switch Edit Accept Play Progress disp. Switch & Close Ok Ch display Select Switch Edit Accept Play Progress disp. Switch & Close
Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu on Menu on Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu off Menu off
Back - Menu off VDR menu VDR menu Discard VDR menu Recordings menu Close Back - Menu off VDR menu VDR menu Discard VDR menu Recordings menu Close
Red - Record Edit Edit ABC/abc Play/Commands(2) Jump - Red - Record Edit Edit ABC/abc Play/Commands(2) Jump -
Green - Audio New New Ins/Ovr Rewind Skip -60s - Green - Audio New New Ins/Ovr Rewind Skip -60s -

40
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/vdr * The project's page is at http://www.cadsoft.de/vdr
* *
* $Id: vdr.c 1.225 2006/01/03 10:20:41 kls Exp $ * $Id: vdr.c 1.226 2006/01/04 13:01:13 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -480,7 +480,6 @@ int main(int argc, char *argv[])
// Main program loop variables - need to be here to have them initialized before any EXIT(): // Main program loop variables - need to be here to have them initialized before any EXIT():
cOsdObject *Menu = NULL; cOsdObject *Menu = NULL;
cOsdObject *Temp = NULL;
int LastChannel = -1; int LastChannel = -1;
int LastTimerChannel = -1; int LastTimerChannel = -1;
int PreviousChannel[2] = { 1, 1 }; int PreviousChannel[2] = { 1, 1 };
@ -718,7 +717,7 @@ int main(int argc, char *argv[])
// Channel display: // Channel display:
if (!EITScanner.Active() && cDevice::CurrentChannel() != LastChannel) { if (!EITScanner.Active() && cDevice::CurrentChannel() != LastChannel) {
if (!Menu) if (!Menu)
Menu = Temp = new cDisplayChannel(cDevice::CurrentChannel(), LastChannel > 0); Menu = new cDisplayChannel(cDevice::CurrentChannel(), LastChannel > 0);
LastChannel = cDevice::CurrentChannel(); LastChannel = cDevice::CurrentChannel();
LastChannelChanged = time(NULL); LastChannelChanged = time(NULL);
} }
@ -786,22 +785,18 @@ int main(int argc, char *argv[])
// Menu control: // Menu control:
case kMenu: case kMenu:
key = kNone; // nobody else needs to see this key key = kNone; // nobody else needs to see this key
if (Menu) { if (Menu)
DELETENULL(Menu); DELETENULL(Menu);
if (!Temp) else if (cControl::Control() && cOsd::IsOpen())
break;
}
if (cControl::Control())
cControl::Control()->Hide(); cControl::Control()->Hide();
Menu = new cMenuMain; else
Temp = NULL; Menu = new cMenuMain;
break; break;
#define DirectMainFunction(function)\ #define DirectMainFunction(function)\
DELETENULL(Menu);\ DELETENULL(Menu);\
if (cControl::Control())\ if (cControl::Control())\
cControl::Control()->Hide();\ cControl::Control()->Hide();\
Menu = new cMenuMain(function);\ Menu = new cMenuMain(function);\
Temp = NULL;\
key = kNone; // nobody else needs to see this key key = kNone; // nobody else needs to see this key
case kSchedule: DirectMainFunction(osSchedule); break; case kSchedule: DirectMainFunction(osSchedule); break;
case kChannels: DirectMainFunction(osChannels); break; case kChannels: DirectMainFunction(osChannels); break;
@ -812,12 +807,11 @@ int main(int argc, char *argv[])
case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break; case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break;
case k_Plugin: { case k_Plugin: {
DELETENULL(Menu); DELETENULL(Menu);
Temp = NULL;
if (cControl::Control()) if (cControl::Control())
cControl::Control()->Hide(); cControl::Control()->Hide();
cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin()); cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin());
if (plugin) { if (plugin) {
Menu = Temp = plugin->MainMenuAction(); Menu = plugin->MainMenuAction();
if (Menu) { if (Menu) {
Menu->Show(); Menu->Show();
if (Menu->IsMenu()) if (Menu->IsMenu())
@ -851,7 +845,7 @@ int main(int argc, char *argv[])
else else
cDevice::PrimaryDevice()->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA); cDevice::PrimaryDevice()->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
if (!Menu && !cOsd::IsOpen()) if (!Menu && !cOsd::IsOpen())
Menu = Temp = cDisplayVolume::Create(); Menu = cDisplayVolume::Create();
cDisplayVolume::Process(key); cDisplayVolume::Process(key);
key = kNone; // nobody else needs to see these keys key = kNone; // nobody else needs to see these keys
break; break;
@ -859,12 +853,10 @@ int main(int argc, char *argv[])
case kAudio: case kAudio:
if (cControl::Control()) if (cControl::Control())
cControl::Control()->Hide(); cControl::Control()->Hide();
if (Temp && !cDisplayTracks::IsOpen()) { if (!cDisplayTracks::IsOpen()) {
DELETENULL(Menu); DELETENULL(Menu);
Temp = NULL; Menu = cDisplayTracks::Create();
} }
if (!Menu && !cOsd::IsOpen())
Menu = Temp = cDisplayTracks::Create();
else else
cDisplayTracks::Process(key); cDisplayTracks::Process(key);
key = kNone; key = kNone;
@ -873,7 +865,6 @@ int main(int argc, char *argv[])
case kPause: case kPause:
if (!cControl::Control()) { if (!cControl::Control()) {
DELETENULL(Menu); DELETENULL(Menu);
Temp = NULL;
if (!cRecordControls::PauseLiveVideo()) if (!cRecordControls::PauseLiveVideo())
Skins.Message(mtError, tr("No free DVB device to record!")); Skins.Message(mtError, tr("No free DVB device to record!"));
key = kNone; // nobody else needs to see this key key = kNone; // nobody else needs to see this key
@ -892,7 +883,6 @@ int main(int argc, char *argv[])
// Power off: // Power off:
case kPower: isyslog("Power button pressed"); case kPower: isyslog("Power button pressed");
DELETENULL(Menu); DELETENULL(Menu);
Temp = NULL;
if (!Shutdown) { if (!Shutdown) {
Skins.Message(mtError, tr("Can't shutdown - option '-s' not given!")); Skins.Message(mtError, tr("Can't shutdown - option '-s' not given!"));
break; break;
@ -924,12 +914,10 @@ int main(int argc, char *argv[])
switch (state) { switch (state) {
case osPause: DELETENULL(Menu); case osPause: DELETENULL(Menu);
cControl::Shutdown(); // just in case cControl::Shutdown(); // just in case
Temp = NULL;
if (!cRecordControls::PauseLiveVideo()) if (!cRecordControls::PauseLiveVideo())
Skins.Message(mtError, tr("No free DVB device to record!")); Skins.Message(mtError, tr("No free DVB device to record!"));
break; break;
case osRecord: DELETENULL(Menu); case osRecord: DELETENULL(Menu);
Temp = NULL;
if (cRecordControls::Start()) if (cRecordControls::Start())
;//XXX Skins.Message(mtInfo, tr("Recording")); ;//XXX Skins.Message(mtInfo, tr("Recording"));
else else
@ -938,28 +926,24 @@ int main(int argc, char *argv[])
case osRecordings: case osRecordings:
DELETENULL(Menu); DELETENULL(Menu);
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
Menu = new cMenuMain(osRecordings); Menu = new cMenuMain(osRecordings);
break; break;
case osReplay: DELETENULL(Menu); case osReplay: DELETENULL(Menu);
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
cControl::Launch(new cReplayControl); cControl::Launch(new cReplayControl);
break; break;
case osStopReplay: case osStopReplay:
DELETENULL(Menu); DELETENULL(Menu);
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
break; break;
case osSwitchDvb: case osSwitchDvb:
DELETENULL(Menu); DELETENULL(Menu);
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
Skins.Message(mtInfo, tr("Switching primary DVB...")); Skins.Message(mtInfo, tr("Switching primary DVB..."));
cDevice::SetPrimaryDevice(Setup.PrimaryDVB); cDevice::SetPrimaryDevice(Setup.PrimaryDVB);
break; break;
case osPlugin: DELETENULL(Menu); case osPlugin: DELETENULL(Menu);
Menu = Temp = cMenuMain::PluginOsdObject(); Menu = cMenuMain::PluginOsdObject();
if (Menu) if (Menu)
Menu->Show(); Menu->Show();
break; break;
@ -968,7 +952,6 @@ int main(int argc, char *argv[])
DELETENULL(Menu); DELETENULL(Menu);
else else
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
break; break;
default: ; default: ;
} }
@ -1007,7 +990,6 @@ int main(int argc, char *argv[])
case kPlay: case kPlay:
if (cReplayControl::LastReplayed()) { if (cReplayControl::LastReplayed()) {
cControl::Shutdown(); cControl::Shutdown();
Temp = NULL;
cControl::Launch(new cReplayControl); cControl::Launch(new cReplayControl);
} }
break; break;