diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-15 16:40:20 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-15 16:41:16 (GMT) |
commit | c0ea59aed73b5425ad78e6bdb6f8f12e2b44567e (patch) | |
tree | bc111c071c92911d7e9745c86c8cdfac69cd64e7 /SwifTools/Notifier/GrowlNotifier.cpp | |
parent | 3c45ed7c3b62609824c0ea50f1ce9c00bbe00849 (diff) | |
download | swift-contrib-c0ea59aed73b5425ad78e6bdb6f8f12e2b44567e.zip swift-contrib-c0ea59aed73b5425ad78e6bdb6f8f12e2b44567e.tar.bz2 |
Added Snarl notification support
Diffstat (limited to 'SwifTools/Notifier/GrowlNotifier.cpp')
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/SwifTools/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp index 0527ef8..0660910 100644 --- a/SwifTools/Notifier/GrowlNotifier.cpp +++ b/SwifTools/Notifier/GrowlNotifier.cpp @@ -71,7 +71,10 @@ GrowlNotifier::GrowlNotifier(const String& name) { Growl_SetDelegate(&delegate_); } -void GrowlNotifier::showMessage(Type type, const String& subject, const String& description, const ByteArray& picture, boost::function<void()> callback) { +void GrowlNotifier::showMessage(Type type, const String& subject, const String& description, const boost::filesystem::path& picturePath, boost::function<void()> callback) { + ByteArray picture; + picture.readFromFile(picturePath.string()); + CFStringRef cfSubject = SWIFTEN_STRING_TO_CFSTRING(subject); CFStringRef cfDescription = SWIFTEN_STRING_TO_CFSTRING(description); CFStringRef cfName = SWIFTEN_STRING_TO_CFSTRING(typeToString(type)); @@ -92,16 +95,4 @@ void GrowlNotifier::showMessage(Type type, const String& subject, const String& CFRelease(cfSubject); } -String GrowlNotifier::typeToString(Type type) { - switch (type) { - case ContactAvailable: return "Contact Becomes Available"; - case ContactUnavailable: return "Contact Becomes Unavailable"; - case ContactStatusChange: return "Contact Changes Status"; - case IncomingMessage: return "Incoming Message"; - case SystemMessage: return "System Message"; - } - assert(false); - return ""; -} - } |