diff options
author | Tobias Markmann <tm@ayena.de> | 2012-01-06 22:18:25 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-01-23 14:51:26 (GMT) |
commit | 83afa3d4bf18e4feb8a33d084ed181508084fc64 (patch) | |
tree | b81a0c6eaaedbad3f3e607ea52a69acf98f95eff /Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp | |
parent | 093d499945d779cfed92b45e413644834004b0d9 (diff) | |
download | swift-contrib-83afa3d4bf18e4feb8a33d084ed181508084fc64.zip swift-contrib-83afa3d4bf18e4feb8a33d084ed181508084fc64.tar.bz2 |
XEP-0004 form support for user search.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp b/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp index 3ef048b..13858a7 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp @@ -8,12 +8,31 @@ namespace Swift { -QtUserSearchFieldsPage::QtUserSearchFieldsPage() { +QtUserSearchFieldsPage::QtUserSearchFieldsPage() : formWidget_(0) { setupUi(this); } bool QtUserSearchFieldsPage::isComplete() const { - return nickInput_->isEnabled() || firstInput_->isEnabled() || lastInput_->isEnabled() || emailInput_->isEnabled(); + if (formWidget_) { + return formWidget_->isEnabled(); + } else { + return nickInput_->isEnabled() || firstInput_->isEnabled() || lastInput_->isEnabled() || emailInput_->isEnabled(); + } +} + +QtFormWidget* QtUserSearchFieldsPage::getFormWidget() { + return formWidget_; +} + +void QtUserSearchFieldsPage::setFormWidget(QtFormWidget *widget) { + if (formWidget_) { + delete formWidget_; + formWidget_ = NULL; + } + if (widget) { + formContainer_->layout()->addWidget(widget); + } + formWidget_ = widget; } void QtUserSearchFieldsPage::emitCompletenessCheck() { |