[Bf-blender-cvs] [b6dc152] master: OSX: move notification into its own function
Jens Verwiebe
noreply at git.blender.org
Thu Oct 23 14:20:28 CEST 2014
Commit: b6dc15278c315b1929e2b5df00a8f5c48b6310b5
Author: Jens Verwiebe
Date: Thu Oct 23 14:20:06 2014 +0200
Branches: master
https://developer.blender.org/rBb6dc15278c315b1929e2b5df00a8f5c48b6310b5
OSX: move notification into its own function
===================================================================
M intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 44b3c5b..774008b 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
More information about the Bf-blender-cvs
mailing list