aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-04-12 13:48:05 +0000
committerBibiko <bibiko@eva.mpg.de>2010-04-12 13:48:05 +0000
commitba9e5fc5c311e756c6a1e1e7294d2c719d5b4709 (patch)
treece6e740c14de92ee8c101513ba8960104ae9c16b
parentc642c194f391442f7d20f6f33c6a9ffb2a641447 (diff)
downloadsequelpro-ba9e5fc5c311e756c6a1e1e7294d2c719d5b4709.tar.gz
sequelpro-ba9e5fc5c311e756c6a1e1e7294d2c719d5b4709.tar.bz2
sequelpro-ba9e5fc5c311e756c6a1e1e7294d2c719d5b4709.zip
• Export compressed mysql dump
- first fixes to support sql.gz extension better in the NSSavePanel
-rw-r--r--Source/TableDump.m16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 8d56a1d7..d74eacea 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -169,7 +169,7 @@
[self reloadTables:self];
[sqlCompressionSwitch setState:[prefs boolForKey:SPSQLExportUseCompression]?NSOnState:NSOffState];
if ([prefs boolForKey:SPSQLExportUseCompression]) {
- [currentExportPanel setRequiredFileType:@"gz"];
+ [currentExportPanel setRequiredFileType:@"sql.gz"];
} else {
[currentExportPanel setRequiredFileType:@"sql"];
}
@@ -265,6 +265,18 @@
[currentExportPanel beginSheetForDirectory:[prefs objectForKey:@"savePath"]
file:file modalForWindow:tableWindow modalDelegate:self
didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:contextInfo];
+
+
+ // Wait for the SavePanel and check for '.sql.gz' extension; if so - select only the path name without any extensions
+ while(![currentExportPanel isVisible]) { usleep(100); }
+ 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];
+ }
+ }
}
/**
@@ -3151,7 +3163,7 @@
{
if (exportMode == SPExportingSQL) {
if ([sender state] == NSOnState) {
- [currentExportPanel setAllowedFileTypes:[NSArray arrayWithObject:@"gz"]];
+ [currentExportPanel setAllowedFileTypes:[NSArray arrayWithObjects:@"sql.gz", @"gz", nil]];
} else {
[currentExportPanel setAllowedFileTypes:[NSArray arrayWithObject:@"sql"]];
}