diff options
author | Jens Verwiebe <info@jensverwiebe.de> | 2014-10-23 16:20:06 +0400 |
---|---|---|
committer | Jens Verwiebe <info@jensverwiebe.de> | 2014-10-23 16:20:16 +0400 |
commit | b6dc15278c315b1929e2b5df00a8f5c48b6310b5 (patch) | |
tree | ea7c5ce973bd49d3d8ac8546aa91da607f2c2baa /intern | |
parent | dbea73a30fc60f54449302a131a9d858f0c28bba (diff) |
OSX: move notification into its own function
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 44b3c5b2a81..774008be77b 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -1326,7 +1326,16 @@ GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress) return GHOST_kSuccess; } - +static void postNotification() +{ + NSUserNotification *notification = [[NSUserNotification alloc] init]; + notification.title = @"Blender progress notification"; + notification.informativeText = @"Calculation is finished"; + notification.soundName = NSUserNotificationDefaultSoundName; + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; + [notification release]; +} + GHOST_TSuccess GHOST_WindowCocoa::endProgressBar() { if (!m_progressBarVisible) return GHOST_kFailure; @@ -1346,12 +1355,7 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar() // 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]; - [notification release]; + postNotification(); } [dockIcon release]; @@ -1362,6 +1366,7 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar() + #pragma mark Cursor handling void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) const |