summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-11-18 21:17:27 +0100
committerjcid <devnull@localhost>2007-11-18 21:17:27 +0100
commit256fc28baf951ab2a8a47c10fbbec3edcf28c96c (patch)
tree05fe989e477bbbdae9c1ceff40180c1e210f7239
parent18b139e2f2e1cecb18d9d1e803ac5551b5a01d6c (diff)
copy image/link location
-rw-r--r--ChangeLog1
-rw-r--r--README4
-rw-r--r--src/menu.cc11
-rw-r--r--src/uicmd.cc9
-rw-r--r--src/uicmd.hh1
5 files changed, 18 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 694c1dd9..55111abb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,7 @@ dillo-fltk2
- Added a save-directory preference (save_dir in dillorc2).
- Fixed page-popup-menu to use the stack's top URL instead of base_url.
- Added the "static" qualifier where missing.
+ - Bound "Copy link location".
Patches: place
+- Fixed a problem with locally-installed dpis.
- Added code for optional image loading (nice interface) very advanced!
diff --git a/README b/README
index 7205f28c..73ce0eb5 100644
--- a/README
+++ b/README
@@ -26,9 +26,9 @@ Advanced * viewport scrolling is not yet optimized (takes lots of CPU)
* you may experience crashes from "assert" statements from
unfinished code.
Fixed * context menus are not yet completely hooked or activated
- * Selecting text with the mouse is half hooked. This is, you
+Fixed * Selecting text with the mouse is half hooked. This is, you
can see the selected text in the terminal but can't paste.
- * Searching for text is not yet hooked. Look in test/ directory
+Advanced * Searching for text is not yet hooked. Look in test/ directory
of dw2 for an example of find text.
Advanced * Form elements are not yet hooked/implemented. You can look
in dw2' test/dw_ui_test.cc to see what's already done.
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);