aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-07-24 21:34:05 +0000
committerstuconnolly <stuart02@gmail.com>2010-07-24 21:34:05 +0000
commitbf1294bd1016672aa3062bb80b546bf2f8037fb3 (patch)
tree121768027638e59af7d5830855bd19b88de7e601 /Source/SPExportController.m
parenteb29a57a6860961c0caa00787d779f4cb4117c90 (diff)
downloadsequelpro-bf1294bd1016672aa3062bb80b546bf2f8037fb3.tar.gz
sequelpro-bf1294bd1016672aa3062bb80b546bf2f8037fb3.tar.bz2
sequelpro-bf1294bd1016672aa3062bb80b546bf2f8037fb3.zip
In addition to Gzip compression support when exporting SQL dumps add the ability to use Bzip2 compression.
Other changes include: + Enable the use of export compression (Gzip and Bzip2) for all export formats. + Move the compression options in the export dialog to the 'Advanced' export settings view. + Simplify the setting of common exporter properties (e.g. the connection, use of compression). + Fix a potential memory leak in the dot exporter. + Update the data importer to recognise Bzip2 compressed files. + Fix several display issues on export dialog. + Restore the default .csv file extension of CSV exports. + Correctly update the default export filename when selecting a output compression type. The addition of Bzip2 compression support implements issue #688.
Diffstat (limited to 'Source/SPExportController.m')
-rw-r--r--Source/SPExportController.m28
1 files changed, 27 insertions, 1 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index 7ccd296d..89f4fdce 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -117,6 +117,9 @@
// Prevents the background colour from changing when clicked
[[exportCustomFilenameViewLabelButton cell] setHighlightsBy:NSNoCellMask];
+ // Set the progress indicator's max value
+ [exportProgressIndicator setMaxValue:(NSInteger)[exportProgressIndicator bounds].size.width];
+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSAllDomainsMask, YES);
// If found the set the default path to the user's desktop, otherwise use their home directory
@@ -523,6 +526,14 @@
}
/**
+ * Updates the default filename extenstion based on the selected output compression format.
+ */
+- (IBAction)changeExportCompressionFormat:(id)sender
+{
+ [self _updateDisplayedExportFilename];
+}
+
+/**
* Toggles the state of the custom filename format token fields.
*/
- (IBAction)toggleCustomFilenameFormatView:(id)sender
@@ -770,7 +781,10 @@
switch (exportType) {
case SPSQLExport:
- extension = ([exportCompressOutputFile state]) ? [NSString stringWithFormat:@"%@.gz", SPFileExtensionSQL] : SPFileExtensionSQL;
+ extension = SPFileExtensionSQL;
+ break;
+ case SPCSVExport:
+ extension = @"csv";
break;
case SPXMLExport:
extension = @"xml";
@@ -780,6 +794,18 @@
break;
}
+ if ([exportOutputCompressionFormatPopupButton indexOfSelectedItem] != SPNoCompression) {
+
+ SPFileCompressionFormat compressionFormat = [exportOutputCompressionFormatPopupButton indexOfSelectedItem];
+
+ if ([extension length] > 0) {
+ extension = [extension stringByAppendingPathExtension:(compressionFormat == SPGzipCompression) ? @"gz" : @"bz2"];
+ }
+ else {
+ extension = (compressionFormat == SPGzipCompression) ? @"gz" : @"bz2";
+ }
+ }
+
return extension;
}