diff options
-rw-r--r-- | NAMINGSUGGESTIONS | 7 | ||||
-rw-r--r-- | src/custommainmenuitem.h | 6 | ||||
-rw-r--r-- | src/menunode.cpp | 4 | ||||
-rw-r--r-- | src/menunode.h | 6 | ||||
-rw-r--r-- | src/menuorg.cpp | 74 | ||||
-rw-r--r-- | src/menuorg.h | 13 | ||||
-rw-r--r-- | src/pluginmainmenuitem.h | 6 | ||||
-rw-r--r-- | src/pluginmenuitem.cpp | 6 | ||||
-rw-r--r-- | src/pluginmenuitem.h | 6 | ||||
-rw-r--r-- | src/submenuprovider.cpp | 14 | ||||
-rw-r--r-- | src/submenuprovider.h | 14 | ||||
-rw-r--r-- | src/vdrmenuitem.cpp | 6 | ||||
-rw-r--r-- | src/vdrmenuitem.h | 6 | ||||
-rwxr-xr-x | vdr-patch/menuorg-0.1.diff (renamed from vdr-patch/opt-37_submenu.dpatch) | 61 |
14 files changed, 85 insertions, 144 deletions
diff --git a/NAMINGSUGGESTIONS b/NAMINGSUGGESTIONS deleted file mode 100644 index 64d34fe..0000000 --- a/NAMINGSUGGESTIONS +++ /dev/null @@ -1,7 +0,0 @@ -vdr-plugin-menuorg -vdr-plugin-custommenu -vdr-plugin-alacarte -vdr-plugin-menucustomizer -vdr-plugin-yasm (yet another sub menu) -vdr-plugin-fleximenu - diff --git a/src/custommainmenuitem.h b/src/custommainmenuitem.h index b46be85..11316dd 100644 --- a/src/custommainmenuitem.h +++ b/src/custommainmenuitem.h @@ -16,13 +16,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> -class CustomMainMenuItem: public SubMenuPatch::IMainMenuItem +class CustomMainMenuItem: public MenuOrgPatch::IMainMenuItem { private: cOsdItem* _osdItem; diff --git a/src/menunode.cpp b/src/menunode.cpp index f76f6eb..e813c1c 100644 --- a/src/menunode.cpp +++ b/src/menunode.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -58,7 +58,7 @@ void MenuNode::SetParent(MenuNode* parent) _parent = parent; } -SubMenuPatch::IMainMenuItem* MenuNode::CreateMainMenuItem() +MenuOrgPatch::IMainMenuItem* MenuNode::CreateMainMenuItem() { return NULL; } diff --git a/src/menunode.h b/src/menunode.h index 56c5ecd..160e75c 100644 --- a/src/menunode.h +++ b/src/menunode.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -24,7 +24,7 @@ #define ___MENUNODE_H #include <vector> -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> class MenuNode; @@ -45,7 +45,7 @@ class MenuNode MenuNode* Parent(); MenuNodeList& Childs(); MenuNode* AddChild(MenuNode* child); - virtual SubMenuPatch::IMainMenuItem* CreateMainMenuItem(); + virtual MenuOrgPatch::IMainMenuItem* CreateMainMenuItem(); }; #endif diff --git a/src/menuorg.cpp b/src/menuorg.cpp index 1a25475..47b6476 100644 --- a/src/menuorg.cpp +++ b/src/menuorg.cpp @@ -16,14 +16,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ #include <vdr/plugin.h> #include <vdr/config.h> #include <vdr/tools.h> -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> #include <vector> #include "version.h" #include "menuorg.h" @@ -31,7 +31,7 @@ #include <string> using namespace std; -using namespace SubMenuPatch; +using namespace MenuOrgPatch; MenuOrgPlugin::MenuOrgPlugin(void) { @@ -58,14 +58,7 @@ const char* MenuOrgPlugin::Description(void) const char* MenuOrgPlugin::MainMenuEntry(void) { - if (!_subMenuProvider) - { - return tr("Failed to load config file"); - } - else - { - return NULL; - } + return NULL; } const char *MenuOrgPlugin::CommandLineHelp(void) @@ -89,7 +82,7 @@ bool MenuOrgPlugin::Initialize(void) MenuNode* menu = xmlMenu.LoadXmlMenu(configFile); if (menu) { - _subMenuProvider = new SubMenuProvider(menu); + _subMenuProvider = new MainMenuItemsProvider(menu); } else { @@ -101,34 +94,6 @@ bool MenuOrgPlugin::Initialize(void) return true; } -bool MenuOrgPlugin::Start(void) -{ - // Start any background activities the plugin shall perform. - return true; -} - -void MenuOrgPlugin::Stop(void) -{ - // Stop any background activities the plugin shall perform. -} - -void MenuOrgPlugin::Housekeeping(void) -{ - // Perform any cleanup or other regular tasks. -} - -void MenuOrgPlugin::MainThreadHook(void) -{ - // Perform actions in the context of the main program thread. - // WARNING: Use with great care - see PLUGINS.html! -} - -cString MenuOrgPlugin::Active(void) -{ - // Return a message string if shutdown should be postponed - return NULL; -} - cOsdObject *MenuOrgPlugin::MainMenuAction(void) { // Perform the action when selected from the main VDR menu. @@ -151,25 +116,20 @@ bool MenuOrgPlugin::SetupParse(const char *Name, const char *Value) bool MenuOrgPlugin::Service(const char *Id, void *Data) { - if (strcmp(Id, "SubMenuPatch-v0.1::SubMenuProvider") == 0 && _subMenuProvider) + if (strcmp(Id, "MenuOrgPatch-v0.1::MainMenuItemsProvider") == 0) { - ISubMenuProvider** ptr = (ISubMenuProvider**)Data; - *ptr = _subMenuProvider; - - return true; + if (_subMenuProvider) + { + IMainMenuItemsProvider** ptr = (IMainMenuItemsProvider**)Data; + *ptr = _subMenuProvider; + + return true; + } + else + { + Skins.Message(mtError, tr("Failed to load MenuOrg's config file!")); + } } return false; } - -const char **MenuOrgPlugin::SVDRPHelpPages(void) -{ - // Return help text for SVDRP commands this plugin implements - return NULL; -} - -cString MenuOrgPlugin::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) -{ - // Process SVDRP commands this plugin implements - return NULL; -} diff --git a/src/menuorg.h b/src/menuorg.h index 821ed5b..12ae279 100644 --- a/src/menuorg.h +++ b/src/menuorg.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -26,12 +26,12 @@ #include <vdr/plugin.h> #include "submenuprovider.h" -using namespace SubMenuPatch; +using namespace MenuOrgPatch; class MenuOrgPlugin : public cPlugin { private: - SubMenuProvider* _subMenuProvider; + MainMenuItemsProvider* _subMenuProvider; public: MenuOrgPlugin(void); @@ -41,18 +41,11 @@ class MenuOrgPlugin : public cPlugin virtual const char *CommandLineHelp(void); virtual bool ProcessArgs(int argc, char *argv[]); virtual bool Initialize(void); - virtual bool Start(void); - virtual void Stop(void); - virtual void Housekeeping(void); - virtual void MainThreadHook(void); - virtual cString Active(void); virtual const char *MainMenuEntry(void); virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); virtual bool Service(const char *Id, void *Data = NULL); - virtual const char **SVDRPHelpPages(void); - virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); }; extern "C" void* VDRPluginCreator(); diff --git a/src/pluginmainmenuitem.h b/src/pluginmainmenuitem.h index e51633b..ce54e3b 100644 --- a/src/pluginmainmenuitem.h +++ b/src/pluginmainmenuitem.h @@ -16,13 +16,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> -class PluginMainMenuItem: public SubMenuPatch::IMainMenuItem +class PluginMainMenuItem: public MenuOrgPatch::IMainMenuItem { private: const char* _mainMenuEntry; diff --git a/src/pluginmenuitem.cpp b/src/pluginmenuitem.cpp index 7589ee7..36bbfa6 100644 --- a/src/pluginmenuitem.cpp +++ b/src/pluginmenuitem.cpp @@ -16,12 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ #include "pluginmenuitem.h" -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> #include "pluginmainmenuitem.h" PluginMenuItem::PluginMenuItem(const char* pluginMainMenuEntry, int pluginIndex) @@ -30,7 +30,7 @@ PluginMenuItem::PluginMenuItem(const char* pluginMainMenuEntry, int pluginIndex) _pluginIndex = pluginIndex; } -SubMenuPatch::IMainMenuItem* PluginMenuItem::CreateMainMenuItem() +MenuOrgPatch::IMainMenuItem* PluginMenuItem::CreateMainMenuItem() { return new PluginMainMenuItem(_pluginMainMenuEntry, _pluginIndex); } diff --git a/src/pluginmenuitem.h b/src/pluginmenuitem.h index ef8bdf3..11085b7 100644 --- a/src/pluginmenuitem.h +++ b/src/pluginmenuitem.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -25,7 +25,7 @@ #include "menunode.h" #include <vdr/osdbase.h> -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> class PluginMenuItem: public MenuNode { @@ -35,7 +35,7 @@ class PluginMenuItem: public MenuNode public: PluginMenuItem(const char* pluginMainMenuEntry, int pluginIndex); - SubMenuPatch::IMainMenuItem* CreateMainMenuItem(); + MenuOrgPatch::IMainMenuItem* CreateMainMenuItem(); }; #endif diff --git a/src/submenuprovider.cpp b/src/submenuprovider.cpp index 56ab329..36cdc43 100644 --- a/src/submenuprovider.cpp +++ b/src/submenuprovider.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -26,12 +26,12 @@ #include "pluginmenuitem.h" #include <vdr/plugin.h> -SubMenuProvider::SubMenuProvider(MenuNode* rootMenu) +MainMenuItemsProvider::MainMenuItemsProvider(MenuNode* rootMenu) { _currentMenu = _rootMenu = rootMenu; } -MainMenuItemsList* SubMenuProvider::MainMenuItems() +MainMenuItemsList* MainMenuItemsProvider::MainMenuItems() { ResetMainMenuItemsList(); @@ -44,7 +44,7 @@ MainMenuItemsList* SubMenuProvider::MainMenuItems() return &_currentMainMenuItems; } -void SubMenuProvider::ResetMainMenuItemsList() +void MainMenuItemsProvider::ResetMainMenuItemsList() { for( MainMenuItemsList::iterator i = _currentMainMenuItems.begin(); @@ -55,12 +55,12 @@ void SubMenuProvider::ResetMainMenuItemsList() _currentMainMenuItems.clear(); } -void SubMenuProvider::EnterRootMenu() +void MainMenuItemsProvider::EnterRootMenu() { _currentMenu = _rootMenu; } -void SubMenuProvider::EnterSubMenu(cOsdItem* item) +void MainMenuItemsProvider::EnterSubMenu(cOsdItem* item) { for(unsigned int itemIndex=0; itemIndex < _currentMainMenuItems.size(); itemIndex++) { @@ -73,7 +73,7 @@ void SubMenuProvider::EnterSubMenu(cOsdItem* item) } } -bool SubMenuProvider::LeaveSubMenu() +bool MainMenuItemsProvider::LeaveSubMenu() { if (_currentMenu->Parent()) { diff --git a/src/submenuprovider.h b/src/submenuprovider.h index ff2e8dc..4a9e50e 100644 --- a/src/submenuprovider.h +++ b/src/submenuprovider.h @@ -16,20 +16,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ -#ifndef ___SUBMENUPROVIDER_H -#define ___SUBMENUPROVIDER_H +#ifndef ___MAINMENUITEMSPROVIDER_H +#define ___MAINMENUITEMSPROVIDER_H -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> #include "menunode.h" #include "xmlmenu.h" -using namespace SubMenuPatch; +using namespace MenuOrgPatch; -class SubMenuProvider: public ISubMenuProvider +class MainMenuItemsProvider: public IMainMenuItemsProvider { private: MenuNode* _rootMenu; @@ -37,7 +37,7 @@ class SubMenuProvider: public ISubMenuProvider MainMenuItemsList _currentMainMenuItems; public: - SubMenuProvider(MenuNode* rootMenu); + MainMenuItemsProvider(MenuNode* rootMenu); virtual MainMenuItemsList* MainMenuItems(); virtual void EnterRootMenu(); virtual void EnterSubMenu(cOsdItem* item); diff --git a/src/vdrmenuitem.cpp b/src/vdrmenuitem.cpp index f8af0ad..36dfe0d 100644 --- a/src/vdrmenuitem.cpp +++ b/src/vdrmenuitem.cpp @@ -16,12 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ #include "vdrmenuitem.h" -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> #include "custommainmenuitem.h" VdrMenuItem::VdrMenuItem(std::string itemText, eOSState itemState) @@ -30,7 +30,7 @@ VdrMenuItem::VdrMenuItem(std::string itemText, eOSState itemState) _itemState = itemState; } -SubMenuPatch::IMainMenuItem* VdrMenuItem::CreateMainMenuItem() +MenuOrgPatch::IMainMenuItem* VdrMenuItem::CreateMainMenuItem() { return new CustomMainMenuItem(new cOsdItem(tr(_itemText.c_str()), _itemState)); } diff --git a/src/vdrmenuitem.h b/src/vdrmenuitem.h index d0f069e..8582e7c 100644 --- a/src/vdrmenuitem.h +++ b/src/vdrmenuitem.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id:$ + * $Id$ * */ @@ -25,7 +25,7 @@ #include "menunode.h" #include <vdr/osdbase.h> -#include <vdr/submenupatch.h> +#include <vdr/menuorgpatch.h> #include <string> class VdrMenuItem: public MenuNode @@ -36,7 +36,7 @@ class VdrMenuItem: public MenuNode public: VdrMenuItem(std::string itemText, eOSState itemState); - SubMenuPatch::IMainMenuItem* CreateMainMenuItem(); + MenuOrgPatch::IMainMenuItem* CreateMainMenuItem(); }; #endif diff --git a/vdr-patch/opt-37_submenu.dpatch b/vdr-patch/menuorg-0.1.diff index 826dc8b..3c1fcb1 100755 --- a/vdr-patch/opt-37_submenu.dpatch +++ b/vdr-patch/menuorg-0.1.diff @@ -1,16 +1,11 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## opt-37_submenu.dpatch by Tobias Grimm <tg@e-tobi.net> -## DP: This patch is needed for the submenu plugin. - -@DPATCH@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c ---- vdr-1.4.7~/menu.c 2007-07-28 15:20:41.000000000 +0200 -+++ vdr-1.4.7/menu.c 2007-07-28 15:20:41.000000000 +0200 +--- vdr-1.4.7~/menu.c 2007-08-11 20:48:29.000000000 +0200 ++++ vdr-1.4.7/menu.c 2007-08-11 20:48:29.000000000 +0200 @@ -31,6 +31,7 @@ #include "vdrttxtsubshooks.h" #include "dvbsub.h" #include "videodir.h" -+#include "submenupatch.h" ++#include "menuorgpatch.h" #define MAXWAIT4EPGINFO 3 // seconds #define MODETIMEOUT 3 // seconds @@ -19,10 +14,10 @@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c stopRecordingItem = NULL; recordControlsState = 0; + -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; + -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ subMenuProvider->EnterRootMenu(); ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuitemsProvider", &mainMenuItemsProvider)) { ++ mainMenuItemsProvider->EnterRootMenu(); + } + Set(); @@ -33,11 +28,11 @@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c SetTitle("VDR"); SetHasHotkeys(); + -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; + -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ SubMenuPatch::MainMenuItemsList* menuItems = subMenuProvider->MainMenuItems(); -+ SubMenuPatch::MainMenuItemsList::iterator i; ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ MenuOrgPatch::MainMenuItemsList* menuItems = mainMenuItemsProvider->MainMenuItems(); ++ MenuOrgPatch::MainMenuItemsList::iterator i; + + for (i = menuItems->begin(); i != menuItems->end(); i++) { + if ((*i)->IsCustomMenuItem()) { @@ -72,10 +67,10 @@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c } break; + case osBack: { -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; + -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ bool leavingMenuSucceeded = subMenuProvider->LeaveSubMenu(); ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ bool leavingMenuSucceeded = mainMenuItemsProvider->LeaveSubMenu(); + Set(); + stopReplayItem = NULL; + cancelEditingItem = NULL; @@ -91,10 +86,10 @@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c + } + break; + case osUser1: { -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; + -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ subMenuProvider->EnterSubMenu(Get(Current())); ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ mainMenuItemsProvider->EnterSubMenu(Get(Current())); + Set(); + return osContinue; + } @@ -103,13 +98,13 @@ diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c default: switch (Key) { case kRecord: case kRed: if (!HadSubMenu) -diff -urNad vdr-1.4.7~/submenupatch.h vdr-1.4.7/submenupatch.h ---- vdr-1.4.7~/submenupatch.h 1970-01-01 01:00:00.000000000 +0100 -+++ vdr-1.4.7/submenupatch.h 2007-07-28 15:23:23.000000000 +0200 +diff -urNad vdr-1.4.7~/menuorgpatch.h vdr-1.4.7/menuorgpatch.h +--- vdr-1.4.7~/menuorgpatch.h 1970-01-01 01:00:00.000000000 +0100 ++++ vdr-1.4.7/menuorgpatch.h 2007-08-11 20:48:58.000000000 +0200 @@ -0,0 +1,58 @@ +/* -+ * vdr-submenu - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2007 Tobias Grimm <vdr@e-tobi.net> ++ * 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 @@ -125,18 +120,18 @@ diff -urNad vdr-1.4.7~/submenupatch.h vdr-1.4.7/submenupatch.h + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * -+ * $Id$ ++ * $Id:$ + * + */ + -+#ifndef __SUBMENUPATCH_H -+#define __SUBMENUPATCH_H ++#ifndef __MENUORGPATCH_H ++#define __MENUORGPATCH_H + +#include <vector> + +class cOsdItem; + -+namespace SubMenuPatch ++namespace MenuOrgPatch +{ + +class IMainMenuItem @@ -152,10 +147,10 @@ diff -urNad vdr-1.4.7~/submenupatch.h vdr-1.4.7/submenupatch.h + +typedef std::vector<IMainMenuItem*> MainMenuItemsList; + -+class ISubMenuProvider ++class IMainMenuItemsProvider +{ + public: -+ virtual ~ISubMenuProvider() {}; ++ virtual ~IMainMenuItemsProvider() {}; + virtual MainMenuItemsList* MainMenuItems() = 0; + virtual void EnterRootMenu() = 0; + virtual void EnterSubMenu(cOsdItem* item) = 0; @@ -164,4 +159,4 @@ diff -urNad vdr-1.4.7~/submenupatch.h vdr-1.4.7/submenupatch.h + +}; + -+#endif //__SUBMENUPATCH_H ++#endif //__MENUORGPATCH_H |