зеркало из https://github.com/mozilla/pjs.git
Fix bug 306084: avoid crashes when closing the last tab (or trying to move it to a new window), and disable the menu items as appropriate.
This commit is contained in:
Родитель
a1a4cb4d78
Коммит
70719bc37e
|
@ -1233,6 +1233,22 @@ enum BWCOpenDest {
|
|||
|
||||
#pragma mark -
|
||||
|
||||
|
||||
-(BOOL)validateMenuItem: (NSMenuItem*)aMenuItem
|
||||
{
|
||||
SEL action = [aMenuItem action];
|
||||
|
||||
if (action == @selector(moveTabToNewWindow:) ||
|
||||
action == @selector(closeCurrentTab:) ||
|
||||
action == @selector(closeSendersTab:) ||
|
||||
action == @selector(closeOtherTabs:))
|
||||
return ([mTabBrowser numberOfTabViewItems] > 1);
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
// BrowserUIDelegate methods (called from the frontmost tab's BrowserWrapper)
|
||||
|
||||
|
||||
|
@ -2570,6 +2586,9 @@ enum BWCOpenDest {
|
|||
{
|
||||
[[NSApp delegate] fixCloseMenuItemKeyEquivalents];
|
||||
[mTabBrowser refreshTabBar:YES];
|
||||
// paranoia, to avoid stale mBrowserView pointer (since we don't own it)
|
||||
if ([aTabView numberOfTabViewItems] == 0)
|
||||
mBrowserView = nil;
|
||||
}
|
||||
|
||||
-(BrowserTabView*)getTabBrowser
|
||||
|
|
Загрузка…
Ссылка в новой задаче