diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CommandItemSetup.cpp | 58 | ||||
-rw-r--r-- | src/CommandItemSetup.h | 45 | ||||
-rw-r--r-- | src/MenuEditMenusFactory.cpp | 27 | ||||
-rw-r--r-- | src/PluginItemSetup.cpp | 52 | ||||
-rw-r--r-- | src/PluginItemSetup.h | 44 | ||||
-rw-r--r-- | src/RecursiveMenuSetup.cpp | 1 | ||||
-rw-r--r-- | src/SeparatorItemSetup.cpp | 48 | ||||
-rw-r--r-- | src/SeparatorItemSetup.h | 43 | ||||
-rw-r--r-- | src/SubMenuItemSetup.cpp | 48 | ||||
-rw-r--r-- | src/SubMenuItemSetup.h | 43 | ||||
-rw-r--r-- | src/SystemItemSetup.cpp | 53 | ||||
-rw-r--r-- | src/SystemItemSetup.h | 44 |
12 files changed, 495 insertions, 11 deletions
diff --git a/src/CommandItemSetup.cpp b/src/CommandItemSetup.cpp new file mode 100644 index 0000000..ed35660 --- /dev/null +++ b/src/CommandItemSetup.cpp @@ -0,0 +1,58 @@ +/* + * 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 "CommandItemSetup.h" + +cCommandItemSetup::cCommandItemSetup(CommandMenuNode* node) +:cOsdMenu(tr("Edit Command Menu Item")) +{ + _newName = node->Text(); + _newCommand = node->Command(); + _newConfirm = node->ShouldConfirm(); + CreateMenuItems(); +} + +cCommandItemSetup::~cCommandItemSetup() +{ + // TODO: write back the changes + free(_newName); + free(_newCommand); + free(_newConfirm); +} + +void cCommandItemSetup::CreateMenuItems() +{ + // Add textItem for name attribute + Add(new cMenuEditStrItem(tr("name"), _newName, 64, NULL)); + + // Add textItem for command attribute + Add(new cMenuEditStrItem(tr("command"), _newCommand, 200, NULL)); + + // Add boolItem for confirm attribute + Add(new cMenuEditBoolItem(tr("confirm"), _newConfirm)); +} + +eOSState cCommandItemSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/CommandItemSetup.h b/src/CommandItemSetup.h new file mode 100644 index 0000000..e821349 --- /dev/null +++ b/src/CommandItemSetup.h @@ -0,0 +1,45 @@ +/* + * 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 ___COMMANDITEMSETUP_H +#define ___COMMANDITEMSETUP_H + +#include <vdr/menu.h> +#include "CommandMenuNode.h" + +class cCommandItemSetup : public cOsdMenu +{ + private: + char* _newName; + char* _newCommand; + int* _newConfirm; + + public: + cCommandItemSetup(CommandMenuNode* node); + ~cCommandItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); +}; + +#endif diff --git a/src/MenuEditMenusFactory.cpp b/src/MenuEditMenusFactory.cpp index 4a16285..b402c69 100644 --- a/src/MenuEditMenusFactory.cpp +++ b/src/MenuEditMenusFactory.cpp @@ -20,14 +20,21 @@ * */ +#include <vdr/osdbase.h> #include "MenuEditMenusFactory.h" +#include "RecursiveMenuSetup.h" + #include "CommandMenuNode.h" #include "PluginMenuNode.h" -#include "SystemMenuNode.h" -#include "SubMenuNode.h" #include "SeparatorMenuNode.h" -#include <vdr/osdbase.h> -#include "RecursiveMenuSetup.h" +#include "SubMenuNode.h" +#include "SystemMenuNode.h" + +#include "CommandItemSetup.h" +#include "PluginItemSetup.h" +#include "SeparatorItemSetup.h" +#include "SubMenuItemSetup.h" +#include "SystemItemSetup.h" cOsdMenu* MenuEditMenusFactory::Create(MenuNode& menuNode, bool openSubmenuInsteadOfEditing) { @@ -39,12 +46,12 @@ cOsdMenu* MenuEditMenusFactory::Create(MenuNode& menuNode, bool openSubmenuInste void MenuEditMenusFactory::ProcessSystemMenuNode(SystemMenuNode* node) { - _menu = new cOsdMenu("Edit System Menu Node"); + _menu = new cSystemItemSetup(node); } void MenuEditMenusFactory::ProcessPluginMenuNode(PluginMenuNode* node) { - _menu = new cOsdMenu("Edit Plugin Menu Node"); + _menu = new cPluginItemSetup(node); } void MenuEditMenusFactory::ProcessSubMenuNode(SubMenuNode* node) @@ -55,18 +62,18 @@ void MenuEditMenusFactory::ProcessSubMenuNode(SubMenuNode* node) } else { - _menu = new cOsdMenu("Edit Sub Menu Node"); + _menu = new cSubMenuItemSetup(node); } } void MenuEditMenusFactory::ProcessCommandMenuNode(CommandMenuNode* node) { - _menu = new cOsdMenu("Edit Command Menu Node"); + _menu = new cCommandItemSetup(node); } -void MenuEditMenusFactory::ProcessSeparatorMenuNode(SeparatorMenuNode* nod) +void MenuEditMenusFactory::ProcessSeparatorMenuNode(SeparatorMenuNode* node) { - _menu = new cOsdMenu("Edit Separator Menu Node"); + _menu = new cSeparatorItemSetup(node); } MenuEditMenusFactory::MenuEditMenusFactory(cOsdMenu*& menu, bool openSubmenuInsteadOfEditing) diff --git a/src/PluginItemSetup.cpp b/src/PluginItemSetup.cpp new file mode 100644 index 0000000..ce91791 --- /dev/null +++ b/src/PluginItemSetup.cpp @@ -0,0 +1,52 @@ +/* + * 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 "PluginItemSetup.h" + +cPluginItemSetup::cPluginItemSetup(PluginMenuNode* node) +:cOsdMenu(tr("Edit Plugin Menu Item")) +{ + _newName = node->PluginName(); + _newTitle = node->CustomTitle(); + CreateMenuItems(); +} + +cPluginItemSetup::~cPluginItemSetup() +{ + // TODO: write back the changes + free(_newName); + free(_newTitle); +} + +void cPluginItemSetup::CreateMenuItems() +{ + // Add listItem of unused plugins or a submenu with the items + //Add(new cMenuEditStraItem(tr("available Plugins Items"),)) + // Add textItem for title attribute + Add(new cMenuEditStrItem(tr("title"), _newTitle, 64, NULL)); +} + +eOSState cPluginItemSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/PluginItemSetup.h b/src/PluginItemSetup.h new file mode 100644 index 0000000..d89cf6b --- /dev/null +++ b/src/PluginItemSetup.h @@ -0,0 +1,44 @@ +/* + * 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 ___PLUGINITEMSETUP_H +#define ___PLUGINITEMSETUP_H + +#include <vdr/menu.h> +#include "PluginMenuNode.h" + +class cPluginItemSetup : public cOsdMenu +{ + private: + char* _newName; + char* _newTitle; + + public: + cPluginItemSetup(PluginMenuNode* node); + ~cPluginItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); +}; + +#endif diff --git a/src/RecursiveMenuSetup.cpp b/src/RecursiveMenuSetup.cpp index ec54eec..2afd2a7 100644 --- a/src/RecursiveMenuSetup.cpp +++ b/src/RecursiveMenuSetup.cpp @@ -73,7 +73,6 @@ eOSState RecursiveMenuSetup::ProcessKey(eKeys Key) eOSState state = cOsdMenu::ProcessKey(Key); if(HasSubMenu()) { - return state; } diff --git a/src/SeparatorItemSetup.cpp b/src/SeparatorItemSetup.cpp new file mode 100644 index 0000000..ff0d0ec --- /dev/null +++ b/src/SeparatorItemSetup.cpp @@ -0,0 +1,48 @@ +/* + * 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 "SeparatorItemSetup.h" + +cSeparatorItemSetup::cSeparatorItemSetup(SeparatorMenuNode* node) +:cOsdMenu(tr("Edit Separator Menu Item")) +{ + _newTitle = node->CustomTitle(); + CreateMenuItems(); +} + +cSeparatorItemSetup::~cSeparatorItemSetup() +{ + // TODO: write back the changes + free(_newTitle); +} + +void cSeparatorItemSetup::CreateMenuItems() +{ + // Add textItem for title attribute + Add(new cMenuEditStrItem(tr("title"), _newTitle, 64, NULL)); +} + +eOSState cSeparatorItemSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/SeparatorItemSetup.h b/src/SeparatorItemSetup.h new file mode 100644 index 0000000..d3f615c --- /dev/null +++ b/src/SeparatorItemSetup.h @@ -0,0 +1,43 @@ +/* + * 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 ___SEPARATORITEMSETUP_H +#define ___SEPARATORITEMSETUP_H + +#include <vdr/menu.h> +#include "SeparatorMenuNode.h" + +class cSeparatorItemSetup : public cOsdMenu +{ + private: + char* _newTitle; + + public: + cSeparatorItemSetup(SeparatorMenuNode* node); + ~cSeparatorItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); +}; + +#endif diff --git a/src/SubMenuItemSetup.cpp b/src/SubMenuItemSetup.cpp new file mode 100644 index 0000000..afd7c91 --- /dev/null +++ b/src/SubMenuItemSetup.cpp @@ -0,0 +1,48 @@ +/* + * 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 "SubMenuItemSetup.h" + +cSubMenuItemSetup::cSubMenuItemSetup(SubMenuNode* node) +:cOsdMenu(tr("Edit Sub Menu Item")) +{ + _newName=node->Text(); + CreateMenuItems(); +} + +cSubMenuItemSetup::~cSubMenuItemSetup() +{ + // TODO: write back the changes + free(_newName); +} + +void cSubMenuItemSetup::CreateMenuItems() +{ + // Add textItem for name attribute + Add(new cMenuEditStrItem(tr("name"), _newName, 64, NULL)); +} + +eOSState cSubMenuItemSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/SubMenuItemSetup.h b/src/SubMenuItemSetup.h new file mode 100644 index 0000000..92962b5 --- /dev/null +++ b/src/SubMenuItemSetup.h @@ -0,0 +1,43 @@ +/* + * 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 ___SUBMENUTEMSETUP_H +#define ___SUBMENUTEMSETUP_H + +#include <vdr/menu.h> +#include "SubMenuNode.h" + +class cSubMenuItemSetup : public cOsdMenu +{ + private: + char* _newName; + + public: + cSubMenuItemSetup(SubMenuNode* node); + ~cSubMenuItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); +}; + +#endif diff --git a/src/SystemItemSetup.cpp b/src/SystemItemSetup.cpp new file mode 100644 index 0000000..d6f8ba4 --- /dev/null +++ b/src/SystemItemSetup.cpp @@ -0,0 +1,53 @@ +/* + * 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 "SystemItemSetup.h" + +cSystemItemSetup::cSystemItemSetup(SystemMenuNode* node) +:cOsdMenu(tr("Edit System Menu Item")) +{ + _newName = node->Text(); + _newTitle = node->CustomTitle(); + CreateMenuItems(); +} + +cSystemItemSetup::~cSystemItemSetup() +{ + // TODO: write back the changes + free(_newName); + free(_newTitle); +} + +void cSystemItemSetup::CreateMenuItems() +{ + // Add listItem of valid System Items + //Add(new cMenuEditStraItem(tr("available System Items"),)) + + // Add textItem for title attribute + Add(new cMenuEditStrItem(tr("title"), _newTitle, 64, NULL)); +} + +eOSState cSystemItemSetup::ProcessKey(eKeys Key) +{ + eOSState state = cOsdMenu::ProcessKey(Key); + return state; +} diff --git a/src/SystemItemSetup.h b/src/SystemItemSetup.h new file mode 100644 index 0000000..4f30a63 --- /dev/null +++ b/src/SystemItemSetup.h @@ -0,0 +1,44 @@ +/* + * 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 ___SYSTEMITEMSETUP_H +#define ___SYSTEMITEMSETUP_H + +#include <vdr/menu.h> +#include "SystemMenuNode.h" + +class cSystemItemSetup : public cOsdMenu +{ + private: + char* _newName; + char* _newTitle; + + public: + cSystemItemSetup(SystemMenuNode* node); + ~cSystemItemSetup(void); + virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); +}; + +#endif |