From 24c1421cd5ff96d567a64903f4134f3364a3dd9c Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 6 Jun 2010 14:22:24 +0000 Subject: - Exporter: SQL select/deselect all will now toggle structure/drop table if those are enabled - Exporter: SQL export now correctly excludes structure/drop table if the global structure/drop toggles are disabled - Exporter: Save exporter window size --- Interfaces/English.lproj/ExportDialog.xib | 29 +++++++++++++++-------------- Source/SPExportController.m | 19 +++++++++++++++++-- Source/SPExportInitializer.m | 9 +++++++++ 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib index 4b97d410..9dbedacf 100644 --- a/Interfaces/English.lproj/ExportDialog.xib +++ b/Interfaces/English.lproj/ExportDialog.xib @@ -2,7 +2,7 @@ 1050 - 10D573 + 10D2094 762 1038.29 460.00 @@ -21,12 +21,12 @@ YES - + YES - com.brandonwalkin.BWToolkit com.apple.InterfaceBuilder.CocoaPlugin + com.brandonwalkin.BWToolkit YES @@ -182,7 +182,7 @@ YES - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {450, 462} @@ -267,7 +267,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -2165,7 +2165,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1680, 1028}} {450, 539} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} + SPExportWindow @@ -2309,7 +2310,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 50} @@ -2433,7 +2434,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1680, 1028}} {213, 72} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 9 @@ -2445,7 +2446,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} @@ -2632,7 +2633,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1680, 1028}} {213, 129} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -5082,21 +5083,21 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NSObject IBProjectSource - Source/CMImageView.h + Source/SPConnectionController.h NSObject IBProjectSource - Source/SPConnectionController.h + Source/SPContentFilterManager.h NSObject IBProjectSource - Source/SPContentFilterManager.h + Source/SPImageView.h @@ -5128,7 +5129,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA IBProjectSource - Source/TablesList.h + Source/SPTablesList.h diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 3b42104c..cb972551 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -448,12 +448,27 @@ * Selects or de-selects all tables. */ - (IBAction)selectDeselectAllTables:(id)sender -{ +{ + BOOL toggleStructure = NO; + BOOL toggleDropTable = NO; + [self refreshTableList:self]; - + + // Determine whether the structure and drop items should also be toggled + for (NSToolbarItem *item in [exportToolbar items]) + { + if ([[item itemIdentifier] isEqualToString:[exportToolbar selectedItemIdentifier]] && [item tag] == SPSQLExport) { + if ([exportSQLIncludeStructureCheck state] == NSOnState) toggleStructure = YES; + if ([exportSQLIncludeDropSyntaxCheck state] == NSOnState) toggleDropTable = YES; + break; + } + } + for (NSMutableArray *table in tables) { + if (toggleStructure) [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:[sender tag]]]; [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:[sender tag]]]; + if (toggleDropTable) [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:[sender tag]]]; } [exportTableList reloadData]; diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 1d128e91..ce894628 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -88,6 +88,15 @@ { if (exportType == SPSQLExport) { if ([[table objectAtIndex:1] boolValue] || [[table objectAtIndex:2] boolValue] || [[table objectAtIndex:3] boolValue]) { + + // Check the overall export settings + if ([[table objectAtIndex:1] boolValue] && [exportSQLIncludeStructureCheck state] == NSOffState) + [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:NO]]; + if ([[table objectAtIndex:2] boolValue] && [exportSQLIncludeContentCheck state] == NSOffState) + [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:NO]]; + if ([[table objectAtIndex:3] boolValue] && [exportSQLIncludeDropSyntaxCheck state] == NSOffState) + [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:NO]]; + [exportTables addObject:table]; } } -- cgit v1.2.3