From 6ba9531a7f5bd5430e3c1e38956a766912701a8f Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 15 Aug 2010 14:09:58 +0000 Subject: Improve export menu item validation by disabling export as XML and CSV when either a proc or function is selected. --- Source/SPDatabaseDocument.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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:) || -- cgit v1.2.3