diff options
author | avenjamin <avenjamin@gmail.com> | 2008-12-22 11:56:33 +0000 |
---|---|---|
committer | avenjamin <avenjamin@gmail.com> | 2008-12-22 11:56:33 +0000 |
commit | 17ee678d8b552693f45a9d38cdf0684aed6dabf6 (patch) | |
tree | 6b564c44ccae636eaef1ed290db3a569440ef61a /Source | |
parent | 041f6415294ae42bccd414997b241227164984b7 (diff) | |
download | sequelpro-17ee678d8b552693f45a9d38cdf0684aed6dabf6.tar.gz sequelpro-17ee678d8b552693f45a9d38cdf0684aed6dabf6.tar.bz2 sequelpro-17ee678d8b552693f45a9d38cdf0684aed6dabf6.zip |
Clean up of validate menu items method.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/TableDocument.m | 26 |
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]; } |