diff options
author | stuconnolly <stuart02@gmail.com> | 2009-11-10 00:25:42 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-11-10 00:25:42 +0000 |
commit | 10c7995efabe8ba96fbaaaff88b3f06a8c0d5cde (patch) | |
tree | 65ee23f9e9a1a71cd95d134af74b4239f517c6b0 /Source/TableDocument.m | |
parent | 0ce7f983fad694c57aff9217666435685dea5e05 (diff) | |
download | sequelpro-10c7995efabe8ba96fbaaaff88b3f06a8c0d5cde.tar.gz sequelpro-10c7995efabe8ba96fbaaaff88b3f06a8c0d5cde.tar.bz2 sequelpro-10c7995efabe8ba96fbaaaff88b3f06a8c0d5cde.zip |
Implement a more reliable way of updating the show/hide console menu item.
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]; } |