diff options
author | stuconnolly <stuart02@gmail.com> | 2009-04-11 15:49:04 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-04-11 15:49:04 +0000 |
commit | 40a49b30a8feaf8f0cdd7a084d9843ce7d6da77f (patch) | |
tree | 2dbf62b1d4044f35dba58234642c972effe57242 | |
parent | a0cd9ef61ebcd6d360c167dc25939c1d1bc6ffb2 (diff) | |
download | sequelpro-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.
-rw-r--r-- | Source/SPGrowlController.h | 1 | ||||
-rw-r--r-- | Source/SPGrowlController.m | 33 | ||||
-rw-r--r-- | sequel-pro.xcodeproj/project.pbxproj | 2 |
3 files changed, 19 insertions, 17 deletions
diff --git a/Source/SPGrowlController.h b/Source/SPGrowlController.h index 2ad73e8b..7b604e30 100644 --- a/Source/SPGrowlController.h +++ b/Source/SPGrowlController.h @@ -30,5 +30,6 @@ // Post notification - (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name; +- (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name iconData:(NSData *)data priority:(int)priority isSticky:(BOOL)sticky clickContext:(id)clickContext; @end 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 diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 83d5c308..518b1822 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -425,9 +425,9 @@ 17E641430EF01E90001BC333 /* Resources */ = { isa = PBXGroup; children = ( - 296DC8D10F90950C002A3258 /* sequel-pro-print-template.html */, 17E6418B0EF01FF7001BC333 /* Images */, 1703EF2A0F0B0742005BBE7E /* english_help */, + 296DC8D10F90950C002A3258 /* sequel-pro-print-template.html */, B58731270F838C9E00087794 /* PreferenceDefaults.plist */, 17E641F60EF02088001BC333 /* Info.plist */, 17E6423C0EF0218B001BC333 /* InfoPlist.strings */, |