Commit 5f5dd8a9 authored by William Jon McCann's avatar William Jon McCann

Move enter location into the app menu

https://bugzilla.gnome.org/show_bug.cgi?id=680985
parent ac7318fd
......@@ -36,7 +36,7 @@
#define NAUTILUS_ACTION_SHOW_HIDE_SIDEBAR "Show Hide Sidebar"
#define NAUTILUS_ACTION_SHOW_HIDE_LOCATION_BAR "Show Hide Location Bar"
#define NAUTILUS_ACTION_GO_TO_BURN_CD "Go to Burn CD"
#define NAUTILUS_ACTION_GO_TO_LOCATION "Go to Location"
#define NAUTILUS_ACTION_ENTER_LOCATION "Enter Location"
#define NAUTILUS_ACTION_GO_HOME "Home"
#define NAUTILUS_ACTION_ADD_BOOKMARK "Add Bookmark"
#define NAUTILUS_ACTION_EDIT_BOOKMARKS "Edit Bookmarks"
......
......@@ -11,6 +11,10 @@
<attribute name="action">app.connect-to-server</attribute>
<attribute name="label" translatable="yes">Connect to _Server</attribute>
</item>
<item>
<attribute name="action">app.enter-location</attribute>
<attribute name="label" translatable="yes">Enter _Location</attribute>
</item>
</section>
<section>
<item>
......
......@@ -832,6 +832,20 @@ action_connect_to_server (GSimpleAction *action,
gtk_widget_show (dialog);
}
static void
action_enter_location (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkApplication *application = user_data;
NautilusWindow *window;
GtkWindow *cur_window;
cur_window = get_focus_window (application);
window = NAUTILUS_WINDOW (cur_window);
nautilus_window_ensure_location_bar (window);
}
static void
action_bookmarks (GSimpleAction *action,
GVariant *parameter,
......@@ -924,6 +938,7 @@ action_quit (GSimpleAction *action,
static GActionEntry app_entries[] = {
{ "new-window", action_new_window, NULL, NULL, NULL },
{ "connect-to-server", action_connect_to_server, NULL, NULL, NULL },
{ "enter-location", action_enter_location, NULL, NULL, NULL },
{ "bookmarks", action_bookmarks, NULL, NULL, NULL },
{ "preferences", action_preferences, NULL, NULL, NULL },
{ "about", action_about, NULL, NULL, NULL },
......
......@@ -62,7 +62,7 @@
<separator/>
<menuitem name="Add Bookmark" action="Add Bookmark"/>
<menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
<menuitem name="Go to Location" action="Go to Location"/>
<menuitem name="Enter Location" action="Enter Location"/>
<separator/>
<placeholder name="Extension Actions"/>
<separator/>
......
......@@ -378,11 +378,11 @@ action_new_tab_callback (GtkAction *action,
}
static void
action_go_to_location_callback (GtkAction *action,
action_enter_location_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindow *window = user_data;
nautilus_window_ensure_location_bar (window);
g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
"enter-location", NULL);
}
static void
......@@ -538,9 +538,9 @@ static const GtkActionEntry main_entries[] = {
/* name, stock id, label */ { NAUTILUS_ACTION_FORWARD, "go-next-symbolic", N_("_Forward"),
"<alt>Right", N_("Go to the next visited location"),
G_CALLBACK (action_forward_callback) },
/* name, stock id, label */ { "Go to Location", NULL, N_("_Location..."),
/* name, stock id, label */ { NAUTILUS_ACTION_ENTER_LOCATION, NULL, N_("Enter _Location..."),
"<control>L", N_("Specify a location to open"),
G_CALLBACK (action_go_to_location_callback) },
G_CALLBACK (action_enter_location_callback) },
/* name, stock id, label */ { NAUTILUS_ACTION_ADD_BOOKMARK, GTK_STOCK_ADD, N_("Bookmark this Location"),
"<control>d", N_("Add a bookmark for the current location"),
G_CALLBACK (action_add_bookmark_callback) },
......@@ -583,6 +583,7 @@ static const GtkToggleActionEntry main_toggle_entries[] = {
static const gchar* app_actions[] = {
NAUTILUS_ACTION_NEW_WINDOW,
NAUTILUS_ACTION_CONNECT_TO_SERVER,
NAUTILUS_ACTION_ENTER_LOCATION,
NAUTILUS_ACTION_EDIT_BOOKMARKS,
NAUTILUS_ACTION_PREFERENCES,
NAUTILUS_ACTION_HELP,
......
......@@ -120,9 +120,9 @@ static const struct {
#ifdef HAVE_X11_XF86KEYSYM_H
{ XF86XK_AddFavorite, NAUTILUS_ACTION_ADD_BOOKMARK },
{ XF86XK_Favorites, NAUTILUS_ACTION_EDIT_BOOKMARKS },
{ XF86XK_Go, NAUTILUS_ACTION_GO_TO_LOCATION },
{ XF86XK_Go, NAUTILUS_ACTION_ENTER_LOCATION },
{ XF86XK_HomePage, NAUTILUS_ACTION_GO_HOME },
{ XF86XK_OpenURL, NAUTILUS_ACTION_GO_TO_LOCATION },
{ XF86XK_OpenURL, NAUTILUS_ACTION_ENTER_LOCATION },
{ XF86XK_Refresh, NAUTILUS_ACTION_RELOAD },
{ XF86XK_Reload, NAUTILUS_ACTION_RELOAD },
{ XF86XK_Search, NAUTILUS_ACTION_SEARCH },
......
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