Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Notification Center as a handler for user notifications
close #867
- Loading branch information
Showing
6 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// QSNotificationCenterNotifier.h | ||
// Quicksilver | ||
// | ||
// Created by Rob McBroom on 2012/09/20. | ||
// | ||
// Display notifications using Notification Center introduced with 10.8 | ||
// | ||
|
||
@interface QSNotificationCenterNotifier : NSObject <QSNotifier> | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// QSNotificationCenterNotifier.m | ||
// Quicksilver | ||
// | ||
// Created by Rob McBroom on 2012/09/20. | ||
// | ||
// | ||
|
||
#import "QSNotificationCenterNotifier.h" | ||
|
||
@implementation QSNotificationCenterNotifier | ||
|
||
- (void)displayNotificationWithAttributes:(NSDictionary *)attributes | ||
{ | ||
NSString *title = [attributes objectForKey:QSNotifierTitle]; | ||
NSString *subtitle = [attributes objectForKey:QSNotifierText]; | ||
NSString *details = [[attributes objectForKey:QSNotifierDetails] string]; | ||
|
||
NSUserNotification *message = [[NSUserNotification alloc] init]; | ||
[message setTitle:title]; | ||
[message setSubtitle:subtitle]; | ||
[message setInformativeText:details]; | ||
|
||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:message]; | ||
[message release]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters