Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2014-10-22 21:59:00 +0400
committerJens Verwiebe <info@jensverwiebe.de>2014-10-22 21:59:16 +0400
commitdfc0afb5b8b2cf432159bf801733f97d3dbdc495 (patch)
treee7deb018115d0bde73dfd1154c44ac3a253b5901 /intern
parent553ec988e7a44046c86ec1528c357269e4f23f7f (diff)
OSX/GHOST: use notifications to inform user about a progress reached 100%
The occurance can be controlled in NotificationCenter, todo: move to own function ?
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 7e589cb74eb..f95a23f358d 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -1339,6 +1339,20 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
[[NSImage imageNamed:@"NSApplicationIcon"] drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
[dockIcon unlockFocus];
[NSApp setApplicationIconImage:dockIcon];
+
+
+ // With OSX 10.8 and later, we can use notifications to inform the user when the progress reached 100%
+ // Atm. just fire this when the progressbar ends, the behavior is controlled in the NotificationCenter
+ // If Blender is not frontmost window, a message pops up with sound, in any case an entry in notifications
+
+ if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) {
+ NSUserNotification *notification = [[NSUserNotification alloc] init];
+ notification.title = @"Blender progress notification";
+ notification.informativeText = @"Calculation ended";
+ notification.soundName = NSUserNotificationDefaultSoundName;
+ [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
+ }
+
[dockIcon release];
[pool drain];