diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-12 16:21:36 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-12 21:39:01 (GMT) |
commit | 3ae8cccfe9c6bfed5dda5f024a5cb046ccfc9793 (patch) | |
tree | cf58a21d66725dead1cda2d029b19b04d5f30e0c | |
parent | 326c0620a103d621bcdd74341cd0117816acca03 (diff) | |
download | swift-contrib-3ae8cccfe9c6bfed5dda5f024a5cb046ccfc9793.zip swift-contrib-3ae8cccfe9c6bfed5dda5f024a5cb046ccfc9793.tar.bz2 |
Move Notifier to SwifTools
-rw-r--r-- | BuildTools/SCons/SConstruct | 16 | ||||
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.cpp (renamed from Swiften/Notifier/GrowlNotifier.cpp) | 2 | ||||
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.h (renamed from Swiften/Notifier/GrowlNotifier.h) | 2 | ||||
-rw-r--r-- | SwifTools/Notifier/Notifier.cpp (renamed from Swiften/Notifier/Notifier.cpp) | 2 | ||||
-rw-r--r-- | SwifTools/Notifier/Notifier.h (renamed from Swiften/Notifier/Notifier.h) | 0 | ||||
-rw-r--r-- | SwifTools/Notifier/NullNotifier.h | 17 | ||||
-rw-r--r-- | SwifTools/Notifier/SConscript | 13 | ||||
-rw-r--r-- | SwifTools/SConscript | 1 | ||||
-rw-r--r-- | Swift/Controllers/MainController.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/MainController.h | 3 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.cpp | 11 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 3 | ||||
-rw-r--r-- | Swiften/SConscript | 2 |
14 files changed, 71 insertions, 5 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index a67817a..5a8791b 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -363,6 +363,22 @@ if env["PLATFORM"] == "darwin" : env["SPARKLE_FRAMEWORK"] = "/Library/Frameworks/Sparkle.framework" conf.Finish() +# Growl +env["HAVE_GROWL"] = 0 +if env["PLATFORM"] == "darwin" : + growl_flags = { + "FRAMEWORKPATH": ["/Library/Frameworks"], + "FRAMEWORKS": ["Growl"] + } + growl_env = conf_env.Clone() + growl_env.MergeFlags(growl_flags) + conf = Configure(growl_env, custom_tests = { "CheckObjCHeader" : checkObjCHeader }) + if conf.CheckObjCHeader("Growl/Growl.h") : + env["HAVE_GROWL"] = 1 + env["GROWL_FLAGS"] = growl_flags + env["GROWL_FRAMEWORK"] = "/Library/Frameworks/Growl.framework" + conf.Finish() + # LibXML conf = Configure(conf_env) if conf.CheckCHeader("libxml/parser.h") and conf.CheckLib("xml2") : diff --git a/Swiften/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp index 8f92b04..4c671ac 100644 --- a/Swiften/Notifier/GrowlNotifier.cpp +++ b/SwifTools/Notifier/GrowlNotifier.cpp @@ -10,7 +10,7 @@ #include <cassert> #include "Swiften/Base/ByteArray.h" -#include "Swiften/Notifier/GrowlNotifier.h" +#include "SwifTools/Notifier/GrowlNotifier.h" #pragma GCC diagnostic ignored "-Wold-style-cast" diff --git a/Swiften/Notifier/GrowlNotifier.h b/SwifTools/Notifier/GrowlNotifier.h index 5743fe5..fab3b5e 100644 --- a/Swiften/Notifier/GrowlNotifier.h +++ b/SwifTools/Notifier/GrowlNotifier.h @@ -9,7 +9,7 @@ #include <CoreFoundation/CoreFoundation.h> #include <Growl/Growl.h> -#include "Swiften/Notifier/Notifier.h" +#include "SwifTools/Notifier/Notifier.h" namespace Swift { /** diff --git a/Swiften/Notifier/Notifier.cpp b/SwifTools/Notifier/Notifier.cpp index 44e7b32..2c2cfe5 100644 --- a/Swiften/Notifier/Notifier.cpp +++ b/SwifTools/Notifier/Notifier.cpp @@ -4,7 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Notifier/Notifier.h" +#include "SwifTools/Notifier/Notifier.h" namespace Swift { diff --git a/Swiften/Notifier/Notifier.h b/SwifTools/Notifier/Notifier.h index 7eb09f4..7eb09f4 100644 --- a/Swiften/Notifier/Notifier.h +++ b/SwifTools/Notifier/Notifier.h diff --git a/SwifTools/Notifier/NullNotifier.h b/SwifTools/Notifier/NullNotifier.h new file mode 100644 index 0000000..d278e4f --- /dev/null +++ b/SwifTools/Notifier/NullNotifier.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include "SwifTools/Notifier/Notifier.h" + +namespace Swift { + class NullNotifier : public Notifier { + public: + virtual void showMessage(Type, const String&, const String&, const ByteArray&, boost::function<void()>) { + } + }; +} diff --git a/SwifTools/Notifier/SConscript b/SwifTools/Notifier/SConscript new file mode 100644 index 0000000..89fc31b --- /dev/null +++ b/SwifTools/Notifier/SConscript @@ -0,0 +1,13 @@ +Import("swiftools_env") + +sources = [ + "Notifier.cpp", + ] + +if swiftools_env.get("HAVE_GROWL", False) : + sources += [ + "GrowlNotifier.cpp", + ] + +objects = swiftools_env.StaticObject(sources) +swiftools_env.Append(SWIFTOOLS_OBJECTS = objects) diff --git a/SwifTools/SConscript b/SwifTools/SConscript index 2675b9f..6b9b727 100644 --- a/SwifTools/SConscript +++ b/SwifTools/SConscript @@ -48,6 +48,7 @@ if env["SCONS_STAGE"] == "build" : SConscript(dirs = [ "Dock", + "Notifier", "Idle/IdleQuerierTest", "Idle/UnitTest", "UnitTest" diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index d4222e3..834dacd 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -83,6 +83,7 @@ MainController::MainController( CapsStorage* capsStorage, VCardStorageFactory* vcardStorageFactory, Dock* dock, + Notifier* notifier, bool useDelayForLatency) : timerFactory_(&boostIOServiceThread_.getIOService()), idleDetector_(&idleQuerier_, &timerFactory_, 100), @@ -114,6 +115,7 @@ MainController::MainController( mucSearchWindowFactory_ = mucSearchWindowFactory; eventWindowFactory_ = eventWindowFactory; dock_ = dock; + notifier_ = notifier; chatListWindowFactory_ = chatListWindowFactory; uiEventStream_ = new UIEventStream(); diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h index 7aad4a0..7fbf54f 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/MainController.h @@ -54,6 +54,7 @@ namespace Swift { class SoftwareVersionResponder; class LoginWindowFactory; class MUCController; + class Notifier; class PresenceOracle; class SystemTray; class SystemTrayController; @@ -88,6 +89,7 @@ namespace Swift { CapsStorage* capsStorage, VCardStorageFactory* vcardStorageFactory, Dock* dock, + Notifier* notifier, bool useDelayForLatency); ~MainController(); @@ -134,6 +136,7 @@ namespace Swift { VCardStorageFactory* vcardStorageFactory_; VCardManager* vcardManager_; Dock* dock_; + Notifier* notifier_; ChatController* chatController_; XMPPRosterController* xmppRosterController_; RosterController* rosterController_; diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp index 758fe29..ee97fc6 100644 --- a/Swift/QtUI/QtSwift.cpp +++ b/Swift/QtUI/QtSwift.cpp @@ -36,6 +36,11 @@ #include "Swift/Controllers/BuildVersion.h" #include "SwifTools/AutoUpdater/AutoUpdater.h" #include "SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h" +#if defined(HAVE_GROWL) +#include "SwifTools/Notifier/GrowlNotifier.h" +#else +#include "SwifTools/Notifier/NullNotifier.h" +#endif #if defined(SWIFTEN_PLATFORM_MACOSX) #include "SwifTools/Dock/MacOSXDock.h" #else @@ -90,6 +95,11 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) { capsStorage_ = new CapsFileStorage(applicationPathProvider_->getDataDir() / "caps"); chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_, ""); soundPlayer_ = new QtSoundPlayer(applicationPathProvider_); +#if defined(HAVE_GROWL) + notifier_ = new GrowlNotifier(SWIFT_APPLICATION_NAME); +#else + notifier_ = new NullNotifier(); +#endif #if defined(SWIFTEN_PLATFORM_MACOSX) dock_ = new MacOSXDock(&cocoaApplication_); @@ -131,6 +141,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) { capsStorage_, vcardStorageFactory_, dock_, + notifier_, options.count("latency-debug") > 0); mainControllers_.push_back(mainController); } diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h index 657b749..abc8c75 100644 --- a/Swift/QtUI/QtSwift.h +++ b/Swift/QtUI/QtSwift.h @@ -27,6 +27,7 @@ class QSplitter; namespace Swift { class Dock; + class Notifier; class VCardStorageFactory; class AutoUpdater; class ApplicationPathProvider; @@ -70,6 +71,7 @@ namespace Swift { CapsStorage* capsStorage_; VCardStorageFactory* vcardStorageFactory_; AutoUpdater* autoUpdater_; + Notifier* notifier_; #if defined(SWIFTEN_PLATFORM_MACOSX) CocoaApplication cocoaApplication_; #endif diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 9f08f4f..bf9e5cf 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -35,6 +35,9 @@ myenv.MergeFlags(env["ZLIB_FLAGS"]) myenv.MergeFlags(env["OPENSSL_FLAGS"]) myenv.MergeFlags(env.get("LIBXML_FLAGS", "")) myenv.MergeFlags(env.get("EXPAT_FLAGS", "")) +if myenv.get("HAVE_GROWL", False) : + myenv.MergeFlags(myenv["GROWL_FLAGS"]) + myenv.Append(CPPDEFINES = ["HAVE_GROWL"]) myenv.MergeFlags(myenv["PLATFORM_FLAGS"]) myenv.Tool("qt4", toolpath = ["#/BuildTools/SCons/Tools"]) diff --git a/Swiften/SConscript b/Swiften/SConscript index 7689ffc..11c976e 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -43,7 +43,6 @@ if env["SCONS_STAGE"] == "build" : "MUC/MUCOccupant.cpp", "MUC/MUCRegistry.cpp", "MUC/MUCBookmarkManager.cpp", - "Notifier/Notifier.cpp", "Presence/PresenceOracle.cpp", "Presence/PresenceSender.cpp", "Queries/IQChannel.cpp", @@ -107,7 +106,6 @@ if env["SCONS_STAGE"] == "build" : "StringCodecs/PBKDF2.cpp", "StringCodecs/Hexify.cpp", ] -# "Notifier/GrowlNotifier.cpp", if myenv.get("HAVE_OPENSSL", 0) : sources += ["TLS/OpenSSL/OpenSSLContext.cpp"] |