aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m26
1 files changed, 8 insertions, 18 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index d1412032..9b5ce8e0 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1168,34 +1168,23 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
- if ([menuItem action] == @selector(import:)) {
- return ([self database] != nil);
- }
-
- if ([menuItem action] == @selector(importCSV:)) {
- return ([self database] != nil && [self table] != nil);
- }
-
- if ([menuItem action] == @selector(export:)) {
+ if ([menuItem action] == @selector(import:) ||
+ [menuItem action] == @selector(export:) ||
+ [menuItem action] == @selector(exportMultipleTables:) ||
+ [menuItem action] == @selector(removeDatabase:))
+ {
return ([self database] != nil);
}
- if ([menuItem action] == @selector(exportTable:)) {
+ if ([menuItem action] == @selector(exportTable:))
+ {
return ([self database] != nil && [self table] != nil);
}
- if ([menuItem action] == @selector(exportMultipleTables:)) {
- return ([self database] != nil);
- }
-
if ([menuItem action] == @selector(chooseEncoding:)) {
return [self supportsEncoding];
}
- if ([menuItem action] == @selector(removeDatabase:)) {
- return ([self database] != nil);
- }
-
// table menu items
if ([menuItem action] == @selector(showCreateTableSyntax:) ||
[menuItem action] == @selector(copyCreateTableSyntax:) ||
@@ -1208,6 +1197,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
{
return ([self table] != nil && [[self table] isNotEqualTo:@""]);
}
+
return [super validateMenuItem:menuItem];
}