summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r--client/widgets/widget.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index 5899839..c17633f 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -31,7 +31,9 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
QDomElement elem = node.toElement();
this->macrowindow = macrowindow;
-
+
+ widget_type = elem.tagName();
+
if(elem.hasAttribute("name")) {
widget_name = elem.attribute("name");
} else {
@@ -63,11 +65,16 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
initial_value = "";
}
-QString Widget::getName()
+QString Widget::name()
{
return widget_name;
}
+QString Widget::type()
+{
+ return widget_type;
+}
+
void Widget::setValue(QString, QString)
{
}
@@ -85,11 +92,12 @@ bool Widget::regexpValidator()
bool Widget::luaValidator()
{
if(!hasluaprogram) return true;
-
- if(macrowindow->luaprograms.contains(luaprogram) == false) return false;
- QString program = macrowindow->luaprograms.value(luaprogram);
- return macrowindow->lua->runValidator(program, getName(), getValue());
+ QString program = "";
+
+ program += luaprogram;
+
+ return macrowindow->lua->runValidator(program, this, name(), getValue());
}
void Widget::setInitialValue(QString value)