From be7e9559a3973122649f5d42c25149750314c902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Wed, 15 Sep 2010 10:46:11 +0200 Subject: Added system message to notifier. diff --git a/SwifTools/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp index 7ea7193..0527ef8 100644 --- a/SwifTools/Notifier/GrowlNotifier.cpp +++ b/SwifTools/Notifier/GrowlNotifier.cpp @@ -4,7 +4,6 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -// FIXME: Is it safe to pass boost::function by raw values? // FIXME: Should we release the strings created in the constructor? #include @@ -53,11 +52,13 @@ GrowlNotifier::GrowlNotifier(const String& name) { CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactUnavailable))); CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactStatusChange))); CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(IncomingMessage))); + CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(SystemMessage))); // Default Notifications CFMutableArrayRef defaultNotifications = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactAvailable))); CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(IncomingMessage))); + CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(SystemMessage))); // Initialize delegate InitGrowlDelegate(&delegate_); @@ -97,6 +98,7 @@ String GrowlNotifier::typeToString(Type type) { 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 ""; diff --git a/SwifTools/Notifier/Notifier.h b/SwifTools/Notifier/Notifier.h index 7eb09f4..3e3da8a 100644 --- a/SwifTools/Notifier/Notifier.h +++ b/SwifTools/Notifier/Notifier.h @@ -15,7 +15,7 @@ namespace Swift { public: virtual ~Notifier(); - enum Type { ContactAvailable, ContactUnavailable, ContactStatusChange, IncomingMessage }; + enum Type { ContactAvailable, ContactUnavailable, ContactStatusChange, IncomingMessage, SystemMessage }; /** * Picture is a PNG image. -- cgit v0.10.2-6-g49f6