summaryrefslogtreecommitdiff
path: root/desktop/tree.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-15 19:19:24 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-08-16 08:25:25 +0100
commit8b83456c02fbdc738bc25b244633eb27522b9119 (patch)
treef2e8cd27124c055376a875e83b794103e53731c0 /desktop/tree.c
parentee7df2761f95359b9ad67812dd48286740036710 (diff)
downloadnetsurf-8b83456c02fbdc738bc25b244633eb27522b9119.tar.gz
netsurf-8b83456c02fbdc738bc25b244633eb27522b9119.tar.bz2
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.
Diffstat (limited to 'desktop/tree.c')
-rw-r--r--desktop/tree.c26
1 files changed, 26 insertions, 0 deletions
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;
}