From 35bf4d7b737302d1c8b927c978cb63fc67bf23ab Mon Sep 17 00:00:00 2001 From: svntobi Date: Sat, 11 Aug 2007 19:05:39 +0000 Subject: more renamings git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5682 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- src/mainmenuitemsprovider.cpp | 87 +++++++++++++++++++++++++++++++++++++++++++ src/mainmenuitemsprovider.h | 50 +++++++++++++++++++++++++ src/menuorg.h | 2 +- src/submenuprovider.cpp | 87 ------------------------------------------- src/submenuprovider.h | 50 ------------------------- 5 files changed, 138 insertions(+), 138 deletions(-) create mode 100644 src/mainmenuitemsprovider.cpp create mode 100644 src/mainmenuitemsprovider.h delete mode 100644 src/submenuprovider.cpp delete mode 100644 src/submenuprovider.h (limited to 'src') diff --git a/src/mainmenuitemsprovider.cpp b/src/mainmenuitemsprovider.cpp new file mode 100644 index 0000000..c95e9fb --- /dev/null +++ b/src/mainmenuitemsprovider.cpp @@ -0,0 +1,87 @@ +/* + * 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 "mainmenuitemsprovider.h" +#include "submenuitem.h" +#include "vdrmenuitem.h" +#include "pluginmenuitem.h" +#include + +MainMenuItemsProvider::MainMenuItemsProvider(MenuNode* rootMenu) +{ + _currentMenu = _rootMenu = rootMenu; +} + +MainMenuItemsList* MainMenuItemsProvider::MainMenuItems() +{ + ResetMainMenuItemsList(); + + for (MenuNodeList::iterator i = _currentMenu->Childs().begin(); + i != _currentMenu->Childs().end(); i++) + { + _currentMainMenuItems.push_back((*i)->CreateMainMenuItem()); + } + + return &_currentMainMenuItems; +} + +void MainMenuItemsProvider::ResetMainMenuItemsList() +{ + + for( MainMenuItemsList::iterator i = _currentMainMenuItems.begin(); + i != _currentMainMenuItems.end(); i++) + { + delete *i; + } + _currentMainMenuItems.clear(); +} + +void MainMenuItemsProvider::EnterRootMenu() +{ + _currentMenu = _rootMenu; +} + +void MainMenuItemsProvider::EnterSubMenu(cOsdItem* item) +{ + for(unsigned int itemIndex=0; itemIndex < _currentMainMenuItems.size(); itemIndex++) + { + IMainMenuItem* menuItem = _currentMainMenuItems.at(itemIndex); + if (menuItem->IsCustomMenuItem() && (menuItem->CustomMenuItem() == item)) + { + _currentMenu = _currentMenu->Childs().at(itemIndex); + break; + } + } +} + +bool MainMenuItemsProvider::LeaveSubMenu() +{ + if (_currentMenu->Parent()) + { + _currentMenu = _currentMenu->Parent(); + return true; + } + else + { + return false; + } +} diff --git a/src/mainmenuitemsprovider.h b/src/mainmenuitemsprovider.h new file mode 100644 index 0000000..4a9e50e --- /dev/null +++ b/src/mainmenuitemsprovider.h @@ -0,0 +1,50 @@ +/* + * 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 ___MAINMENUITEMSPROVIDER_H +#define ___MAINMENUITEMSPROVIDER_H + +#include +#include "menunode.h" +#include "xmlmenu.h" + +using namespace MenuOrgPatch; + +class MainMenuItemsProvider: public IMainMenuItemsProvider +{ + private: + MenuNode* _rootMenu; + MenuNode* _currentMenu; + MainMenuItemsList _currentMainMenuItems; + + public: + MainMenuItemsProvider(MenuNode* rootMenu); + virtual MainMenuItemsList* MainMenuItems(); + virtual void EnterRootMenu(); + virtual void EnterSubMenu(cOsdItem* item); + virtual bool LeaveSubMenu(); + + private: + void ResetMainMenuItemsList(); +}; + +#endif diff --git a/src/menuorg.h b/src/menuorg.h index 12ae279..fb71ba5 100644 --- a/src/menuorg.h +++ b/src/menuorg.h @@ -24,7 +24,7 @@ #define ___MENUORGPLUGIN_H #include -#include "submenuprovider.h" +#include "mainmenuitemsprovider.h" using namespace MenuOrgPatch; diff --git a/src/submenuprovider.cpp b/src/submenuprovider.cpp deleted file mode 100644 index 36cdc43..0000000 --- a/src/submenuprovider.cpp +++ /dev/null @@ -1,87 +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 "submenuprovider.h" -#include "submenuitem.h" -#include "vdrmenuitem.h" -#include "pluginmenuitem.h" -#include - -MainMenuItemsProvider::MainMenuItemsProvider(MenuNode* rootMenu) -{ - _currentMenu = _rootMenu = rootMenu; -} - -MainMenuItemsList* MainMenuItemsProvider::MainMenuItems() -{ - ResetMainMenuItemsList(); - - for (MenuNodeList::iterator i = _currentMenu->Childs().begin(); - i != _currentMenu->Childs().end(); i++) - { - _currentMainMenuItems.push_back((*i)->CreateMainMenuItem()); - } - - return &_currentMainMenuItems; -} - -void MainMenuItemsProvider::ResetMainMenuItemsList() -{ - - for( MainMenuItemsList::iterator i = _currentMainMenuItems.begin(); - i != _currentMainMenuItems.end(); i++) - { - delete *i; - } - _currentMainMenuItems.clear(); -} - -void MainMenuItemsProvider::EnterRootMenu() -{ - _currentMenu = _rootMenu; -} - -void MainMenuItemsProvider::EnterSubMenu(cOsdItem* item) -{ - for(unsigned int itemIndex=0; itemIndex < _currentMainMenuItems.size(); itemIndex++) - { - IMainMenuItem* menuItem = _currentMainMenuItems.at(itemIndex); - if (menuItem->IsCustomMenuItem() && (menuItem->CustomMenuItem() == item)) - { - _currentMenu = _currentMenu->Childs().at(itemIndex); - break; - } - } -} - -bool MainMenuItemsProvider::LeaveSubMenu() -{ - if (_currentMenu->Parent()) - { - _currentMenu = _currentMenu->Parent(); - return true; - } - else - { - return false; - } -} diff --git a/src/submenuprovider.h b/src/submenuprovider.h deleted file mode 100644 index 4a9e50e..0000000 --- a/src/submenuprovider.h +++ /dev/null @@ -1,50 +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 ___MAINMENUITEMSPROVIDER_H -#define ___MAINMENUITEMSPROVIDER_H - -#include -#include "menunode.h" -#include "xmlmenu.h" - -using namespace MenuOrgPatch; - -class MainMenuItemsProvider: public IMainMenuItemsProvider -{ - private: - MenuNode* _rootMenu; - MenuNode* _currentMenu; - MainMenuItemsList _currentMainMenuItems; - - public: - MainMenuItemsProvider(MenuNode* rootMenu); - virtual MainMenuItemsList* MainMenuItems(); - virtual void EnterRootMenu(); - virtual void EnterSubMenu(cOsdItem* item); - virtual bool LeaveSubMenu(); - - private: - void ResetMainMenuItemsList(); -}; - -#endif -- cgit v1.2.3