-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrowlSender.m
57 lines (46 loc) · 1.67 KB
/
GrowlSender.m
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// GrowlSender.m
// CocoBit
//
// Created by Dmitry Krassovski on 28.04.09.
// Copyright 2009 Getalime. All rights reserved.
//
#import "GrowlSender.h"
#import "GrowlConstants.h"
@implementation GrowlSender
- (void) initializeGrowl
{
growlReady = YES;
// Tells the Growl framework that this class will receive callbacks
[GrowlApplicationBridge setGrowlDelegate:self];
}
- (NSDictionary*) registrationDictionaryForGrowl
{
// For this application, only one notification is registered
NSArray* defaultNotifications = [NSArray arrayWithObjects:growlTestNotification, nil];
NSArray* allNotifications = [NSArray arrayWithObjects:growlTestNotification, nil];
NSDictionary* growlRegistration = [NSDictionary dictionaryWithObjectsAndKeys:
defaultNotifications, GROWL_NOTIFICATIONS_DEFAULT,
allNotifications, GROWL_NOTIFICATIONS_ALL, nil];
return growlRegistration;
}
- (void)growlString:(NSString *) string
{
[GrowlApplicationBridge notifyWithTitle: @"Bit.ly client"
description: string
notificationName:growlTestNotification
iconData:nil
priority:3
isSticky: NO
clickContext: nil ];
/*
[GrowlApplicationBridge notifyWithTitle:[notifyWithTitle stringValue]
description:[description stringValue]
notificationName:growlTestNotification
iconData:[[iconData image] TIFFRepresentation]
priority:[priority intValue]
isSticky:[isSticky state] == NSOnState ? YES : NO
clickContext:[clickContextButton state] == NSOnState ? [NSDate date] : nil];
*/
}
@end