Browse files

Use Notification Center on Mountain Lion

  • Loading branch information...
1 parent a314d69 commit 3f087d8a92cffd9cc38766a32baaf3625ac820d8 @viveksjain committed Dec 13, 2012
Showing with 16 additions and 9 deletions.
  1. +1 −1 Heracles.xcodeproj/project.pbxproj
  2. +15 −8 Heracles/HeraclesAppDelegate.m
View
2 Heracles.xcodeproj/project.pbxproj
@@ -324,7 +324,7 @@
GCC_PREFIX_HEADER = "Heracles/Heracles-Prefix.pch";
INFOPLIST_FILE = "Heracles/Heracles-Info.plist";
PRODUCT_NAME = Heracles;
- SDKROOT = macosx10.7;
+ SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Release;
View
23 Heracles/HeraclesAppDelegate.m
@@ -611,14 +611,21 @@ - (void)notify:(NSString *)message {
NSString *title;
if ([self isSuccessfulMessage:message]) title = @"Authenticated";
else title = @"Error Authenticating";
- [GrowlApplicationBridge
- notifyWithTitle:title
- description:message
- notificationName:title
- iconData:nil
- priority:0
- isSticky:NO
- clickContext:nil];
+ if (NSClassFromString(@"NSUserNotification") != nil) {
+ NSUserNotification *notification = [[NSUserNotification alloc] init];
+ [notification setTitle:title];
+ [notification setInformativeText:message];
+ [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:notification];
+ } else {
+ [GrowlApplicationBridge
+ notifyWithTitle:title
+ description:message
+ notificationName:title
+ iconData:nil
+ priority:0
+ isSticky:NO
+ clickContext:nil];
+ }
if (exitAfterNotify) exit(1);
}

0 comments on commit 3f087d8

Please sign in to comment.