From e81caa93d528bf7e73e66057093814371a538bf2 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Fri, 11 Feb 2011 12:41:22 +0000
Subject: Allow double-clicking in the user search results.

Resolves: #748

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();
 	};
-- 
cgit v0.10.2-6-g49f6