Commit 9c46a677 authored by Germán Poo-Caamaño's avatar Germán Poo-Caamaño

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
parent f31b38d9
Pipeline #24204 failed with stage
in 5 minutes and 19 seconds
......@@ -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,
......
......@@ -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 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment