mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
Fix bug 278949: make sure we have a bookmarks view controller when we need one for adding a new bookmark. Also fix a build warning (bad BOOL return value).
This commit is contained in:
parent
4666b22381
commit
a373822bf4
@ -1071,7 +1071,7 @@ const int kReuseWindowOnAE = 2;
|
||||
}
|
||||
|
||||
if (action == @selector(newTab:))
|
||||
return (browserController);
|
||||
return (browserController != nil);
|
||||
|
||||
// check if someone has previously done a find before allowing findAgain to be enabled
|
||||
if (action == @selector(findAgain:) || action == @selector(findPrevious:))
|
||||
|
@ -142,7 +142,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
|
||||
// wait for |-completeSetup| to be called to lazily complete our setup
|
||||
mSetupComplete = NO;
|
||||
|
||||
// load our nib
|
||||
// load our nib (maybe we can delay this until we actually need to show UI?)
|
||||
[NSBundle loadNibNamed:@"BookmarksEditing" owner:self];
|
||||
}
|
||||
return self;
|
||||
|
@ -348,7 +348,7 @@ enum BWCOpenDest {
|
||||
- (BrowserTabViewItem*)openNewTab:(BOOL)aLoadInBG;
|
||||
|
||||
- (void)setupToolbar;
|
||||
- (void)setupSidebarTabs;
|
||||
- (void)ensureBookmarkViewController;
|
||||
- (NSString*)getContextMenuNodeDocumentURL;
|
||||
- (void)loadSourceOfURL:(NSString*)urlStr;
|
||||
- (void)transformFormatString:(NSMutableString*)inFormat domain:(NSString*)inDomain search:(NSString*)inSearch;
|
||||
@ -1204,6 +1204,13 @@ enum BWCOpenDest {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)ensureBookmarkViewController
|
||||
{
|
||||
if (!mBookmarkViewController) {
|
||||
mBookmarkViewController = [[BookmarkViewController alloc] initWithBrowserWindowController:self];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)loadingStarted
|
||||
@ -1695,6 +1702,8 @@ enum BWCOpenDest {
|
||||
|
||||
- (void)addBookmarkExtended:(BOOL)aIsFolder URL:(NSString*)aURL title:(NSString*)aTitle
|
||||
{
|
||||
// why doesn't this talk to the data source?
|
||||
[self ensureBookmarkViewController];
|
||||
[mBookmarkViewController ensureBookmarks];
|
||||
[mBookmarkViewController addItem: self isFolder: aIsFolder URL:aURL title:aTitle];
|
||||
}
|
||||
@ -2440,6 +2449,7 @@ enum BWCOpenDest {
|
||||
|
||||
- (void)getInfo:(id)sender
|
||||
{
|
||||
[self ensureBookmarkViewController];
|
||||
[mBookmarkViewController ensureBookmarks];
|
||||
[mBookmarkViewController showBookmarkInfo:sender];
|
||||
}
|
||||
@ -3040,6 +3050,7 @@ enum BWCOpenDest {
|
||||
|
||||
- (BookmarkViewController *)bookmarkViewController
|
||||
{
|
||||
[self ensureBookmarkViewController];
|
||||
return mBookmarkViewController;
|
||||
}
|
||||
|
||||
@ -3082,9 +3093,7 @@ enum BWCOpenDest {
|
||||
- (void)toggleBookmarkManager:(id)sender
|
||||
{
|
||||
// lazily init the setup of the view's controller
|
||||
if (!mBookmarkViewController) {
|
||||
mBookmarkViewController = [[BookmarkViewController alloc] initWithBrowserWindowController:self];
|
||||
}
|
||||
[self ensureBookmarkViewController];
|
||||
|
||||
// deactivate any gecko view that might think it has focus
|
||||
if ([self isResponderGeckoView:[[self window] firstResponder]]) {
|
||||
|
Loading…
Reference in New Issue
Block a user