aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-08-26 01:22:52 +0000
committerrowanbeentje <rowan@beent.je>2010-08-26 01:22:52 +0000
commit91c2f021d4a8e323872cc733becbdfc19870ceb7 (patch)
treefb858ab649014c78aaca1512029b20713e8a450e
parentdc9d005f21b3e281294f61d4d8e49d0ad003e8fb (diff)
downloadsequelpro-91c2f021d4a8e323872cc733becbdfc19870ceb7.tar.gz
sequelpro-91c2f021d4a8e323872cc733becbdfc19870ceb7.tar.bz2
sequelpro-91c2f021d4a8e323872cc733becbdfc19870ceb7.zip
Exporter:
- Enable alternating table lines in the export table view - this addresses Issue #797 - Reconnect GZIp & BZIP2 compression functionality (TODO: not currently working for file overwrites; to be discussed)
-rw-r--r--Interfaces/English.lproj/ExportDialog.xib68
-rw-r--r--Source/SPExportFile.h2
-rw-r--r--Source/SPExportFile.m16
-rw-r--r--Source/SPExportInitializer.m5
-rw-r--r--Source/SPSQLExporter.m2
5 files changed, 62 insertions, 31 deletions
diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib
index de05a02c..6afa968d 100644
--- a/Interfaces/English.lproj/ExportDialog.xib
+++ b/Interfaces/English.lproj/ExportDialog.xib
@@ -21,12 +21,15 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1183"/>
+ <integer value="1086"/>
+ <integer value="441"/>
+ <integer value="1299"/>
+ <integer value="294"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.brandonwalkin.BWToolkit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.brandonwalkin.BWToolkit</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,10 +59,10 @@
<string key="NSWindowTitle">Export</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{449, 480}</string>
<object class="NSView" key="NSWindowView" id="13817034">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -85,7 +88,7 @@
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor" id="1056664274">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<reference key="NSTabView" ref="109227463"/>
@@ -251,7 +254,7 @@
<object class="NSPopUpButton" id="257072199">
<reference key="NSNextResponder" ref="906049809"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{134, 10}, {94, 22}}</string>
+ <string key="NSFrame">{{134, 10}, {232, 22}}</string>
<reference key="NSSuperview" ref="906049809"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="148052048">
@@ -291,7 +294,7 @@
<reference ref="422399506"/>
<object class="NSMenuItem" id="856388568">
<reference key="NSMenu" ref="58358184"/>
- <string key="NSTitle">Gzip</string>
+ <string key="NSTitle">Gzip (Very fast, good compression)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -303,7 +306,7 @@
</object>
<object class="NSMenuItem" id="846378668">
<reference key="NSMenu" ref="58358184"/>
- <string key="NSTitle">Bzip2</string>
+ <string key="NSTitle">Bzip2 (Slower, very good compression)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -430,10 +433,11 @@
</object>
</object>
<string key="NSFrameSize">{449, 480}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{449, 502}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSFrameAutosaveName">SPExportWindow</string>
</object>
<object class="NSWindowTemplate" id="480162967">
@@ -446,10 +450,10 @@
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{213, 50}</string>
<object class="NSView" key="NSWindowView" id="217849587">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -567,10 +571,11 @@
</object>
</object>
<string key="NSFrameSize">{379, 139}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{213, 72}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSWindowTemplate" id="172544148">
<int key="NSWindowStyleMask">9</int>
@@ -582,10 +587,10 @@
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{213, 107}</string>
<object class="NSView" key="NSWindowView" id="487307915">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -766,10 +771,11 @@
</object>
</object>
<string key="NSFrameSize">{405, 267}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{213, 129}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomView" id="1039688935">
<reference key="NSNextResponder"/>
@@ -1884,16 +1890,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSComboTableView" key="NSTableView" id="343222687">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{31, 54}</string>
+ <string key="NSFrameSize">{13, 54}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSMutableArray" key="NSTableColumns">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTableColumn">
<integer value="0" key="NSIdentifier"/>
- <double key="NSWidth">28</double>
+ <double key="NSWidth">10</double>
<double key="NSMinWidth">10</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
@@ -1947,7 +1952,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<double key="NSRowHeight">16</double>
<string key="NSAction">tableViewAction:</string>
- <int key="NSTvFlags">-767524864</int>
+ <int key="NSTvFlags">-765427712</int>
<reference key="NSDelegate" ref="24725207"/>
<reference key="NSDataSource" ref="24725207"/>
<reference key="NSTarget" ref="24725207"/>
@@ -2650,7 +2655,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSBackgroundColor" ref="985041161"/>
<reference key="NSGridColor" ref="60183875"/>
<double key="NSRowHeight">17</double>
- <int key="NSTvFlags">306184192</int>
+ <int key="NSTvFlags">314572800</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">5</int>
@@ -5385,7 +5390,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{475, 44}, {94, 54}}</string>
+ <string>{{537, 168}, {267, 54}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5731,7 +5736,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>refreshTableList:</string>
<string>selectDeselectAllTables:</string>
<string>switchInput:</string>
- <string>switchTab:</string>
<string>toggleAdvancedExportOptionsView:</string>
<string>toggleCustomFilenameFormatView:</string>
<string>toggleSQLIncludeContent:</string>
@@ -5754,7 +5758,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
@@ -5770,7 +5773,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>refreshTableList:</string>
<string>selectDeselectAllTables:</string>
<string>switchInput:</string>
- <string>switchTab:</string>
<string>toggleAdvancedExportOptionsView:</string>
<string>toggleCustomFilenameFormatView:</string>
<string>toggleSQLIncludeContent:</string>
@@ -5816,10 +5818,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
- <string key="name">switchTab:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
<string key="name">toggleAdvancedExportOptionsView:</string>
<string key="candidateClassName">id</string>
</object>
@@ -6239,6 +6237,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="className">SPExportController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Source/SPExportFileUtilities.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">SPExportController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
<string key="minorKey">Source/SPExportFilenameUtilities.h</string>
</object>
</object>
@@ -6758,6 +6763,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">PrintCore.framework/Headers/PDEPluginInterface.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Sparkle.framework/Headers/SUAppcast.h</string>
</object>
</object>
diff --git a/Source/SPExportFile.h b/Source/SPExportFile.h
index fb61eef2..946f6aec 100644
--- a/Source/SPExportFile.h
+++ b/Source/SPExportFile.h
@@ -82,5 +82,5 @@
- (BOOL)delete;
- (void)writeData:(NSData *)data;
- (SPExportFileHandleStatus)createExportFileHandle:(BOOL)overwrite;
-
+- (void)setCompressionFormat:(SPFileCompressionFormat)fileCompressionFormat;
@end
diff --git a/Source/SPExportFile.m b/Source/SPExportFile.m
index e102b28e..1f09157f 100644
--- a/Source/SPExportFile.m
+++ b/Source/SPExportFile.m
@@ -168,6 +168,22 @@
return exportFileHandleStatus;
}
+/**
+ * Sets the compression level on the newly created file. Throws an exception
+ * if attempting to set the compression level when no file handle exists.
+ *
+ * @param fileCompressionFormat The compression level to support, from the SPFileCompressionFormat enum.
+ */
+- (void)setCompressionFormat:(SPFileCompressionFormat)fileCompressionFormat
+{
+ if (![self exportFileHandle]) {
+ [NSException raise:NSInternalInconsistencyException format:@"Attempting to set compression level of an uninitialized file handle."];
+ return;
+ }
+
+ [[self exportFileHandle] setShouldWriteWithCompressionFormat:fileCompressionFormat];
+}
+
#pragma mark -
#pragma mark Private API
diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m
index a34f729b..4812dd82 100644
--- a/Source/SPExportInitializer.m
+++ b/Source/SPExportInitializer.m
@@ -397,8 +397,11 @@
// Create the actual file handles while dealing with errors (e.g. file already exists, etc) during creation
for (SPExportFile *exportFile in exportFiles)
- {
+ {
if ([exportFile createExportFileHandle:NO] == SPExportFileHandleCreated) {
+
+ // TODO: these will not currently get triggered if there's an error in creating the files - eg when the user later chooses "overwrite".
+ [exportFile setCompressionFormat:[exportOutputCompressionFormatPopupButton indexOfSelectedItem]];
if ([exportFile exportFileNeedsCSVHeader]) {
[self writeCSVHeaderToExportFile:exportFile];
}
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index a38732cb..186243b1 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -135,7 +135,7 @@
// Clear errors
[self setSqlExportErrors:@""];
-
+
// Copy over the selected item names into tables in preparation for iteration
NSMutableArray *targetArray;