diff options
author | stuconnolly <stuart02@gmail.com> | 2010-08-15 14:09:58 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-08-15 14:09:58 +0000 |
commit | 6ba9531a7f5bd5430e3c1e38956a766912701a8f (patch) | |
tree | 75b23803152982331d8195b2e2b3562795308529 /Source | |
parent | 6b1b086cd39169d1cdf35c1e89251215ec09907d (diff) | |
download | sequelpro-6ba9531a7f5bd5430e3c1e38956a766912701a8f.tar.gz sequelpro-6ba9531a7f5bd5430e3c1e38956a766912701a8f.tar.bz2 sequelpro-6ba9531a7f5bd5430e3c1e38956a766912701a8f.zip |
Improve export menu item validation by disabling export as XML and CSV when either a proc or function is selected.
Diffstat (limited to 'Source')
-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:) || |