diff options
-rw-r--r-- | Source/SPDatabaseDocument.m | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 27e773b9..42d42931 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3519,7 +3519,18 @@ // Selected tables data export if ([menuItem action] == @selector(exportSelectedTablesAs:)) { - return (([self database] != nil) && ([[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count])); + + NSInteger tag = [menuItem tag]; + NSInteger type = [tablesListInstance tableType]; + + BOOL enable = (([self database] != nil) && ([[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count])); + + if (type == SPTableTypeTable) { + return enable; + } + else if ((type == SPTableTypeProc) || (type == SPTableTypeFunc)) { + return (enable && (tag == SPSQLExport)); + } } if ([menuItem action] == @selector(import:) || |