summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-04-15 14:49:05 (GMT)
committerRichard Maudsley <richard.maudsley@isode.com>2014-04-25 08:38:30 (GMT)
commitb42a5c5849813fe8db3bd3889378a53238cc36f7 (patch)
tree2c9265025c0281acfde3077d884e17c834400358 /Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
parentd5f701fdd6826421c0c83b8e299918065b6c99d1 (diff)
downloadswift-contrib-b42a5c5849813fe8db3bd3889378a53238cc36f7.zip
swift-contrib-b42a5c5849813fe8db3bd3889378a53238cc36f7.tar.bz2
Hide reason field in impromptu chat invites.
Change-Id: Icb5075f85a23fc181ff8f5ee00633bb768c4eb5f
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchWindow.cpp')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index c154c8f..40b4e28 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -367,70 +367,75 @@ std::vector<JID> QtUserSearchWindow::getJIDs() const {
}
void QtUserSearchWindow::setCanStartImpromptuChats(bool supportsImpromptu) {
supportsImpromptu_ = supportsImpromptu;
if (type_ == ChatToContact) {
firstMultiJIDPage_->contactList_->setMaximumNoOfContactsToOne(!supportsImpromptu_);
}
}
void QtUserSearchWindow::updateContacts(const std::vector<Contact::ref>& contacts) {
if (type_ != AddContact) {
firstMultiJIDPage_->contactList_->updateContacts(contacts);
}
}
void QtUserSearchWindow::addContacts(const std::vector<Contact::ref>& contacts) {
if (type_ != AddContact) {
/* prevent duplicate JIDs from appearing in the contact list */
foreach (Contact::ref newContact, contacts) {
bool found = false;
foreach (Contact::ref oldContact, contactVector_) {
if (newContact->jid == oldContact->jid) {
found = true;
break;
}
}
if (!found) {
contactVector_.push_back(newContact);
}
}
firstMultiJIDPage_->contactList_->setList(contactVector_);
firstMultiJIDPage_->emitCompletenessCheck();
}
}
+void QtUserSearchWindow::setCanSupplyDescription(bool allowed) {
+ firstMultiJIDPage_->label->setVisible(allowed);
+ firstMultiJIDPage_->reason_->setVisible(allowed);
+}
+
void QtUserSearchWindow::handleAddViaSearch() {
searchNext_ = true;
next();
}
void QtUserSearchWindow::handleListChanged(std::vector<Contact::ref> list) {
contactVector_ = list;
if (type_ == ChatToContact) {
firstMultiJIDPage_->groupBox->setEnabled(supportsImpromptu_ ? 1 : (contactVector_.size() < 1));
}
}
void QtUserSearchWindow::handleJIDsAdded(std::vector<JID> jids) {
onJIDAddRequested(jids);
}
void QtUserSearchWindow::setResults(const std::vector<UserSearchResult>& results) {
UserSearchModel *newModel = new UserSearchModel();
newModel->setResults(results);
resultsPage_->results_->setModel(newModel);
resultsPage_->results_->setItemDelegate(delegate_);
resultsPage_->results_->setHeaderHidden(true);
delete model_;
model_ = newModel;
resultsPage_->setNoResults(model_->rowCount() == 0);
resultsPage_->emitCompletenessCheck();
}
void QtUserSearchWindow::setResultsForm(Form::ref results) {
QtFormResultItemModel *newModel = new QtFormResultItemModel(this);
newModel->setForm(results);
resultsPage_->results_->setModel(newModel);
resultsPage_->results_->setItemDelegate(new QItemDelegate());
resultsPage_->results_->setHeaderHidden(false);
#if QT_VERSION >= 0x050000