summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/Notifier/NotificationCenterNotifier.mm')
-rw-r--r--SwifTools/Notifier/NotificationCenterNotifier.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/SwifTools/Notifier/NotificationCenterNotifier.mm b/SwifTools/Notifier/NotificationCenterNotifier.mm
index df092ff..28cacb6 100644
--- a/SwifTools/Notifier/NotificationCenterNotifier.mm
+++ b/SwifTools/Notifier/NotificationCenterNotifier.mm
@@ -50,12 +50,17 @@ NotificationCenterNotifier::NotificationCenterNotifier() {
NotificationCenterNotifier::~NotificationCenterNotifier() {
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate: nil];
p->callbacksForNotifications.clear();
}
void NotificationCenterNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function<void ()> callback) {
+ std::vector<Notifier::Type> defaultTypes = getDefaultTypes();
+ if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) {
+ return;
+ }
+
NSUserNotification* notification = [[NSUserNotification alloc] init];
notification.title = STD2NSSTRING(typeToString(type));
notification.subtitle = STD2NSSTRING(subject);
notification.informativeText = STD2NSSTRING(description);
notification.contentImage = [[NSImage alloc] initWithContentsOfFile: STD2NSSTRING(picture.string())];