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:
sfraser%netscape.com 2002-07-06 00:00:50 +00:00
Родитель 27c5a43c45
Коммит becd776e28
4 изменённых файлов: 56 добавлений и 32 удалений

Просмотреть файл

@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
- (void)performAppropriateLocationAction - (void)performAppropriateLocationAction
{ {
if ( [[[self window] toolbar] isVisible] ) { NSToolbar *toolbar = [[self window] toolbar];
if ( [toolbar isVisible] ) {
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) || if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) { ([[[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]; [self focusURLBar];
} else { return;
[self beginLocationSheet];
} }
} else {
[self beginLocationSheet];
} }
} }
}
[self beginLocationSheet];
}
- (void)focusURLBar - (void)focusURLBar
{ {

Просмотреть файл

@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
- (void)performAppropriateLocationAction - (void)performAppropriateLocationAction
{ {
if ( [[[self window] toolbar] isVisible] ) { NSToolbar *toolbar = [[self window] toolbar];
if ( [toolbar isVisible] ) {
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) || if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) { ([[[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]; [self focusURLBar];
} else { return;
[self beginLocationSheet];
} }
} else {
[self beginLocationSheet];
} }
} }
}
[self beginLocationSheet];
}
- (void)focusURLBar - (void)focusURLBar
{ {

Просмотреть файл

@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
- (void)performAppropriateLocationAction - (void)performAppropriateLocationAction
{ {
if ( [[[self window] toolbar] isVisible] ) { NSToolbar *toolbar = [[self window] toolbar];
if ( [toolbar isVisible] ) {
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) || if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) { ([[[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]; [self focusURLBar];
} else { return;
[self beginLocationSheet];
} }
} else {
[self beginLocationSheet];
} }
} }
}
[self beginLocationSheet];
}
- (void)focusURLBar - (void)focusURLBar
{ {

Просмотреть файл

@ -569,17 +569,23 @@ static NSArray* sToolbarDefaults = nil;
- (void)performAppropriateLocationAction - (void)performAppropriateLocationAction
{ {
if ( [[[self window] toolbar] isVisible] ) { NSToolbar *toolbar = [[self window] toolbar];
if ( [toolbar isVisible] ) {
if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) || if ( ([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconAndLabel) ||
([[[self window] toolbar] displayMode] == NSToolbarDisplayModeIconOnly) ) { ([[[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]; [self focusURLBar];
} else { return;
[self beginLocationSheet];
} }
} else {
[self beginLocationSheet];
} }
} }
}
[self beginLocationSheet];
}
- (void)focusURLBar - (void)focusURLBar
{ {