aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-10-03 21:47:55 +0000
committerrowanbeentje <rowan@beent.je>2009-10-03 21:47:55 +0000
commitd794d105545e92a75bdaf697580ee7f12b566531 (patch)
tree18a8cf4bc60380284d28b151eb89357cf0df76bd /Source/TableDump.m
parent7abd1679730327d15a33cc516e84e0e368f53696 (diff)
downloadsequelpro-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/TableDump.m')
-rw-r--r--Source/TableDump.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 346ae099..7a02964a 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -247,6 +247,9 @@
if ( returnCode != NSOKButton )
return;
+ // Start the notification timer to allow notifications to be shown even if frontmost for long queries
+ [[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Export Finished"];
+
// Save path to preferences
[prefs setObject:[sheet directory] forKey:@"savePath"];
@@ -400,6 +403,7 @@
// Export finished Growl notification
[[SPGrowlController sharedGrowlController] notifyWithTitle:@"Export Finished"
description:[NSString stringWithFormat:NSLocalizedString(@"Finished exporting to %@",@"description for finished exporting growl notification"), [[sheet filename] lastPathComponent]]
+ window:tableWindow
notificationName:@"Export Finished"];
}
@@ -487,6 +491,9 @@
NSStringEncoding sqlEncoding = NSUTF8StringEncoding;
NSCharacterSet *whitespaceAndNewlineCharset = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ // Start the notification timer to allow notifications to be shown even if frontmost for long queries
+ [[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Import Finished"];
+
// Open a filehandle for the SQL file
sqlFileHandle = [NSFileHandle fileHandleForReadingAtPath:filename];
if (!sqlFileHandle) {
@@ -687,6 +694,7 @@
// Import finished Growl notification
[[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished"
description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@",@"description for finished importing growl notification"), [filename lastPathComponent]]
+ window:tableWindow
notificationName:@"Import Finished"];
}
@@ -718,6 +726,9 @@
NSStringEncoding csvEncoding = [MCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
+ // Start the notification timer to allow notifications to be shown even if frontmost for long queries
+ [[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Import Finished"];
+
// Open a filehandle for the CSV file
csvFileHandle = [NSFileHandle fileHandleForReadingAtPath:filename];
if (!csvFileHandle) {
@@ -968,6 +979,7 @@
// Import finished Growl notification
[[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished"
description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@",@"description for finished importing growl notification"), [filename lastPathComponent]]
+ window:tableWindow
notificationName:@"Import Finished"];
// Update the content view