diff options
author | rowanbeentje <rowan@beent.je> | 2010-06-06 14:22:24 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-06-06 14:22:24 +0000 |
commit | 24c1421cd5ff96d567a64903f4134f3364a3dd9c (patch) | |
tree | e4f8a85bf4b0019d2d2b9e302e97a25f340be9b8 /Source | |
parent | 685b4b1787297ae3a419a57a95d4110708b5110f (diff) | |
download | sequelpro-24c1421cd5ff96d567a64903f4134f3364a3dd9c.tar.gz sequelpro-24c1421cd5ff96d567a64903f4134f3364a3dd9c.tar.bz2 sequelpro-24c1421cd5ff96d567a64903f4134f3364a3dd9c.zip |
- 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
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPExportController.m | 19 | ||||
-rw-r--r-- | Source/SPExportInitializer.m | 9 |
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]; } } |