diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-10 10:51:58 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-10 10:51:58 +0200 |
commit | a334a2df334ccd3c2a2756b374b675a15bdb3de8 (patch) | |
tree | 54f3208ff1d55f2f6dc01ff0afc3ffd68a10dde5 /menu.c | |
parent | c00d4ea326e61d76d7ab5760a5c06646d6b88ab0 (diff) | |
download | vdr-a334a2df334ccd3c2a2756b374b675a15bdb3de8.tar.gz vdr-a334a2df334ccd3c2a2756b374b675a15bdb3de8.tar.bz2 |
Added a 'Setup' menu
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 39 |
1 files changed, 38 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.23 2000/09/09 14:43:37 kls Exp $ + * $Id: menu.c 1.24 2000/09/10 10:28:46 kls Exp $ */ #include "menu.h" @@ -1072,6 +1072,41 @@ eOSState cMenuRecordings::ProcessKey(eKeys Key) return state; } +// --- cMenuSetup ------------------------------------------------------------ + +class cMenuSetup : public cOsdMenu { +private: + cSetup data; +public: + cMenuSetup(void); + virtual eOSState ProcessKey(eKeys Key); + }; + +cMenuSetup::cMenuSetup(void) +:cOsdMenu("Setup", 20) +{ + data = Setup; + Add(new cMenuEditIntItem( "PrimaryDVB", &data.PrimaryDVB, 1, cDvbApi::NumDvbApis)); + Add(new cMenuEditBoolItem("ShowInfoOnChSwitch", &data.ShowInfoOnChSwitch)); + Add(new cMenuEditBoolItem("MenuScrollPage", &data.MenuScrollPage)); +} + +eOSState cMenuSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + + if (state == osUnknown) { + switch (Key) { + case kOk: state = (Setup.PrimaryDVB != data.PrimaryDVB) ? osSwitchDvb : osBack; + Setup = data; + Setup.Save(); + break; + default: break; + } + } + return state; +} + // --- cMenuMain ------------------------------------------------------------- #define STOP_RECORDING "Stop recording " @@ -1082,6 +1117,7 @@ cMenuMain::cMenuMain(bool Replaying) Add(new cOsdItem("Channels", osChannels)); Add(new cOsdItem("Timer", osTimer)); Add(new cOsdItem("Recordings", osRecordings)); + Add(new cOsdItem("Setup", osSetup)); if (Replaying) Add(new cOsdItem("Stop replaying", osStopReplay)); const char *s = NULL; @@ -1104,6 +1140,7 @@ eOSState cMenuMain::ProcessKey(eKeys Key) case osChannels: return AddSubMenu(new cMenuChannels); case osTimer: return AddSubMenu(new cMenuTimers); case osRecordings: return AddSubMenu(new cMenuRecordings); + case osSetup: return AddSubMenu(new cMenuSetup); case osStopRecord: if (Interface.Confirm("Stop Recording?")) { cOsdItem *item = Get(Current()); if (item) { |