patch: binding to add bookmark

corvid <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
Another simple one from the bug tracker. I don't use bookmarks heavily
enough to have much need for this, but I can see that it could be
convenient.

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
add_bookmark.patch (text/x-diff, 1.9 KB)
diff -r 69ca34e6a601 src/keys.cc
--- a/src/keys.cc	Sat Sep 14 15:26:13 2013 +0000
+++ b/src/keys.cc	Sun Sep 15 17:45:50 2013 +0000
@@ -110,6 +110,7 @@
    { "find"         , KEYS_FIND         , FL_CTRL   , 'f'             },
    { "websearch"    , KEYS_WEBSEARCH    , FL_CTRL   , 's'             },
    { "bookmarks"    , KEYS_BOOKMARKS    , FL_CTRL   , 'b'             },
+   { "add-bookmark" , KEYS_ADD_BOOKMARK , 0         , 0               },
    { "reload"       , KEYS_RELOAD       , FL_CTRL   , 'r'             },
    { "stop"         , KEYS_STOP         , 0         , 0               },
    { "save"         , KEYS_SAVE         , 0         , 0               },
diff -r 69ca34e6a601 src/keys.hh
--- a/src/keys.hh	Sat Sep 14 15:26:13 2013 +0000
+++ b/src/keys.hh	Sun Sep 15 17:45:50 2013 +0000
@@ -27,6 +27,7 @@
    KEYS_FIND,
    KEYS_WEBSEARCH,
    KEYS_BOOKMARKS,
+   KEYS_ADD_BOOKMARK,
    KEYS_RELOAD,
    KEYS_STOP,
    KEYS_SAVE,
diff -r 69ca34e6a601 src/keysrc
--- a/src/keysrc	Sat Sep 14 15:26:13 2013 +0000
+++ b/src/keysrc	Sun Sep 15 17:45:50 2013 +0000
@@ -69,6 +69,9 @@
 # go to your "bookmarks".
 #<ctrl>b = bookmarks
 
+# "add-bookmark" adds the current page to your bookmarks.
+#(add-bookmark has no default binding)
+
 # "file-menu" pops up the file menu.
 #<alt>f = file-menu
 
diff -r 69ca34e6a601 src/ui.cc
--- a/src/ui.cc	Sat Sep 14 15:26:13 2013 +0000
+++ b/src/ui.cc	Sun Sep 15 17:45:50 2013 +0000
@@ -770,6 +770,11 @@
          const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
          a_UIcmd_view_page_source(bw, url);
          ret = 1;
+      } else if (cmd == KEYS_ADD_BOOKMARK) {
+         BrowserWindow *bw = a_UIcmd_get_bw_by_widget(this);
+         const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
+         a_UIcmd_add_bookmark(bw, url);
+         ret = 1;
       }
    } else if (event == FL_RELEASE) {
       if (Fl::event_button() == FL_MIDDLE_MOUSE &&
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.