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.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index de49968..0857d67 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -35,8 +35,10 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
if(elem.hasAttribute("name")) {
widget_name = elem.attribute("name");
} else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
+ if(elem.tagName() != "frame" && elem.tagName() != "label"
+ && elem.tagName() != "button" && elem.tagName() != "window")
+ printf("XML ERROR!! Unnamed widget of type: %s\n",
+ elem.tagName().toStdString().c_str());
}
if(elem.hasAttribute("script")) {
@@ -52,6 +54,9 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
} else {
hasregexpvalidator = false;
}
+
+ has_initial_value = false;
+ initial_value = "";
}
QString Widget::getName()
@@ -59,12 +64,7 @@ QString Widget::getName()
return widget_name;
}
-QString Widget::getValue()
-{
- return "";
-}
-
-void Widget::setValue(QString)
+void Widget::setValue(QString, QString)
{
}
@@ -85,10 +85,15 @@ bool Widget::luaValidator()
return macrowindow->lua->run(luaprogram, getName(), getValue());
}
-void Widget::disable()
+void Widget::setInitialValue(QString value)
{
+ if(!has_initial_value) {
+ initial_value = value;
+ has_initial_value = true;
+ }
}
-void Widget::enable()
+void Widget::reset()
{
+ setValue(initial_value);
}