summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
authordeva <deva>2010-08-31 09:36:16 +0000
committerdeva <deva>2010-08-31 09:36:16 +0000
commit49ecf45c89c4fea8ed9d041bf9f3fb508aa8e1f0 (patch)
treecb4aafd1e4a02c003e247094e37b9c3cb6f85ed3 /client/widgets/widget.cc
parent78f9569c082a3ee947ffe981599605cc708bdd8c (diff)
DBWidget is now obsolete. Use combobox and luaDB instead.
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);