summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp9
-rw-r--r--Swift/Controllers/MainController.h6
-rw-r--r--Swift/QtUI/QtAboutWidget.cpp2
-rw-r--r--Swift/QtUI/QtSwift.cpp20
-rw-r--r--Swift/QtUI/QtSwift.h12
5 files changed, 31 insertions, 18 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index afffa59..04112ea 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -12,8 +12,6 @@
#include <stdlib.h>
#include <sstream>
-#include "Swiften/Application/Application.h"
-#include "Swiften/Application/ApplicationMessageDisplay.h"
#include "Swiften/Network/TimerFactory.h"
#include "Swiften/Network/BoostIOServiceThread.h"
#include "Swiften/Network/MainBoostIOServiceThread.h"
@@ -40,6 +38,7 @@
#include "Swift/Controllers/XMLConsoleController.h"
#include "Swift/Controllers/XMPPRosterController.h"
#include "Swift/Controllers/UIEvents/UIEventStream.h"
+#include "SwifTools/Dock/Dock.h"
#include "Swiften/Base/foreach.h"
#include "Swiften/Base/String.h"
#include "Swiften/Client/Client.h"
@@ -83,7 +82,7 @@ MainController::MainController(
AvatarStorage* avatarStorage,
CapsStorage* capsStorage,
VCardStorageFactory* vcardStorageFactory,
- ApplicationMessageDisplay* applicationMessageDisplay,
+ Dock* dock,
bool useDelayForLatency) :
timerFactory_(&boostIOServiceThread_.getIOService()),
idleDetector_(&idleQuerier_, &timerFactory_, 100),
@@ -114,7 +113,7 @@ MainController::MainController(
timeBeforeNextReconnect_ = -1;
mucSearchWindowFactory_ = mucSearchWindowFactory;
eventWindowFactory_ = eventWindowFactory;
- applicationMessageDisplay_ = applicationMessageDisplay;
+ dock_ = dock;
chatListWindowFactory_ = chatListWindowFactory;
uiEventStream_ = new UIEventStream();
@@ -291,7 +290,7 @@ void MainController::handleConnected() {
}
void MainController::handleEventQueueLengthChange(int count) {
- applicationMessageDisplay_->setMessage(count == 0 ? "" : boost::lexical_cast<std::string>(count).c_str());
+ dock_->setMessage(count == 0 ? "" : boost::lexical_cast<std::string>(count).c_str());
}
void MainController::reconnectAfterError() {
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index 8596ace..7aad4a0 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -46,7 +46,6 @@ namespace Swift {
class XMPPRosterController;
class PresenceSender;
class DiscoInfoResponder;
- class ApplicationMessageDisplay;
class AvatarManager;
class CapsManager;
class EntityCapsManager;
@@ -70,6 +69,7 @@ namespace Swift {
class StatusTracker;
class VCardStorageFactory;
class MUCRegistry;
+ class Dock;
class MainController {
public:
@@ -87,7 +87,7 @@ namespace Swift {
AvatarStorage* avatarStorage,
CapsStorage* capsStorage,
VCardStorageFactory* vcardStorageFactory,
- ApplicationMessageDisplay* applicationMessageDisplay,
+ Dock* dock,
bool useDelayForLatency);
~MainController();
@@ -133,7 +133,7 @@ namespace Swift {
CapsStorage* capsStorage_;
VCardStorageFactory* vcardStorageFactory_;
VCardManager* vcardManager_;
- ApplicationMessageDisplay* applicationMessageDisplay_;
+ Dock* dock_;
ChatController* chatController_;
XMPPRosterController* xmppRosterController_;
RosterController* rosterController_;
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp
index e9e6329..e8b0baf 100644
--- a/Swift/QtUI/QtAboutWidget.cpp
+++ b/Swift/QtUI/QtAboutWidget.cpp
@@ -16,8 +16,6 @@
#include <QFile>
#include <QTextStream>
-#include "Swiften/Application/Application.h"
-
namespace Swift {
QtAboutWidget::QtAboutWidget() : QDialog() {
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index e548e29..6606f85 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -23,8 +23,6 @@
#include <boost/bind.hpp>
#include <QSplitter>
-#include "Swiften/Application/Application.h"
-#include "Swiften/Application/PlatformApplication.h"
#include "Swiften/Application/PlatformApplicationPathProvider.h"
#include "Swiften/Avatars/AvatarFileStorage.h"
#include "Swiften/Disco/CapsFileStorage.h"
@@ -33,11 +31,17 @@
#include "Swiften/Base/Platform.h"
#include "Swiften/Elements/Presence.h"
#include "Swiften/Client/Client.h"
+#include "SwifTools/Dock/PlatformDock.h"
#include "Swift/Controllers/MainController.h"
#include "Swift/Controllers/ApplicationInfo.h"
#include "Swift/Controllers/BuildVersion.h"
#include "SwifTools/AutoUpdater/AutoUpdater.h"
#include "SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h"
+#if defined(SWIFTEN_PLATFORM_MACOSX)
+#include "SwifTools/Dock/MacOSXDock.h"
+#else
+#include "SwifTools/Dock/NullDock.h"
+#endif
namespace Swift{
@@ -81,13 +85,19 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
tabs_ = options.count("no-tabs") && !(splitter_ > 0) ? NULL : new QtChatTabs();
settings_ = new QtSettingsProvider();
- application_ = new PlatformApplication(SWIFT_APPLICATION_NAME);
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
avatarStorage_ = new AvatarFileStorage(applicationPathProvider_->getAvatarDir());
vcardStorageFactory_ = new VCardFileStorageFactory(applicationPathProvider_->getDataDir());
capsStorage_ = new CapsFileStorage(applicationPathProvider_->getDataDir() / "caps");
chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_, "");
soundPlayer_ = new QtSoundPlayer(applicationPathProvider_);
+
+#if defined(SWIFTEN_PLATFORM_MACOSX)
+ dock_ = new MacOSXDock(&cocoaApplication_);
+#else
+ dock_ = new NullDock();
+#endif
+
if (splitter_) {
splitter_->show();
}
@@ -121,7 +131,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
avatarStorage_,
capsStorage_,
vcardStorageFactory_,
- application_->getApplicationMessageDisplay(),
+ dock_,
options.count("latency-debug") > 0);
mainControllers_.push_back(mainController);
}
@@ -150,12 +160,12 @@ QtSwift::~QtSwift() {
delete controller;
}
delete settings_;
- delete application_;
foreach (QtSystemTray* tray, systemTrays_) {
delete tray;
}
delete tabs_;
delete splitter_;
+ delete dock_;
delete soundPlayer_;
foreach (QtXMLConsoleWidgetFactory* factory, xmlConsoleWidgetFactories_) {
delete factory;
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index 4c570ae..657b749 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -11,20 +11,24 @@
#include <boost/program_options/options_description.hpp>
#include "Swiften/Base/String.h"
+#include "Swiften/Base/Platform.h"
#include "Swiften/EventLoop/Qt/QtEventLoop.h"
#include "QtLoginWindowFactory.h"
#include "QtMainWindowFactory.h"
#include "QtChatWindowFactory.h"
#include "QtSettingsProvider.h"
+#if defined(SWIFTEN_PLATFORM_MACOSX)
+#include "Swiften/Application/CocoaApplication.h"
+#endif
namespace po = boost::program_options;
class QSplitter;
namespace Swift {
+ class Dock;
class VCardStorageFactory;
class AutoUpdater;
- class Application;
class ApplicationPathProvider;
class AvatarStorage;
class CapsStorage;
@@ -59,14 +63,16 @@ namespace Swift {
QtSettingsProvider *settings_;
QSplitter* splitter_;
QtSoundPlayer* soundPlayer_;
+ Dock* dock_;
QtChatTabs* tabs_;
- Application* application_;
ApplicationPathProvider* applicationPathProvider_;
AvatarStorage* avatarStorage_;
CapsStorage* capsStorage_;
VCardStorageFactory* vcardStorageFactory_;
AutoUpdater* autoUpdater_;
-
+#if defined(SWIFTEN_PLATFORM_MACOSX)
+ CocoaApplication cocoaApplication_;
+#endif
};
}