summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-21 20:19:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-21 20:19:13 (GMT)
commitc868a4d587ea8ebbdbe5ef4ccc525af9811acbf9 (patch)
tree092ddb7e0f5dc34fddac5d83a41d727608afb796 /Swift
parenteb0caf8201ed2b5507401a7127624b64ca2f51fc (diff)
downloadswift-c868a4d587ea8ebbdbe5ef4ccc525af9811acbf9.zip
swift-c868a4d587ea8ebbdbe5ef4ccc525af9811acbf9.tar.bz2
Revert to SnarlNotifier on Windows.
Use balloons as a fallback.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtSwift.cpp25
-rw-r--r--Swift/QtUI/QtSwift.h3
-rw-r--r--Swift/QtUI/QtSystemTray.h4
3 files changed, 27 insertions, 5 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 7717b77..ef87aab 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -36,7 +36,7 @@
#include "SwifTools/Notifier/GrowlNotifier.h"
#elif defined(HAVE_SNARL)
#include "QtWin32NotifierWindow.h"
-#include "SwifTools/Notifier/GNTPNotifier.h"
+#include "SwifTools/Notifier/SnarlNotifier.h"
#elif defined(SWIFTEN_PLATFORM_LINUX)
#include "FreeDesktopNotifier.h"
#else
@@ -44,6 +44,8 @@
#endif
#if defined(SWIFTEN_PLATFORM_MACOSX)
#include "SwifTools/Dock/MacOSXDock.h"
+#elif defined(SWIFTEN_PLATFORM_WINDOWS)
+#include "SwifTools/Dock/WindowsDock.h"
#else
#include "SwifTools/Dock/NullDock.h"
#endif
@@ -105,15 +107,23 @@ QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThrea
#if defined(HAVE_GROWL)
notifier_ = new GrowlNotifier(SWIFT_APPLICATION_NAME);
#elif defined(HAVE_SNARL)
- notifier_ = new GNTPNotifier(SWIFT_APPLICATION_NAME, applicationPathProvider_->getResourcePath("/images/logo-icon-128.png"), networkFactories_.getConnectionFactory());
+ notifierWindow_ = new QtWin32NotifierWindow();
+ notifier_ = new SnarlNotifier(SWIFT_APPLICATION_NAME, notifierWindow_, applicationPathProvider_->getResourcePath("/images/logo-icon-32.png"));
#elif defined(SWIFTEN_PLATFORM_LINUX)
notifier_ = new FreeDesktopNotifier(SWIFT_APPLICATION_NAME);
#else
notifier_ = new NullNotifier();
#endif
+ // Ugly, because the dock depends on the tray, but the temporary
+ // multi-account hack creates one tray per account.
+ QtSystemTray* systemTray = new QtSystemTray();
+ systemTrays_.push_back(systemTray);
+
#if defined(SWIFTEN_PLATFORM_MACOSX)
dock_ = new MacOSXDock(&cocoaApplication_);
+#elif defined(SWIFTEN_PLATFORM_WINDOWS)
+ dock_ = new WindowsDock(systemTray->getQSystemTrayIcon(), notifier_);
#else
dock_ = new NullDock();
#endif
@@ -123,9 +133,11 @@ QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThrea
}
for (int i = 0; i < numberOfAccounts; i++) {
- QtSystemTray* systemTray = new QtSystemTray();
- systemTrays_.push_back(systemTray);
- QtUIFactory* uiFactory = new QtUIFactory(settings_, tabs_, splitter_, systemTray, chatWindowFactory_, startMinimized);
+ if (i > 0) {
+ // Don't add the first tray (see note above)
+ systemTrays_.push_back(new QtSystemTray());
+ }
+ QtUIFactory* uiFactory = new QtUIFactory(settings_, tabs_, splitter_, systemTrays_[i], chatWindowFactory_, startMinimized);
uiFactories_.push_back(uiFactory);
MainController* mainController = new MainController(
&clientMainThreadCaller_,
@@ -152,6 +164,9 @@ QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThrea
QtSwift::~QtSwift() {
delete notifier_;
+#if defined(HAVE_SNARL)
+ delete notifierWindow_;
+#endif
delete autoUpdater_;
foreach (QtUIFactory* factory, uiFactories_) {
delete factory;
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index f241fd0..b674802 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -71,5 +71,8 @@ namespace Swift {
#if defined(SWIFTEN_PLATFORM_MACOSX)
CocoaApplication cocoaApplication_;
#endif
+#if defined(HAVE_SNARL)
+ Win32NotifierWindow* notifierWindow_;
+#endif
};
}
diff --git a/Swift/QtUI/QtSystemTray.h b/Swift/QtUI/QtSystemTray.h
index a49357e..cc7321b 100644
--- a/Swift/QtUI/QtSystemTray.h
+++ b/Swift/QtUI/QtSystemTray.h
@@ -22,6 +22,10 @@ namespace Swift {
void setUnreadMessages(bool some);
void setStatusType(StatusShow::Type type);
void setConnecting();
+ QSystemTrayIcon* getQSystemTrayIcon() {
+ return trayIcon_;
+ }
+
signals:
void clicked();
private slots: