From 8b83456c02fbdc738bc25b244633eb27522b9119 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 15 Aug 2013 19:19:24 +0100 Subject: Beginnings of new hotlist module, implemented with new treeview. Currently it can only open, display and launch entries in an existing hotlist file. TODO: - Generate defualt hotlist when file not found. - Add hotlist saving. - Allow adding to hotlist. - Allow hotlist editing. - Allow hotlist nodes to be moved by dragging. - Allow hotlist visit data to be updated. --- desktop/tree.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'desktop/tree.c') diff --git a/desktop/tree.c b/desktop/tree.c index 0f5697203..b49782a77 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -177,6 +177,7 @@ struct tree { #include "desktop/treeview.h" +#include "desktop/hotlist.h" #include "desktop/cookie_manager.h" #include "desktop/global_history.h" #include "desktop/sslcert_viewer.h" @@ -275,6 +276,13 @@ static bool treeview_test_init(struct tree *tree) warn_user("Couldn't init new global history.", 0); } } + if (tree->flags & TREE_HOTLIST) { + err = hotlist_init(&cw_t, (struct core_window *)tree, + tree_hotlist_path); + if (err != NSERROR_OK) { + warn_user("Couldn't init new hotlist.", 0); + } + } return true; } @@ -312,6 +320,12 @@ static bool treeview_test_fini(struct tree *tree) warn_user("Couldn't finalise cookie manager.", 0); } } + if (tree->flags & TREE_HOTLIST) { + err = hotlist_fini(tree_hotlist_path); + if (err != NSERROR_OK) { + warn_user("Couldn't finalise hotlist.", 0); + } + } if (treeview_inits == 1) treeview_fini(); @@ -348,6 +362,10 @@ static bool treeview_test_redraw(struct tree *tree, int x, int y, global_history_redraw(x, y, &clip, ctx); return true; } + if (tree->flags & TREE_HOTLIST) { + hotlist_redraw(x, y, &clip, ctx); + return true; + } return false; } @@ -372,6 +390,10 @@ static bool treeview_test_mouse_action(struct tree *tree, global_history_mouse_action(mouse, x, y); return true; } + if (tree->flags & TREE_HOTLIST) { + hotlist_mouse_action(mouse, x, y); + return true; + } return false; } @@ -395,6 +417,10 @@ static bool treeview_test_keypress(struct tree *tree, uint32_t key) global_history_keypress(key); return true; } + if (tree->flags & TREE_HOTLIST) { + hotlist_keypress(key); + return true; + } return false; } -- cgit v1.2.3