summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-11-18 12:09:08 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-12-22 20:19:07 (GMT)
commit9f04a7ec3429303118f12607703b877d8ba43888 (patch)
tree3e868395fa3c4f9cbbf84614094bb0251b425c15 /Swift/QtUI/QtMainWindow.cpp
parent04b99ce8430109d0467c29c85cb6bacb85c54c44 (diff)
downloadswift-9f04a7ec3429303118f12607703b877d8ba43888.zip
swift-9f04a7ec3429303118f12607703b877d8ba43888.tar.bz2
Basic User Search support, and Find Rooms cleanup.
Adds a throbber to the MUC search, turns the Add Contact dialog into something searchy, adds the option to open chats to arbitrary JIDs. Resolves: #614 Resolves: #695 Resolves: #436 Release-Notes: On servers that support it, users can now perform searches for contacts to add or chat to.
Diffstat (limited to 'Swift/QtUI/QtMainWindow.cpp')
-rw-r--r--Swift/QtUI/QtMainWindow.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index ee83f4d..6e53258 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -24,7 +24,7 @@
#include "QtSwiftUtil.h"
#include "QtTabWidget.h"
#include "Roster/QtTreeWidget.h"
-#include "Swift/Controllers/UIEvents/AddContactUIEvent.h"
+#include "Swift/Controllers/UIEvents/RequestUserSearchUIEvent.h"
#include "Swift/Controllers/UIEvents/RequestMUCSearchUIEvent.h"
#include "Swift/Controllers/UIEvents/JoinMUCUIEvent.h"
#include "Swift/Controllers/UIEvents/ToggleShowOfflineUIEvent.h"
@@ -84,9 +84,9 @@ QtMainWindow::QtMainWindow(QtSettingsProvider* settings, UIEventStream* uiEventS
QAction* joinMUCAction = new QAction("Join Room", this);
connect(joinMUCAction, SIGNAL(triggered()), SLOT(handleJoinMUCAction()));
actionsMenu->addAction(joinMUCAction);
- addAction_ = new QAction("Add Contact", this);
- connect(addAction_, SIGNAL(triggered(bool)), this, SLOT(handleAddActionTriggered(bool)));
- actionsMenu->addAction(addAction_);
+ otherUserAction_ = new QAction("Find Other Contact", this);
+ connect(otherUserAction_, SIGNAL(triggered(bool)), this, SLOT(handleOtherUserActionTriggered(bool)));
+ actionsMenu->addAction(otherUserAction_);
QAction* signOutAction = new QAction("Sign Out", this);
connect(signOutAction, SIGNAL(triggered()), SLOT(handleSignOutAction()));
actionsMenu->addAction(signOutAction);
@@ -123,22 +123,15 @@ void QtMainWindow::handleEventCountUpdated(int count) {
tabs_->setTabText(eventIndex, text);
}
-void QtMainWindow::handleAddActionTriggered(bool checked) {
- Q_UNUSED(checked);
- QtAddContactDialog* addContact = new QtAddContactDialog(this);
- connect(addContact, SIGNAL(onAddCommand(const JID&, const QString&)), SLOT(handleAddContactDialogComplete(const JID&, const QString&)));
- addContact->show();
+void QtMainWindow::handleOtherUserActionTriggered(bool /*checked*/) {
+ boost::shared_ptr<UIEvent> event(new RequestUserSearchUIEvent());
+ uiEventStream_->send(event);
}
void QtMainWindow::handleSignOutAction() {
onSignOutRequest();
}
-void QtMainWindow::handleAddContactDialogComplete(const JID& contact, const QString& name) {
- boost::shared_ptr<UIEvent> event(new AddContactUIEvent(contact, Q2PSTRING(name)));
- uiEventStream_->send(event);
-}
-
void QtMainWindow::handleJoinMUCAction() {
uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestMUCSearchUIEvent()));
}