[evince] shell: Add shortcut to delete bookmarks



commit 9c46a6774dfe0abc6745d1d13487c8ec459d6903
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Thu Aug 9 17:18:18 2018 -0400

    shell: Add shortcut to delete bookmarks
    
    We already have a shortcut to add bookmarks, it makes sense
    to provide one to delete them without depending on the UI.
    
    Fixes #478

 shell/ev-application.c |  1 +
 shell/ev-window.c      | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index d1a0f520..e88109c6 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -1015,6 +1015,7 @@ ev_application_startup (GApplication *gapplication)
           "win.select-all",             "<Ctrl>A", NULL,
           "win.save-settings",          "<Ctrl>T", NULL,
           "win.add-bookmark",           "<Ctrl>D", NULL,
+          "win.delete-bookmark",        "<Ctrl><Shift>D", NULL,
           "win.close",                  "<Ctrl>W", NULL,
           "win.escape",                 "Escape", NULL,
           "win.find",                   "<Ctrl>F", "slash", NULL,
diff --git a/shell/ev-window.c b/shell/ev-window.c
index e909e139..1705e13d 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4819,6 +4819,20 @@ ev_window_cmd_bookmarks_add (GSimpleAction *action,
        ev_bookmarks_add (window->priv->bookmarks, &bm);
 }
 
+static void
+ev_window_cmd_bookmarks_delete (GSimpleAction *action,
+                               GVariant      *parameter,
+                               gpointer       user_data)
+{
+       EvWindow *window = user_data;
+       EvBookmark bm;
+
+       bm.page = ev_document_model_get_page (window->priv->model);
+       bm.title = NULL;
+
+       ev_bookmarks_delete (window->priv->bookmarks, &bm);
+}
+
 static void
 ev_window_activate_goto_bookmark_action (GSimpleAction *action,
                                         GVariant      *parameter,
@@ -5902,6 +5916,7 @@ static const GActionEntry actions[] = {
        { "reload", ev_window_cmd_view_reload },
        { "auto-scroll", ev_window_cmd_view_autoscroll },
        { "add-bookmark", ev_window_cmd_bookmarks_add },
+       { "delete-bookmark", ev_window_cmd_bookmarks_delete },
        { "goto-bookmark", ev_window_activate_goto_bookmark_action, "u" },
        { "close", ev_window_cmd_file_close_window },
        { "scroll-forward", ev_window_cmd_scroll_forward },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]