зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 155617: make sure we show the location dialog if the user removed the location field from their toolbar. Patch from David Haas.
This commit is contained in:
Родитель
27c5a43c45
Коммит
becd776e28
|
@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
|
|||
|
||||
- (void)performAppropriateLocationAction
|
||||
{
|
||||
if ( [[[self window] toolbar] isVisible] ) {
|
||||
NSToolbar *toolbar = [[self window] toolbar];
|
||||
if ( [toolbar isVisible] ) {
|
||||
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
|
||||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) {
|
||||
NSArray *itemsWeCanSee = [toolbar visibleItems];
|
||||
|
||||
for (unsigned int i=0;i<[itemsWeCanSee count];i++) {
|
||||
if ([[[itemsWeCanSee objectAtIndex:i] itemIdentifier] isEqual:LocationToolbarItemIdentifier]) {
|
||||
[self focusURLBar];
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
|
||||
- (void)focusURLBar
|
||||
{
|
||||
|
|
|
@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
|
|||
|
||||
- (void)performAppropriateLocationAction
|
||||
{
|
||||
if ( [[[self window] toolbar] isVisible] ) {
|
||||
NSToolbar *toolbar = [[self window] toolbar];
|
||||
if ( [toolbar isVisible] ) {
|
||||
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
|
||||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) {
|
||||
NSArray *itemsWeCanSee = [toolbar visibleItems];
|
||||
|
||||
for (unsigned int i=0;i<[itemsWeCanSee count];i++) {
|
||||
if ([[[itemsWeCanSee objectAtIndex:i] itemIdentifier] isEqual:LocationToolbarItemIdentifier]) {
|
||||
[self focusURLBar];
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
|
||||
- (void)focusURLBar
|
||||
{
|
||||
|
|
|
@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
|
|||
|
||||
- (void)performAppropriateLocationAction
|
||||
{
|
||||
if ( [[[self window] toolbar] isVisible] ) {
|
||||
NSToolbar *toolbar = [[self window] toolbar];
|
||||
if ( [toolbar isVisible] ) {
|
||||
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
|
||||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) {
|
||||
NSArray *itemsWeCanSee = [toolbar visibleItems];
|
||||
|
||||
for (unsigned int i=0;i<[itemsWeCanSee count];i++) {
|
||||
if ([[[itemsWeCanSee objectAtIndex:i] itemIdentifier] isEqual:LocationToolbarItemIdentifier]) {
|
||||
[self focusURLBar];
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
|
||||
- (void)focusURLBar
|
||||
{
|
||||
|
|
|
@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
|
|||
|
||||
- (void)performAppropriateLocationAction
|
||||
{
|
||||
if ( [[[self window] toolbar] isVisible] ) {
|
||||
NSToolbar *toolbar = [[self window] toolbar];
|
||||
if ( [toolbar isVisible] ) {
|
||||
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
|
||||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) {
|
||||
NSArray *itemsWeCanSee = [toolbar visibleItems];
|
||||
|
||||
for (unsigned int i=0;i<[itemsWeCanSee count];i++) {
|
||||
if ([[[itemsWeCanSee objectAtIndex:i] itemIdentifier] isEqual:LocationToolbarItemIdentifier]) {
|
||||
[self focusURLBar];
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[self beginLocationSheet];
|
||||
}
|
||||
|
||||
- (void)focusURLBar
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче