diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-04-12 14:35:45 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-04-12 14:35:45 +0000 |
commit | bc1f5c488f532023c5ebb545449e05409b19cded (patch) | |
tree | 7f27cc404795a2c54b09d8b207f42e4be03e3e3c | |
parent | 6867d2ec117eaa9537a5e6ccb39fc233d790ba61 (diff) | |
download | sequelpro-bc1f5c488f532023c5ebb545449e05409b19cded.tar.gz sequelpro-bc1f5c488f532023c5ebb545449e05409b19cded.tar.bz2 sequelpro-bc1f5c488f532023c5ebb545449e05409b19cded.zip |
preserve path name selection only if user ticks the 'compress dump' checkbox in mysql dump save panel (thanks to rowan)
-rw-r--r-- | Source/TableDump.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index d74eacea..e056208c 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -3164,6 +3164,17 @@ if (exportMode == SPExportingSQL) { if ([sender state] == NSOnState) { [currentExportPanel setAllowedFileTypes:[NSArray arrayWithObjects:@"sql.gz", @"gz", nil]]; + + // if file name text view is the first responder re-select the path name only without '.sql.gz' + if([[currentExportPanel firstResponder] isKindOfClass:[NSTextView class]]) { + NSTextView *filenameTextView = (NSTextView *)[currentExportPanel firstResponder]; + if([filenameTextView selectedRange].length > 4 && [[filenameTextView string] hasSuffix:@".sql.gz"]) { + NSRange selRange = [filenameTextView selectedRange]; + selRange.length -= 4; + [filenameTextView setSelectedRange:selRange]; + } + } + } else { [currentExportPanel setAllowedFileTypes:[NSArray arrayWithObject:@"sql"]]; } |