diff options
author | rowanbeentje <rowan@beent.je> | 2009-10-03 21:47:55 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-10-03 21:47:55 +0000 |
commit | d794d105545e92a75bdaf697580ee7f12b566531 (patch) | |
tree | 18a8cf4bc60380284d28b151eb89357cf0df76bd /Source/CustomQuery.m | |
parent | 7abd1679730327d15a33cc516e84e0e368f53696 (diff) | |
download | sequelpro-d794d105545e92a75bdaf697580ee7f12b566531.tar.gz sequelpro-d794d105545e92a75bdaf697580ee7f12b566531.tar.bz2 sequelpro-d794d105545e92a75bdaf697580ee7f12b566531.zip |
Improve Growl interaction to reduce general Growl spammage and improve functionality:
- Growls are now only shown by default if they are not fired from the frontmost window
- Long-running tasks (>3 secs) will still Growl
- Clicking on a Growl will now bring the associated window to the front
This addresses the original concerns of Issue #98.
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 3f2afc2f..f04f9fd1 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -350,6 +350,9 @@ // Notify listeners that a query has started [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self]; + // Start the notification timer to allow notifications to be shown even if frontmost for long queries + [[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Query Finished"]; + // Reset the current table view as necessary to avoid redraw and reload issues. // Restore the view position to the top left to be within the results for all datasets. [customQueryView scrollRowToVisible:0]; @@ -585,6 +588,7 @@ // If no results were returned, redraw the empty table and post notifications before returning. if ( ![fullResult count] ) { [customQueryView reloadData]; + [streamingResult release]; // Notify any listeners that the query has completed [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; @@ -592,9 +596,8 @@ // Perform the Growl notification for query completion [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Query Finished" description:[NSString stringWithFormat:NSLocalizedString(@"%@",@"description for query finished growl notification"), [errorText stringValue]] + window:tableWindow notificationName:@"Query Finished"]; - - [streamingResult release]; return; } @@ -673,6 +676,7 @@ // Query finished Growl notification [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Query Finished" description:[NSString stringWithFormat:NSLocalizedString(@"%@",@"description for query finished growl notification"), [errorText stringValue]] + window:tableWindow notificationName:@"Query Finished"]; } |