Bumping to version 1.0.1, which uses the latest ITKit. This resolves GrowlITTSW bug #4.
[GrowlITTSW.git] / GrowlITTSWDisplay.m
1 #import "GrowlITTSWDisplay.h"
2 #import "GrowlITTSWController.h"
3 #import "GrowlITTSWPrefs.h"
4 #import "GrowlDefines.h"
5 #import "GrowlDefinesInternal.h"
6 #import "GrowlApplicationNotification.h"
7
8 @implementation GrowlITTSWDisplay
9
10 - (void) dealloc {
11         [preferencePane release];
12         [super dealloc];
13 }
14
15 - (NSPreferencePane *) preferencePane {
16         if (!preferencePane) {
17                 preferencePane = [[GrowlITTSWPrefs alloc] initWithBundle:[NSBundle bundleWithIdentifier:@"com.ithinksw.growl-ittsw"]];
18         }
19         return preferencePane;
20 }
21
22 //we implement requiresPositioning entirely because it was added as a requirement for doing 1.1 plugins, however
23 //we don't really care if positioning is required or not, because we are only ever in the menubar.
24 - (BOOL)requiresPositioning {
25         return NO;
26 }
27
28 #pragma mark -
29 - (void) displayNotification:(GrowlApplicationNotification *)notification {
30         NSDictionary *dict = [notification dictionaryRepresentation];
31         NSString *title = [dict objectForKey:GROWL_NOTIFICATION_TITLE];
32         NSString *desc = [dict objectForKey:GROWL_NOTIFICATION_DESCRIPTION];
33         NSImage *image = [dict objectForKey:GROWL_NOTIFICATION_ICON];
34         [[GrowlITTSWController sharedController] showWindowWithTitle:title desc:desc image:image];
35 }
36
37 @end