From fe820d76ac53ea565a83a60c092654187bb268b1 Mon Sep 17 00:00:00 2001 From: "joshmoz%gmail.com" Date: Sat, 5 Mar 2005 17:39:50 +0000 Subject: [PATCH] allow for toggling of bookmark manager using bm manager toolbar button, no bug sr=pinkerton --- camino/src/browser/BrowserWindowController.mm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/camino/src/browser/BrowserWindowController.mm b/camino/src/browser/BrowserWindowController.mm index b2b9cdcbcfe..069291d0db6 100644 --- a/camino/src/browser/BrowserWindowController.mm +++ b/camino/src/browser/BrowserWindowController.mm @@ -1156,6 +1156,12 @@ enum BWCOpenDest { [theItem setEnabled:enable]; return enable; } + else if (action == @selector(manageBookmarks:)) { + BOOL enable = [[mBrowserView getBrowserView] canGoBack]; + if (!enable && ![self bookmarkManagerIsVisible]) + enable = true; + return enable; + } else if (action == @selector(forward:)) { // we have to handle all the enabling/disabling ourselves because this // toolbar button is a view item. Note the return value is ignored. @@ -1455,9 +1461,12 @@ enum BWCOpenDest { // // Load the bookmarks in the frontmost tab or window. // --(IBAction)manageBookmarks: (id)aSender +-(IBAction)manageBookmarks:(id)aSender { - [self loadURL:@"about:bookmarks" referrer:nil activate:YES allowPopups:YES]; + if ([self bookmarkManagerIsVisible]) + [self back:aSender]; + else + [self loadURL:@"about:bookmarks" referrer:nil activate:YES allowPopups:YES]; } //