From 402de7572d76686dd65a5ee71274a690a421cc8f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 16 Aug 2012 23:26:05 +0100 Subject: Use new content message for saving of hyperlink target URL. --- render/html.c | 5 +++++ render/html_interaction.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'render') diff --git a/render/html.c b/render/html.c index 62b3d1d4e..7c7b797ba 100644 --- a/render/html.c +++ b/render/html.c @@ -1247,6 +1247,11 @@ html_object_callback(hlcache_handle *object, content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data); break; + case CONTENT_MSG_SAVELINK: + /* Pass it on */ + content_broadcast(&c->base, CONTENT_MSG_SAVELINK, event->data); + break; + default: assert(0); } diff --git a/render/html_interaction.c b/render/html_interaction.c index a74e99d9a..a3cfaa95f 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -696,16 +696,19 @@ void html_mouse_action(struct content *c, struct browser_window *bw, mouse & BROWSER_MOUSE_MOD_1) { /* force download of link */ browser_window_go_post(bw, nsurl_access(url), 0, 0, - false, nsurl_access(hlcache_handle_get_url(h)), + false, + nsurl_access(hlcache_handle_get_url(h)), true, true, 0); + } else if (mouse & BROWSER_MOUSE_CLICK_2 && mouse & BROWSER_MOUSE_MOD_1) { - gui_window_save_link(bw->window, - nsurl_access(url), title); + msg_data.savelink.url = nsurl_access(url); + msg_data.savelink.title = title; + content_broadcast(c, CONTENT_MSG_SAVELINK, msg_data); + } else if (mouse & (BROWSER_MOUSE_CLICK_1 | BROWSER_MOUSE_CLICK_2)) action = ACTION_GO; - } else { bool done = false; -- cgit v1.2.3