aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPExportController.m19
-rw-r--r--Source/SPExportInitializer.m9
2 files changed, 26 insertions, 2 deletions
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];
}
}