diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-02-11 12:41:22 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-02-11 12:41:22 (GMT) |
commit | e81caa93d528bf7e73e66057093814371a538bf2 (patch) | |
tree | 3e4e24628ce61f8c475c47c86eee1c93339b9429 | |
parent | b8a73b1d16afd4f3aa0e8e39447024ec541df4c8 (diff) | |
download | swift-contrib-e81caa93d528bf7e73e66057093814371a538bf2.zip swift-contrib-e81caa93d528bf7e73e66057093814371a538bf2.tar.bz2 |
Allow double-clicking in the user search results.
Resolves: #748
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index 911d410..ad06654 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -25,7 +25,7 @@ QtUserSearchFirstPage::QtUserSearchFirstPage(UserSearchWindow::Type type, const setTitle(title); setSubTitle(QString("%1. If you know their JID you can enter it directly, or you can search for them.").arg(type == UserSearchWindow::AddContact ? "Add another user to your roster" : "Chat to another user")); connect(jid_, SIGNAL(textChanged(const QString&)), this, SLOT(emitCompletenessCheck())); - connect(service_, SIGNAL(textChanged(const QString&)), this, SLOT(emitCompletenessCheck())); + connect(service_->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(emitCompletenessCheck())); } bool QtUserSearchFirstPage::isComplete() const { @@ -60,8 +60,10 @@ void QtUserSearchFieldsPage::emitCompletenessCheck() { QtUserSearchResultsPage::QtUserSearchResultsPage() { setupUi(this); connect(results_, SIGNAL(activated(const QModelIndex&)), this, SLOT(emitCompletenessCheck())); + connect(results_, SIGNAL(activated(const QModelIndex&)), this, SIGNAL(onUserTriggersFinish())); connect(results_, SIGNAL(clicked(const QModelIndex&)), this, SLOT(emitCompletenessCheck())); connect(results_, SIGNAL(entered(const QModelIndex&)), this, SLOT(emitCompletenessCheck())); + results_->setExpandsOnDoubleClick(false); } bool QtUserSearchResultsPage::isComplete() const { @@ -105,6 +107,7 @@ QtUserSearchWindow::QtUserSearchWindow(UIEventStream* eventStream, UserSearchWin #endif connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(handleCurrentChanged(int))); connect(this, SIGNAL(accepted()), this, SLOT(handleAccepted())); + connect(resultsPage_, SIGNAL(onUserTriggersFinish()), this, SLOT(accept())); clear(); } diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.h b/Swift/QtUI/UserSearch/QtUserSearchWindow.h index e7b8226..a9a9ffa 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.h +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.h @@ -45,6 +45,8 @@ namespace Swift { public: QtUserSearchResultsPage(); virtual bool isComplete() const; + signals: + void onUserTriggersFinish(); public slots: void emitCompletenessCheck(); }; |