diff options
author | stuconnolly <stuart02@gmail.com> | 2010-07-24 21:34:05 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-07-24 21:34:05 +0000 |
commit | bf1294bd1016672aa3062bb80b546bf2f8037fb3 (patch) | |
tree | 121768027638e59af7d5830855bd19b88de7e601 | |
parent | eb29a57a6860961c0caa00787d779f4cb4117c90 (diff) | |
download | sequelpro-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.
-rw-r--r-- | Interfaces/English.lproj/ExportDialog.xib | 496 | ||||
-rw-r--r-- | Source/SPConstants.h | 8 | ||||
-rw-r--r-- | Source/SPDataImport.m | 26 | ||||
-rw-r--r-- | Source/SPDotExporter.m | 1 | ||||
-rw-r--r-- | Source/SPExportController.h | 3 | ||||
-rw-r--r-- | Source/SPExportController.m | 28 | ||||
-rw-r--r-- | Source/SPExportInitializer.m | 69 | ||||
-rw-r--r-- | Source/SPExporter.h | 72 | ||||
-rw-r--r-- | Source/SPExporter.m | 28 | ||||
-rw-r--r-- | Source/SPFileHandle.h | 46 | ||||
-rw-r--r-- | Source/SPFileHandle.m | 239 | ||||
-rw-r--r-- | Source/SPSQLExporter.h | 6 | ||||
-rw-r--r-- | Source/SPSQLExporter.m | 18 | ||||
-rw-r--r-- | Source/SPXMLExporterDelegate.m | 1 | ||||
-rw-r--r-- | sequel-pro.xcodeproj/project.pbxproj | 6 |
15 files changed, 704 insertions, 343 deletions
diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib index 152dd346..efab0c8d 100644 --- a/Interfaces/English.lproj/ExportDialog.xib +++ b/Interfaces/English.lproj/ExportDialog.xib @@ -21,7 +21,7 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="1105"/> + <integer value="1183"/> <integer value="2"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> @@ -52,13 +52,13 @@ <object class="NSWindowTemplate" id="834889278"> <int key="NSWindowStyleMask">4111</int> <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{610, 277}, {451, 494}}</string> + <string key="NSWindowRect">{{610, 291}, {449, 480}}</string> <int key="NSWTFlags">611845120</int> <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="NSWindowContentMinSize">{454, 494}</string> + <string key="NSWindowContentMinSize">{449, 480}</string> <object class="NSView" key="NSWindowView" id="13817034"> <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> @@ -67,7 +67,7 @@ <object class="NSTabView" id="109227463"> <reference key="NSNextResponder" ref="13817034"/> <int key="NSvFlags">18</int> - <string key="NSFrame">{{-14, 64}, {479, 424}}</string> + <string key="NSFrame">{{-14, 69}, {473, 405}}</string> <reference key="NSSuperview" ref="13817034"/> <object class="NSMutableArray" key="NSTabViewItems"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -76,7 +76,7 @@ <object class="NSView" key="NSView" id="254508059"> <reference key="NSNextResponder" ref="109227463"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{10, 33}, {459, 378}}</string> + <string key="NSFrame">{{10, 33}, {453, 359}}</string> <reference key="NSSuperview" ref="109227463"/> </object> <string key="NSLabel">SQL</string> @@ -96,7 +96,7 @@ <object class="NSView" key="NSView" id="975133006"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{10, 33}, {459, 378}}</string> + <string key="NSFrame">{{10, 33}, {451, 359}}</string> </object> <string key="NSLabel">CSV</string> <reference key="NSColor" ref="683790803"/> @@ -107,7 +107,7 @@ <object class="NSView" key="NSView" id="351963414"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{10, 33}, {459, 378}}</string> + <string key="NSFrame">{{10, 33}, {451, 359}}</string> </object> <string key="NSLabel">XML</string> <reference key="NSColor" ref="683790803"/> @@ -118,7 +118,7 @@ <object class="NSView" key="NSView" id="622234095"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{10, 33}, {459, 378}}</string> + <string key="NSFrame">{{10, 33}, {451, 359}}</string> </object> <string key="NSLabel">Dot</string> <reference key="NSColor" ref="683790803"/> @@ -141,7 +141,7 @@ <object class="NSButton" id="842573327"> <reference key="NSNextResponder" ref="13817034"/> <int key="NSvFlags">289</int> - <string key="NSFrame">{{333, 12}, {104, 32}}</string> + <string key="NSFrame">{{331, 12}, {104, 32}}</string> <reference key="NSSuperview" ref="13817034"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> @@ -162,7 +162,7 @@ <object class="NSButton" id="840756827"> <reference key="NSNextResponder" ref="13817034"/> <int key="NSvFlags">289</int> - <string key="NSFrame">{{229, 12}, {104, 32}}</string> + <string key="NSFrame">{{227, 12}, {104, 32}}</string> <reference key="NSSuperview" ref="13817034"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="460096525"> @@ -197,7 +197,7 @@ <object class="NSButton" id="829070828"> <reference key="NSNextResponder" ref="906049809"/> <int key="NSvFlags">292</int> - <string key="NSFrame">{{15, 12}, {397, 18}}</string> + <string key="NSFrame">{{15, 37}, {397, 18}}</string> <reference key="NSSuperview" ref="906049809"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="333778774"> @@ -225,12 +225,110 @@ <int key="NSPeriodicInterval">25</int> </object> </object> + <object class="NSTextField" id="659859169"> + <reference key="NSNextResponder" ref="906049809"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{15, 15}, {117, 14}}</string> + <reference key="NSSuperview" ref="906049809"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="833444680"> + <int key="NSCellFlags">68288064</int> + <int key="NSCellFlags2">272761856</int> + <string key="NSContents">Output compression:</string> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="659859169"/> + <reference key="NSBackgroundColor" ref="683790803"/> + <object class="NSColor" key="NSTextColor" id="804867667"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlTextColor</string> + <object class="NSColor" key="NSColor" id="881778134"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MAA</bytes> + </object> + </object> + </object> + </object> + <object class="NSPopUpButton" id="257072199"> + <reference key="NSNextResponder" ref="906049809"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{134, 10}, {94, 22}}</string> + <reference key="NSSuperview" ref="906049809"/> + <bool key="NSEnabled">YES</bool> + <object class="NSPopUpButtonCell" key="NSCell" id="148052048"> + <int key="NSCellFlags">-2076049856</int> + <int key="NSCellFlags2">133120</int> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="257072199"/> + <int key="NSButtonFlags">109199615</int> + <int key="NSButtonFlags2">129</int> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">400</int> + <int key="NSPeriodicInterval">75</int> + <object class="NSMenuItem" key="NSMenuItem" id="422399506"> + <reference key="NSMenu" ref="58358184"/> + <string key="NSTitle">None</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <int key="NSState">1</int> + <object class="NSCustomResource" key="NSOnImage" id="626013002"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuCheckmark</string> + </object> + <object class="NSCustomResource" key="NSMixedImage" id="428837307"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuMixedState</string> + </object> + <string key="NSAction">_popUpItemAction:</string> + <reference key="NSTarget" ref="148052048"/> + </object> + <bool key="NSMenuItemRespectAlignment">YES</bool> + <object class="NSMenu" key="NSMenu" id="58358184"> + <string key="NSTitle">OtherViews</string> + <object class="NSMutableArray" key="NSMenuItems"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="422399506"/> + <object class="NSMenuItem" id="856388568"> + <reference key="NSMenu" ref="58358184"/> + <string key="NSTitle">Gzip</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> + <string key="NSAction">_popUpItemAction:</string> + <int key="NSTag">1</int> + <reference key="NSTarget" ref="148052048"/> + </object> + <object class="NSMenuItem" id="846378668"> + <reference key="NSMenu" ref="58358184"/> + <string key="NSTitle">Bzip2</string> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> + <string key="NSAction">_popUpItemAction:</string> + <int key="NSTag">2</int> + <reference key="NSTarget" ref="148052048"/> + </object> + </object> + <reference key="NSMenuFont" ref="695505032"/> + </object> + <int key="NSPreferredEdge">1</int> + <bool key="NSUsesItemFromMenu">YES</bool> + <bool key="NSAltersState">YES</bool> + <int key="NSArrowPosition">2</int> + </object> + </object> </object> - <string key="NSFrame">{{1, 1}, {414, 40}}</string> + <string key="NSFrame">{{1, 1}, {412, 65}}</string> <reference key="NSSuperview" ref="75303935"/> </object> </object> - <string key="NSFrame">{{-3, -4}, {416, 42}}</string> + <string key="NSFrame">{{-3, -4}, {414, 67}}</string> <reference key="NSSuperview" ref="184955131"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> @@ -261,7 +359,7 @@ <object class="NSButton" id="72396235"> <reference key="NSNextResponder" ref="184955131"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{-83, 10}, {100, 18}}</string> + <string key="NSFrame">{{-83, 35}, {100, 18}}</string> <reference key="NSSuperview" ref="184955131"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="832281129"> @@ -281,7 +379,7 @@ </object> </object> </object> - <string key="NSFrame">{{21, 9}, {410, 36}}</string> + <string key="NSFrame">{{21, -16}, {408, 61}}</string> <reference key="NSSuperview" ref="13817034"/> <string key="NSClassName">NSView</string> </object> @@ -332,11 +430,11 @@ </object> </object> </object> - <string key="NSFrameSize">{451, 494}</string> + <string key="NSFrameSize">{449, 480}</string> <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> - <string key="NSMinSize">{454, 516}</string> + <string key="NSMinSize">{449, 502}</string> <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> <string key="NSFrameAutosaveName">SPExportWindow</string> </object> @@ -434,15 +532,7 @@ </object> <reference key="NSControlView" ref="871576863"/> <reference key="NSBackgroundColor" ref="683790803"/> - <object class="NSColor" key="NSTextColor" id="804867667"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">controlTextColor</string> - <object class="NSColor" key="NSColor" id="881778134"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MAA</bytes> - </object> - </object> + <reference key="NSTextColor" ref="804867667"/> </object> </object> <object class="NSImageView" id="496317468"> @@ -591,6 +681,7 @@ </object> <string key="NSFrame">{{1, 1}, {352, 178}}</string> <reference key="NSSuperview" ref="835590192"/> + <reference key="NSNextKeyView" ref="195858660"/> <reference key="NSDocView" ref="195858660"/> <reference key="NSBGColor" ref="628696263"/> <object class="NSCursor" key="NSCursor"> @@ -623,6 +714,7 @@ </object> <string key="NSFrame">{{20, 45}, {365, 180}}</string> <reference key="NSSuperview" ref="487307915"/> + <reference key="NSNextKeyView" ref="919560029"/> <int key="NSsFlags">18</int> <reference key="NSVScroller" ref="1025585018"/> <reference key="NSHScroller" ref="24038425"/> @@ -689,7 +781,7 @@ <object class="NSPopUpButton" id="429080228"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{17, 284}, {207, 22}}</string> + <string key="NSFrame">{{17, 266}, {207, 22}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="176341375"> @@ -710,14 +802,8 @@ <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <int key="NSState">1</int> - <object class="NSCustomResource" key="NSOnImage" id="386436227"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">NSMenuCheckmark</string> - </object> - <object class="NSCustomResource" key="NSMixedImage" id="402926002"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">NSMenuMixedState</string> - </object> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="176341375"/> </object> @@ -732,8 +818,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="386436227"/> - <reference key="NSMixedImage" ref="402926002"/> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="176341375"/> </object> @@ -743,8 +829,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="386436227"/> - <reference key="NSMixedImage" ref="402926002"/> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="176341375"/> </object> @@ -890,14 +976,14 @@ <bool key="NSTransparent">NO</bool> </object> </object> - <string key="NSFrame">{{0, 206}, {450, 108}}</string> + <string key="NSFrame">{{0, 188}, {450, 108}}</string> <reference key="NSSuperview" ref="1039688935"/> <string key="NSClassName">NSView</string> </object> <object class="NSButton" id="93580453"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{32, 315}, {400, 28}}</string> + <string key="NSFrame">{{32, 297}, {400, 28}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="704057245"> @@ -918,7 +1004,7 @@ <object class="NSButton" id="585337816"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{9, 317}, {29, 26}}</string> + <string key="NSFrame">{{9, 299}, {29, 26}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="240404499"> @@ -1025,7 +1111,7 @@ <object class="NSButton" id="1058029781"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">265</int> - <string key="NSFrame">{{341, 343}, {94, 28}}</string> + <string key="NSFrame">{{341, 325}, {94, 28}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="808873518"> @@ -1045,7 +1131,7 @@ <object class="NSBox" id="212414565"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">10</int> - <string key="NSFrame">{{20, 311}, {410, 5}}</string> + <string key="NSFrame">{{20, 293}, {410, 5}}</string> <reference key="NSSuperview" ref="1039688935"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> @@ -1067,12 +1153,12 @@ <object class="NSTextField" id="412690578"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">266</int> - <string key="NSFrame">{{53, 348}, {285, 19}}</string> + <string key="NSFrame">{{53, 330}, {285, 19}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="291144691"> <int key="NSCellFlags">-2072904127</int> - <int key="NSCellFlags2">272761856</int> + <int key="NSCellFlags2">272794624</int> <string key="NSContents"/> <reference key="NSSupport" ref="26"/> <reference key="NSControlView" ref="412690578"/> @@ -1084,7 +1170,7 @@ <object class="NSTextField" id="85590559"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{17, 350}, {31, 14}}</string> + <string key="NSFrame">{{17, 332}, {31, 14}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="869459931"> @@ -1100,7 +1186,7 @@ <object class="NSButton" id="238794017"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">-2147483380</int> - <string key="NSFrame">{{226, 287}, {116, 18}}</string> + <string key="NSFrame">{{226, 269}, {116, 18}}</string> <reference key="NSSuperview" ref="1039688935"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="328323922"> @@ -1122,21 +1208,21 @@ <object class="NSTabView" id="683006936"> <reference key="NSNextResponder" ref="1039688935"/> <int key="NSvFlags">17</int> - <string key="NSFrame">{{225, 16}, {209, 267}}</string> + <string key="NSFrame">{{225, 16}, {209, 249}}</string> <reference key="NSSuperview" ref="1039688935"/> <object class="NSMutableArray" key="NSTabViewItems"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTabViewItem" id="286086449"> <string key="NSIdentifier">sql</string> <object class="NSView" key="NSView" id="311280472"> - <reference key="NSNextResponder" ref="683006936"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSButton" id="896448830"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{11, 194}, {179, 18}}</string> + <string key="NSFrame">{{11, 176}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1070796296"> @@ -1158,7 +1244,7 @@ <object class="NSTextField" id="868197026"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 218}, {180, 14}}</string> + <string key="NSFrame">{{12, 200}, {180, 14}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="882864517"> @@ -1174,7 +1260,7 @@ <object class="NSTextField" id="904279924"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 114}, {180, 14}}</string> + <string key="NSFrame">{{12, 96}, {180, 14}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="460496284"> @@ -1190,7 +1276,7 @@ <object class="NSButton" id="636989900"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 154}, {179, 18}}</string> + <string key="NSFrame">{{12, 136}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1026671526"> @@ -1212,7 +1298,7 @@ <object class="NSButton" id="163591590"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 134}, {179, 18}}</string> + <string key="NSFrame">{{12, 116}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="902213604"> @@ -1234,7 +1320,7 @@ <object class="NSButton" id="472940336"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 174}, {179, 18}}</string> + <string key="NSFrame">{{12, 156}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="619630097"> @@ -1256,7 +1342,7 @@ <object class="NSButton" id="771021044"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 70}, {179, 18}}</string> + <string key="NSFrame">{{12, 72}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="302595793"> @@ -1275,32 +1361,10 @@ <int key="NSPeriodicInterval">25</int> </object> </object> - <object class="NSButton" id="361163399"> - <reference key="NSNextResponder" ref="311280472"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 90}, {179, 18}}</string> - <reference key="NSSuperview" ref="311280472"/> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="537350067"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">131072</int> - <string key="NSContents">Compress output (gzip)</string> - <reference key="NSSupport" ref="26"/> - <reference key="NSControlView" ref="361163399"/> - <int key="NSButtonFlags">1211912703</int> - <int key="NSButtonFlags2">2</int> - <reference key="NSNormalImage" ref="191147027"/> - <reference key="NSAlternateImage" ref="506551266"/> - <string key="NSAlternateContents"/> - <string key="NSKeyEquivalent"/> - <int key="NSPeriodicDelay">200</int> - <int key="NSPeriodicInterval">25</int> - </object> - </object> <object class="NSButton" id="243826641"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 50}, {179, 18}}</string> + <string key="NSFrame">{{12, 52}, {179, 18}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="595529721"> @@ -1322,7 +1386,7 @@ <object class="NSTextField" id="864598499"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 30}, {180, 14}}</string> + <string key="NSFrame">{{12, 32}, {180, 14}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="618129698"> @@ -1338,7 +1402,7 @@ <object class="NSTextField" id="946500215"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{15, 3}, {60, 19}}</string> + <string key="NSFrame">{{15, 5}, {60, 19}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="754103523"> @@ -1422,7 +1486,7 @@ <object class="NSPopUpButton" id="137273930"> <reference key="NSNextResponder" ref="311280472"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{80, 0}, {98, 22}}</string> + <string key="NSFrame">{{80, 2}, {98, 22}}</string> <reference key="NSSuperview" ref="311280472"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="341187036"> @@ -1443,8 +1507,8 @@ <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <int key="NSState">1</int> - <reference key="NSOnImage" ref="386436227"/> - <reference key="NSMixedImage" ref="402926002"/> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="341187036"/> </object> @@ -1460,8 +1524,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="386436227"/> - <reference key="NSMixedImage" ref="402926002"/> + <reference key="NSOnImage" ref="626013002"/> + <reference key="NSMixedImage" ref="428837307"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="341187036"/> </object> @@ -1475,8 +1539,7 @@ </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> - <reference key="NSSuperview" ref="683006936"/> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">SQL</string> <reference key="NSColor" ref="683790803"/> @@ -1492,7 +1555,7 @@ <object class="NSMatrix" id="28875144"> <reference key="NSNextResponder" ref="15125403"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{14, 134}, {106, 100}}</string> + <string key="NSFrame">{{14, 116}, {106, 100}}</string> <reference key="NSSuperview" ref="15125403"/> <bool key="NSEnabled">YES</bool> <int key="NSNumRows">2</int> @@ -1689,7 +1752,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="427812983"> <reference key="NSNextResponder" ref="15125403"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{33, 165}, {154, 42}}</string> + <string key="NSFrame">{{33, 147}, {154, 42}}</string> <reference key="NSSuperview" ref="15125403"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="592352325"> @@ -1705,7 +1768,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="114464704"> <reference key="NSNextResponder" ref="15125403"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{33, 84}, {154, 42}}</string> + <string key="NSFrame">{{33, 66}, {154, 42}}</string> <reference key="NSSuperview" ref="15125403"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="866512404"> @@ -1719,7 +1782,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">Excel</string> <reference key="NSColor" ref="683790803"/> @@ -1728,14 +1791,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTabViewItem" id="566176242"> <string key="NSIdentifier">csv</string> <object class="NSView" key="NSView" id="251397907"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder" ref="683006936"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTextField" id="431819810"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{5, 196}, {39, 14}}</string> + <string key="NSFrame">{{5, 178}, {39, 14}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="704779797"> @@ -1751,7 +1814,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="154639832"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{5, 97}, {36, 14}}</string> + <string key="NSFrame">{{5, 79}, {36, 14}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="476159630"> @@ -1767,7 +1830,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="118891385"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{46, 143}, {31, 17}}</string> + <string key="NSFrame">{{46, 125}, {31, 17}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="677830525"> @@ -1783,7 +1846,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="897158083"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{46, 168}, {59, 17}}</string> + <string key="NSFrame">{{46, 150}, {59, 17}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="51337104"> @@ -1799,7 +1862,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSComboBox" id="160760073"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{8, 167}, {36, 22}}</string> + <string key="NSFrame">{{8, 149}, {36, 22}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSComboBoxCell" key="NSCell" id="24725207"> @@ -1899,7 +1962,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSComboBox" id="43051200"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{8, 142}, {36, 22}}</string> + <string key="NSFrame">{{8, 124}, {36, 22}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSComboBoxCell" key="NSCell" id="802916595"> @@ -1981,7 +2044,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSComboBox" id="1056509825"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{8, 115}, {36, 22}}</string> + <string key="NSFrame">{{8, 97}, {36, 22}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSComboBoxCell" key="NSCell" id="590352278"> @@ -2063,7 +2126,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="291048492"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{46, 116}, {41, 17}}</string> + <string key="NSFrame">{{46, 98}, {41, 17}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="725186903"> @@ -2079,7 +2142,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSComboBox" id="216687791"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{8, 68}, {36, 22}}</string> + <string key="NSFrame">{{8, 50}, {36, 22}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSComboBoxCell" key="NSCell" id="755941142"> @@ -2162,7 +2225,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="17832185"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{46, 69}, {59, 17}}</string> + <string key="NSFrame">{{46, 51}, {59, 17}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="188018483"> @@ -2178,13 +2241,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSButton" id="586747972"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{5, 216}, {172, 18}}</string> + <string key="NSFrame">{{5, 198}, {172, 18}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="306434977"> <int key="NSCellFlags">-2080244224</int> <int key="NSCellFlags2">131072</int> - <string key="NSContents">Put fields names at first row</string> + <string key="NSContents">Put field names in first row</string> <reference key="NSSupport" ref="26"/> <reference key="NSControlView" ref="586747972"/> <int key="NSButtonFlags">1211912703</int> @@ -2199,7 +2262,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="768545032"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{5, 47}, {72, 14}}</string> + <string key="NSFrame">{{5, 29}, {72, 14}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="112977810"> @@ -2215,7 +2278,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="445644168"> <reference key="NSNextResponder" ref="251397907"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{8, 20}, {55, 19}}</string> + <string key="NSFrame">{{8, 2}, {55, 19}}</string> <reference key="NSSuperview" ref="251397907"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="95838642"> @@ -2230,7 +2293,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> + <reference key="NSSuperview" ref="683006936"/> </object> <string key="NSLabel">CSV</string> <reference key="NSColor" ref="683790803"/> @@ -2246,7 +2310,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSButton" id="1019941940"> <reference key="NSNextResponder" ref="701209678"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 194}, {71, 18}}</string> + <string key="NSFrame">{{12, 176}, {71, 18}}</string> <reference key="NSSuperview" ref="701209678"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="925634353"> @@ -2268,7 +2332,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="877462978"> <reference key="NSNextResponder" ref="701209678"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{11, 218}, {53, 14}}</string> + <string key="NSFrame">{{11, 200}, {53, 14}}</string> <reference key="NSSuperview" ref="701209678"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="1006075597"> @@ -2282,7 +2346,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">HTML</string> <reference key="NSColor" ref="683790803"/> @@ -2298,7 +2362,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="65089502"> <reference key="NSNextResponder" ref="855848511"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{11, 218}, {72, 14}}</string> + <string key="NSFrame">{{11, 200}, {72, 14}}</string> <reference key="NSSuperview" ref="855848511"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="649072289"> @@ -2314,7 +2378,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="700877238"> <reference key="NSNextResponder" ref="855848511"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{14, 191}, {55, 19}}</string> + <string key="NSFrame">{{14, 173}, {55, 19}}</string> <reference key="NSSuperview" ref="855848511"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="120501725"> @@ -2329,7 +2393,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">XML</string> <reference key="NSColor" ref="683790803"/> @@ -2345,7 +2409,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSButton" id="480550596"> <reference key="NSNextResponder" ref="1016607584"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{12, 194}, {71, 18}}</string> + <string key="NSFrame">{{12, 176}, {71, 18}}</string> <reference key="NSSuperview" ref="1016607584"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="874604248"> @@ -2367,7 +2431,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="432645968"> <reference key="NSNextResponder" ref="1016607584"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{11, 218}, {53, 14}}</string> + <string key="NSFrame">{{11, 200}, {53, 14}}</string> <reference key="NSSuperview" ref="1016607584"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="95457837"> @@ -2381,7 +2445,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">PDF</string> <reference key="NSColor" ref="683790803"/> @@ -2392,21 +2456,21 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSView" key="NSView" id="243567307"> <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{10, 7}, {189, 247}}</string> + <string key="NSFrame">{{10, 7}, {189, 229}}</string> </object> <string key="NSLabel">Dot</string> <reference key="NSColor" ref="683790803"/> <reference key="NSTabView" ref="683006936"/> </object> </object> - <reference key="NSSelectedTabViewItem" ref="286086449"/> + <reference key="NSSelectedTabViewItem" ref="566176242"/> <reference key="NSFont" ref="695505032"/> <int key="NSTvFlags">4</int> <bool key="NSAllowTruncatedLabels">YES</bool> <bool key="NSDrawsBackground">YES</bool> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="311280472"/> + <reference ref="251397907"/> </object> </object> <object class="NSScrollView" id="505274803"> @@ -2422,7 +2486,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTableView" id="324452213"> <reference key="NSNextResponder" ref="475696168"/> <int key="NSvFlags">4352</int> - <string key="NSFrameSize">{199, 219}</string> + <string key="NSFrameSize">{199, 201}</string> <reference key="NSSuperview" ref="475696168"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="181185916"> @@ -2578,7 +2642,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <bool key="NSIsResizeable">YES</bool> <bool key="NSIsEditable">YES</bool> <reference key="NSTableView" ref="324452213"/> - <string key="NSHeaderToolTip">Include drop syntax</string> + <string key="NSHeaderToolTip">Include DROP TABLE syntax</string> </object> </object> <double key="NSIntercellSpacingWidth">3</double> @@ -2596,7 +2660,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <int key="NSTableViewDraggingDestinationStyle">0</int> </object> </object> - <string key="NSFrame">{{1, 17}, {199, 219}}</string> + <string key="NSFrame">{{1, 17}, {199, 201}}</string> <reference key="NSSuperview" ref="505274803"/> <reference key="NSNextKeyView" ref="324452213"/> <reference key="NSDocView" ref="324452213"/> @@ -2639,7 +2703,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <reference ref="307218216"/> </object> - <string key="NSFrame">{{20, 43}, {201, 237}}</string> + <string key="NSFrame">{{20, 43}, {201, 219}}</string> <reference key="NSSuperview" ref="1039688935"/> <reference key="NSNextKeyView" ref="475696168"/> <int key="NSsFlags">530</int> @@ -2651,7 +2715,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes> </object> </object> - <string key="NSFrameSize">{450, 377}</string> + <string key="NSFrameSize">{450, 359}</string> <reference key="NSSuperview"/> <string key="NSClassName">NSView</string> </object> @@ -2893,14 +2957,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> - <string key="label">exportCompressOutputFile</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="361163399"/> - </object> - <int key="connectionID">1262</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> <string key="label">exportSQLInsertNValueTextField</string> <reference key="source" ref="1001"/> <reference key="destination" ref="946500215"/> @@ -3235,6 +3291,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <int key="connectionID">1321</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">exportOutputCompressionFormatPopupButton</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="257072199"/> + </object> + <int key="connectionID">1348</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">changeExportCompressionFormat:</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="257072199"/> + </object> + <int key="connectionID">1349</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -3914,7 +3986,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference ref="864598499"/> <reference ref="243826641"/> <reference ref="771021044"/> - <reference ref="361163399"/> <reference ref="904279924"/> <reference ref="472940336"/> <reference ref="163591590"/> @@ -3970,15 +4041,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference key="parent" ref="311280472"/> </object> <object class="IBObjectRecord"> - <int key="objectID">1151</int> - <reference key="object" ref="361163399"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="537350067"/> - </object> - <reference key="parent" ref="311280472"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">1152</int> <reference key="object" ref="904279924"/> <object class="NSMutableArray" key="children"> @@ -4063,11 +4125,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference key="parent" ref="904279924"/> </object> <object class="IBObjectRecord"> - <int key="objectID">1164</int> - <reference key="object" ref="537350067"/> - <reference key="parent" ref="361163399"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">1165</int> <reference key="object" ref="302595793"/> <reference key="parent" ref="771021044"/> @@ -4667,6 +4724,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="829070828"/> + <reference ref="659859169"/> + <reference ref="257072199"/> </object> <reference key="parent" ref="184955131"/> </object> @@ -4699,6 +4758,64 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference key="object" ref="436911803"/> <reference key="parent" ref="842573327"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">1336</int> + <reference key="object" ref="659859169"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="833444680"/> + </object> + <reference key="parent" ref="75303935"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1337</int> + <reference key="object" ref="833444680"/> + <reference key="parent" ref="659859169"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1338</int> + <reference key="object" ref="257072199"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="148052048"/> + </object> + <reference key="parent" ref="75303935"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1339</int> + <reference key="object" ref="148052048"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="58358184"/> + </object> + <reference key="parent" ref="257072199"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1340</int> + <reference key="object" ref="58358184"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="422399506"/> + <reference ref="856388568"/> + <reference ref="846378668"/> + </object> + <reference key="parent" ref="148052048"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1341</int> + <reference key="object" ref="422399506"/> + <reference key="parent" ref="58358184"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1342</int> + <reference key="object" ref="856388568"/> + <reference key="parent" ref="58358184"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1343</int> + <reference key="object" ref="846378668"/> + <reference key="parent" ref="58358184"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -4727,6 +4844,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1097.IBPluginDependency</string> <string>1100.IBAttributePlaceholdersKey</string> <string>1100.IBPluginDependency</string> + <string>1101.IBAttributePlaceholdersKey</string> <string>1101.IBPluginDependency</string> <string>1102.IBPluginDependency</string> <string>1103.IBPluginDependency</string> @@ -4776,7 +4894,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1148.IBPluginDependency</string> <string>1149.IBPluginDependency</string> <string>1150.IBPluginDependency</string> - <string>1151.IBPluginDependency</string> <string>1152.IBPluginDependency</string> <string>1153.IBPluginDependency</string> <string>1154.IBPluginDependency</string> @@ -4789,7 +4906,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1161.IBPluginDependency</string> <string>1162.IBPluginDependency</string> <string>1163.IBPluginDependency</string> - <string>1164.IBPluginDependency</string> <string>1165.IBPluginDependency</string> <string>1166.IBPluginDependency</string> <string>1167.IBPluginDependency</string> @@ -4871,6 +4987,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1227.IBPluginDependency</string> <string>1228.IBPluginDependency</string> <string>1229.IBPluginDependency</string> + <string>1230.IBAttributePlaceholdersKey</string> <string>1230.IBPluginDependency</string> <string>1231.IBPluginDependency</string> <string>1232.IBPluginDependency</string> @@ -4885,6 +5002,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1299.IBPluginDependency</string> <string>1300.IBAttributePlaceholdersKey</string> <string>1300.IBPluginDependency</string> + <string>1301.IBAttributePlaceholdersKey</string> <string>1301.IBPluginDependency</string> <string>1302.IBPluginDependency</string> <string>1303.IBPluginDependency</string> @@ -4895,6 +5013,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>1308.IBPluginDependency</string> <string>1309.IBPluginDependency</string> <string>1310.IBPluginDependency</string> + <string>1336.IBPluginDependency</string> + <string>1337.IBPluginDependency</string> + <string>1338.IBPluginDependency</string> + <string>1339.IBPluginDependency</string> + <string>1340.IBEditorWindowLastContentRect</string> + <string>1340.IBPluginDependency</string> + <string>1341.IBPluginDependency</string> + <string>1342.IBPluginDependency</string> + <string>1343.IBPluginDependency</string> <string>2.IBPluginDependency</string> <string>2.IBUserGuides</string> <string>294.IBEditorWindowLastContentRect</string> @@ -4960,15 +5087,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{517, 163}, {451, 494}}</string> + <string>{{395, 209}, {449, 480}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <boolean value="NO"/> <boolean value="NO"/> - <string>{{517, 163}, {451, 494}}</string> + <string>{{395, 209}, {449, 480}}</string> <boolean value="NO"/> <boolean value="YES"/> - <string>{454, 494}</string> - <string>{{378, 126}, {450, 377}}</string> + <string>{449, 480}</string> + <string>{{459, 205}, {450, 359}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableDictionary"> @@ -4995,11 +5122,19 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <object class="NSMutableDictionary"> + <string key="NS.key.0">ToolTip</string> + <object class="IBToolTipAttribute" key="NS.object.0"> + <string key="name">ToolTip</string> + <reference key="object" ref="93580453"/> + <string key="toolTip">Customize filename</string> + </object> + </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{384, 378}, {207, 54}}</string> + <string>{{374, 422}, {207, 54}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5087,8 +5222,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1041"/> <boolean value="YES"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5194,6 +5327,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <object class="NSMutableDictionary"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference key="dict.sortedKeys" ref="0"/> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5215,6 +5355,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <object class="NSMutableDictionary"> + <string key="NS.key.0">ToolTip</string> + <object class="IBToolTipAttribute" key="NS.object.0"> + <string key="name">ToolTip</string> + <reference key="object" ref="443463899"/> + <string key="toolTip">Advanced export settings</string> + </object> + </object> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5226,6 +5375,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <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>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableArray"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -5313,7 +5470,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> <nil key="sourceID"/> - <int key="maxID">1321</int> + <int key="maxID">1349</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -5558,6 +5715,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>cancelExport:</string> + <string>changeExportCompressionFormat:</string> <string>changeExportOutputPath:</string> <string>closeSheet:</string> <string>exportCustomQueryResultAsFormat:</string> @@ -5586,6 +5744,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> @@ -5593,6 +5752,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>cancelExport:</string> + <string>changeExportCompressionFormat:</string> <string>changeExportOutputPath:</string> <string>closeSheet:</string> <string>exportCustomQueryResultAsFormat:</string> @@ -5613,6 +5773,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> + <string key="name">changeExportCompressionFormat:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> <string key="name">changeExportOutputPath:</string> <string key="candidateClassName">id</string> </object> @@ -5679,7 +5843,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>exportCSVIncludeFieldNamesCheck</string> <string>exportCSVLinesTerminatedField</string> <string>exportCSVNULLValuesAsTextField</string> - <string>exportCompressOutputFile</string> <string>exportCustomFilenameTokenField</string> <string>exportCustomFilenameTokensField</string> <string>exportCustomFilenameView</string> @@ -5692,6 +5855,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>exportHTMLIncludeStructureCheck</string> <string>exportInputPopUpButton</string> <string>exportOptionsTabBar</string> + <string>exportOutputCompressionFormatPopupButton</string> <string>exportPDFIncludeStructureCheck</string> <string>exportPathField</string> <string>exportProcessLowMemoryButton</string> @@ -5735,7 +5899,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>NSButton</string> <string>NSComboBox</string> <string>NSTextField</string> - <string>NSButton</string> <string>NSTokenField</string> <string>NSTokenField</string> <string>NSView</string> @@ -5748,6 +5911,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>NSButton</string> <string>NSPopUpButton</string> <string>NSTabView</string> + <string>NSPopUpButton</string> <string>NSButton</string> <string>NSTextField</string> <string>NSButton</string> @@ -5794,7 +5958,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>exportCSVIncludeFieldNamesCheck</string> <string>exportCSVLinesTerminatedField</string> <string>exportCSVNULLValuesAsTextField</string> - <string>exportCompressOutputFile</string> <string>exportCustomFilenameTokenField</string> <string>exportCustomFilenameTokensField</string> <string>exportCustomFilenameView</string> @@ -5807,6 +5970,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>exportHTMLIncludeStructureCheck</string> <string>exportInputPopUpButton</string> <string>exportOptionsTabBar</string> + <string>exportOutputCompressionFormatPopupButton</string> <string>exportPDFIncludeStructureCheck</string> <string>exportPathField</string> <string>exportProcessLowMemoryButton</string> @@ -5890,10 +6054,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="candidateClassName">NSTextField</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">exportCompressOutputFile</string> - <string key="candidateClassName">NSButton</string> - </object> - <object class="IBToOneOutletInfo"> <string key="name">exportCustomFilenameTokenField</string> <string key="candidateClassName">NSTokenField</string> </object> @@ -5942,6 +6102,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="candidateClassName">NSTabView</string> </object> <object class="IBToOneOutletInfo"> + <string key="name">exportOutputCompressionFormatPopupButton</string> + <string key="candidateClassName">NSPopUpButton</string> + </object> + <object class="IBToOneOutletInfo"> <string key="name">exportPDFIncludeStructureCheck</string> <string key="candidateClassName">NSButton</string> </object> diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 3f69b268..3ba923ff 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -175,6 +175,14 @@ typedef enum SPEncodingEUCKRKorean = 180 } SPEncodingTypes; +// File compression formats +typedef enum +{ + SPNoCompression = 0, + SPGzipCompression = 1, + SPBzip2Compression = 2 +} SPFileCompressionFormat; + // Predefined localisable URLs #define SPLOCALIZEDURL_HOMEPAGE NSLocalizedString(@"http://www.sequelpro.com/", @"Localized home page - do not localize if no translated webpage is available") #define SPLOCALIZEDURL_FAQ NSLocalizedString(@"http://www.sequelpro.com/docs/Frequently_Asked_Questions", @"Localized help page for Frequently Asked Questions - do not localize if no translated webpage is available") diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index f78af011..b82bf1bb 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -596,7 +596,7 @@ - (void)importCSVFile:(NSString *)filename { NSAutoreleasePool *importPool; - NSFileHandle *csvFileHandle; + SPFileHandle *csvFileHandle; NSMutableData *csvDataBuffer; const unsigned char *csvDataBufferBytes; NSData *fileChunk; @@ -630,7 +630,8 @@ [[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Import Finished"]; // Open a filehandle for the CSV file - csvFileHandle = [NSFileHandle fileHandleForReadingAtPath:filename]; + csvFileHandle = [SPFileHandle fileHandleForReadingAtPath:filename]; + if (!csvFileHandle) { SPBeginAlertSheet(NSLocalizedString(@"Import Error", @"Import Error title"), NSLocalizedString(@"OK", @"OK button"), @@ -1278,13 +1279,17 @@ if ( [selectedFilenames count] != 1 ) return; pathExtension = [[[selectedFilenames objectAtIndex:0] pathExtension] uppercaseString]; - // If a file has extension ".gz", indicating gzip, fetch the next extension - if ([pathExtension isEqualToString:@"GZ"]) { + // If the file has an extension '.gz' or '.bz2' indicating gzip or bzip2 compression, fetch the next extension + if ([pathExtension isEqualToString:@"GZ"] || [pathExtension isEqualToString:@"BZ2"]) { NSMutableString *pathString = [NSMutableString stringWithString:[selectedFilenames objectAtIndex:0]]; - [pathString deleteCharactersInRange:NSMakeRange([pathString length]-3, 3)]; - pathExtension = [[pathString pathExtension] uppercaseString]; + + BOOL isGzip = [pathExtension isEqualToString:@"GZ"]; + + [pathString deleteCharactersInRange:NSMakeRange([pathString length] - (isGzip ? 3 : 4), (isGzip ? 3 : 4))]; + + pathExtension = [[pathString pathExtension] uppercaseString]; } - + if ([pathExtension isEqualToString:@"SQL"]) { [importFormatPopup selectItemWithTitle:@"SQL"]; [self changeFormat:self]; @@ -1347,7 +1352,7 @@ } /** - * + * Selectable toolbar identifiers. */ - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { @@ -1363,7 +1368,7 @@ } /** - * + * Displays the import error sheet with the supplied error message. */ - (void)showErrorSheetWithMessage:(NSString*)message { @@ -1381,9 +1386,6 @@ [errorsSheet makeKeyWindow]; } -/** - * - */ - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { [sheet orderOut:self]; diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m index 88b859db..f10e1c97 100644 --- a/Source/SPDotExporter.m +++ b/Source/SPDotExporter.m @@ -153,6 +153,7 @@ { // Check for cancellation flag if ([self isCancelled]) { + [fkInfo release]; [pool release]; return; } diff --git a/Source/SPExportController.h b/Source/SPExportController.h index cedebdc3..b63f7c73 100644 --- a/Source/SPExportController.h +++ b/Source/SPExportController.h @@ -69,8 +69,8 @@ IBOutlet NSView *exportAdvancedOptionsView; IBOutlet NSButton *exportAdvancedOptionsViewLabelButton; IBOutlet NSButton *exportUseUTF8BOMButton; - IBOutlet NSButton *exportCompressOutputFile; IBOutlet NSButton *exportProcessLowMemoryButton; + IBOutlet NSPopUpButton *exportOutputCompressionFormatPopupButton; IBOutlet BWAnchoredButtonBar *exportTableListButtonBar; @@ -250,6 +250,7 @@ - (IBAction)changeExportOutputPath:(id)sender; - (IBAction)refreshTableList:(id)sender; - (IBAction)selectDeselectAllTables:(id)sender; +- (IBAction)changeExportCompressionFormat:(id)sender; - (IBAction)toggleCustomFilenameFormatView:(id)sender; - (IBAction)toggleAdvancedExportOptionsView:(id)sender; - (IBAction)exportCustomQueryResultAsFormat:(id)sender; 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; } diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 2478b1b3..fab11da9 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -187,6 +187,8 @@ } } + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; + singleFileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; } @@ -267,17 +269,11 @@ [sqlExporter setSqlOutputIncludeUTF8BOM:[exportUseUTF8BOMButton state]]; [sqlExporter setSqlOutputEncodeBLOBasHex:[exportSQLBLOBFieldsAsHexCheck state]]; - [sqlExporter setSqlOutputCompressFile:[exportCompressOutputFile state]]; [sqlExporter setSqlOutputIncludeErrors:[exportSQLIncludeErrorsCheck state]]; [sqlExporter setSqlInsertAfterNValue:[exportSQLInsertNValueTextField integerValue]]; [sqlExporter setSqlInsertDivider:[exportSQLInsertDividerPopUpButton indexOfSelectedItem]]; - // Set generic properties - [sqlExporter setConnection:connection]; - [sqlExporter setExportOutputEncoding:[connection encoding]]; - [sqlExporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; - // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; sqlPreviousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil]; @@ -286,15 +282,10 @@ [sqlExporter setSqlExportTables:exportTables]; - // Set the exporter's max progress - [sqlExporter setExportMaxProgress:((NSInteger)[exportProgressIndicator bounds].size.width)]; - - // Set the progress bar's max value - [exportProgressIndicator setMaxValue:[sqlExporter exportMaxProgress]]; - // Create custom filename if required [exportFilename setString:(createCustomFilename) ? [self expandCustomFilenameFormatFromString:[exportCustomFilenameTokenField stringValue] usingTableName:nil] : [NSString stringWithFormat:@"%@_%@", [tableDocumentInstance database], [[NSDate date] descriptionWithCalendarFormat:@"%Y-%m-%d" timeZone:nil locale:nil]]]; - [exportFilename setString:[exportFilename stringByAppendingPathExtension:([exportCompressOutputFile state]) ? [NSString stringWithFormat:@"%@.gz", SPFileExtensionSQL] : SPFileExtensionSQL]]; + + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; SPFileHandle *fileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; @@ -333,7 +324,7 @@ } } - [exportFilename setString:[exportFilename stringByAppendingPathExtension:@"xml"]]; + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; singleFileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; } @@ -382,15 +373,9 @@ SPDotExporter *dotExporter = [[SPDotExporter alloc] initWithDelegate:self]; [dotExporter setDotTableData:tableDataInstance]; - [dotExporter setDotDatabaseHost:[tableDocumentInstance host]]; [dotExporter setDotDatabaseName:[tableDocumentInstance database]]; [dotExporter setDotDatabaseVersion:[tableDocumentInstance mySQLVersion]]; - - // Set generic properties - [dotExporter setConnection:connection]; - [dotExporter setExportOutputEncoding:[connection encoding]]; - [dotExporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; @@ -400,12 +385,6 @@ [dotExporter setDotExportTables:exportTables]; - // Set the exporter's max progress - [dotExporter setExportMaxProgress:(NSInteger)[exportProgressIndicator bounds].size.width]; - - // Set the progress bar's max value - [exportProgressIndicator setMaxValue:[dotExporter exportMaxProgress]]; - // Create custom filename if required if (createCustomFilename) { [exportFilename setString:[self expandCustomFilenameFormatFromString:[exportCustomFilenameTokenField stringValue] usingTableName:nil]]; @@ -414,7 +393,7 @@ [exportFilename setString:[tableDocumentInstance database]]; } - [exportFilename setString:[exportFilename stringByAppendingPathExtension:@"dot"]]; + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; SPFileHandle *fileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; @@ -424,6 +403,17 @@ [dotExporter release]; } + + // For each of the created exporters, set their generic properties + for (SPExporter *exporter in exporters) + { + [exporter setConnection:connection]; + [exporter setExportOutputEncoding:[connection encoding]]; + [exporter setExportMaxProgress:(NSInteger)[exportProgressIndicator bounds].size.width]; + [exporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; + [exporter setExportOutputCompressionFormat:[exportOutputCompressionFormatPopupButton indexOfSelectedItem]]; + [exporter setExportOutputCompressFile:([exportOutputCompressionFormatPopupButton indexOfSelectedItem] != SPNoCompression)]; + } // Add the first exporter to the operation queue [operationQueue addOperation:[exporters objectAtIndex:0]]; @@ -451,7 +441,6 @@ } [csvExporter setCsvTableData:tableDataInstance]; - [csvExporter setCsvOutputFieldNames:[exportCSVIncludeFieldNamesCheck state]]; [csvExporter setCsvFieldSeparatorString:[exportCSVFieldsTerminatedField stringValue]]; [csvExporter setCsvEnclosingCharacterString:[exportCSVFieldsWrappedField stringValue]]; @@ -476,21 +465,14 @@ else { [exportFilename setString:(dataArray) ? [tableDocumentInstance database] : table]; } - + + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; + fileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; [csvExporter setExportOutputFileHandle:fileHandle]; } - // Set generic properties - [csvExporter setConnection:connection]; - [csvExporter setExportOutputEncoding:[connection encoding]]; - [csvExporter setExportMaxProgress:((NSInteger)[exportProgressIndicator bounds].size.width)]; - [csvExporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; - - // Set the progress bar's max value - [exportProgressIndicator setMaxValue:[csvExporter exportMaxProgress]]; - return [csvExporter autorelease]; } @@ -520,7 +502,7 @@ // If required create separate files if ((exportSource == SPTableExport) && exportToMultipleFiles && (exportTableCount > 0)) { [exportFilename setString:[[exportPathField stringValue] stringByAppendingPathComponent:table]]; - [exportFilename setString:[exportFilename stringByAppendingPathExtension:@"xml"]]; + [exportFilename setString:[exportFilename stringByAppendingPathExtension:[self _currentDefaultExportFileExtension]]]; fileHandle = [self getFileHandleForFilePath:exportFilename]; @@ -530,15 +512,6 @@ [xmlExporter setExportOutputFileHandle:fileHandle]; } - // Set generic properties - [xmlExporter setConnection:connection]; - [xmlExporter setExportOutputEncoding:[connection encoding]]; - [xmlExporter setExportMaxProgress:((NSInteger)[exportProgressIndicator bounds].size.width)]; - [xmlExporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; - - // Set the progress bar's max value - [exportProgressIndicator setMaxValue:[xmlExporter exportMaxProgress]]; - return [xmlExporter autorelease]; } diff --git a/Source/SPExporter.h b/Source/SPExporter.h index f3c01077..d9dadb6c 100644 --- a/Source/SPExporter.h +++ b/Source/SPExporter.h @@ -33,38 +33,78 @@ * This class is designed to be the base class of all data exporters and provide basic functionality * common to each of them. Each data exporter (i.e. CSV, SQL, XML, etc.) should be implemented as a subclass * of this class, with the end result being a modular export architecture separated by export type. All exporters - * should also conform to the SPExporterAccess protocol to allow generic access to the exporter's state and common - * functionality. + * should also have an associated delegate protocol and delegate category (of SPExportController) which conforms + * to this protocol. * * All export functionality is initially controlled by SPExportController, which is the single point within the * architecture that controls the user interface and provides user feedback. When the user starts an export * operation after selecting the available options, SPExportController should create an instance of the appropriate - * exporter (e.g. SPCSVExporter for a CSV export) and begin the export process. Any available progress information - * (defined in SPExporter as is common to all exporters) of the export should be set by the exporter and made + * exporter (e.g. SPCSVExporter for a CSV export, etc) and begin the export process. Any available progress information + * (defined in SPExporter as it's common to all exporters) of the export should be set by the exporter and made * available to SPExportController via delegate methods in order to update the user interface. * * Note that all exporters are designed to be run concurrently and as such this base class is a subclass of * NSOperation. All the data format specific subclasses have to do is override NSOperation's main() method * and implement all processes which are to be run concurrently within it. This method is automatically called - * once the exporter instance is placed on the operation queue once its ready to be run. + * once the exporter instance is placed on the operation queue once its ready to be run. It should not be + * explicity called. */ +#import "SPConstants.h" + @class MCPConnection, SPFileHandle; @interface SPExporter : NSOperation { + /** + * The MySQL connection to use + */ MCPConnection *connection; - + + /** + * The exports current progress value + */ double exportProgressValue; + /** + * The max progress value of the export operation + */ + double exportMaxProgress; + + /** + * Indicates whether or not the exporter is running + */ BOOL exportProcessIsRunning; + + /** + * Indicates whether or not low memory streaming is used + */ BOOL exportUsingLowMemoryBlockingStreaming; + /** + * Compress output + */ + BOOL exportOutputCompressFile; + + /** + * Compression format + */ + SPFileCompressionFormat exportOutputCompressionFormat; + + /** + * The resulting exported data as a string + */ NSString *exportData; + + /** + * The output file handle of the exporter + */ SPFileHandle *exportOutputFileHandle; + + /** + * Export output encoding + */ NSStringEncoding exportOutputEncoding; - - double exportMaxProgress; } @property(readwrite, retain) MCPConnection *connection; @@ -74,10 +114,26 @@ @property(readwrite, assign) BOOL exportProcessIsRunning; @property(readwrite, assign) BOOL exportUsingLowMemoryBlockingStreaming; +@property(readwrite, assign) SPFileCompressionFormat exportOutputCompressionFormat; + @property(readwrite, retain) NSString *exportData; @property(readwrite, retain) SPFileHandle *exportOutputFileHandle; @property(readwrite, assign) NSStringEncoding exportOutputEncoding; @property(readwrite, assign) double exportMaxProgress; +/** + * Returns whether or not file compression is in use. + * + * @return A BOOL indicating the use of compression + */ +- (BOOL)exportOutputCompressFile; + +/** + * Sets whether or not the resulting output of this exporter should be compressed. + * + * @param compress A BOOL indicating the use of compression + */ +- (void)setExportOutputCompressFile:(BOOL)compress; + @end diff --git a/Source/SPExporter.m b/Source/SPExporter.m index b7d9f242..cd45ec50 100644 --- a/Source/SPExporter.m +++ b/Source/SPExporter.m @@ -31,6 +31,7 @@ @synthesize exportProgressValue; @synthesize exportProcessIsRunning; @synthesize exportUsingLowMemoryBlockingStreaming; +@synthesize exportOutputCompressionFormat; @synthesize exportData; @synthesize exportOutputFileHandle; @synthesize exportOutputEncoding; @@ -44,9 +45,11 @@ if ((self = [super init])) { [self setExportProgressValue:0]; [self setExportProcessIsRunning:NO]; + [self setExportOutputCompressFile:NO]; + [self setExportOutputCompressionFormat:SPNoCompression]; // Default the resulting data to an empty string - [self setExportData:@""]; + [self setExportData:[NSString string]]; // Default the output encoding to UTF-8 [self setExportOutputEncoding:NSUTF8StringEncoding]; @@ -61,11 +64,32 @@ - (void)main { @throw [NSException exceptionWithName:@"NSOperation main() Call" - reason:@"Can't call NSOperation's main() method in SPExpoter, must be overriden in subclass." + reason:@"Cannot call NSOperation's main() method in SPExpoter, must be overriden in a subclass. See SPExporter.h" userInfo:nil]; } /** + * Returns whether or not file compression is in use. + */ +- (BOOL)exportOutputCompressFile +{ + return exportOutputCompressFile; +} + +/** + * Sets whether or not the resulting output of this exporter should be compressed. + */ +- (void)setExportOutputCompressFile:(BOOL)compress +{ + // If the export file handle is nil or a compression format has not yet been set don't proceed + if ((!exportOutputFileHandle) || ([self exportOutputCompressionFormat] == SPNoCompression)) return; + + exportOutputCompressFile = compress; + + [[self exportOutputFileHandle] setShouldWriteWithCompressionFormat:(compress) ? [self exportOutputCompressionFormat] : SPNoCompression]; +} + +/** * Get rid of the export data. */ - (void)dealloc diff --git a/Source/SPFileHandle.h b/Source/SPFileHandle.h index 05e05dd5..1bd2ef81 100644 --- a/Source/SPFileHandle.h +++ b/Source/SPFileHandle.h @@ -25,13 +25,16 @@ /** * Provides a class which aims to duplicate some of the most-used functionality - * of NSFileHandle, while also transparently supporting GZip-compressed content - * on reading; also supports GZip compression when writing. + * of NSFileHandle, while also transparently supporting gzip and bzip2 compressed content + * on reading; gzip and bzip2 compression is also supported on writing. */ #import <Cocoa/Cocoa.h> -@interface SPFileHandle : NSObject { +#import "SPConstants.h" + +@interface SPFileHandle : NSObject +{ void *wrappedFile; char *wrappedFilePath; @@ -46,57 +49,58 @@ BOOL dataWritten; BOOL allDataWritten; BOOL fileIsClosed; - BOOL useGzip; + BOOL useCompression; + + SPFileCompressionFormat compressionFormat; } - #pragma mark - #pragma mark Class methods -+ (id) fileHandleForReadingAtPath:(NSString *)path; -+ (id) fileHandleForWritingAtPath:(NSString *)path; -+ (id) fileHandleForPath:(NSString *)path mode:(int)mode; ++ (id)fileHandleForReadingAtPath:(NSString *)path; ++ (id)fileHandleForWritingAtPath:(NSString *)path; ++ (id)fileHandleForPath:(NSString *)path mode:(int)mode; #pragma mark - #pragma mark Initialisation // Returns a file handle initialised with a file -- (id) initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode; - +- (id)initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode; #pragma mark - #pragma mark Data reading // Reads data up to a specified number of bytes from the file -- (NSMutableData *) readDataOfLength:(NSUInteger)length; +- (NSMutableData *)readDataOfLength:(NSUInteger)length; // Returns the data to the end of the file -- (NSMutableData *) readDataToEndOfFile; +- (NSMutableData *)readDataToEndOfFile; // Returns the on-disk (raw) length of data read so far - can be used in progress bars -- (NSUInteger) realDataReadLength; +- (NSUInteger)realDataReadLength; #pragma mark - #pragma mark Data writing -// Set whether data should be written as gzipped data (defaults to NO on a fresh object) -- (void) setShouldWriteWithGzipCompression:(BOOL)useGzip; +// Set whether data should be written in the supplied compression format (defaults to NO on a fresh object) +- (void)setShouldWriteWithCompressionFormat:(SPFileCompressionFormat)useCompressionFormat; // Write the provided data to the file -- (void) writeData:(NSData *)data; +- (void)writeData:(NSData *)data; // Ensures any buffers are written to disk -- (void) synchronizeFile; +- (void)synchronizeFile; // Prevents further access to the file -- (void) closeFile; - +- (void)closeFile; #pragma mark - #pragma mark File information -// Returns whether gzip compression is enabled on the file -- (BOOL) isCompressed; +// Returns whether compression is enabled on the file +- (BOOL)isCompressed; +// Returns the compression format being used. Currently gzip or bzip2 only. +- (SPFileCompressionFormat)compressionFormat; @end diff --git a/Source/SPFileHandle.m b/Source/SPFileHandle.m index bceae2aa..ac812ac7 100644 --- a/Source/SPFileHandle.m +++ b/Source/SPFileHandle.m @@ -25,6 +25,7 @@ #import "SPFileHandle.h" #import "zlib.1.2.4.h" +#import "bzlib.h" #import "pthread.h" // Define the maximum size of the background write buffer before the writing thread @@ -32,9 +33,10 @@ #define SPFH_MAX_WRITE_BUFFER_SIZE 1048576 @interface SPFileHandle (PrivateAPI) -- (void) _writeBufferToData; -@end +- (void)_writeBufferToData; + +@end @implementation SPFileHandle @@ -42,13 +44,16 @@ #pragma mark Setup and teardown /** - * Initialises and returns a SPFileHandle with a specified file (FILE or gzFile). + * Initialises and returns a SPFileHandle with a specified file (FILE, gzFile or BZFILE). * "mode" indicates the file interaction mode - currently only read-only * or write-only are supported. - * On reading, theFile should always be a gzFile; on writing, theFile is a FILE - * when compression is disabled, or a gzFile when enbled. + * + * On reading, theFile can either be one of FILE, gzFile or BZFILE depending on the attempt to + * determine whether or not the file is in a compressed format (gzip or bzip2). On writing, + * theFile is a FILE when compression is disabled, a gzFile when gzip compression is enabled + * or a BZFILE when bzip2 compression is enabled. */ -- (id) initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode +- (id)initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode { if (self = [super init]) { dataWritten = NO; @@ -61,26 +66,77 @@ // Check and set the mode fileMode = mode; + if (fileMode != O_RDONLY && fileMode != O_WRONLY) { [NSException raise:NSInvalidArgumentException format:@"SPFileHandle only supports read-only and write-only file modes"]; } // Instantiate the buffer pthread_mutex_init(&bufferLock, NULL); + buffer = [[NSMutableData alloc] init]; bufferDataLength = 0; bufferPosition = 0; endOfFile = NO; + + useCompression = NO; + compressionFormat = SPNoCompression; // If in read mode, set up the buffer if (fileMode == O_RDONLY) { - gzbuffer(wrappedFile, 131072); - useGzip = !gzdirect(wrappedFile); + + int i, c; + char *bzbuf = malloc(4); + const char *charFileMode = (fileMode == O_WRONLY) ? "wb" : "rb"; + + BZFILE *bzfile; + gzFile *gzfile = gzopen(path, charFileMode); + + // Set gzip buffer + gzbuffer(gzfile, 131072); + + // Get the first 3 bytes from the file + for (i = 0; (c = getc(wrappedFile)) != EOF && i < 4; bzbuf[i++] = c); + + // Test to see if the file is gzip compressed + BOOL isGzip = (!gzdirect(gzfile)); + + // Test to see if the first 2 bytes extracted from the file match the Bzip2 signature/magic number + // (BZ). The 3rd byte should be either 'h' (Huffman encoding) or 0 (Bzip1 - deprecated) to + // indicate the Bzip version. Finally, the 4th byte should be a number between 1 and 9 that indicates + // the block size used. + BOOL isBzip2 = ((bzbuf[0] == 'B') && (bzbuf[1] == 'Z') && + ((bzbuf[2] == 'h') || (bzbuf[2] == '0')) && + ((bzbuf[3] >= 0x31) && (bzbuf[3] <= 0x39))); + + free(bzbuf); + + if (isBzip2) bzfile = BZ2_bzopen(path, charFileMode); + + useCompression = (isGzip || isBzip2); + + if (useCompression) { + if (isGzip) { + compressionFormat = SPGzipCompression; + wrappedFile = gzfile; + } + else if (isBzip2) { + compressionFormat = SPBzip2Compression; + wrappedFile = bzfile; + gzclose(gzfile); + } + + fclose(theFile); + } + else { + gzclose(gzfile); + } + processingThread = nil; - + } // In write mode, set up a thread to handle writing in the background - } else if (fileMode == O_WRONLY) { - useGzip = NO; + else if (fileMode == O_WRONLY) { + useCompression = NO; processingThread = [[NSThread alloc] initWithTarget:self selector:@selector(_writeBufferToData) object:nil]; [processingThread start]; } @@ -89,7 +145,10 @@ return self; } -- (void) dealloc +/** + * Dealloc. + */ +- (void)dealloc { [self closeFile]; if (processingThread) [processingThread release]; @@ -106,7 +165,7 @@ * Retrieve and return a SPFileHandle for reading a file at the supplied * path. Returns nil if the file could not be found or opened. */ -+ (id) fileHandleForReadingAtPath:(NSString *)path ++ (id)fileHandleForReadingAtPath:(NSString *)path { return [self fileHandleForPath:path mode:O_RDONLY]; } @@ -115,57 +174,63 @@ * Retrieve and return a SPFileHandle for writing a file at the supplied * path. Returns nil if the file could not be found or opened. */ -+ (id) fileHandleForWritingAtPath:(NSString *)path ++ (id)fileHandleForWritingAtPath:(NSString *)path { return [self fileHandleForPath:path mode:O_WRONLY]; } /** * Retrieve and return a SPFileHandle for a file at the specified path, - * using the supplied file status flag. Returns nil if the file could + * using the supplied file status flag. Returns nil if the file could * not be found or opened. */ -+ (id) fileHandleForPath:(NSString *)path mode:(int)mode ++ (id)fileHandleForPath:(NSString *)path mode:(int)mode { - // Retrieves the path in a filesystem-appropriate format and encoding const char *pathRepresentation = [path fileSystemRepresentation]; if (!pathRepresentation) return nil; // Open the file to get a file descriptor, returning on failure - FILE *theFile; - const char *theMode; - if (mode == O_WRONLY) { - theMode = "wb"; - theFile = fopen(pathRepresentation, theMode); - } else { - theMode = "rb"; - theFile = gzopen(pathRepresentation, theMode); - } - if (theFile == NULL) return nil; + const char *theMode = (mode == O_WRONLY) ? "wb" : "rb"; + + FILE *file = fopen(pathRepresentation, theMode); + + if (file == NULL) return nil; // Return an autoreleased file handle - return [[[self alloc] initWithFile:theFile fromPath:pathRepresentation mode:mode] autorelease]; + return [[[self alloc] initWithFile:file fromPath:pathRepresentation mode:mode] autorelease]; } - #pragma mark - #pragma mark Data reading /** * Reads data up to a specified number of uncompressed bytes from the file. */ -- (NSMutableData *) readDataOfLength:(NSUInteger)length -{ +- (NSMutableData *)readDataOfLength:(NSUInteger)length +{ + long theDataLength; void *theData = malloc(length); - long theDataLength = gzread(wrappedFile, theData, length); + + if (useCompression) { + if (compressionFormat == SPGzipCompression) { + theDataLength = gzread(wrappedFile, theData, length); + } + else if (compressionFormat == SPBzip2Compression) { + theDataLength = BZ2_bzread(wrappedFile, theData, length); + } + } + else { + theDataLength = fread(theData, 1, length, wrappedFile); + } + return [NSMutableData dataWithBytesNoCopy:theData length:theDataLength freeWhenDone:YES]; } /** * Returns all the data to the end of the file. */ -- (NSMutableData *) readDataToEndOfFile +- (NSMutableData *)readDataToEndOfFile { return [self readDataOfLength:NSUIntegerMax]; } @@ -175,10 +240,16 @@ * This includes any compression headers within the data, and can be used * for progress bars when processing files. */ -- (NSUInteger) realDataReadLength +- (NSUInteger)realDataReadLength { - if (fileMode == O_WRONLY) return 0; - return gzoffset(wrappedFile); + if ((fileMode == O_WRONLY) || (compressionFormat == SPBzip2Compression)) return 0; + + if (useCompression && (compressionFormat == SPGzipCompression)) { + return gzoffset(wrappedFile); + } + else { + return ftell(wrappedFile); + } } #pragma mark - @@ -189,31 +260,49 @@ * to NO on a fresh object. If this is called after data has been * written, an exception is thrown. */ -- (void) setShouldWriteWithGzipCompression:(BOOL)shouldUseGzip +- (void)setShouldWriteWithCompressionFormat:(SPFileCompressionFormat)useCompressionFormat { - if (shouldUseGzip == useGzip) return; + if (compressionFormat == useCompressionFormat) return; - if (dataWritten) [NSException raise:NSInternalInconsistencyException format:@"Cannot change compression settings when data has already been written"]; - - if (shouldUseGzip) { + // Regardless of the supplied argument, close the current file according to how it was previously opened + if (useCompression) { + if (compressionFormat == SPGzipCompression) { + gzclose(wrappedFile); + } + else if (compressionFormat == SPBzip2Compression) { + BZ2_bzclose(wrappedFile); + } + } + else { fclose(wrappedFile); - wrappedFile = gzopen(wrappedFilePath, "wb"); - gzbuffer(wrappedFile, 131072); - } else { - gzclose(wrappedFile); + } + + if (dataWritten) [NSException raise:NSInternalInconsistencyException format:@"Cannot change compression settings when data has already been written."]; + + useCompression = ((useCompressionFormat == SPGzipCompression) || (useCompressionFormat == SPBzip2Compression)); + + compressionFormat = useCompressionFormat; + + if (useCompression) { + if (compressionFormat == SPGzipCompression) { + wrappedFile = gzopen(wrappedFilePath, "wb"); + gzbuffer(wrappedFile, 131072); + } + else if (compressionFormat == SPBzip2Compression) { + wrappedFile = BZ2_bzopen(wrappedFilePath, "wb"); + } + } + else { wrappedFile = fopen(wrappedFilePath, "wb"); } - useGzip = shouldUseGzip; } - /** * Write the supplied data to the file. The data may not be written to the * disk at once (see synchronizeFile). */ -- (void) writeData:(NSData *)data +- (void)writeData:(NSData *)data { - // Throw an exception if the file is closed if (fileIsClosed) [NSException raise:NSInternalInconsistencyException format:@"Cannot write to a file handle after it has been closed"]; @@ -237,7 +326,7 @@ /** * Blocks until all data has been written to disk. */ -- (void) synchronizeFile +- (void)synchronizeFile { pthread_mutex_lock(&bufferLock); while (!allDataWritten) { @@ -252,35 +341,51 @@ * Ensure all data is written out, close any file handles, and prevent any * more data from being written to the file. */ -- (void) closeFile +- (void)closeFile { if (!fileIsClosed) { [self synchronizeFile]; - if (useGzip || fileMode == O_RDONLY) { - gzclose(wrappedFile); - } else { + + if (useCompression) { + if (compressionFormat == SPGzipCompression) { + gzclose(wrappedFile); + } + else if (compressionFormat == SPBzip2Compression) { + BZ2_bzclose(wrappedFile); + } + } + else { fclose(wrappedFile); } + if (processingThread) { if ([processingThread isExecuting]) { [processingThread cancel]; while ([processingThread isExecuting]) usleep(100); } } + fileIsClosed = YES; } } - #pragma mark - #pragma mark File information /** - * Returns whether gzip compression is enabled on the file. + * Returns whether compression is enabled on the file. */ -- (BOOL) isCompressed +- (BOOL)isCompressed { - return useGzip; + return useCompression; +} + +/** + * Returns the compression format being used. Currently gzip or bzip2 only. + */ +- (SPFileCompressionFormat)compressionFormat +{ + return compressionFormat; } @end @@ -292,7 +397,7 @@ * up in a buffer and write to disk in chunks as the buffer fills. This allows * background compression of the data when using Gzip compression. */ -- (void) _writeBufferToData +- (void)_writeBufferToData { NSAutoreleasePool *writePool = [[NSAutoreleasePool alloc] init]; @@ -315,9 +420,19 @@ // Write out the data long bufferLengthWrittenOut; - if (useGzip) { - bufferLengthWrittenOut = gzwrite(wrappedFile, [dataToBeWritten bytes], [dataToBeWritten length]); - } else { + + if (useCompression) { + switch (compressionFormat) + { + case SPGzipCompression: + bufferLengthWrittenOut = gzwrite(wrappedFile, [dataToBeWritten bytes], [dataToBeWritten length]); + break; + case SPBzip2Compression: + bufferLengthWrittenOut = BZ2_bzwrite(wrappedFile, [dataToBeWritten bytes], [dataToBeWritten length]); + break; + } + } + else { bufferLengthWrittenOut = fwrite([dataToBeWritten bytes], 1, [dataToBeWritten length], wrappedFile); } diff --git a/Source/SPSQLExporter.h b/Source/SPSQLExporter.h index 1dcacf4b..6f42dd4c 100644 --- a/Source/SPSQLExporter.h +++ b/Source/SPSQLExporter.h @@ -88,11 +88,6 @@ BOOL sqlOutputIncludeErrors; /** - * Compress output - */ - BOOL sqlOutputCompressFile; - - /** * New INSERT statement divider */ SPSQLExportInsertDivider sqlInsertDivider; @@ -127,7 +122,6 @@ @property(readwrite, assign) BOOL sqlOutputIncludeUTF8BOM; @property(readwrite, assign) BOOL sqlOutputEncodeBLOBasHex; @property(readwrite, assign) BOOL sqlOutputIncludeErrors; -@property(readwrite, assign) BOOL sqlOutputCompressFile; @property(readwrite, assign) NSUInteger sqlCurrentTableExportIndex; @property(readwrite, assign) NSUInteger sqlInsertAfterNValue; diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 3d36fce3..7249af1d 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -52,7 +52,6 @@ @synthesize sqlOutputIncludeUTF8BOM; @synthesize sqlOutputEncodeBLOBasHex; @synthesize sqlOutputIncludeErrors; -@synthesize sqlOutputCompressFile; @synthesize sqlCurrentTableExportIndex; @synthesize sqlInsertAfterNValue; @synthesize sqlInsertDivider; @@ -140,6 +139,8 @@ { // Check for cancellation flag if ([self isCancelled]) { + [errors release]; + [sqlString release]; [pool release]; return; } @@ -159,7 +160,7 @@ [targetArray addObject:item]; } - // If required write the UTF-8 Byte Order Mark + // If required write the UTF-8 Byte Order Mark (BOM) if ([self sqlOutputIncludeUTF8BOM]) { [metaString setString:@"\xef\xbb\xbf"]; [metaString appendString:@"# ************************************************************\n"]; @@ -167,9 +168,6 @@ else { [metaString setString:@"# ************************************************************\n"]; } - - // If required set the file handle to compress it's output - [[self exportOutputFileHandle] setShouldWriteWithGzipCompression:[self sqlOutputCompressFile]]; // Add the dump header to the dump file [metaString appendString:@"# Sequel Pro SQL dump\n"]; @@ -186,12 +184,6 @@ [metaString appendString:@"/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"]; [metaString appendString:@"/*!40101 SET NAMES utf8 */;\n"]; - // Add commands to store and disable unique checks, foreign key checks, mode and notes where supported. - // Include trailing semicolons to ensure they're run individually. Use MySQL-version based comments. - //if (sqlOutputIncludeDropSyntax) { - //[metaString appendString:@"/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"]; - //} - [metaString appendString:@"/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"]; [metaString appendString:@"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"]; [metaString appendString:@"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n\n"]; @@ -722,10 +714,6 @@ [metaString appendString:@"/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n"]; [metaString appendString:@"/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n"]; - //if (sqlOutputIncludeDropSyntax) { - //[metaString appendString:@"/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n"]; - //} - // Restore the client encoding to the original encoding before import [metaString appendString:@"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"]; [metaString appendString:@"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"]; diff --git a/Source/SPXMLExporterDelegate.m b/Source/SPXMLExporterDelegate.m index ace3f0fa..44deb33c 100644 --- a/Source/SPXMLExporterDelegate.m +++ b/Source/SPXMLExporterDelegate.m @@ -45,6 +45,7 @@ // Only update the progress text if this is a table export if (exportSource == SPTableExport) { + // Update the current table export index currentTableExportIndex = (exportTableCount - [exporters count]); diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 30669b87..fe304ea9 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -52,6 +52,7 @@ 1792C13210AD752100ABE758 /* DatabaseServerVariables.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1792C13010AD752100ABE758 /* DatabaseServerVariables.xib */; }; 1792C13710AD75C800ABE758 /* SPServerVariablesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1792C13610AD75C800ABE758 /* SPServerVariablesController.m */; }; 1792C26110AE1A2D00ABE758 /* SPConnectionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1792C26010AE1A2D00ABE758 /* SPConnectionDelegate.m */; }; + 179ECECA11F265FC009C6A40 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 179ECEC611F265EE009C6A40 /* libbz2.dylib */; }; 179F15060F7C433C00579954 /* SPEditorTokens.l in Sources */ = {isa = PBXBuildFile; fileRef = 179F15050F7C433C00579954 /* SPEditorTokens.l */; }; 17A7773411C52D8E001E27B4 /* SPIndexesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17A7773311C52D8E001E27B4 /* SPIndexesController.m */; }; 17A7773811C52E61001E27B4 /* IndexesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17A7773611C52E61001E27B4 /* IndexesView.xib */; }; @@ -488,6 +489,7 @@ 1792C13610AD75C800ABE758 /* SPServerVariablesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPServerVariablesController.m; sourceTree = "<group>"; }; 1792C25F10AE1A2D00ABE758 /* SPConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPConnectionDelegate.h; sourceTree = "<group>"; }; 1792C26010AE1A2D00ABE758 /* SPConnectionDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPConnectionDelegate.m; sourceTree = "<group>"; }; + 179ECEC611F265EE009C6A40 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; 179F15040F7C433C00579954 /* SPEditorTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPEditorTokens.h; sourceTree = "<group>"; }; 179F15050F7C433C00579954 /* SPEditorTokens.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; path = SPEditorTokens.l; sourceTree = "<group>"; }; 17A66F6A10B1ED59004C9B12 /* old-appicon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "old-appicon.icns"; sourceTree = "<group>"; }; @@ -998,6 +1000,7 @@ 58C458DF10CF188F00E6E13E /* libcrypto.dylib in Frameworks */, B52ECDDC10DDACE9009DC3E8 /* BWToolkitFramework.framework in Frameworks */, 586EBD2411418D7C00B3DE45 /* FeedbackReporter.framework in Frameworks */, + 179ECECA11F265FC009C6A40 /* libbz2.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1014,8 +1017,10 @@ 4DECC3320EC2A170008D359E /* Sparkle.framework */, 296DC89E0F8FD336002A3258 /* WebKit.framework */, 586EBD2311418D7C00B3DE45 /* FeedbackReporter.framework */, + 580E8EDC11EBE2A4000D8427 /* SystemConfiguration.framework */, 296DC8BE0F9091DF002A3258 /* libicucore.dylib */, 17B7B58F1016028F00F057DE /* libcrypto.dylib */, + 179ECEC611F265EE009C6A40 /* libbz2.dylib */, 17B7B591101602AE00F057DE /* libssl.dylib */, 583CE52C11725642008F148E /* libz.dylib */, ); @@ -1786,7 +1791,6 @@ 1761FD9C0EF0486A00331368 /* Scripts */, 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, 19C28FB0FE9D524F11CA2CBB /* Products */, - 580E8EDC11EBE2A4000D8427 /* SystemConfiguration.framework */, ); name = "sequel-pro"; sourceTree = "<group>"; |