From ab87a4b960bf70ac7def486de5d2c51a4c6af7f1 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Tue, 1 Feb 2011 14:52:20 +0000 Subject: Bookmarks window. No editing yet. svn path=/trunk/netsurf/; revision=11581 --- cocoa/BookmarksController.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'cocoa/BookmarksController.m') diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index e78d76529..9ec6818d7 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -18,6 +18,7 @@ #import "cocoa/BookmarksController.h" #import "cocoa/Tree.h" +#import "cocoa/TreeView.h" #import "cocoa/NetsurfApp.h" #import "cocoa/BrowserViewController.h" #import "cocoa/gui.h" @@ -29,6 +30,7 @@ @implementation BookmarksController @synthesize defaultMenu; +@synthesize view; static const char *cocoa_hotlist_path( void ) { @@ -38,7 +40,7 @@ static const char *cocoa_hotlist_path( void ) - init; { - if ((self = [super init]) == nil) return nil; + if ((self = [super initWithWindowNibName: @"BookmarksWindow"]) == nil) return nil; tree = [[Tree alloc] initWithFlags: hotlist_get_tree_flags()]; hotlist_initialise( [tree tree], cocoa_hotlist_path(), "" ); @@ -49,9 +51,11 @@ static const char *cocoa_hotlist_path( void ) - (void) dealloc; { + [self setView: nil]; NSFreeMapTable( nodeForMenu ); hotlist_cleanup( cocoa_hotlist_path() ); [tree release]; + [super dealloc]; } @@ -112,11 +116,6 @@ static const char *cocoa_hotlist_path( void ) } } -- (IBAction) showBookmarksWindow: (id) sender; -{ - NSLog( @"TODO: show bookmarks window" ); -} - - (IBAction) addBookmark: (id) sender; { NSLog( @"TODO: add bookmark" ); @@ -133,6 +132,12 @@ static const char *cocoa_hotlist_path( void ) return YES; } +- (void) windowDidLoad; +{ + hotlist_expand_all( ); + [view setTree: tree]; +} + + (void) initialize; { -- cgit v1.2.3