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.cc35
1 files changed, 11 insertions, 24 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index b155279..dbce00c 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -54,11 +54,7 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
widget_local =
elem.hasAttribute("local") && elem.attribute("local") == "true";
- /*
- if(elem.hasAttribute("prefilled")) {
- prefilled = elem.attribute("prefilled");
- }
- */
+
has_lazy = elem.hasAttribute("name") && elem.hasAttribute("value");
lazy_value = elem.attribute("value", "");
lazy_source = elem.attribute("prefilled", "prefilled");
@@ -179,21 +175,17 @@ void Widget::setWdgValidRecursive(bool forcevalid)
void Widget::setEnabled(bool enabled)
{
widget->setEnabled(enabled);
- if(enabled == false) setWdgValidRecursive(true);
- else setWdgValidRecursive(false);
-
- /*
- if(enabled) {
- setValid(valid(), true);
- emit eventOnChange();
- } else setValid(true, true); // Force disabled widgets to be valid
- */
- QVector< Widget* >::iterator i = children.begin();
- while(i != children.end()) {
- if(*i) (*i)->runEventOnChange(true);
- i++;
+ if(enabled == false) {
+ setWdgValidRecursive(true); // Force all valid
+ } else {
+ setWdgValidRecursive(false);
+
+ QVector< Widget* >::iterator i = children.begin();
+ while(i != children.end()) {
+ if(*i) (*i)->runEventOnChange(true);
+ i++;
+ }
}
-
}
bool Widget::enabled()
@@ -367,11 +359,6 @@ void Widget::createWidget(QDomNode &xml_node, QLayout *layout)
ComboBox *combobox = new ComboBox(xml_elem, macrowindow);
widget = combobox;
- } else if(xml_elem.tagName() == "dbwidget") {
-
- DBWidget *dbwidget = new DBWidget(xml_elem, macrowindow);
- widget = dbwidget;
-
} else if(xml_elem.tagName() == "listbox") {
ListBox *listbox = new ListBox(xml_elem, macrowindow);