diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-24 08:18:49 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-10 09:53:29 (GMT) |
commit | c7cd9c8d239c1c5d604de8862625741754138771 (patch) | |
tree | 06c6915ce14f84ae63f50f564a5b6021acf5c0a3 /Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | |
parent | 8921c929a190c3ae4d7a10e5e58c8e720a0121c3 (diff) | |
download | swift-contrib-c7cd9c8d239c1c5d604de8862625741754138771.zip swift-contrib-c7cd9c8d239c1c5d604de8862625741754138771.tar.bz2 |
Fix JID auto-complete item select not working when adding a contact.
Test-Information:
Confirm that clicking a suggested user fills the JID box on the "Add User" dialog. Confirm that JID suggestion functions normally in other places.
Change-Id: Ic1a5c30b95416fd46bc22a612793621e9501d770
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchWindow.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index e5bd5d0..29ee306 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -275,18 +275,22 @@ Contact::ref QtUserSearchWindow::getContact() const { } void QtUserSearchWindow::addSearchedJIDToList(const Contact::ref& contact) { std::vector<JID> jids; jids.push_back(contact->jid); handleJIDsAdded(jids); firstMultiJIDPage_->jid_->clear(); } +void QtUserSearchWindow::handleOnSearchedJIDSelected(const Contact::ref& contact) { + firstPage_->jid_->setText(P2QSTRING(contact->jid.toString())); +} + void QtUserSearchWindow::show() { clear(); QWidget::show(); } void QtUserSearchWindow::addSavedServices(const std::vector<JID>& services) { if (type_ == AddContact) { firstPage_->service_->clear(); foreach (JID jid, services) { @@ -462,18 +466,19 @@ void QtUserSearchWindow::setSelectedService(const JID& jid) { } void QtUserSearchWindow::setFirstPage(QString title) { if (page(1) != 0) { removePage(1); } if (type_ == AddContact) { firstPage_ = new QtUserSearchFirstPage(type_, title.isEmpty() ? firstPage_->title() : title, settings_); connect(firstPage_->jid_, SIGNAL(textEdited(QString)), this, SLOT(handleContactSuggestionRequested(QString))); + firstPage_->jid_->onUserSelected.connect(boost::bind(&QtUserSearchWindow::handleOnSearchedJIDSelected, this, _1)); connect(firstPage_->byJID_, SIGNAL(toggled(bool)), this, SLOT(handleFirstPageRadioChange())); connect(firstPage_->byLocalSearch_, SIGNAL(toggled(bool)), this, SLOT(handleFirstPageRadioChange())); connect(firstPage_->byRemoteSearch_, SIGNAL(toggled(bool)), this, SLOT(handleFirstPageRadioChange())); #if QT_VERSION >= 0x040700 firstPage_->jid_->setPlaceholderText(tr("alice@wonderland.lit")); #endif firstPage_->service_->setEnabled(false); setPage(1, firstPage_); } else { |