Camino only - Bug 235863: Show/Hide Bookmarks toolbar button does not indicate state. Patch only, with a duplicate icon (so people can test proposed new icons). r=hwaara sr=pink

This commit is contained in:
stridey%gmail.com 2006-09-12 18:35:35 +00:00
parent b52ac37b42
commit 8450b84cc5

View File

@ -1090,8 +1090,8 @@ enum BWCOpenDest {
toolbarItem = [[[ToolbarViewItem alloc] initWithItemIdentifier:itemIdent] autorelease]; toolbarItem = [[[ToolbarViewItem alloc] initWithItemIdentifier:itemIdent] autorelease];
NSButton* button = [self createToolbarPopupButton:toolbarItem]; NSButton* button = [self createToolbarPopupButton:toolbarItem];
[toolbarItem setLabel:NSLocalizedString(@"Back", @"Back")]; [toolbarItem setLabel:NSLocalizedString(@"Back", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go Back", @"Go Back")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Go Back", nil)];
NSSize size = NSMakeSize(32., 32.); NSSize size = NSMakeSize(32., 32.);
NSImage* icon = [NSImage imageNamed:@"back"]; NSImage* icon = [NSImage imageNamed:@"back"];
@ -1118,8 +1118,8 @@ enum BWCOpenDest {
else if ([itemIdent isEqual:BackToolbarItemIdentifier]) { else if ([itemIdent isEqual:BackToolbarItemIdentifier]) {
// not going onto the toolbar, don't need to go through the gynmastics above // not going onto the toolbar, don't need to go through the gynmastics above
// and create a separate view // and create a separate view
[toolbarItem setLabel:NSLocalizedString(@"Back", @"Back")]; [toolbarItem setLabel:NSLocalizedString(@"Back", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go Back", @"Go Back")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Go Back", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"back"]]; [toolbarItem setImage:[NSImage imageNamed:@"back"]];
} }
else if ( [itemIdent isEqual:ForwardToolbarItemIdentifier] && willBeInserted ) { else if ( [itemIdent isEqual:ForwardToolbarItemIdentifier] && willBeInserted ) {
@ -1127,8 +1127,8 @@ enum BWCOpenDest {
toolbarItem = [[[ToolbarViewItem alloc] initWithItemIdentifier:itemIdent] autorelease]; toolbarItem = [[[ToolbarViewItem alloc] initWithItemIdentifier:itemIdent] autorelease];
NSButton* button = [self createToolbarPopupButton:toolbarItem]; NSButton* button = [self createToolbarPopupButton:toolbarItem];
[toolbarItem setLabel:NSLocalizedString(@"Forward", @"Forward")]; [toolbarItem setLabel:NSLocalizedString(@"Forward", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go Forward", @"Go Forward")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Go Forward", nil)];
NSSize size = NSMakeSize(32., 32.); NSSize size = NSMakeSize(32., 32.);
NSImage* icon = [NSImage imageNamed:@"forward"]; NSImage* icon = [NSImage imageNamed:@"forward"];
@ -1155,45 +1155,45 @@ enum BWCOpenDest {
else if ([itemIdent isEqual:ForwardToolbarItemIdentifier]) { else if ([itemIdent isEqual:ForwardToolbarItemIdentifier]) {
// not going onto the toolbar, don't need to go through the gynmastics above // not going onto the toolbar, don't need to go through the gynmastics above
// and create a separate view // and create a separate view
[toolbarItem setLabel:NSLocalizedString(@"Forward", @"Forward")]; [toolbarItem setLabel:NSLocalizedString(@"Forward", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go Forward", @"Go Forward")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Go Forward", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"forward"]]; [toolbarItem setImage:[NSImage imageNamed:@"forward"]];
} }
else if ([itemIdent isEqual:ReloadToolbarItemIdentifier]) { else if ([itemIdent isEqual:ReloadToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Reload", @"Reload")]; [toolbarItem setLabel:NSLocalizedString(@"Reload", @"Reload")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Reload Page", @"Reload Page")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Reload Page", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"ReloadToolTip", @"Reload current page")]; [toolbarItem setToolTip:NSLocalizedString(@"ReloadToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"reload"]]; [toolbarItem setImage:[NSImage imageNamed:@"reload"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(reload:)]; [toolbarItem setAction:@selector(reload:)];
} }
else if ([itemIdent isEqual:StopToolbarItemIdentifier]) { else if ([itemIdent isEqual:StopToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Stop", @"Stop")]; [toolbarItem setLabel:NSLocalizedString(@"Stop", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Stop Loading", @"Stop Loading")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Stop Loading", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"StopToolTip", @"Stop loading this page")]; [toolbarItem setToolTip:NSLocalizedString(@"StopToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"stop"]]; [toolbarItem setImage:[NSImage imageNamed:@"stop"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(stop:)]; [toolbarItem setAction:@selector(stop:)];
} }
else if ([itemIdent isEqual:HomeToolbarItemIdentifier]) { else if ([itemIdent isEqual:HomeToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Home", @"Home")]; [toolbarItem setLabel:NSLocalizedString(@"Home", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go Home", @"Go Home")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Go Home", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"HomeToolTip", @"Go to home page")]; [toolbarItem setToolTip:NSLocalizedString(@"HomeToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"home"]]; [toolbarItem setImage:[NSImage imageNamed:@"home"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(home:)]; [toolbarItem setAction:@selector(home:)];
} }
else if ([itemIdent isEqual:BookmarksToolbarItemIdentifier]) { else if ([itemIdent isEqual:BookmarksToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"ToggleBookmarks", @"Manage Bookmarks label")]; [toolbarItem setLabel:NSLocalizedString(@"ToggleBookmarks", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Manage Bookmarks", @"Manage Bookmarks palette")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Manage Bookmarks", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"BookmarkMgrToolTip", @"Show or hide all bookmarks")]; [toolbarItem setToolTip:NSLocalizedString(@"ShowBookmarkMgrToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"manager"]]; [toolbarItem setImage:[NSImage imageNamed:@"manager"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(manageBookmarks:)]; [toolbarItem setAction:@selector(manageBookmarks:)];
} }
else if ([itemIdent isEqual:ThrobberToolbarItemIdentifier]) { else if ([itemIdent isEqual:ThrobberToolbarItemIdentifier]) {
[toolbarItem setLabel:@""]; [toolbarItem setLabel:@""];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Progress", @"Progress")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Progress", nil)];
[toolbarItem setToolTip:NSLocalizedStringFromTable(@"ThrobberPageDefault", @"WebsiteDefaults", nil)]; [toolbarItem setToolTip:NSLocalizedStringFromTable(@"ThrobberPageDefault", @"WebsiteDefaults", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"throbber-01"]]; [toolbarItem setImage:[NSImage imageNamed:@"throbber-01"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
@ -1203,8 +1203,8 @@ enum BWCOpenDest {
else if ([itemIdent isEqual:CombinedLocationToolbarItemIdentifier]) { else if ([itemIdent isEqual:CombinedLocationToolbarItemIdentifier]) {
NSMenuItem *menuFormRep = [[[NSMenuItem alloc] init] autorelease]; NSMenuItem *menuFormRep = [[[NSMenuItem alloc] init] autorelease];
[toolbarItem setLabel:NSLocalizedString(@"Location", @"Location")]; [toolbarItem setLabel:NSLocalizedString(@"Location", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Location", @"Location")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Location", nil)];
[toolbarItem setView:mLocationToolbarView]; [toolbarItem setView:mLocationToolbarView];
[toolbarItem setMinSize:NSMakeSize(250, NSHeight([mLocationToolbarView frame]))]; [toolbarItem setMinSize:NSMakeSize(250, NSHeight([mLocationToolbarView frame]))];
[toolbarItem setMaxSize:NSMakeSize(FLT_MAX, NSHeight([mLocationToolbarView frame]))]; [toolbarItem setMaxSize:NSMakeSize(FLT_MAX, NSHeight([mLocationToolbarView frame]))];
@ -1219,73 +1219,73 @@ enum BWCOpenDest {
[toolbarItem setMenuFormRepresentation:menuFormRep]; [toolbarItem setMenuFormRepresentation:menuFormRep];
} }
else if ([itemIdent isEqual:PrintToolbarItemIdentifier]) { else if ([itemIdent isEqual:PrintToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Print", @"Print")]; [toolbarItem setLabel:NSLocalizedString(@"Print", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Print", @"Print")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Print", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"PrintToolTip", @"Print this page")]; [toolbarItem setToolTip:NSLocalizedString(@"PrintToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"print"]]; [toolbarItem setImage:[NSImage imageNamed:@"print"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(printDocument:)]; [toolbarItem setAction:@selector(printDocument:)];
} }
else if ([itemIdent isEqual:ViewSourceToolbarItemIdentifier]) { else if ([itemIdent isEqual:ViewSourceToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"View Source", @"View Source")]; [toolbarItem setLabel:NSLocalizedString(@"View Source", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"View Page Source", @"View Page Source")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"View Page Source", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"ViewSourceToolTip", @"Display the HTML source of this page")]; [toolbarItem setToolTip:NSLocalizedString(@"ViewSourceToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"showsource"]]; [toolbarItem setImage:[NSImage imageNamed:@"showsource"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewSource:)]; [toolbarItem setAction:@selector(viewSource:)];
} }
else if ([itemIdent isEqual:BookmarkToolbarItemIdentifier]) { else if ([itemIdent isEqual:BookmarkToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Bookmark", @"Bookmark")]; [toolbarItem setLabel:NSLocalizedString(@"Bookmark", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Bookmark Page", @"Bookmark Page")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Bookmark Page", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"BookmarkToolTip", @"Add this page to your bookmarks")]; [toolbarItem setToolTip:NSLocalizedString(@"BookmarkToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"add_to_bookmark.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"add_to_bookmark.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(addBookmark:)]; [toolbarItem setAction:@selector(addBookmark:)];
} }
else if ([itemIdent isEqual:TextBiggerToolbarItemIdentifier]) { else if ([itemIdent isEqual:TextBiggerToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"BigText", @"Enlarge Text")]; [toolbarItem setLabel:NSLocalizedString(@"BigText", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"BigText", @"Enlarge Text")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"BigText", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"BigTextToolTip", @"Enlarge the text on this page")]; [toolbarItem setToolTip:NSLocalizedString(@"BigTextToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"textBigger.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"textBigger.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(makeTextBigger:)]; [toolbarItem setAction:@selector(makeTextBigger:)];
} }
else if ([itemIdent isEqual:TextSmallerToolbarItemIdentifier]) { else if ([itemIdent isEqual:TextSmallerToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"SmallText", @"Shrink Text")]; [toolbarItem setLabel:NSLocalizedString(@"SmallText", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"SmallText", @"Shrink Text")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"SmallText", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"SmallTextToolTip", @"Shrink the text on this page")]; [toolbarItem setToolTip:NSLocalizedString(@"SmallTextToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"textSmaller.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"textSmaller.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(makeTextSmaller:)]; [toolbarItem setAction:@selector(makeTextSmaller:)];
} }
else if ([itemIdent isEqual:NewTabToolbarItemIdentifier]) { else if ([itemIdent isEqual:NewTabToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"NewTab", @"New Tab")]; [toolbarItem setLabel:NSLocalizedString(@"NewTab", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"NewTab", @"New Tab")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"NewTab", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"NewTabToolTip", @"Create a new tab")]; [toolbarItem setToolTip:NSLocalizedString(@"NewTabToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"newTab.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"newTab.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(newTab:)]; [toolbarItem setAction:@selector(newTab:)];
} }
else if ([itemIdent isEqual:CloseTabToolbarItemIdentifier]) { else if ([itemIdent isEqual:CloseTabToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"CloseTab", @"Close Tab")]; [toolbarItem setLabel:NSLocalizedString(@"CloseTab", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"CloseTab", @"Close Tab")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"CloseTab", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"CloseTabToolTip", @"Close the current tab")]; [toolbarItem setToolTip:NSLocalizedString(@"CloseTabToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"closeTab.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"closeTab.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(closeCurrentTab:)]; [toolbarItem setAction:@selector(closeCurrentTab:)];
} }
else if ([itemIdent isEqual:SendURLToolbarItemIdentifier]) { else if ([itemIdent isEqual:SendURLToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"SendLink", @"Send Link")]; [toolbarItem setLabel:NSLocalizedString(@"SendLink", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"SendLinkPaletteLabel", @"Email Page Location")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"SendLinkPaletteLabel", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"SendLinkToolTip", @"Send current URL")]; [toolbarItem setToolTip:NSLocalizedString(@"SendLinkToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"sendLink.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"sendLink.tif"]];
[toolbarItem setTarget:self]; [toolbarItem setTarget:self];
[toolbarItem setAction:@selector(sendURL:)]; [toolbarItem setAction:@selector(sendURL:)];
} }
else if ([itemIdent isEqual:DLManagerToolbarItemIdentifier]) { else if ([itemIdent isEqual:DLManagerToolbarItemIdentifier]) {
[toolbarItem setLabel:NSLocalizedString(@"Downloads", @"Downloads")]; [toolbarItem setLabel:NSLocalizedString(@"Downloads", nil)];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Downloads", @"Downloads")]; [toolbarItem setPaletteLabel:NSLocalizedString(@"Downloads", nil)];
[toolbarItem setToolTip:NSLocalizedString(@"DownloadsToolTip", @"Show the download manager")]; [toolbarItem setToolTip:NSLocalizedString(@"DownloadsToolTip", nil)];
[toolbarItem setImage:[NSImage imageNamed:@"dl_manager.tif"]]; [toolbarItem setImage:[NSImage imageNamed:@"dl_manager.tif"]];
[toolbarItem setTarget:[ProgressDlgController sharedDownloadController]]; [toolbarItem setTarget:[ProgressDlgController sharedDownloadController]];
[toolbarItem setAction:@selector(showWindow:)]; [toolbarItem setAction:@selector(showWindow:)];
@ -1366,8 +1366,20 @@ enum BWCOpenDest {
return enable; return enable;
} }
else if (action == @selector(manageBookmarks:)) else if (action == @selector(manageBookmarks:)) {
if ([self bookmarkManagerIsVisible]) {
[theItem setPaletteLabel:NSLocalizedString(@"Hide Bookmarks", nil)];
[theItem setToolTip:NSLocalizedString(@"HideBookmarkMgrToolTip", nil)];
[theItem setImage:[NSImage imageNamed:@"hidemanager"]];
}
else {
[theItem setPaletteLabel:NSLocalizedString(@"Manage Bookmarks", nil)];
[theItem setToolTip:NSLocalizedString(@"ShowBookmarkMgrToolTip", nil)];
[theItem setImage:[NSImage imageNamed:@"manager"]];
}
return ![self bookmarkManagerIsVisible] || [self canHideBookmarks]; return ![self bookmarkManagerIsVisible] || [self canHideBookmarks];
}
else if (action == @selector(reload:)) else if (action == @selector(reload:))
return [[self getBrowserWrapper] canReload]; return [[self getBrowserWrapper] canReload];
else if (action == @selector(stop:)) else if (action == @selector(stop:))