From 39719e375c373557e44decf2e1d2c87e9b5f8f32 Mon Sep 17 00:00:00 2001 From: svntobi Date: Sun, 19 Aug 2007 19:37:40 +0000 Subject: SystemMenuItem -> SystemMenuNode git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5829 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- src/mainmenuitemsprovider.cpp | 2 +- src/menuconfiguration.cpp | 8 ++++---- src/menuconfiguration.h | 2 +- src/submenuitem.cpp | 2 +- src/submenuitem.h | 4 ++-- src/systemmenuitem.cpp | 39 --------------------------------------- src/systemmenuitem.h | 41 ----------------------------------------- src/systemmenunode.cpp | 39 +++++++++++++++++++++++++++++++++++++++ src/systemmenunode.h | 41 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 src/systemmenuitem.cpp delete mode 100644 src/systemmenuitem.h create mode 100644 src/systemmenunode.cpp create mode 100644 src/systemmenunode.h (limited to 'src') diff --git a/src/mainmenuitemsprovider.cpp b/src/mainmenuitemsprovider.cpp index fe14ddb..b091c59 100644 --- a/src/mainmenuitemsprovider.cpp +++ b/src/mainmenuitemsprovider.cpp @@ -22,7 +22,7 @@ #include "mainmenuitemsprovider.h" #include "submenuitem.h" -#include "systemmenuitem.h" +#include "systemmenunode.h" #include "pluginmenuitem.h" #include diff --git a/src/menuconfiguration.cpp b/src/menuconfiguration.cpp index 0c0d7b4..87fb1f1 100644 --- a/src/menuconfiguration.cpp +++ b/src/menuconfiguration.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "systemmenuitem.h" +#include "systemmenunode.h" #include "submenuitem.h" #include "pluginmenuitem.h" @@ -95,7 +95,7 @@ void MenuConfiguration::ParseElement(const Element* element, MenuNode* menuNode) } else if (type == "system") { - AddSystemMenuItem(name, menuNode); + AddSystemMenuNode(name, menuNode); } else if (type == "plugin") { @@ -111,9 +111,9 @@ MenuNode* MenuConfiguration::AddSubMenuItem(string name, MenuNode* menu) return menu->AddChild(new SubMenuItem(name)); } -void MenuConfiguration::AddSystemMenuItem(string name, MenuNode* menu) +void MenuConfiguration::AddSystemMenuNode(string name, MenuNode* menu) { - menu->AddChild(new SystemMenuItem(name, MenuTextToVdrState(name))); + menu->AddChild(new SystemMenuNode(name, MenuTextToVdrState(name))); } void MenuConfiguration::AddPluginMenuItem(string pluginName, MenuNode* menu) diff --git a/src/menuconfiguration.h b/src/menuconfiguration.h index 933ea0f..fbf462a 100644 --- a/src/menuconfiguration.h +++ b/src/menuconfiguration.h @@ -42,7 +42,7 @@ class MenuConfiguration eOSState MenuTextToVdrState(std::string menuText); bool FindPluginByName(std::string name, const char** mainMenuEntry, int& pluginIndex); MenuNode* AddSubMenuItem(std::string name, MenuNode* menu); - void AddSystemMenuItem(std::string name, MenuNode* menu); + void AddSystemMenuNode(std::string name, MenuNode* menu); void AddPluginMenuItem(std::string pluginName, MenuNode* menu); }; diff --git a/src/submenuitem.cpp b/src/submenuitem.cpp index 0785018..86b84da 100644 --- a/src/submenuitem.cpp +++ b/src/submenuitem.cpp @@ -23,6 +23,6 @@ #include "submenuitem.h" SubMenuItem::SubMenuItem(std::string itemText) - :SystemMenuItem(itemText, osUser1) + :SystemMenuNode(itemText, osUser1) { } diff --git a/src/submenuitem.h b/src/submenuitem.h index 2101dc6..1c056d5 100644 --- a/src/submenuitem.h +++ b/src/submenuitem.h @@ -23,10 +23,10 @@ #ifndef ___SUBMENUITEM_H #define ___SUBMENUITEM_H -#include "systemmenuitem.h" +#include "systemmenunode.h" #include -class SubMenuItem: public SystemMenuItem +class SubMenuItem: public SystemMenuNode { public: SubMenuItem(std::string itemText); diff --git a/src/systemmenuitem.cpp b/src/systemmenuitem.cpp deleted file mode 100644 index 30257ee..0000000 --- a/src/systemmenuitem.cpp +++ /dev/null @@ -1,39 +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 "systemmenuitem.h" -#include -#include "custommainmenuitem.h" - -SystemMenuItem::SystemMenuItem(std::string itemText, eOSState itemState) -{ - _itemText = itemText; - _itemState = itemState; -} - -IMenuItemDefinition* SystemMenuItem::CreateMenuItemDefinition() -{ - if(_itemState != osUser1) - return new CustomMainMenuItem(new cOsdItem(tr(_itemText.c_str()), _itemState)); - else - return new CustomMainMenuItem(new cOsdItem(_itemText.c_str(), _itemState)); -} diff --git a/src/systemmenuitem.h b/src/systemmenuitem.h deleted file mode 100644 index 4c7c1f7..0000000 --- a/src/systemmenuitem.h +++ /dev/null @@ -1,41 +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 ___SYSTEMMENUITEM_H -#define ___SYSTEMMENUITEM_H - -#include "menunode.h" -#include -#include - -class SystemMenuItem: public MenuNode -{ - private: - std::string _itemText; - eOSState _itemState; - - public: - SystemMenuItem(std::string itemText, eOSState itemState); - IMenuItemDefinition* CreateMenuItemDefinition(); -}; - -#endif diff --git a/src/systemmenunode.cpp b/src/systemmenunode.cpp new file mode 100644 index 0000000..3edc922 --- /dev/null +++ b/src/systemmenunode.cpp @@ -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$ + * + */ + +#include "systemmenunode.h" +#include +#include "custommainmenuitem.h" + +SystemMenuNode::SystemMenuNode(std::string text, eOSState state) +{ + _text = text; + _state = 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)); +} diff --git a/src/systemmenunode.h b/src/systemmenunode.h new file mode 100644 index 0000000..45a611b --- /dev/null +++ b/src/systemmenunode.h @@ -0,0 +1,41 @@ +/* + * 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 ___SYSTEMMENUNODE_H +#define ___SYSTEMMENUNODE_H + +#include "menunode.h" +#include +#include + +class SystemMenuNode: public MenuNode +{ + private: + std::string _text; + eOSState _state; + + public: + SystemMenuNode(std::string text, eOSState state); + IMenuItemDefinition* CreateMenuItemDefinition(); +}; + +#endif -- cgit v1.2.3