aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-04-12 14:35:45 +0000
committerBibiko <bibiko@eva.mpg.de>2010-04-12 14:35:45 +0000
commitbc1f5c488f532023c5ebb545449e05409b19cded (patch)
tree7f27cc404795a2c54b09d8b207f42e4be03e3e3c /Source
parent6867d2ec117eaa9537a5e6ccb39fc233d790ba61 (diff)
downloadsequelpro-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)
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDump.m11
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"]];
}