diff options
author | stuconnolly <stuart02@gmail.com> | 2011-10-08 22:28:30 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-10-08 22:28:30 +0000 |
commit | a4ac00795c534d2ee74ad1d3be6facfda9c82b6d (patch) | |
tree | 0141127b68c0bf0b7e1e2b2ccfcb0c3615b866ac /Source/SPGrowlController.m | |
parent | 4c2a3a4692a1931a57cf6f9566ff9bdd92e3d261 (diff) | |
download | sequelpro-a4ac00795c534d2ee74ad1d3be6facfda9c82b6d.tar.gz sequelpro-a4ac00795c534d2ee74ad1d3be6facfda9c82b6d.tar.bz2 sequelpro-a4ac00795c534d2ee74ad1d3be6facfda9c82b6d.zip |
Add a hidden preference for specifying the long running query notification time (currently in milliseconds). Implements issue #944
Diffstat (limited to 'Source/SPGrowlController.m')
-rw-r--r-- | Source/SPGrowlController.m | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m index 3f98f41a..3fc27f64 100644 --- a/Source/SPGrowlController.m +++ b/Source/SPGrowlController.m @@ -60,8 +60,11 @@ static SPGrowlController *sharedGrowlController = nil; { if ((self = [super init])) { [GrowlApplicationBridge setGrowlDelegate:self]; + timingNotificationName = nil; timingNotificationStart = 0; + + longRunningQueryNotificationTime = [[NSUserDefaults standardUserDefaults] floatForKey:SPLongRunningQueryNotificationTime]; } return self; @@ -74,7 +77,6 @@ static SPGrowlController *sharedGrowlController = nil; */ - (void)notifyWithTitle:(NSString *)title description:(NSString *)description document:(SPDatabaseDocument *)document notificationName:(NSString *)name { - // Ensure that the delayed notification call is made on the main thread if (![NSThread isMainThread]) { [[self onMainThread] notifyWithTitle:title description:description document:document notificationName:name]; @@ -127,9 +129,10 @@ static SPGrowlController *sharedGrowlController = nil; // if it does, and the time exceeds the threshold, display the notification even for // frontmost windows to provide feedback for long-running tasks. if (timingNotificationName && [timingNotificationName isEqualToString:name]) { - if ([self milliTime] > (SPLongRunningNotificationTime * 1000) + timingNotificationStart) { + if ([self milliTime] > (longRunningQueryNotificationTime * 1000) + timingNotificationStart) { postNotification = YES; } + [timingNotificationName release], timingNotificationName = nil; } |