diff options
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 11a2c102..253f54f5 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1138,13 +1138,6 @@ // Show or hide the console [[[SPQueryController sharedQueryController] window] setIsVisible:(!isConsoleVisible)]; - - // Get the menu item for showing and hiding the console. This is isn't the best way to get it as any - // changes to the menu structure will result in the wrong item being selected. - NSMenuItem *menuItem = [[[[NSApp mainMenu] itemWithTitle:@"View"] submenu] itemAtIndex:5]; - - // Only update the menu item title if its the menu item and not the toolbar - [menuItem setTitle:(!isConsoleVisible) ? NSLocalizedString(@"Hide Console", @"Hide Console") : NSLocalizedString(@"Show Console", @"show console")]; } /** @@ -2910,6 +2903,11 @@ return ([variablesTableView numberOfSelectedRows] > 0); } + + // Show/hide console + if ([menuItem action] == @selector(toggleConsole:)) { + [menuItem setTitle:([[[SPQueryController sharedQueryController] window] isVisible]) ? NSLocalizedString(@"Hide Console", @"hide console") : NSLocalizedString(@"Show Console", @"show console")]; + } return [super validateMenuItem:menuItem]; } |