diff options
author | stuconnolly <stuart02@gmail.com> | 2012-09-24 01:54:55 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-09-24 01:54:55 +0000 |
commit | 544e82c69fe3e1bfce7df5c0e2d89a6bd2d834fc (patch) | |
tree | a212964e91a13529004770fb263019340f03f703 /Source/SPDatabaseDocument.m | |
parent | b3b5f9fc11121713ccd751aae5c6de0f87663bd8 (diff) | |
download | sequelpro-544e82c69fe3e1bfce7df5c0e2d89a6bd2d834fc.tar.gz sequelpro-544e82c69fe3e1bfce7df5c0e2d89a6bd2d834fc.tar.bz2 sequelpro-544e82c69fe3e1bfce7df5c0e2d89a6bd2d834fc.zip |
Tidy up menu validation.
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 9bcb9733..0bfbb16f 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3383,15 +3383,18 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; } if (!_isConnected || _isWorkingLevel) { - return ([menuItem action] == @selector(newWindow:) || [menuItem action] == @selector(terminate:) || [menuItem action] == @selector(closeTab:)); + return ([menuItem action] == @selector(newWindow:) || + [menuItem action] == @selector(terminate:) || + [menuItem action] == @selector(closeTab:)); } if ([menuItem action] == @selector(openCurrentConnectionInNewWindow:)) { - if([self isUntitled]) { + if ([self isUntitled]) { [menuItem setTitle:NSLocalizedString(@"Open in New Window", @"menu item open in new window")]; return NO; - } else { + } + else { [menuItem setTitle:[NSString stringWithFormat:NSLocalizedString(@"Open “%@” in New Window", @"menu item open “%@” in new window"), [self displayName]]]; return YES; } @@ -3442,7 +3445,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; if ([menuItem action] == @selector(importFromClipboard:)) { - return ([self database] && [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:NSStringPboardType, nil]]) ? YES : NO; + return [self database] && [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:NSStringPboardType, nil]]; } @@ -3482,11 +3485,11 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [menuItem action] == @selector(showCreateTableSyntax:) || [menuItem action] == @selector(copyCreateTableSyntax:)) { - return ([[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count]) ? YES:NO; + return [[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count]; } if ([menuItem action] == @selector(addConnectionToFavorites:)) { - return ([connectionController selectedFavorite] ? NO : YES); + return ![connectionController selectedFavorite]; } // Backward in history menu item |