aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPGrowlController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-04-11 15:49:04 +0000
committerstuconnolly <stuart02@gmail.com>2009-04-11 15:49:04 +0000
commit40a49b30a8feaf8f0cdd7a084d9843ce7d6da77f (patch)
tree2dbf62b1d4044f35dba58234642c972effe57242 /Source/SPGrowlController.m
parenta0cd9ef61ebcd6d360c167dc25939c1d1bc6ffb2 (diff)
downloadsequelpro-40a49b30a8feaf8f0cdd7a084d9843ce7d6da77f.tar.gz
sequelpro-40a49b30a8feaf8f0cdd7a084d9843ce7d6da77f.tar.bz2
sequelpro-40a49b30a8feaf8f0cdd7a084d9843ce7d6da77f.zip
Implement very basic Growl enable/disable preference. Still need to add more complex notification rules.
Diffstat (limited to 'Source/SPGrowlController.m')
-rw-r--r--Source/SPGrowlController.m33
1 files changed, 17 insertions, 16 deletions
diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m
index 4583f33e..853619ff 100644
--- a/Source/SPGrowlController.m
+++ b/Source/SPGrowlController.m
@@ -81,14 +81,13 @@ static SPGrowlController *sharedGrowlController = nil;
*/
- (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name
{
- // Post notification
- [GrowlApplicationBridge notifyWithTitle:title
- description:description
- notificationName:name
- iconData:nil
- priority:0
- isSticky:NO
- clickContext:nil];
+ [self notifyWithTitle:title
+ description:description
+ notificationName:name
+ iconData:nil
+ priority:0
+ isSticky:NO
+ clickContext:nil];
}
/*
@@ -96,14 +95,16 @@ static SPGrowlController *sharedGrowlController = nil;
*/
- (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name iconData:(NSData *)data priority:(int)priority isSticky:(BOOL)sticky clickContext:(id)clickContext
{
- // Post notification
- [GrowlApplicationBridge notifyWithTitle:title
- description:description
- notificationName:name
- iconData:data
- priority:priority
- isSticky:sticky
- clickContext:clickContext];
+ // Post notification only if preference is set
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GrowlEnabled"]) {
+ [GrowlApplicationBridge notifyWithTitle:title
+ description:description
+ notificationName:name
+ iconData:data
+ priority:priority
+ isSticky:sticky
+ clickContext:clickContext];
+ }
}
@end