diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 11:33:43 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 11:33:43 +0200 |
commit | 45a29e5b1614359d09aa3e69b8928fcfeebc84a2 (patch) | |
tree | 7e3532af8e53c32402b2980e02c9f4988a687031 /vdr.c | |
parent | 2a91de02abee737333cf650b32d13e5689443b76 (diff) | |
download | vdr-45a29e5b1614359d09aa3e69b8928fcfeebc84a2.tar.gz vdr-45a29e5b1614359d09aa3e69b8928fcfeebc84a2.tar.bz2 |
Key macros can now call plugins that don't have a main menu entry
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.211 2005/08/21 08:47:06 kls Exp $ + * $Id: vdr.c 1.212 2005/09/03 11:26:27 kls Exp $ */ #include <getopt.h> @@ -695,7 +695,7 @@ int main(int argc, char *argv[]) Menu = new cMenuMain(cControl::Control()); Temp = NULL; break; - #define DirectMainFunction(function...)\ + #define DirectMainFunction(function)\ DELETENULL(Menu);\ if (cControl::Control())\ cControl::Control()->Hide();\ @@ -709,7 +709,23 @@ int main(int argc, char *argv[]) case kSetup: DirectMainFunction(osSetup); break; case kCommands: DirectMainFunction(osCommands); break; case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break; - case k_Plugin: DirectMainFunction(osPlugin, cRemote::GetPlugin()); break; + case k_Plugin: { + DELETENULL(Menu); + Temp = NULL; + if (cControl::Control()) + cControl::Control()->Hide(); + cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin()); + if (plugin) { + Menu = Temp = plugin->MainMenuAction(); + if (Menu) { + Menu->Show(); + if (Menu->IsMenu()) + ((cOsdMenu*)Menu)->Display(); + } + } + key = kNone; // nobody else needs to see these keys + } + break; // Channel up/down: case kChanUp|k_Repeat: case kChanUp: |