summaryrefslogtreecommitdiff
path: root/src/menuconfiguration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/menuconfiguration.cpp')
-rw-r--r--src/menuconfiguration.cpp14
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));
+}