[nautilus] Move enter location into the app menu
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Move enter location into the app menu
- Date: Thu, 9 Aug 2012 14:12:43 +0000 (UTC)
commit 5f5dd8a985a1df07bf092b87347085034ff4a5db
Author: William Jon McCann <jmccann redhat com>
Date: Wed Aug 8 09:35:28 2012 -0400
Move enter location into the app menu
https://bugzilla.gnome.org/show_bug.cgi?id=680985
src/nautilus-actions.h | 2 +-
src/nautilus-app-menu.ui | 4 ++++
src/nautilus-application.c | 15 +++++++++++++++
src/nautilus-shell-ui.xml | 2 +-
src/nautilus-window-menus.c | 11 ++++++-----
src/nautilus-window.c | 4 ++--
6 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index 4ef389a..ce452c9 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -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"
diff --git a/src/nautilus-app-menu.ui b/src/nautilus-app-menu.ui
index f14646f..494c3c0 100644
--- a/src/nautilus-app-menu.ui
+++ b/src/nautilus-app-menu.ui
@@ -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>
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 2bbf106..fdd9c9a 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -833,6 +833,20 @@ action_connect_to_server (GSimpleAction *action,
}
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,
gpointer user_data)
@@ -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 },
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 298e81a..868ea84 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -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/>
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 5d1c753..37ab174 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -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,
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 8b86128..c0fbaf6 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -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 },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]