diff options
-rw-r--r-- | sources.mk | 1 | ||||
-rw-r--r-- | src/menusetup.cpp | 67 | ||||
-rw-r--r-- | src/menusetup.h | 1 | ||||
-rw-r--r-- | src/menusetupitemsetup.cpp | 42 | ||||
-rw-r--r-- | src/menusetupitemsetup.h | 39 | ||||
-rw-r--r-- | src/pluginsetup.cpp | 10 | ||||
-rw-r--r-- | src/pluginsetup.h | 2 |
7 files changed, 150 insertions, 12 deletions
@@ -14,3 +14,4 @@ SRCS = \ src/systemmenunode.cpp \ src/i18n.cpp \ src/menusetup.cpp \ + src/menusetupitemsetup.cpp \ diff --git a/src/menusetup.cpp b/src/menusetup.cpp index 81f0103..255801e 100644 --- a/src/menusetup.cpp +++ b/src/menusetup.cpp @@ -22,19 +22,21 @@ #include "menusetup.h" #include <vdr/menu.h> +#include <vdr/interface.h> #include <libxml++/libxml++.h> #include "menuconfiguration.h" +#include "menusetupitemsetup.h" using namespace xmlpp; using namespace std; cMenuSetup::cMenuSetup(MenuConfiguration& menuConfiguration) -:cOsdMenu(tr("MENU"),25),_menuConfiguration(menuConfiguration) +:cOsdMenu(tr("Menu Setup"),25),_menuConfiguration(menuConfiguration) { //TODO - + Element* root = _menuConfiguration.Configuration(); - + Node::NodeList children = root->get_children(); for (Node::NodeList::iterator i = children.begin(); i != children.end(); i++) { @@ -46,15 +48,66 @@ cMenuSetup::cMenuSetup(MenuConfiguration& menuConfiguration) string type = childElement->get_name(); string name = nameAttribute->get_value(); - - Add(new cOsdItem(name.c_str(), osUser1)); + + Add(new cOsdItem(name.c_str(), osContinue)); } } + DrawButton(); } eOSState cMenuSetup::ProcessKey(eKeys Key) { - eOSState state=cOsdMenu::ProcessKey(Key); - if(state==osUnknown && Key==kOk) state=osBack; + dsyslog("menuorg: cMenuSetup::ProcessKey called"); + + eOSState state = cOsdMenu::ProcessKey(Key); + + if (state == osUnknown) + { + switch(Key) + { + case kRed: + DrawButton(); + break; + + case kGreen: + state = AddSubMenu(new cMenuSetupItemSetup()); + break; + + case kYellow: + DrawButton(); + break; + + case kBlue: + DrawButton(); + break; + + case kUp: + case kDown: + case kLeft: + DrawButton(); + break; + + case kOk: + if (Interface->Confirm(tr("Apply Changes?"))) + { + // Save it! + } + return osEnd; + break; + + case kBack : + return osBack; + break; + + default: + DrawButton(); + break; + } + } return state; } + +void cMenuSetup::DrawButton(void) +{ + SetHelp(tr("Create"),tr("Edit"),tr("Delete"),tr("Move")); +} diff --git a/src/menusetup.h b/src/menusetup.h index 1828b57..6a2409f 100644 --- a/src/menusetup.h +++ b/src/menusetup.h @@ -35,6 +35,7 @@ class cMenuSetup : public cOsdMenu public: cMenuSetup(MenuConfiguration& menuConfiguration); virtual eOSState ProcessKey(eKeys Key); + void DrawButton(void); }; #endif diff --git a/src/menusetupitemsetup.cpp b/src/menusetupitemsetup.cpp new file mode 100644 index 0000000..e670d19 --- /dev/null +++ b/src/menusetupitemsetup.cpp @@ -0,0 +1,42 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (C) 2007 Thomas Creutz, Tobias Grimm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + * + */ + +#include "menusetupitemsetup.h" + +cMenuSetupItemSetup::cMenuSetupItemSetup(void) +:cOsdMenu(tr("Item Setup"),25) +{ + itemTypeText[0] = "System"; + itemTypeText[1] = "Plugin"; + itemTypeText[2] = "Submenu"; + itemTypeText[3] = "Command"; + + Add(new cMenuEditStraItem(tr("Item Type"),&_itemType, 4, itemTypeText)); + // TODO: add osd items for the selectet item type +} + +eOSState cMenuSetupItemSetup::ProcessKey(eKeys Key) +{ + dsyslog("menuorg: cMenuSetupItemSetup::ProcessKey called"); + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/menusetupitemsetup.h b/src/menusetupitemsetup.h new file mode 100644 index 0000000..4735d4c --- /dev/null +++ b/src/menusetupitemsetup.h @@ -0,0 +1,39 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (C) 2007 Thomas Creutz, Tobias Grimm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + * + */ + +#ifndef ___MENUSETUP_ITEMSETUP_H +#define ___MENUSETUP_ITEMSETUP_H + +#include <vdr/menu.h> + +class cMenuSetupItemSetup : public cOsdMenu +{ + private: + int _itemType; + const char* itemTypeText[4]; + + public: + cMenuSetupItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); +}; + +#endif diff --git a/src/pluginsetup.cpp b/src/pluginsetup.cpp index 5d81a4b..eb50a6c 100644 --- a/src/pluginsetup.cpp +++ b/src/pluginsetup.cpp @@ -45,15 +45,17 @@ void PluginSetup::Store(void) eOSState PluginSetup::ProcessKey(eKeys Key) { + dsyslog("menuorg: PluginSetup::ProcessKey called"); + eOSState state = cOsdMenu::ProcessKey(Key); switch(state) { case osUser1: - return AddSubMenu(new cMenuSetup(_menuConfiguration)); + state = AddSubMenu(new cMenuSetup(_menuConfiguration)); break; - +/* case osContinue: - if(NORMALKEY(Key)==kUp || NORMALKEY(Key)==kDown) + if(NORMALKEY(Key)==kUp || NORMALKEY(Key)==kDown || NORMALKEY(Key)==kGreen) { cOsdItem *item=Get(Current()); if(item) item->ProcessKey(kNone); @@ -67,7 +69,7 @@ eOSState PluginSetup::ProcessKey(eKeys Key) state=osBack; } break; - +*/ default: break; } diff --git a/src/pluginsetup.h b/src/pluginsetup.h index b991222..554679a 100644 --- a/src/pluginsetup.h +++ b/src/pluginsetup.h @@ -33,7 +33,7 @@ class PluginSetup : public cMenuSetupPage bool& _customMenuActive; bool& _unconfiguredPluginsIncluded; MenuConfiguration& _menuConfiguration; - + public: struct SetupName { |