From 3558fee0667274f8ae325d0354ac6e31b2144db9 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 15 Jul 2010 12:08:13 +0000 Subject: Make the 'Export' menu item in the 'File' menu behave more like the export context menu by checking only the selecting tables. If no tables are selected all of them are checked by default (the same as before). Fixes issue #755. --- Source/SPDatabaseDocument.m | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index d6c17b5e..75e18ff3 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2341,6 +2341,17 @@ [tablesListInstance performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.1]; } +/** + * Opens the export dialog on the SQL dump tab with the selected tables checked for export. If no tables + * are selected then all tables are checked. + */ +- (IBAction)export:(id)sender +{ + NSArray *tables = [tablesListInstance selectedTableItems]; + + [exportControllerInstance exportTables:([tables count]) ? tables : nil asFormat:SPSQLExport usingSource:SPTableExport]; +} + /** * Exports the selected tables in the chosen file format. */ @@ -3436,19 +3447,6 @@ [tableDumpInstance importFromClipboard]; } -/** - * Passes the request to the dataImport object - */ -- (IBAction)export:(id)sender -{ - if ([sender tag] == -1) { - [exportControllerInstance export]; - } - else { - [tableDumpInstance exportFile:[sender tag]]; - } -} - - (IBAction)exportTable:(id)sender { return [self export:sender]; -- cgit v1.2.3