-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrowlITTSWDisplay.m
More file actions
37 lines (31 loc) · 1.19 KB
/
GrowlITTSWDisplay.m
File metadata and controls
37 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#import "GrowlITTSWDisplay.h"
#import "GrowlITTSWController.h"
#import "GrowlITTSWPrefs.h"
#import "GrowlDefines.h"
#import "GrowlDefinesInternal.h"
#import "GrowlApplicationNotification.h"
@implementation GrowlITTSWDisplay
- (void) dealloc {
[preferencePane release];
[super dealloc];
}
- (NSPreferencePane *) preferencePane {
if (!preferencePane) {
preferencePane = [[GrowlITTSWPrefs alloc] initWithBundle:[NSBundle bundleWithIdentifier:@"com.ithinksw.growl-ittsw"]];
}
return preferencePane;
}
//we implement requiresPositioning entirely because it was added as a requirement for doing 1.1 plugins, however
//we don't really care if positioning is required or not, because we are only ever in the menubar.
- (BOOL)requiresPositioning {
return NO;
}
#pragma mark -
- (void) displayNotification:(GrowlApplicationNotification *)notification {
NSDictionary *dict = [notification dictionaryRepresentation];
NSString *title = [dict objectForKey:GROWL_NOTIFICATION_TITLE];
NSString *desc = [dict objectForKey:GROWL_NOTIFICATION_DESCRIPTION];
NSImage *image = [dict objectForKey:GROWL_NOTIFICATION_ICON];
[[GrowlITTSWController sharedController] showWindowWithTitle:title desc:desc image:image];
}
@end