summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtAboutWidget.cpp2
-rw-r--r--Swift/QtUI/QtSwift.cpp20
-rw-r--r--Swift/QtUI/QtSwift.h12
3 files changed, 24 insertions, 10 deletions
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
};
}