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.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index 33e4309..c0c9e81 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -118,6 +118,21 @@ bool Widget::local()
return widget_local;
}
+bool Widget::committable(bool deep)
+{
+ if(preCommit() == false) return false;
+
+ if(deep == false) return true;
+
+ QVector< Widget* >::iterator i = children.begin();
+ while(i != children.end()) {
+ if(*i && (*i)->committable(deep) == false) return false;
+ i++;
+ }
+
+ return true;
+}
+
bool Widget::valid(bool deep)
{
if(enabled() == false) return true;
@@ -288,6 +303,11 @@ void Widget::childWasChanged()
emit wasChanged();
}
+void Widget::connectChild(Widget *child)
+{
+ connect(child, SIGNAL(wasChanged()), this, SLOT(childWasChanged()));
+}
+
void Widget::addChild(Widget *widget)
{
if(widget == NULL) {
@@ -296,7 +316,7 @@ void Widget::addChild(Widget *widget)
return;
}
children.push_back(widget);
- connect(widget, SIGNAL(wasChanged()), this, SLOT(childWasChanged()));
+ connectChild(widget);
//widget->setParent(this);
}