summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-07-27 01:41:30 +0000
committersvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-07-27 01:41:30 +0000
commitca759e5691df7d907fb523f7a5f3b32a51324892 (patch)
treece885e220bdbd31ecfacedd843ddc4b147f85b11
parent98738ae8c7841da4851251684319ad8eab0fcfc7 (diff)
downloadvdr-plugin-menuorg-ca759e5691df7d907fb523f7a5f3b32a51324892.tar.gz
vdr-plugin-menuorg-ca759e5691df7d907fb523f7a5f3b32a51324892.tar.bz2
again fixes (~3 bugs left)
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5649 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
-rw-r--r--src/xmlmenu.cpp18
-rw-r--r--src/xmlmenu.h3
2 files changed, 12 insertions, 9 deletions
diff --git a/src/xmlmenu.cpp b/src/xmlmenu.cpp
index 1a66981..e63b455 100644
--- a/src/xmlmenu.cpp
+++ b/src/xmlmenu.cpp
@@ -41,7 +41,7 @@ void XmlMenu::loadXmlMenu()
}
}
-void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *parentNode)
+void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode* parentNode)
{
const ContentNode* nodeContent = dynamic_cast<const ContentNode*>(a_node);
const TextNode* nodeText = dynamic_cast<const TextNode*>(a_node);
@@ -82,6 +82,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren
{
const Attribute* attribute = *iter;
//cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-SystemItem=" << attribute->get_value() << endl;
+ //TODO: search a valid cast/convert code
if (parentNode == NULL)
newparentNode =_rootMenuNode.AddChild(new VdrMenuItem(tr((const char*) attribute->get_value()), geteOSState(attribute->get_value())));
else
@@ -98,6 +99,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren
{
const Attribute* attribute = *iter;
//cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-MenuItem=" << attribute->get_value() << endl;
+ //TODO: search a valid cast/convert code
if (parentNode == NULL)
newparentNode =_rootMenuNode.AddChild(new SubMenuItem((const char*) attribute->get_value()));
else
@@ -114,16 +116,18 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren
{
const Attribute* attribute = *iter;
//cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-PluginItem=" << attribute->get_value() << endl;
- if (getPluginIndex(attribute->get_value()) != NULL)
+ //TODO: get this running!
+/*
+ PluginItemAndIndex *myPlugin = getPlugin(attribute->get_value());
+ if (myPlugin)
{
- PluginItemAndIndex myPlugin = getPluginIndex(attribute->get_value());
if (parentNode == NULL)
- newparentNode =_rootMenuNode.AddChild(new PluginMenuItem(myPlugin.item, myPlugin.index));
+ newparentNode =_rootMenuNode.AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index));
else
- newparentNode = parentNode->AddChild(new PluginMenuItem(myPlugin.item, myPlugin.index));
+ newparentNode = parentNode->AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index));
}
+*/
}
- //subMenu2->AddChild(new PluginMenuItem(item, i));
}
}
}
@@ -133,7 +137,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren
Node::NodeList list = a_node->get_children();
for(Node::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
{
- parseNode(*iter, Parent+1, newparentNode); //recursive
+ parseNode(*iter, Parent+1, *newparentNode); //recursive
}
}
}
diff --git a/src/xmlmenu.h b/src/xmlmenu.h
index 89db4cd..907a168 100644
--- a/src/xmlmenu.h
+++ b/src/xmlmenu.h
@@ -21,8 +21,7 @@ class XmlMenu
eOSState geteOSState(const Glib::ustring& name); // gets the eOSState for the given string
PluginItemAndIndex getPlugin(const Glib::ustring& name); // gets the plugin for the given string
public:
- MenuNode _rootMenuNode; // hold the Menue Node
- XmlMenu (void);
+ MenuNode _rootMenuNode; // hold the Menue Nodes
void loadXmlMenu(); // load the xmlfile
};