diff options
Diffstat (limited to 'cocoa/BookmarksController.m')
-rw-r--r-- | cocoa/BookmarksController.m | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index a2c5a45c3..96041ab7b 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -24,9 +24,8 @@ #import "cocoa/gui.h" #import "desktop/browser_private.h" -#import "desktop/hotlist_old.h" +#import "desktop/hotlist.h" #import "desktop/tree.h" -#import "desktop/tree_url_node.h" #import "utils/messages.h" @interface BookmarksController () @@ -49,8 +48,7 @@ static const char *cocoa_hotlist_path( void ) { if ((self = [super initWithWindowNibName: @"BookmarksWindow"]) == nil) return nil; tree_hotlist_path = cocoa_hotlist_path(); - tree = [[Tree alloc] initWithFlags: hotlist_old_get_tree_flags()]; - hotlist_old_initialise( [tree tree], cocoa_hotlist_path(), "directory.png" ); + tree = [[Tree alloc] initWithFlags: TREE_HOTLIST]; nodeForMenu = NSCreateMapTable( NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0 ); [[NSNotificationCenter defaultCenter] addObserver:self @@ -68,14 +66,13 @@ static const char *cocoa_hotlist_path( void ) - (void) save; { - hotlist_old_export( cocoa_hotlist_path() ); + hotlist_export( cocoa_hotlist_path(), NULL ); } - (void) dealloc; { [self setView: nil]; NSFreeMapTable( nodeForMenu ); - hotlist_old_cleanup( cocoa_hotlist_path() ); [tree release]; [[NSNotificationCenter defaultCenter] removeObserver: self]; @@ -85,6 +82,7 @@ static const char *cocoa_hotlist_path( void ) - (void) menuNeedsUpdate: (NSMenu *)menu { +#if 0 for (NSMenuItem *item in [menu itemArray]) { if ([item hasSubmenu]) NSMapRemove( nodeForMenu, [item submenu] ); [menu removeItem: item]; @@ -97,7 +95,6 @@ static const char *cocoa_hotlist_path( void ) [menu addItem: [[item copy] autorelease]]; } hasSeparator = false; - node = [tree rootNode]; } for (struct node *child = tree_node_get_child( node ); @@ -125,6 +122,7 @@ static const char *cocoa_hotlist_path( void ) [item setAction: @selector( openBookmarkURL: )]; } } +#endif } - (IBAction) openBookmarkURL: (id) sender; @@ -166,8 +164,7 @@ static const char *cocoa_hotlist_path( void ) { struct browser_window *bw = [[(NetSurfApp *)NSApp frontTab] browser]; if (bw && bw->current_content) { - const char *url = nsurl_access(hlcache_handle_get_url( bw->current_content )); - hotlist_old_add_page( url ); + hotlist_add_url( nsurl_access(hlcache_handle_get_url( bw->current_content )) ); } } @@ -184,8 +181,8 @@ static const char *cocoa_hotlist_path( void ) - (void) windowDidLoad; { - hotlist_old_expand_all(); - hotlist_old_collapse_all(); + hotlist_expand(false); + hotlist_contract(true); [view setTree: tree]; } @@ -200,17 +197,17 @@ static const char *cocoa_hotlist_path( void ) - (IBAction) editSelected: (id) sender; { - hotlist_old_edit_selected(); + hotlist_edit_selection(); } - (IBAction) deleteSelected: (id) sender; { - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); } - (IBAction) addFolder: (id) sender; { - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); } @end |