summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/cookies.c11
-rw-r--r--riscos/menus.c12
-rw-r--r--riscos/menus.h1
-rw-r--r--riscos/sslcert.c1
-rw-r--r--riscos/treeview.c2
5 files changed, 22 insertions, 5 deletions
diff --git a/riscos/cookies.c b/riscos/cookies.c
index 173f73d69..b51720c14 100644
--- a/riscos/cookies.c
+++ b/riscos/cookies.c
@@ -72,6 +72,7 @@ void ro_gui_cookies_initialise(void)
cookies_tree->root->expanded = true;
cookies_tree->handle = (int)cookies_window;
cookies_tree->movable = false;
+ cookies_tree->no_drag = true;
ro_gui_wimp_event_set_user_data(cookies_window,
cookies_tree);
ro_gui_wimp_event_register_keypress(cookies_window,
@@ -122,9 +123,10 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
struct node *child;
struct node *add;
const struct cookie_data *cookie = NULL;
+ bool expanded;
assert(domain);
-
+
/* check if we're a domain, and add get the first cookie */
if (data)
for (cookie = data; cookie->prev; cookie = cookie->prev);
@@ -133,11 +135,14 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
node = ro_gui_cookies_find(domain);
if (node) {
/* mark as deleted so we don't remove the cookies */
+ expanded = node->expanded;
for (child = node->child; child; child = child->next)
child->deleted = true;
if (node->child)
tree_delete_node(cookies_tree, node->child,
true);
+ /* deleting will have contracted our node */
+ node->expanded = expanded;
}
if (!data) {
if (!node)
@@ -148,7 +153,7 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
return true;
}
}
-
+
if (!node) {
for (parent = cookies_tree->root->child; parent;
parent = parent->next) {
@@ -170,7 +175,7 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
for (; cookie; cookie = cookie->next) {
add = tree_create_cookie_node(node, cookie);
- if (!cookies_init)
+ if (add && !cookies_init)
tree_handle_node_changed(cookies_tree, add,
true, false);
}
diff --git a/riscos/menus.c b/riscos/menus.c
index 0d71b6f3b..7b936521e 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -168,7 +168,7 @@ void ro_gui_menu_init(void)
(struct ns_menu *)&iconbar_definition);
/* browser menu */
- NS_MENU(68) browser_definition = {
+ NS_MENU(69) browser_definition = {
"NetSurf", {
{ "Page", BROWSER_PAGE, 0 },
{ "Page.PageInfo",BROWSER_PAGE_INFO, dialog_pageinfo },
@@ -225,6 +225,7 @@ void ro_gui_menu_init(void)
{ "Utilities.History.HistGlobal", HISTORY_SHOW_GLOBAL, 0 },
{ "Utilities.Cookies", COOKIES_SHOW, 0 },
{ "Utilities.Cookies.ShowCookies", COOKIES_SHOW, 0 },
+ { "Utilities.Cookies.DeleteCookies", COOKIES_DELETE, 0 },
{ "Utilities.FindText", BROWSER_FIND_TEXT, dialog_search },
{ "Utilities.Window", NO_ACTION, 0 },
{ "Utilities.Window.WindowSave", BROWSER_WINDOW_DEFAULT, 0 },
@@ -1470,6 +1471,11 @@ bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
ro_gui_tree_show(cookies_tree);
return true;
+ case COOKIES_DELETE:
+ if (cookies_tree->root->child)
+ tree_delete_node(cookies_tree, cookies_tree->root->child, true);
+ return true;
+
/* page actions */
case BROWSER_PAGE_INFO:
if (!c)
@@ -1832,6 +1838,10 @@ void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
ro_gui_menu_set_entry_shaded(current_menu, action,
!cookies_tree);
break;
+ case COOKIES_DELETE:
+ ro_gui_menu_set_entry_shaded(current_menu, action,
+ !(cookies_tree && cookies_tree->root->child));
+ break;
/* page actions */
case BROWSER_PAGE_INFO:
diff --git a/riscos/menus.h b/riscos/menus.h
index 9b68fcf8a..8ce3a9d71 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -42,6 +42,7 @@ typedef enum {
/* cookie actions */
COOKIES_SHOW,
+ COOKIES_DELETE,
/* page actions */
BROWSER_PAGE,
diff --git a/riscos/sslcert.c b/riscos/sslcert.c
index 705e3f4b0..b1e4146bd 100644
--- a/riscos/sslcert.c
+++ b/riscos/sslcert.c
@@ -197,6 +197,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
tree->root->expanded = true;
tree->handle = (int)w;
tree->movable = false;
+ tree->no_drag = true;
tree->no_vscroll = true;
tree->no_furniture = true;
tree->single_selection = true;
diff --git a/riscos/treeview.c b/riscos/treeview.c
index ca03372f7..69b323a20 100644
--- a/riscos/treeview.c
+++ b/riscos/treeview.c
@@ -851,7 +851,7 @@ bool ro_gui_tree_click(wimp_pointer *pointer, struct tree *tree) {
/* drag starts a drag operation */
if ((!tree->editing) && ((pointer->buttons == (wimp_CLICK_SELECT << 4)) ||
(pointer->buttons == (wimp_CLICK_ADJUST << 4)))) {
- if (tree->single_selection)
+ if (tree->no_drag)
return true;
if (!node->selected) {