aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-07-15 12:08:13 +0000
committerstuconnolly <stuart02@gmail.com>2010-07-15 12:08:13 +0000
commit3558fee0667274f8ae325d0354ac6e31b2144db9 (patch)
tree7d01a0e7b8c2b1bade1dd162835d05a67a551d3e /Source
parentb21ab51d37672f7e5934938d0ffde641f4de3a26 (diff)
downloadsequelpro-3558fee0667274f8ae325d0354ac6e31b2144db9.tar.gz
sequelpro-3558fee0667274f8ae325d0354ac6e31b2144db9.tar.bz2
sequelpro-3558fee0667274f8ae325d0354ac6e31b2144db9.zip
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.h2
-rw-r--r--Source/SPDatabaseDocument.m24
-rw-r--r--Source/SPExportController.h1
-rw-r--r--Source/SPExportController.m8
4 files changed, 12 insertions, 23 deletions
diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h
index e16a6b5c..9f04fc71 100644
--- a/Source/SPDatabaseDocument.h
+++ b/Source/SPDatabaseDocument.h
@@ -257,6 +257,7 @@
- (IBAction)copyCreateTableSyntaxFromSheet:(id)sender;
- (IBAction)focusOnTableContentFilter:(id)sender;
- (IBAction)focusOnTableListFilter:(id)sender;
+- (IBAction)export:(id)sender;
- (IBAction)exportSelectedTablesAs:(id)sender;
// Other methods
@@ -306,7 +307,6 @@
- (IBAction)saveConnectionSheet:(id)sender;
- (IBAction)import:(id)sender;
- (IBAction)importFromClipboard:(id)sender;
-- (IBAction)export:(id)sender;
- (IBAction)exportTable:(id)sender;
- (IBAction)exportMultipleTables:(id)sender;
- (IBAction)viewStructure:(id)sender;
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index d6c17b5e..75e18ff3 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -2342,6 +2342,17 @@
}
/**
+ * 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.
*/
- (IBAction)exportSelectedTablesAs:(id)sender
@@ -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];
diff --git a/Source/SPExportController.h b/Source/SPExportController.h
index 83b21525..cedebdc3 100644
--- a/Source/SPExportController.h
+++ b/Source/SPExportController.h
@@ -237,7 +237,6 @@
*/
@property(readwrite, assign) MCPConnection *connection;
-- (void)export;
- (void)exportTables:(NSArray *)table asFormat:(SPExportType)format usingSource:(SPExportSource)source;
- (void)openExportErrorsSheetWithString:(NSString *)errors;
- (void)displayExportFinishedGrowlNotification;
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index 6aa2c3a6..7ccd296d 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -127,14 +127,6 @@
#pragma mark IB action methods
/**
- * Display the export window allowing the user to select what and of what type to export.
- */
-- (void)export
-{
- [self exportTables:nil asFormat:SPSQLExport usingSource:SPTableExport];
-}
-
-/**
* Displays the export window with the supplied tables and export type/format selected.
*/
- (void)exportTables:(NSArray *)exportTables asFormat:(SPExportType)format usingSource:(SPExportSource)source