summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
authordeva <deva>2010-08-13 12:18:14 +0000
committerdeva <deva>2010-08-13 12:18:14 +0000
commit37cd747953facf8c4ffed40dcef175391d15c388 (patch)
treec18d65b3159f92b998673c8499b82cdd2e1277a7 /client/widgets/widget.cc
parent6031ee9c32023fe1202c7e8160dbb04fe4bd0429 (diff)
Child recursion setValue fix. Missing initialisation of hideChildren and missing check on valid().
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r--client/widgets/widget.cc28
1 files changed, 6 insertions, 22 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index cd29d0a..e5ec498 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -55,14 +55,14 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
widget_local =
elem.hasAttribute("local") && elem.attribute("local") == "true";
-
+ /*
if(elem.hasAttribute("prefilled")) {
prefilled = elem.attribute("prefilled");
}
-
- has_initial_value = elem.hasAttribute("name") && elem.hasAttribute("value");
+ */
+ has_lazy = elem.hasAttribute("name") && elem.hasAttribute("value");
lazy_value = elem.attribute("value", "");
- lazy_source = elem.attribute("prefilled", "");
+ lazy_source = elem.attribute("prefilled", "pracro");
if((hasOnChangeEvent = elem.hasAttribute("onChange"))) {
onChangeEventScript = elem.attribute("onChange");
@@ -116,6 +116,8 @@ bool Widget::valid()
if(preValid() == false) return false;
if(is_valid == false) return false;
+ if(hideChildren) return true;
+
QVector< Widget* >::iterator i = children.begin();
while(i != children.end()) {
if(*i && (*i)->valid() == false) return false;
@@ -131,24 +133,6 @@ void Widget::setValid(bool valid)
setWdgValid(valid);
}
-void Widget::setInitialValue(QString value)
-{
- if(!has_initial_value) {
- initial_value = value;
- has_initial_value = true;
- }
-}
-
-bool Widget::hasInitialValue()
-{
- return has_initial_value;
-}
-
-void Widget::reset()
-{
- setValue(initial_value, "");
-}
-
void Widget::eventOnChange()
{
if(enabled() && hasOnChangeEvent)