зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 342237: Disable view-source contextual menu item when viewing binary content. Patch by smorgan <stuart.morgan@alumni.case.edu> r/sr=josh
This commit is contained in:
Родитель
47dd7f0448
Коммит
9457540d44
|
@ -3855,6 +3855,13 @@ enum BWCOpenDest {
|
|||
// our only copy of the menu
|
||||
NSMenu* result = [[menuPrototype copy] autorelease];
|
||||
|
||||
// validate View Page/Frame Source
|
||||
BrowserWrapper* browser = [self getBrowserWrapper];
|
||||
if ([browser isInternalURI] || ![[browser getBrowserView] isTextBasedContent]) {
|
||||
[[result itemWithTarget:self andAction:@selector(viewPageSource:)] setEnabled:NO];
|
||||
[[result itemWithTarget:self andAction:@selector(viewSource:)] setEnabled:NO];
|
||||
}
|
||||
|
||||
if (showSpellingItems)
|
||||
showSpellingItems = [self prepareSpellingSuggestionMenu:result tag:kSpellingRelatedItemsTag];
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static OSStatus MenuEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef
|
|||
- (id<NSMenuItem>)itemWithTarget:(id)anObject andAction:(SEL)actionSelector
|
||||
{
|
||||
int itemIndex = [self indexOfItemWithTarget:anObject andAction:actionSelector];
|
||||
return [self itemAtIndex:itemIndex];
|
||||
return (itemIndex == -1) ? nil : [self itemAtIndex:itemIndex];
|
||||
}
|
||||
|
||||
- (void)removeItemsAfterItem:(id<NSMenuItem>)inItem
|
||||
|
|
Загрузка…
Ссылка в новой задаче