summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp2
-rw-r--r--Swift/Controllers/MainController.cpp30
-rw-r--r--Swift/Controllers/MainController.h24
-rw-r--r--Swift/Controllers/UIInterfaces/ChatListWindowFactory.h2
4 files changed, 16 insertions, 42 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 6bd7597..814d87d 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -42,7 +42,7 @@ ChatsManager::ChatsManager(JID jid, StanzaChannel* stanzaChannel, IQRouter* iqRo
mucBookmarkManager_ = NULL;
presenceOracle_->onPresenceChange.connect(boost::bind(&ChatsManager::handlePresenceChange, this, _1));
uiEventConnection_ = uiEventStream_->onUIEvent.connect(boost::bind(&ChatsManager::handleUIEvent, this, _1));
- chatListWindow_ = chatListWindowFactory->createWindow(uiEventStream_);
+ chatListWindow_ = chatListWindowFactory->createChatListWindow(uiEventStream_);
setupBookmarks();
}
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index de7009c..c965c1c 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -4,13 +4,14 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swift/Controllers/MainController.h"
+#include <Swift/Controllers/MainController.h>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/shared_ptr.hpp>
#include <stdlib.h>
+#include <Swift/Controllers/UIInterfaces/UIFactory.h>
#include "Swiften/Network/TimerFactory.h"
#include "Swift/Controllers/BuildVersion.h"
#include "Swift/Controllers/StoragesFactory.h"
@@ -69,16 +70,10 @@ static const String SHOW_NOTIFICATIONS = "showNotifications";
MainController::MainController(
EventLoop* eventLoop,
NetworkFactories* networkFactories,
- ChatWindowFactory* chatWindowFactory,
- MainWindowFactory *mainWindowFactory,
- LoginWindowFactory *loginWindowFactory,
- EventWindowFactory* eventWindowFactory,
+ UIFactory* uiFactories,
SettingsProvider *settings,
SystemTray* systemTray,
SoundPlayer* soundPlayer,
- XMLConsoleWidgetFactory* xmlConsoleWidgetFactory,
- ChatListWindowFactory* chatListWindowFactory,
- MUCSearchWindowFactory* mucSearchWindowFactory,
StoragesFactory* storagesFactory,
CertificateStorageFactory* certificateStorageFactory,
Dock* dock,
@@ -86,12 +81,10 @@ MainController::MainController(
bool useDelayForLatency) :
eventLoop_(eventLoop),
networkFactories_(networkFactories),
+ uiFactory_(uiFactories),
idleDetector_(&idleQuerier_, networkFactories_->getTimerFactory(), 100),
storagesFactory_(storagesFactory),
certificateStorageFactory_(certificateStorageFactory),
- chatWindowFactory_(chatWindowFactory),
- mainWindowFactory_(mainWindowFactory),
- loginWindowFactory_(loginWindowFactory),
settings_(settings),
loginWindow_(NULL) ,
useDelayForLatency_(useDelayForLatency) {
@@ -108,10 +101,7 @@ MainController::MainController(
quitRequested_ = false;
timeBeforeNextReconnect_ = -1;
- mucSearchWindowFactory_ = mucSearchWindowFactory;
- eventWindowFactory_ = eventWindowFactory;
dock_ = dock;
- chatListWindowFactory_ = chatListWindowFactory;
uiEventStream_ = new UIEventStream();
notifier_ = new TogglableNotifier(notifier);
@@ -119,7 +109,7 @@ MainController::MainController(
eventController_->onEventQueueLengthChange.connect(boost::bind(&MainController::handleEventQueueLengthChange, this, _1));
systemTrayController_ = new SystemTrayController(eventController_, systemTray);
- loginWindow_ = loginWindowFactory_->createLoginWindow(uiEventStream_);
+ loginWindow_ = uiFactory_->createLoginWindow(uiEventStream_);
soundEventController_ = new SoundEventController(eventController_, soundPlayer, settings, uiEventStream_);
String selectedLoginJID = settings_->getStringSetting("lastLoginJID");
@@ -147,7 +137,7 @@ MainController::MainController(
idleDetector_.setIdleTimeSeconds(600);
idleDetector_.onIdleChanged.connect(boost::bind(&MainController::handleInputIdleChanged, this, _1));
- xmlConsoleController_ = new XMLConsoleController(uiEventStream_, xmlConsoleWidgetFactory);
+ xmlConsoleController_ = new XMLConsoleController(uiEventStream_, uiFactory_);
uiEventStream_->onUIEvent.connect(boost::bind(&MainController::handleUIEvent, this, _1));
bool enabled = settings_->getBoolSetting(SHOW_NOTIFICATIONS, true);
@@ -232,15 +222,15 @@ void MainController::handleConnected() {
bool freshLogin = rosterController_ == NULL;
myStatusLooksOnline_ = true;
if (freshLogin) {
- rosterController_ = new RosterController(jid_, client_->getRoster(), client_->getAvatarManager(), mainWindowFactory_, client_->getNickManager(), client_->getNickResolver(), client_->getPresenceOracle(), client_->getSubscriptionManager(), eventController_, uiEventStream_, client_->getIQRouter(), settings_);
+ rosterController_ = new RosterController(jid_, client_->getRoster(), client_->getAvatarManager(), uiFactory_, client_->getNickManager(), client_->getNickResolver(), client_->getPresenceOracle(), client_->getSubscriptionManager(), eventController_, uiEventStream_, client_->getIQRouter(), settings_);
rosterController_->onChangeStatusRequest.connect(boost::bind(&MainController::handleChangeStatusRequest, this, _1, _2));
rosterController_->onSignOutRequest.connect(boost::bind(&MainController::signOut, this));
- chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, chatWindowFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, chatListWindowFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager());
+ chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager());
client_->onMessageReceived.connect(boost::bind(&ChatsManager::handleIncomingMessage, chatsManager_, _1));
chatsManager_->setAvatarManager(client_->getAvatarManager());
- eventWindowController_ = new EventWindowController(eventController_, eventWindowFactory_);
+ eventWindowController_ = new EventWindowController(eventController_, uiFactory_);
loginWindow_->morphInto(rosterController_->getWindow());
@@ -251,7 +241,7 @@ void MainController::handleConnected() {
client_->getDiscoManager()->setCapsNode(CLIENT_NODE);
client_->getDiscoManager()->setDiscoInfo(discoInfo);
- mucSearchController_ = new MUCSearchController(jid_, uiEventStream_, mucSearchWindowFactory_, client_->getIQRouter(), settings_);
+ mucSearchController_ = new MUCSearchController(jid_, uiEventStream_, uiFactory_, client_->getIQRouter(), settings_);
}
client_->requestRoster();
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index 0427307..2f101a5 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -6,7 +6,7 @@
#pragma once
-#include "Swiften/Base/boost_bsignals.h"
+#include <Swiften/Base/boost_bsignals.h>
#include <boost/shared_ptr.hpp>
#include <vector>
@@ -27,22 +27,19 @@
#include "Swift/Controllers/UIEvents/UIEvent.h"
namespace Swift {
+ class UIFactory;
class EventLoop;
class Client;
- class ChatWindowFactory;
class ChatController;
class ChatsManager;
class CertificateStorageFactory;
class CertificateStorage;
class CertificateStorageTrustChecker;
- class ChatListWindowFactory;
class EventController;
- class MainWindowFactory;
class MainWindow;
class RosterController;
class LoginWindow;
class EventLoop;
- class LoginWindowFactory;
class MUCController;
class Notifier;
class TogglableNotifier;
@@ -54,11 +51,9 @@ namespace Swift {
class SoundPlayer;
class XMLConsoleController;
class UIEventStream;
- class XMLConsoleWidgetFactory;
class EventWindowFactory;
class EventWindowController;
class MUCSearchController;
- class MUCSearchWindowFactory;
class StatusTracker;
class Dock;
class Storages;
@@ -70,16 +65,10 @@ namespace Swift {
MainController(
EventLoop* eventLoop,
NetworkFactories* networkFactories,
- ChatWindowFactory* chatWindowFactory,
- MainWindowFactory *mainWindowFactory,
- LoginWindowFactory *loginWindowFactory,
- EventWindowFactory* eventWindowFactory,
+ UIFactory* uiFactories,
SettingsProvider *settings,
SystemTray* systemTray,
SoundPlayer* soundPlayer,
- XMLConsoleWidgetFactory* xmlConsoleWidgetFactory,
- ChatListWindowFactory* chatListWindowFactory_,
- MUCSearchWindowFactory* mucSearchWindowFactory,
StoragesFactory* storagesFactory,
CertificateStorageFactory* certificateStorageFactory,
Dock* dock,
@@ -116,6 +105,7 @@ namespace Swift {
private:
EventLoop* eventLoop_;
NetworkFactories* networkFactories_;
+ UIFactory* uiFactory_;
PlatformIdleQuerier idleQuerier_;
ActualIdleDetector idleDetector_;
StoragesFactory* storagesFactory_;
@@ -124,10 +114,6 @@ namespace Swift {
CertificateStorage* certificateStorage_;
CertificateStorageTrustChecker* certificateTrustChecker_;
Client* client_;
- ChatWindowFactory* chatWindowFactory_;
- MainWindowFactory* mainWindowFactory_;
- LoginWindowFactory* loginWindowFactory_;
- EventWindowFactory* eventWindowFactory_;
SettingsProvider *settings_;
ProfileSettingsProvider* profileSettings_;
Dock* dock_;
@@ -148,11 +134,9 @@ namespace Swift {
String vCardPhotoHash_;
String password_;
String certificateFile_;
- ChatListWindowFactory* chatListWindowFactory_;
boost::shared_ptr<ErrorEvent> lastDisconnectError_;
bool useDelayForLatency_;
MUCSearchController* mucSearchController_;
- MUCSearchWindowFactory* mucSearchWindowFactory_;
int timeBeforeNextReconnect_;
Timer::ref reconnectTimer_;
StatusTracker* statusTracker_;
diff --git a/Swift/Controllers/UIInterfaces/ChatListWindowFactory.h b/Swift/Controllers/UIInterfaces/ChatListWindowFactory.h
index b920e43..cf8409e 100644
--- a/Swift/Controllers/UIInterfaces/ChatListWindowFactory.h
+++ b/Swift/Controllers/UIInterfaces/ChatListWindowFactory.h
@@ -13,6 +13,6 @@ namespace Swift {
class ChatListWindowFactory {
public:
virtual ~ChatListWindowFactory() {}
- virtual ChatListWindow* createWindow(UIEventStream* uiEventStream) = 0;
+ virtual ChatListWindow* createChatListWindow(UIEventStream* uiEventStream) = 0;
};
}