summaryrefslogtreecommitdiff
path: root/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/BookmarksController.m25
-rw-r--r--cocoa/HistoryWindowController.m6
-rw-r--r--cocoa/Tree.h1
-rw-r--r--cocoa/Tree.m9
-rw-r--r--cocoa/utils.m10
5 files changed, 13 insertions, 38 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
diff --git a/cocoa/HistoryWindowController.m b/cocoa/HistoryWindowController.m
index 94fb2979e..cae679b9d 100644
--- a/cocoa/HistoryWindowController.m
+++ b/cocoa/HistoryWindowController.m
@@ -20,7 +20,7 @@
#import "cocoa/Tree.h"
#import "cocoa/TreeView.h"
-#import "desktop/history_global_core.h"
+#import "desktop/global_history.h"
@implementation HistoryWindowController
@@ -30,15 +30,13 @@
{
if ((self = [super initWithWindowNibName: @"HistoryWindow"]) == nil) return nil;
- tree = [[Tree alloc] initWithFlags: history_global_get_tree_flags()];
- history_global_initialise( [tree tree], "directory.png" );
+ tree = [[Tree alloc] initWithFlags: TREE_HISTORY];
return self;
}
- (void) dealloc;
{
- history_global_cleanup();
[tree release];
[self setView: nil];
diff --git a/cocoa/Tree.h b/cocoa/Tree.h
index b03f48be0..e38df5a99 100644
--- a/cocoa/Tree.h
+++ b/cocoa/Tree.h
@@ -42,7 +42,6 @@
- initWithFlags: (unsigned int) flags;
-- (struct node *) rootNode;
- (struct tree *) tree;
@end
diff --git a/cocoa/Tree.m b/cocoa/Tree.m
index 582187f4a..7da7b681c 100644
--- a/cocoa/Tree.m
+++ b/cocoa/Tree.m
@@ -59,11 +59,6 @@ static const struct treeview_table cocoa_tree_callbacks = {
[super dealloc];
}
-- (struct node *) rootNode;
-{
- return tree_get_root( tree );
-}
-
- (struct tree *) tree;
{
return tree;
@@ -76,15 +71,11 @@ static const struct treeview_table cocoa_tree_callbacks = {
- (void) setRedrawing: (BOOL) newRedrawing;
{
- tree_set_redraw( tree, newRedrawing );
}
+ (void) initialize;
{
- if (self == [Tree class]) {
- tree_set_icon_dir( strdup( [[[NSBundle mainBundle] pathForResource: @"Icons" ofType: @""] UTF8String] ) );
- }
}
//MARK: -
diff --git a/cocoa/utils.m b/cocoa/utils.m
index 0e10b9b6b..cd9313d34 100644
--- a/cocoa/utils.m
+++ b/cocoa/utils.m
@@ -19,7 +19,6 @@
#import <Cocoa/Cocoa.h>
#import "utils/utils.h"
-#import "desktop/tree_url_node.h"
#define UNIMPL() NSLog( @"Function '%s' unimplemented", __func__ )
@@ -55,12 +54,3 @@ bool path_add_part(char *path, int length, const char *newpart)
return true;
}
-
-void tree_icon_name_from_content_type(char *buffer, content_type type)
-{
- switch (type) {
- default:
- strcpy( buffer, "content.png" );
- break;
- }
-} \ No newline at end of file