summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/MainController.cpp2
-rw-r--r--Swift/Controllers/UIInterfaces/WhiteboardWindow.h1
-rw-r--r--Swift/Controllers/WhiteboardManager.cpp4
-rw-r--r--Swift/Controllers/WhiteboardManager.h4
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp11
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.h1
6 files changed, 16 insertions, 7 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index e67df62..c1cc055 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -321,7 +321,7 @@ void MainController::handleConnected() {
userSearchControllerChat_ = new UserSearchController(UserSearchController::StartChat, jid_, uiEventStream_, client_->getVCardManager(), uiFactory_, client_->getIQRouter(), rosterController_);
userSearchControllerAdd_ = new UserSearchController(UserSearchController::AddContact, jid_, uiEventStream_, client_->getVCardManager(), uiFactory_, client_->getIQRouter(), rosterController_);
adHocManager_ = new AdHocManager(JID(boundJID_.getDomain()), uiFactory_, client_->getIQRouter(), uiEventStream_, rosterController_->getWindow());
- whiteboardManager_ = new WhiteboardManager(uiFactory_, uiEventStream_, client_->getWhiteboardSessionManager());
+ whiteboardManager_ = new WhiteboardManager(uiFactory_, uiEventStream_, client_->getNickResolver(), client_->getWhiteboardSessionManager());
}
loginWindow_->setIsLoggingIn(false);
diff --git a/Swift/Controllers/UIInterfaces/WhiteboardWindow.h b/Swift/Controllers/UIInterfaces/WhiteboardWindow.h
index d40ff08..a4a9ef0 100644
--- a/Swift/Controllers/UIInterfaces/WhiteboardWindow.h
+++ b/Swift/Controllers/UIInterfaces/WhiteboardWindow.h
@@ -21,5 +21,6 @@ namespace Swift {
virtual void show() = 0;
virtual void setSession(boost::shared_ptr<WhiteboardSession> session) = 0;
virtual void activateWindow() = 0;
+ virtual void setName(const std::string& name) = 0;
};
}
diff --git a/Swift/Controllers/WhiteboardManager.cpp b/Swift/Controllers/WhiteboardManager.cpp
index 142239e..1aa238e 100644
--- a/Swift/Controllers/WhiteboardManager.cpp
+++ b/Swift/Controllers/WhiteboardManager.cpp
@@ -13,13 +13,14 @@
#include <Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h>
#include <Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h>
#include <Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h>
+#include "Swiften/Client/NickResolver.h"
#include <Swiften/Client/StanzaChannel.h>
#include <Swiften/Whiteboard/WhiteboardSessionManager.h>
namespace Swift {
typedef std::pair<JID, WhiteboardWindow*> JIDWhiteboardWindowPair;
- WhiteboardManager::WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, WhiteboardSessionManager* whiteboardSessionManager) : whiteboardWindowFactory_(whiteboardWindowFactory), uiEventStream_(uiEventStream), whiteboardSessionManager_(whiteboardSessionManager) {
+ WhiteboardManager::WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, NickResolver* nickResolver, WhiteboardSessionManager* whiteboardSessionManager) : whiteboardWindowFactory_(whiteboardWindowFactory), uiEventStream_(uiEventStream), nickResolver_(nickResolver), whiteboardSessionManager_(whiteboardSessionManager) {
uiEventConnection_ = uiEventStream_->onUIEvent.connect(boost::bind(&WhiteboardManager::handleUIEvent, this, _1));
}
@@ -31,6 +32,7 @@ namespace Swift {
WhiteboardWindow* WhiteboardManager::createNewWhiteboardWindow(const JID& contact, WhiteboardSession::ref session) {
WhiteboardWindow *window = whiteboardWindowFactory_->createWhiteboardWindow(session);
+ window->setName(nickResolver_->jidToNick(contact));
whiteboardWindows_[contact.toBare()] = window;
return window;
}
diff --git a/Swift/Controllers/WhiteboardManager.h b/Swift/Controllers/WhiteboardManager.h
index 52d9bae..a2c75dd 100644
--- a/Swift/Controllers/WhiteboardManager.h
+++ b/Swift/Controllers/WhiteboardManager.h
@@ -20,10 +20,11 @@
namespace Swift {
class WhiteboardSessionManager;
+ class NickResolver;
class WhiteboardManager {
public:
- WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, WhiteboardSessionManager* whiteboardSessionManager);
+ WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, NickResolver* nickResolver, WhiteboardSessionManager* whiteboardSessionManager);
~WhiteboardManager();
WhiteboardWindow* createNewWhiteboardWindow(const JID& contact, WhiteboardSession::ref session);
@@ -38,6 +39,7 @@ namespace Swift {
std::map<JID, WhiteboardWindow*> whiteboardWindows_;
WhiteboardWindowFactory* whiteboardWindowFactory_;
UIEventStream* uiEventStream_;
+ NickResolver* nickResolver_;
boost::bsignals::scoped_connection uiEventConnection_;
WhiteboardSessionManager* whiteboardSessionManager_;
};
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
index ddbbd5c..eb22904 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
@@ -21,10 +21,12 @@
#include <Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h>
#include <QMessageBox>
-//using namespace std;
namespace Swift {
QtWhiteboardWindow::QtWhiteboardWindow(WhiteboardSession::ref whiteboardSession) : QWidget() {
+#ifndef Q_WS_MAC
+ setWindowIcon(QIcon(":/logo-icon-16.png"));
+#endif
layout = new QVBoxLayout(this);
hLayout = new QHBoxLayout;
sidebarLayout = new QVBoxLayout;
@@ -32,9 +34,6 @@ namespace Swift {
scene = new QGraphicsScene(this);
scene->setSceneRect(0, 0, 400, 400);
- //BspTreeIndex is buggy, there are problems after removing items
- //from scene
- //scene->setItemIndexMethod(QGraphicsScene::NoIndex);
graphicsView = new GView(scene, this);
graphicsView->setMode(GView::Line);
@@ -229,6 +228,10 @@ namespace Swift {
QWidget::activateWindow();
}
+ void QtWhiteboardWindow::setName(const std::string& name) {
+ setWindowTitle(P2QSTRING(name));
+ }
+
void QtWhiteboardWindow::handleLastItemChanged(QGraphicsItem* item, int pos, GView::Type type) {
WhiteboardElement::ref el;
QGraphicsLineItem* lineItem = qgraphicsitem_cast<QGraphicsLineItem*>(item);
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
index 903487a..1462981 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
@@ -35,6 +35,7 @@ namespace Swift {
void show();
void setSession(WhiteboardSession::ref session);
void activateWindow();
+ void setName(const std::string& name);
private slots:
void changeLineWidth(int i);