summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources.mk2
-rw-r--r--src/mainmenuitemsprovider.cpp2
-rw-r--r--src/menuconfiguration.cpp8
-rw-r--r--src/menuconfiguration.h2
-rw-r--r--src/submenunode.cpp (renamed from src/submenuitem.cpp)13
-rw-r--r--src/submenunode.h (renamed from src/submenuitem.h)14
-rw-r--r--src/systemmenunode.cpp5
-rw-r--r--src/systemmenunode.h2
8 files changed, 28 insertions, 20 deletions
diff --git a/sources.mk b/sources.mk
index 6071b4e..cdbcdd1 100644
--- a/sources.mk
+++ b/sources.mk
@@ -7,6 +7,6 @@ SRCS = \
src/plugincreator.cpp \
src/pluginmainmenuitem.cpp \
src/pluginmenunode.cpp \
- src/submenuitem.cpp \
+ src/submenunode.cpp \
src/systemmenunode.cpp \
src/i18n.cpp
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 <vdr/plugin.h>
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 <exception>
#include <vdr/plugin.h>
#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/submenunode.cpp
index 86b84da..18f493a 100644
--- a/src/submenuitem.cpp
+++ b/src/submenunode.cpp
@@ -20,9 +20,16 @@
*
*/
-#include "submenuitem.h"
+#include "submenunode.h"
+#include <vdr/osdbase.h>
+#include "custommainmenuitem.h"
-SubMenuItem::SubMenuItem(std::string itemText)
- :SystemMenuNode(itemText, osUser1)
+SubMenuNode::SubMenuNode(std::string text)
{
+ _text = text;
+}
+
+IMenuItemDefinition* SubMenuNode::CreateMenuItemDefinition()
+{
+ return new CustomMainMenuItem(new cOsdItem(tr(_text.c_str()), osUser1));
}
diff --git a/src/submenuitem.h b/src/submenunode.h
index 1c056d5..8cd1e93 100644
--- a/src/submenuitem.h
+++ b/src/submenunode.h
@@ -20,16 +20,20 @@
*
*/
-#ifndef ___SUBMENUITEM_H
-#define ___SUBMENUITEM_H
+#ifndef ___SUBMENUNODE_H
+#define ___SUBMENUNODE_H
-#include "systemmenunode.h"
+#include "menunode.h"
#include <string>
-class SubMenuItem: public SystemMenuNode
+class SubMenuNode: public MenuNode
{
+ private:
+ std::string _text;
+
public:
- SubMenuItem(std::string itemText);
+ 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 <vdr/osdbase.h>
#include <string>
+#include <vdr/osdbase.h>
class SystemMenuNode: public MenuNode
{