summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-07-27 12:01:20 +0000
committersvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-07-27 12:01:20 +0000
commit9818cb73b5840463757da8707dda1194aa166ddc (patch)
tree371c62c9d07d71df750317eb80730d3a160729d4
parent075f88c6f79f91f9dc0c77dc028b8e36bfb913a7 (diff)
downloadvdr-plugin-menuorg-9818cb73b5840463757da8707dda1194aa166ddc.tar.gz
vdr-plugin-menuorg-9818cb73b5840463757da8707dda1194aa166ddc.tar.bz2
ok, now it compiles.. but now we have cryptic menus
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5654 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
-rw-r--r--src/xmlmenu.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/xmlmenu.cpp b/src/xmlmenu.cpp
index 145e867..32f6799 100644
--- a/src/xmlmenu.cpp
+++ b/src/xmlmenu.cpp
@@ -81,10 +81,16 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent)
const Attribute* attribute = *iter;
//cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-SystemItem=" << attribute->get_value() << endl;
isyslog("SystemItem=%s",attribute->get_value().data());
- if(_subMenu[Parent-1])
+ if((Parent-1) != 0)
+ {
+ isyslog(" - add to _subMenu[%d]",Parent-1);
_subMenu[Parent-1]->AddChild(new VdrMenuItem(tr(attribute->get_value().data()), geteOSState(attribute->get_value())));
+ }
else
+ {
+ isyslog(" - add to _rootMenuNode");
_rootMenuNode.AddChild(new VdrMenuItem(tr(attribute->get_value().data()), geteOSState(attribute->get_value())));
+ }
}
}
}
@@ -99,10 +105,16 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent)
//cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-MenuItem=" << attribute->get_value() << endl;
isyslog("MenuItem=%s",attribute->get_value().data());
- if(_subMenu[Parent-1])
- _subMenu[Parent-1]->AddChild(new SubMenuItem(attribute->get_value().data()));
+ if((Parent-1) > 1)
+ {
+ isyslog(" - add to _subMenu[%d]",Parent-1);
+ _subMenu[Parent] = _subMenu[Parent-1]->AddChild(new SubMenuItem(attribute->get_value().data()));
+ }
else
- _rootMenuNode.AddChild(new SubMenuItem(attribute->get_value().data()));
+ {
+ isyslog(" - add to _rootMenuNode");
+ _subMenu[Parent] = _rootMenuNode.AddChild(new SubMenuItem(attribute->get_value().data()));
+ }
}
}
}
@@ -119,10 +131,16 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent)
PluginItemAndIndex *myPlugin = getPlugin(attribute->get_value());
if (myPlugin)
{
- if(_subMenu[Parent-1])
+ if((Parent-1) != 0)
+ {
+ isyslog(" - add to _subMenu[%d]",Parent-1);
_subMenu[Parent-1]->AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index));
+ }
else
+ {
+ isyslog(" - add to _rootMenuNode");
_rootMenuNode.AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index));
+ }
}
}
}