From a4ac00795c534d2ee74ad1d3be6facfda9c82b6d Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 8 Oct 2011 22:28:30 +0000 Subject: Add a hidden preference for specifying the long running query notification time (currently in milliseconds). Implements issue #944 --- Source/SPGrowlController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/SPGrowlController.m') 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; } -- cgit v1.2.3