set the title of the window to "bookmark manager" when managing bookmarks and

return to the previous title when going back to web page (bug 199790)
This commit is contained in:
pinkerton%aol.net 2004-01-13 20:33:10 +00:00
Родитель 91f5d2a800
Коммит ece372f07e
3 изменённых файлов: 24 добавлений и 1 удалений

Двоичный файл не отображается.

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

@ -177,6 +177,9 @@ typedef enum
nsIURIFixup* mURIFixer; // [STRONG] should be nsCOMPtr, but can't
nsIBrowserHistory* mGlobalHistory; // [STRONG] should be nsCOMPtr, but can't
// saving window titles when opening the bookmark manager
NSString* mSavedTitle;
}
- (void)dealloc;
@ -353,6 +356,7 @@ typedef enum
- (void)toggleBookmarkManager:(id)sender;
- (void)ensureBrowserVisible:(id)sender;
- (NSString*)savedTitle;
- (void)setSavedTitle:(NSString *)aTitle;
@end

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

@ -269,6 +269,7 @@ static NSArray* sToolbarDefaults = nil;
mProgressSuperview = nil;
mBookmarkToolbarItem = nil;
mSidebarToolbarItem = nil;
mSavedTitle = nil;
// register for services
NSArray* sendTypes = [NSArray arrayWithObjects:NSStringPboardType, nil];
@ -438,6 +439,7 @@ static NSArray* sToolbarDefaults = nil;
//if (mSidebarBrowserView)
// [mSidebarBrowserView windowClosed];
[mSavedTitle release];
[mProgress release];
[mPopupBlocked release];
[mSearchBar release];
@ -2566,6 +2568,19 @@ static NSArray* sToolbarDefaults = nil;
return sBrokenIcon;
}
// return the window's saved title
- (NSString *)savedTitle
{
return mSavedTitle;
}
// save the window title before showing
// bookmark manager or History manager
- (void)setSavedTitle:(NSString *)aTitle
{
[mSavedTitle autorelease];
mSavedTitle = [aTitle retain];
}
+ (NSDictionary *)searchURLDictionary
{
@ -2654,12 +2669,16 @@ static NSArray* sToolbarDefaults = nil;
// cancel all pending loads. safari does this, i think we should too
[self stopAllPendingLoads];
// save window title
[self setSavedTitle:[[self window] title]];
[[self window] setTitle:NSLocalizedString(@"Bookmark Manager",@"Bookmark Manager")];
[mBookmarkViewController selectLastContainer];
// set focus to appropriate area of bm manager
[mBookmarkViewController focus];
}
else {
[[self window] setTitle:[self savedTitle]];
CHBrowserView* browserView = [mBrowserView getBrowserView];
if (browserView)
[browserView setActive:YES];