From 4d10a530b28dc76f783315f204019fc09a574727 Mon Sep 17 00:00:00 2001 From: svntobi Date: Mon, 20 Aug 2007 23:12:14 +0000 Subject: added command handling git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5841 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- src/menuconfiguration.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/menuconfiguration.cpp') diff --git a/src/menuconfiguration.cpp b/src/menuconfiguration.cpp index b95c330..8143c00 100644 --- a/src/menuconfiguration.cpp +++ b/src/menuconfiguration.cpp @@ -28,6 +28,7 @@ #include "systemmenunode.h" #include "submenunode.h" #include "pluginmenunode.h" +#include "commandmenunode.h" using namespace xmlpp; using namespace std; @@ -110,6 +111,14 @@ void MenuConfiguration::ParseElement(const Element* element, MenuNode* menuNode) { AddPluginMenuNode(name, menuNode); } + else if (type == "command") + { + string execute = childElement->get_attribute("execute")->get_value(); + const xmlpp::Attribute* confirmAttribute = childElement->get_attribute("confirm"); + bool confirm = confirmAttribute ? (confirmAttribute->get_value() == "yes") : false; + + AddPluginMenuNode(name, execute, confirm, menuNode); + } } } } @@ -204,3 +213,8 @@ void MenuConfiguration::AddUnconfiguredPlugins(MenuNode* menu) i++; } } + +void MenuConfiguration::AddPluginMenuNode(string name, string command, bool confirm, MenuNode* menu) +{ + menu->AddChild(new CommandMenuNode(name, command, confirm)); +} -- cgit v1.2.3