From ade4a322c343a499e7df685787ac00119083556e Mon Sep 17 00:00:00 2001 From: svntobi Date: Sun, 19 Aug 2007 19:54:16 +0000 Subject: submenuitem -> submenunnode git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5831 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- src/mainmenuitemsprovider.cpp | 2 +- src/menuconfiguration.cpp | 8 ++++---- src/menuconfiguration.h | 2 +- src/submenuitem.cpp | 28 ---------------------------- src/submenuitem.h | 35 ----------------------------------- src/submenunode.cpp | 35 +++++++++++++++++++++++++++++++++++ src/submenunode.h | 39 +++++++++++++++++++++++++++++++++++++++ src/systemmenunode.cpp | 5 +---- src/systemmenunode.h | 2 +- 9 files changed, 82 insertions(+), 74 deletions(-) delete mode 100644 src/submenuitem.cpp delete mode 100644 src/submenuitem.h create mode 100644 src/submenunode.cpp create mode 100644 src/submenunode.h (limited to 'src') diff --git a/src/mainmenuitemsprovider.cpp b/src/mainmenuitemsprovider.cpp index a5b5f5c..8cb5469 100644 --- a/src/mainmenuitemsprovider.cpp +++ b/src/mainmenuitemsprovider.cpp @@ -21,7 +21,7 @@ */ #include "mainmenuitemsprovider.h" -#include "submenuitem.h" +#include "submenunode.h" #include "systemmenunode.h" #include "pluginmenunode.h" #include diff --git a/src/menuconfiguration.cpp b/src/menuconfiguration.cpp index 81a81b1..ec3de5e 100644 --- a/src/menuconfiguration.cpp +++ b/src/menuconfiguration.cpp @@ -25,7 +25,7 @@ #include #include #include "systemmenunode.h" -#include "submenuitem.h" +#include "submenunode.h" #include "pluginmenunode.h" using namespace xmlpp; @@ -90,7 +90,7 @@ void MenuConfiguration::ParseElement(const Element* element, MenuNode* menuNode) if ( type == "menu") { - MenuNode* subMenu = AddSubMenuItem(name, menuNode); + MenuNode* subMenu = AddSubMenuNode(name, menuNode); ParseElement(childElement, subMenu); } else if (type == "system") @@ -106,9 +106,9 @@ void MenuConfiguration::ParseElement(const Element* element, MenuNode* menuNode) } } -MenuNode* MenuConfiguration::AddSubMenuItem(string name, MenuNode* menu) +MenuNode* MenuConfiguration::AddSubMenuNode(string name, MenuNode* menu) { - return menu->AddChild(new SubMenuItem(name)); + return menu->AddChild(new SubMenuNode(name)); } void MenuConfiguration::AddSystemMenuNode(string name, MenuNode* menu) diff --git a/src/menuconfiguration.h b/src/menuconfiguration.h index fafbfa9..ca24e1e 100644 --- a/src/menuconfiguration.h +++ b/src/menuconfiguration.h @@ -41,7 +41,7 @@ class MenuConfiguration void ParseElement(const xmlpp::Element* a_node, MenuNode* menuNode); eOSState MenuTextToVdrState(std::string menuText); bool FindPluginByName(std::string name, const char** mainMenuEntry, int& pluginIndex); - MenuNode* AddSubMenuItem(std::string name, MenuNode* menu); + MenuNode* AddSubMenuNode(std::string name, MenuNode* menu); void AddSystemMenuNode(std::string name, MenuNode* menu); void AddPluginMenuNode(std::string pluginName, MenuNode* menu); }; diff --git a/src/submenuitem.cpp b/src/submenuitem.cpp deleted file mode 100644 index 86b84da..0000000 --- a/src/submenuitem.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 "submenuitem.h" - -SubMenuItem::SubMenuItem(std::string itemText) - :SystemMenuNode(itemText, osUser1) -{ -} diff --git a/src/submenuitem.h b/src/submenuitem.h deleted file mode 100644 index 1c056d5..0000000 --- a/src/submenuitem.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 ___SUBMENUITEM_H -#define ___SUBMENUITEM_H - -#include "systemmenunode.h" -#include - -class SubMenuItem: public SystemMenuNode -{ - public: - SubMenuItem(std::string itemText); -}; - -#endif diff --git a/src/submenunode.cpp b/src/submenunode.cpp new file mode 100644 index 0000000..18f493a --- /dev/null +++ b/src/submenunode.cpp @@ -0,0 +1,35 @@ +/* + * 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 "submenunode.h" +#include +#include "custommainmenuitem.h" + +SubMenuNode::SubMenuNode(std::string text) +{ + _text = text; +} + +IMenuItemDefinition* SubMenuNode::CreateMenuItemDefinition() +{ + return new CustomMainMenuItem(new cOsdItem(tr(_text.c_str()), osUser1)); +} diff --git a/src/submenunode.h b/src/submenunode.h new file mode 100644 index 0000000..8cd1e93 --- /dev/null +++ b/src/submenunode.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 ___SUBMENUNODE_H +#define ___SUBMENUNODE_H + +#include "menunode.h" +#include + +class SubMenuNode: public MenuNode +{ + private: + std::string _text; + + public: + SubMenuNode(std::string text); + IMenuItemDefinition* CreateMenuItemDefinition(); +}; + +#endif diff --git a/src/systemmenunode.cpp b/src/systemmenunode.cpp index 3edc922..2b9f2dd 100644 --- a/src/systemmenunode.cpp +++ b/src/systemmenunode.cpp @@ -32,8 +32,5 @@ SystemMenuNode::SystemMenuNode(std::string text, eOSState state) IMenuItemDefinition* SystemMenuNode::CreateMenuItemDefinition() { - if(_state != osUser1) - return new CustomMainMenuItem(new cOsdItem(tr(_text.c_str()), _state)); - else - return new CustomMainMenuItem(new cOsdItem(_text.c_str(), _state)); + return new CustomMainMenuItem(new cOsdItem(_text.c_str(), _state)); } diff --git a/src/systemmenunode.h b/src/systemmenunode.h index 45a611b..09df5d6 100644 --- a/src/systemmenunode.h +++ b/src/systemmenunode.h @@ -24,8 +24,8 @@ #define ___SYSTEMMENUNODE_H #include "menunode.h" -#include #include +#include class SystemMenuNode: public MenuNode { -- cgit v1.2.3