summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtJoinMUCWindow.cpp7
-rw-r--r--Swift/QtUI/QtJoinMUCWindow.h4
-rw-r--r--Swift/QtUI/QtUIFactory.cpp4
-rw-r--r--Swift/QtUI/QtUIFactory.h2
4 files changed, 11 insertions, 6 deletions
diff --git a/Swift/QtUI/QtJoinMUCWindow.cpp b/Swift/QtUI/QtJoinMUCWindow.cpp
index 7980a17..a44cdaf 100644
--- a/Swift/QtUI/QtJoinMUCWindow.cpp
+++ b/Swift/QtUI/QtJoinMUCWindow.cpp
@@ -6,10 +6,13 @@
#include "QtJoinMUCWindow.h"
#include "QtSwiftUtil.h"
+#include <boost/smart_ptr/make_shared.hpp>
+#include <Swift/Controllers/UIEvents/UIEventStream.h>
+#include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h>
namespace Swift {
-QtJoinMUCWindow::QtJoinMUCWindow() {
+QtJoinMUCWindow::QtJoinMUCWindow(UIEventStream* uiEventStream) : uiEventStream(uiEventStream) {
ui.setupUi(this);
#if QT_VERSION >= 0x040700
ui.room->setPlaceholderText(tr("someroom@rooms.example.com"));
@@ -35,7 +38,7 @@ void QtJoinMUCWindow::handleJoin() {
lastSetNick = Q2PSTRING(ui.nickName->text());
JID room(Q2PSTRING(ui.room->text()));
- onJoinMUC(room, lastSetNick, ui.joinAutomatically->isChecked());
+ uiEventStream->send(boost::make_shared<JoinMUCUIEvent>(room, lastSetNick, ui.joinAutomatically->isChecked()));
hide();
}
diff --git a/Swift/QtUI/QtJoinMUCWindow.h b/Swift/QtUI/QtJoinMUCWindow.h
index 6e8e846..90b4f3f 100644
--- a/Swift/QtUI/QtJoinMUCWindow.h
+++ b/Swift/QtUI/QtJoinMUCWindow.h
@@ -11,10 +11,11 @@
#include <Swift/QtUI/ui_QtJoinMUCWindow.h>
namespace Swift {
+ class UIEventStream;
class QtJoinMUCWindow : public QWidget, public JoinMUCWindow {
Q_OBJECT
public:
- QtJoinMUCWindow();
+ QtJoinMUCWindow(UIEventStream* uiEventStream);
virtual void setNick(const std::string& nick);
virtual void setMUC(const std::string& nick);
@@ -28,5 +29,6 @@ namespace Swift {
private:
Ui::QtJoinMUCWindow ui;
std::string lastSetNick;
+ UIEventStream* uiEventStream;
};
}
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp
index 40ce95e..bd936d4 100644
--- a/Swift/QtUI/QtUIFactory.cpp
+++ b/Swift/QtUI/QtUIFactory.cpp
@@ -112,8 +112,8 @@ UserSearchWindow* QtUIFactory::createUserSearchWindow(UserSearchWindow::Type typ
return new QtUserSearchWindow(eventStream, type, groups);
};
-JoinMUCWindow* QtUIFactory::createJoinMUCWindow() {
- return new QtJoinMUCWindow();
+JoinMUCWindow* QtUIFactory::createJoinMUCWindow(UIEventStream* uiEventStream) {
+ return new QtJoinMUCWindow(uiEventStream);
}
ProfileWindow* QtUIFactory::createProfileWindow() {
diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h
index a576ded..e7ea6c6 100644
--- a/Swift/QtUI/QtUIFactory.h
+++ b/Swift/QtUI/QtUIFactory.h
@@ -36,7 +36,7 @@ namespace Swift {
virtual MUCSearchWindow* createMUCSearchWindow();
virtual ChatWindow* createChatWindow(const JID &contact, UIEventStream* eventStream);
virtual UserSearchWindow* createUserSearchWindow(UserSearchWindow::Type type, UIEventStream* eventStream, const std::set<std::string>& groups);
- virtual JoinMUCWindow* createJoinMUCWindow();
+ virtual JoinMUCWindow* createJoinMUCWindow(UIEventStream* uiEventStream);
virtual ProfileWindow* createProfileWindow();
virtual ContactEditWindow* createContactEditWindow();
virtual void createAdHocCommandWindow(boost::shared_ptr<OutgoingAdHocCommandSession> command);