aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-10-12 01:43:00 +0200
committerMax <post@wickenrode.com>2015-10-12 01:43:00 +0200
commit275afcdc8e93a1eb6e89825c28a74c69125917ce (patch)
tree76096fdc03e7af3c35b5c4d499f357cec87d95c0
parent319eee397f894160aa5d6132d7d07881a75a762e (diff)
downloadsequelpro-275afcdc8e93a1eb6e89825c28a74c69125917ce.tar.gz
sequelpro-275afcdc8e93a1eb6e89825c28a74c69125917ce.tar.bz2
sequelpro-275afcdc8e93a1eb6e89825c28a74c69125917ce.zip
Add an option to save the current export dialog settings to a file
-rw-r--r--Interfaces/English.lproj/ExportDialog.xib59
-rw-r--r--Source/SPExportSettingsPersistence.h44
-rw-r--r--Source/SPExportSettingsPersistence.m380
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj6
4 files changed, 487 insertions, 2 deletions
diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib
index 5cea2358..856dc6d9 100644
--- a/Interfaces/English.lproj/ExportDialog.xib
+++ b/Interfaces/English.lproj/ExportDialog.xib
@@ -1229,10 +1229,33 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
+ <object class="NSButton" id="563113326">
+ <reference key="NSNextResponder" ref="1039688935"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{461, 344}, {43, 28}}</string>
+ <reference key="NSSuperview" ref="1039688935"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="344258736">
+ <int key="NSCellFlags">67108864</int>
+ <int key="NSCellFlags2">134348800</int>
+ <string key="NSContents">S…</string>
+ <reference key="NSSupport" ref="26"/>
+ <string key="NSCellIdentifier">_NS:9</string>
+ <reference key="NSControlView" ref="563113326"/>
+ <int key="NSButtonFlags">-2038284288</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
<object class="NSButton" id="1058029781">
<reference key="NSNextResponder" ref="1039688935"/>
<int key="NSvFlags">265</int>
- <string key="NSFrame">{{408, 344}, {94, 28}}</string>
+ <string key="NSFrame">{{369, 344}, {94, 28}}</string>
<reference key="NSSuperview" ref="1039688935"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="808873518">
@@ -1275,7 +1298,7 @@
<object class="NSTextField" id="412690578">
<reference key="NSNextResponder" ref="1039688935"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{127, 349}, {278, 19}}</string>
+ <string key="NSFrame">{{127, 349}, {239, 19}}</string>
<reference key="NSSuperview" ref="1039688935"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="291144691">
@@ -3596,6 +3619,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string key="id">1273</string>
</object>
<object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">exportCurrentSettings:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="563113326"/>
+ </object>
+ <string key="id">SsW-ax-uuL</string>
+ </object>
+ <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="834889278"/>
@@ -3988,6 +4019,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<reference ref="429080228"/>
<reference ref="1058029781"/>
<reference ref="414783283"/>
+ <reference ref="563113326"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">Exporter View</string>
@@ -5193,6 +5225,19 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<reference key="object" ref="77737022"/>
<reference key="parent" ref="193458164"/>
</object>
+ <object class="IBObjectRecord">
+ <string key="id">77c-r9-26W</string>
+ <reference key="object" ref="563113326"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="344258736"/>
+ </array>
+ <reference key="parent" ref="1039688935"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">DcJ-W4-asV</string>
+ <reference key="object" ref="344258736"/>
+ <reference key="parent" ref="563113326"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -5540,6 +5585,16 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string key="579.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="580.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="581.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSMutableDictionary" key="77c-r9-26W.IBAttributePlaceholdersKey">
+ <string key="NS.key.0">ToolTip</string>
+ <object class="IBToolTipAttribute" key="NS.object.0">
+ <string key="name">ToolTip</string>
+ <reference key="object" ref="563113326"/>
+ <string key="toolTip">Save the current export settings to disk</string>
+ </object>
+ </object>
+ <string key="77c-r9-26W.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="DcJ-W4-asV.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
diff --git a/Source/SPExportSettingsPersistence.h b/Source/SPExportSettingsPersistence.h
new file mode 100644
index 00000000..2f9104c4
--- /dev/null
+++ b/Source/SPExportSettingsPersistence.h
@@ -0,0 +1,44 @@
+//
+// SPExportSettingsPersistence.h
+// sequel-pro
+//
+// Created by Max Lohrmann on 09.10.15.
+// Copyright (c) 2015 Max Lohrmann. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+// More info at <https://github.com/sequelpro/sequelpro>
+
+#import <Foundation/Foundation.h>
+#import "SPExportController.h"
+
+@interface SPExportController (SPExportSettingsPersistence)
+
+- (IBAction)exportCurrentSettings:(id)sender;
+- (NSDictionary *)currentSettingsAsDictionary;
+
+/**
+ * @return A serialized form of the "custom filename" field
+ */
+- (NSDictionary *)currentCustomFilenameAsArray;
+
+@end
diff --git a/Source/SPExportSettingsPersistence.m b/Source/SPExportSettingsPersistence.m
new file mode 100644
index 00000000..68963856
--- /dev/null
+++ b/Source/SPExportSettingsPersistence.m
@@ -0,0 +1,380 @@
+//
+// SPExportSettingsPersistence.m
+// sequel-pro
+//
+// Created by Max Lohrmann on 09.10.15.
+// Copyright (c) 2015 Max Lohrmann. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+// More info at <https://github.com/sequelpro/sequelpro>
+
+#import "SPExportSettingsPersistence.h"
+#import "SPExportFileNameTokenObject.h"
+
+/**
+ * converts a ([obj state] == NSOnState) to @YES / @NO
+ * (because doing @([obj state] == NSOnState) will result in an integer 0/1)
+ */
+static inline NSNumber *IsOn(id obj);
+
+@interface SPExportController (SPExportSettingsPersistence_Private)
+
++ (NSString *)describeExportSource:(SPExportSource)es;
++ (NSString *)describeExportType:(SPExportType)et;
++ (NSString *)describeCompressionFormat:(SPFileCompressionFormat)cf;
++ (NSString *)describeXMLExportFormat:(SPXMLExportFormat)xf;
++ (NSString *)describeSQLExportInsertDivider:(SPSQLExportInsertDivider)eid;
+
+- (NSDictionary *)exporterSettings;
+- (NSDictionary *)csvSettings;
+- (NSDictionary *)dotSettings;
+- (NSDictionary *)xmlSettings;
+- (NSDictionary *)sqlSettings;
+
+- (id)exporterSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type;
+- (id)dotSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type;
+- (id)xmlSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type;
+- (id)csvSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type;
+- (id)sqlSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type;
+
+@end
+
+#pragma mark -
+
+@implementation SPExportController (SPExportSettingsPersistence)
+
+#define NAMEOF(x) case x: return @#x
+
++ (NSString *)describeExportSource:(SPExportSource)es
+{
+ switch (es) {
+ NAMEOF(SPFilteredExport);
+ NAMEOF(SPQueryExport);
+ NAMEOF(SPTableExport);
+ }
+ return nil;
+}
+
++ (NSString *)describeExportType:(SPExportType)et
+{
+ switch (et) {
+ NAMEOF(SPSQLExport);
+ NAMEOF(SPCSVExport);
+ NAMEOF(SPXMLExport);
+ NAMEOF(SPDotExport);
+ NAMEOF(SPPDFExport);
+ NAMEOF(SPHTMLExport);
+ NAMEOF(SPExcelExport);
+ }
+ return nil;
+}
+
++ (NSString *)describeCompressionFormat:(SPFileCompressionFormat)cf
+{
+ switch (cf) {
+ NAMEOF(SPNoCompression);
+ NAMEOF(SPGzipCompression);
+ NAMEOF(SPBzip2Compression);
+ }
+ return nil;
+}
+
++ (NSString *)describeXMLExportFormat:(SPXMLExportFormat)xf
+{
+ switch (xf) {
+ NAMEOF(SPXMLExportMySQLFormat);
+ NAMEOF(SPXMLExportPlainFormat);
+ }
+ return nil;
+}
+
++ (NSString *)describeSQLExportInsertDivider:(SPSQLExportInsertDivider)eid
+{
+ switch (eid) {
+ NAMEOF(SPSQLInsertEveryNDataBytes);
+ NAMEOF(SPSQLInsertEveryNRows);
+ }
+ return nil;
+}
+
+#undef NAMEOF
+
+- (IBAction)exportCurrentSettings:(id)sender
+{
+ //show save file dialog
+ NSSavePanel *panel = [NSSavePanel savePanel];
+
+ [panel setAllowedFileTypes:@[SPFileExtensionDefault]];
+
+ [panel setExtensionHidden:NO];
+ [panel setAllowsOtherFileTypes:NO];
+ [panel setCanSelectHiddenExtension:YES];
+ [panel setCanCreateDirectories:YES];
+
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) {
+ if(returnCode != NSFileHandlingPanelOKButton) return;
+
+ NSError *err = nil;
+ NSData *plist = [NSPropertyListSerialization dataWithPropertyList:[self currentSettingsAsDictionary]
+ format:NSPropertyListXMLFormat_v1_0
+ options:0
+ error:&err];
+ if(!err) {
+ [plist writeToURL:[panel URL] options:NSAtomicWrite error:&err];
+ if(!err) return;
+ }
+
+ NSAlert *alert = [NSAlert alertWithError:err];
+ [alert setAlertStyle:NSCriticalAlertStyle];
+ [alert runModal];
+ }];
+}
+
+- (NSArray *)currentCustomFilenameAsArray
+{
+ NSArray *tokenListIn = [exportCustomFilenameTokenField objectValue];
+ NSMutableArray *tokenListOut = [NSMutableArray arrayWithCapacity:[tokenListIn count]];
+
+ for (id obj in tokenListIn) {
+ if([obj isKindOfClass:[NSString class]]) {
+ [tokenListOut addObject:obj];
+ }
+ else if([obj isKindOfClass:[SPExportFileNameTokenObject class]]) {
+ NSDictionary *tokenProperties = @{@"tokenId": [obj tokenId]};
+ // in the future the dict can be used to store per-token settings
+ [tokenListOut addObject:tokenProperties];
+ }
+ else {
+ SPLog(@"unknown object in token list: %@",obj);
+ }
+ }
+
+ return tokenListOut;
+}
+
+- (NSDictionary *)currentSettingsAsDictionary
+{
+ NSMutableDictionary *root = [NSMutableDictionary dictionary];
+
+ [root setObject:@"export settings" forKey:SPFFormatKey];
+ [root setObject:@1 forKey:SPFVersionKey];
+
+ [root setObject:[exportPathField stringValue] forKey:@"exportPath"];
+
+ [root setObject:[[self class] describeExportSource:exportSource] forKey:@"exportSource"];
+ [root setObject:[[self class] describeExportType:exportType] forKey:@"exportType"];
+
+ if([[exportCustomFilenameTokenField stringValue] length] > 0) {
+ [root setObject:[self currentCustomFilenameAsArray] forKey:@"customFilename"];
+ }
+
+ [root setObject:[self exporterSettings] forKey:@"settings"];
+
+ if(exportSource == SPTableExport) {
+ NSMutableDictionary *perObjectSettings = [NSMutableDictionary dictionaryWithCapacity:[tables count]];
+
+ for (NSMutableArray *table in tables) {
+ NSString *key = [table objectAtIndex:0];
+ id settings = [self exporterSpecificSettingsForSchemaObject:key ofType:SPTableTypeTable];
+ if(settings)
+ [perObjectSettings setObject:settings forKey:key];
+ }
+
+ [root setObject:perObjectSettings forKey:@"schemaObjects"];
+ }
+
+ [root setObject:IsOn(exportProcessLowMemoryButton) forKey:@"lowMemoryStreaming"];
+ [root setObject:[[self class] describeCompressionFormat:(SPFileCompressionFormat)[exportOutputCompressionFormatPopupButton indexOfSelectedItem]] forKey:@"compressionFormat"];
+
+ return root;
+}
+
+- (NSDictionary *)exporterSettings
+{
+ switch (exportType) {
+ case SPCSVExport:
+ return [self csvSettings];
+ case SPSQLExport:
+ return [self sqlSettings];
+ case SPXMLExport:
+ return [self xmlSettings];
+ case SPDotExport:
+ return [self dotSettings];
+ case SPExcelExport:
+ case SPHTMLExport:
+ case SPPDFExport:
+ default:
+ @throw [NSException exceptionWithName:NSInternalInconsistencyException
+ reason:@"exportType not implemented!"
+ userInfo:@{@"exportType": @(exportType)}];
+ }
+}
+
+- (NSDictionary *)csvSettings
+{
+ return @{
+ @"exportToMultipleFiles": IsOn(exportFilePerTableCheck),
+ @"CSVIncludeFieldNames": IsOn(exportCSVIncludeFieldNamesCheck),
+ @"CSVFieldsTerminated": [exportCSVFieldsTerminatedField stringValue],
+ @"CSVFieldsWrapped": [exportCSVFieldsWrappedField stringValue],
+ @"CSVLinesTerminated": [exportCSVLinesTerminatedField stringValue],
+ @"CSVFieldsEscaped": [exportCSVFieldsEscapedField stringValue],
+ @"CSVNULLValuesAsText": [exportCSVNULLValuesAsTextField stringValue]
+ };
+}
+
+- (NSDictionary *)dotSettings
+{
+ return @{@"DotForceLowerTableNames": IsOn(exportDotForceLowerTableNamesCheck)};
+}
+
+- (NSDictionary *)xmlSettings
+{
+ return @{
+ @"exportToMultipleFiles": IsOn(exportFilePerTableCheck),
+ @"XMLFormat": [[self class] describeXMLExportFormat:(SPXMLExportFormat)[exportXMLFormatPopUpButton indexOfSelectedItem]],
+ @"XMLOutputIncludeStructure": IsOn(exportXMLIncludeStructure),
+ @"XMLOutputIncludeContent": IsOn(exportXMLIncludeContent),
+ @"XMLNULLString": [exportXMLNULLValuesAsTextField stringValue]
+ };
+}
+
+- (NSDictionary *)sqlSettings
+{
+ BOOL includeStructure = ([exportSQLIncludeStructureCheck state] == NSOnState);
+
+ NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:@{
+ @"SQLIncludeStructure": IsOn(exportSQLIncludeStructureCheck),
+ @"SQLIncludeContent": IsOn(exportSQLIncludeContentCheck),
+ @"SQLIncludeErrors": IsOn(exportSQLIncludeErrorsCheck),
+ @"SQLUseUTF8BOM": IsOn(exportUseUTF8BOMButton),
+ @"SQLBLOBFieldsAsHex": IsOn(exportSQLBLOBFieldsAsHexCheck),
+ @"SQLInsertNValue": @([exportSQLInsertNValueTextField integerValue]),
+ @"SQLInsertDivider": [[self class] describeSQLExportInsertDivider:(SPSQLExportInsertDivider)[exportSQLInsertDividerPopUpButton indexOfSelectedItem]]
+ }];
+
+ if(includeStructure) {
+ [dict addEntriesFromDictionary:@{
+ @"SQLIncludeAutoIncrementValue": IsOn(exportSQLIncludeAutoIncrementValueButton),
+ @"SQLIncludeDropSyntax": IsOn(exportSQLIncludeDropSyntaxCheck)
+ }];
+ }
+
+ return dict;
+}
+
+- (id)exporterSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type
+{
+ switch (exportType) {
+ case SPCSVExport:
+ return [self csvSpecificSettingsForSchemaObject:name ofType:type];
+ case SPSQLExport:
+ return [self sqlSpecificSettingsForSchemaObject:name ofType:type];
+ case SPXMLExport:
+ return [self xmlSpecificSettingsForSchemaObject:name ofType:type];
+ case SPDotExport:
+ return [self dotSpecificSettingsForSchemaObject:name ofType:type];
+ case SPExcelExport:
+ case SPHTMLExport:
+ case SPPDFExport:
+ default:
+ @throw [NSException exceptionWithName:NSInternalInconsistencyException
+ reason:@"exportType not implemented!"
+ userInfo:@{@"exportType": @(exportType)}];
+ }
+}
+
+- (id)dotSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type
+{
+ // Dot is a graph of the whole database - nothing to pick from
+ return nil;
+}
+
+- (id)xmlSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type
+{
+ // XML per table setting is only yes/no
+ if(type == SPTableTypeTable) {
+ // we have to look through the table views' rows to find the current checkbox value...
+ for (NSArray *table in tables) {
+ if([[table objectAtIndex:0] isEqualTo:name]) {
+ return @([[table objectAtIndex:2] boolValue]);
+ }
+ }
+ }
+ return nil;
+}
+
+- (id)csvSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type
+{
+ // CSV per table setting is only yes/no
+ if(type == SPTableTypeTable) {
+ // we have to look through the table views rows to find the current checkbox value...
+ for (NSArray *table in tables) {
+ if([[table objectAtIndex:0] isEqualTo:name]) {
+ return @([[table objectAtIndex:2] boolValue]);
+ }
+ }
+ }
+ return nil;
+}
+
+- (id)sqlSpecificSettingsForSchemaObject:(NSString *)name ofType:(SPTableType)type
+{
+ BOOL structure = ([exportSQLIncludeStructureCheck state] == NSOnState);
+ BOOL content = ([exportSQLIncludeContentCheck state] == NSOnState);
+ BOOL drop = ([exportSQLIncludeDropSyntaxCheck state] == NSOnState);
+
+ // SQL allows per table setting of structure/content/drop table
+ if(type == SPTableTypeTable) {
+ // we have to look through the table views rows to find the current checkbox value...
+ for (NSArray *table in tables) {
+ if([[table objectAtIndex:0] isEqualTo:name]) {
+ NSMutableArray *flags = [NSMutableArray arrayWithCapacity:3];
+
+ if (structure && [[table objectAtIndex:1] boolValue]) {
+ [flags addObject:@"structure"];
+ }
+
+ if (content && [[table objectAtIndex:2] boolValue]) {
+ [flags addObject:@"content"];
+ }
+
+ if (drop && [[table objectAtIndex:3] boolValue]) {
+ [flags addObject:@"drop"];
+ }
+
+ return flags;
+ }
+ }
+ }
+ return nil;
+}
+
+@end
+
+#pragma mark -
+
+NSNumber *IsOn(id obj)
+{
+ return (([obj state] == NSOnState)? @YES : @NO);
+}
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 02a15375..9a78e182 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -192,6 +192,7 @@
507FF1121BBCC57600104523 /* SPFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 507FF1111BBCC57600104523 /* SPFunctions.m */; };
507FF1621BBF0D5000104523 /* SPTableCopyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 112730551180788A000737FD /* SPTableCopyTest.m */; };
507FF2421BC33BBC00104523 /* SPOSInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */; };
+ 507FF26A1BC8450100104523 /* SPExportSettingsPersistence.m in Sources */ = {isa = PBXBuildFile; fileRef = 507FF2691BC8450100104523 /* SPExportSettingsPersistence.m */; };
50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; };
50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */; };
50D3C3521A77135F00B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; };
@@ -906,6 +907,8 @@
506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = "<group>"; };
507FF1101BBCC4C400104523 /* SPFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFunctions.h; sourceTree = "<group>"; };
507FF1111BBCC57600104523 /* SPFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFunctions.m; sourceTree = "<group>"; };
+ 507FF2681BC8450100104523 /* SPExportSettingsPersistence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPExportSettingsPersistence.h; sourceTree = "<group>"; };
+ 507FF2691BC8450100104523 /* SPExportSettingsPersistence.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPExportSettingsPersistence.m; sourceTree = "<group>"; };
50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGotoDatabaseController.h; sourceTree = "<group>"; };
50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGotoDatabaseController.m; sourceTree = "<group>"; };
50D3C34A1A75B8A800B5429C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = "<group>"; };
@@ -2268,6 +2271,8 @@
173C837C11AAD2C500B8B084 /* Delegate Protocols */,
173C837D11AAD2D300B8B084 /* Delegate Categories */,
50D3C3831A8177D900B5429C /* SPExportController+SharedPrivateAPI.h */,
+ 507FF2681BC8450100104523 /* SPExportSettingsPersistence.h */,
+ 507FF2691BC8450100104523 /* SPExportSettingsPersistence.m */,
);
name = "Data Export";
sourceTree = "<group>";
@@ -3223,6 +3228,7 @@
BC29C37F10501EFD00DD6C6E /* SPQueryController.m in Sources */,
5822D3091061833C00CE2157 /* SPCSVParser.m in Sources */,
BC675A141072039C00C5ACD4 /* SPContentFilterManager.m in Sources */,
+ 507FF26A1BC8450100104523 /* SPExportSettingsPersistence.m in Sources */,
17292443107AC41000B21980 /* SPXMLExporter.m in Sources */,
582A01E9107C0C170027D42B /* SPNotLoaded.m in Sources */,
173284EA1088FEDE0062E892 /* SPConstants.m in Sources */,