diff options
author | jcid <devnull@localhost> | 2007-11-18 21:17:27 +0100 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-11-18 21:17:27 +0100 |
commit | 256fc28baf951ab2a8a47c10fbbec3edcf28c96c (patch) | |
tree | 05fe989e477bbbdae9c1ceff40180c1e210f7239 /src | |
parent | 18b139e2f2e1cecb18d9d1e803ac5551b5a01d6c (diff) |
copy image/link location
Diffstat (limited to 'src')
-rw-r--r-- | src/menu.cc | 11 | ||||
-rw-r--r-- | src/uicmd.cc | 9 | ||||
-rw-r--r-- | src/uicmd.hh | 1 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/menu.cc b/src/menu.cc index 5e289aa6..498c3465 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -70,9 +70,10 @@ void NewItem::draw() { //-------------------------------------------------------------------------- -static void Menu_unimplemented_cb(Widget*) +static void Menu_copy_urlstr_cb(Widget *) { - MSG("Menu_unimplemented_cb: click! :-)\n"); + if (popup_url) + a_UIcmd_copy_urlstr(popup_bw, URL_STR(popup_url)); } static void Menu_link_cb(Widget*, void *user_data) @@ -302,8 +303,7 @@ void a_Menu_link_popup(BrowserWindow *bw, const DilloUrl *url) i = new Item("Bookmark this Link"); i->callback(Menu_add_bookmark_cb); i = new Item("Copy Link location"); - i->callback(Menu_unimplemented_cb); - i->deactivate(); + i->callback(Menu_copy_urlstr_cb); new Divider(); i = new Item("Save Link As..."); i->callback(Menu_save_link_cb); @@ -348,8 +348,7 @@ void a_Menu_image_popup(BrowserWindow *bw, const DilloUrl *url, i = new Item("Bookmark this Image"); i->callback(Menu_add_bookmark_cb); i = new Item("Copy Image location"); - i->callback(Menu_unimplemented_cb); - i->deactivate(); + i->callback(Menu_copy_urlstr_cb); new Divider(); i = new Item("Save Image As..."); i->callback(Menu_save_link_cb); diff --git a/src/uicmd.cc b/src/uicmd.cc index ed72356e..6df03b9e 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -469,6 +469,15 @@ void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, DilloUrl *link_url) } /* + * Copy url string to paste buffer + */ +void a_UIcmd_copy_urlstr(BrowserWindow *bw, const char *urlstr) +{ + Layout *layout = (Layout*)bw->render_layout; + layout->copySelection(urlstr); +} + +/* * Show a text window with the URL's source */ void a_UIcmd_view_page_source(const DilloUrl *url) diff --git a/src/uicmd.hh b/src/uicmd.hh index b1c4e102..13d7a948 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -31,6 +31,7 @@ void a_UIcmd_page_popup(void *vbw, const DilloUrl *url, const char *bugs_txt, int prefs_load_images); void a_UIcmd_link_popup(void *vbw, const DilloUrl *url); void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, DilloUrl *link_url); +void a_UIcmd_copy_urlstr(BrowserWindow *bw, const char *urlstr); void a_UIcmd_view_page_source(const DilloUrl *url); void a_UIcmd_view_page_bugs(void *vbw); void a_UIcmd_bugmeter_popup(void *vbw); |