diff options
author | svntobi <svntobi@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f> | 2007-08-20 23:12:14 +0000 |
---|---|---|
committer | svntobi <svntobi@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f> | 2007-08-20 23:12:14 +0000 |
commit | 4d10a530b28dc76f783315f204019fc09a574727 (patch) | |
tree | 914dce06fdb58116ecffc973a9b600a5e067cd9f /src/menuconfiguration.cpp | |
parent | 7ee95418c543dd4f1c53facf937a043eb8dfc5f4 (diff) | |
download | vdr-plugin-menuorg-4d10a530b28dc76f783315f204019fc09a574727.tar.gz vdr-plugin-menuorg-4d10a530b28dc76f783315f204019fc09a574727.tar.bz2 |
added command handling
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5841 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
Diffstat (limited to 'src/menuconfiguration.cpp')
-rw-r--r-- | src/menuconfiguration.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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)); +} |