summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-08-08 10:39:47 +0100
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2021-12-22 01:38:47 +0000
commit59b1847e60c7f5b6408844a991b0c1e84c1d70b0 (patch)
tree7e0b8b18cdee0615a51a3c89ff410ba1b2332bbb
parenta0203f826ef94831cc2d4426cd09c0fd3bf878c9 (diff)
downloadnautilus-59b1847e60c7f5b6408844a991b0c1e84c1d70b0.tar.gz
window: Add media key shortcut to Starred
The Favorites media key is set as an accel for the "win.bookmarks" action, which has been removed many years ago along with the bookmarks editor. But now we have a Starred view, which fits nicely.
-rw-r--r--src/nautilus-window.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 3ed6ecd19..238271ae8 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -173,7 +173,6 @@ static const struct
{
/* Window actions */
{ GDK_KEY_AddFavorite, "bookmark-current-location" },
- { GDK_KEY_Favorites, "bookmarks" },
{ GDK_KEY_Go, "enter-location" },
{ GDK_KEY_HomePage, "go-home" },
{ GDK_KEY_OpenURL, "enter-location" },
@@ -226,6 +225,20 @@ action_go_home (GSimpleAction *action,
}
static void
+action_go_starred (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
+{
+ NautilusWindow *window;
+ g_autoptr (GFile) starred = NULL;
+
+ window = NAUTILUS_WINDOW (user_data);
+ starred = g_file_new_for_uri ("starred:///");
+
+ nautilus_window_open_location_full (window, starred, 0, NULL, NULL);
+}
+
+static void
action_reload (GSimpleAction *action,
GVariant *state,
gpointer user_data)
@@ -2019,6 +2032,7 @@ const GActionEntry win_entries[] =
/* Only accesible by shorcuts */
{ "close-current-view", action_close_current_view },
{ "go-home", action_go_home },
+ { "go-starred", action_go_starred },
{ "tab-previous", action_tab_previous },
{ "tab-next", action_tab_next },
{ "tab-move-left", action_tab_move_left },
@@ -2080,6 +2094,7 @@ nautilus_window_initialize_actions (NautilusWindow *window)
nautilus_application_set_accelerator (app, "win.bookmark-current-location", "<control>d");
nautilus_application_set_accelerator (app, "win.up", "<alt>Up");
nautilus_application_set_accelerator (app, "win.go-home", "<alt>Home");
+ nautilus_application_set_accelerator (app, "win.go-starred", "Favorites");
nautilus_application_set_accelerator (app, "win.tab-previous", "<control>Page_Up");
nautilus_application_set_accelerator (app, "win.tab-next", "<control>Page_Down");
nautilus_application_set_accelerator (app, "win.tab-move-left", "<shift><control>Page_Up");