summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-08-08 09:25:19 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-08-09 10:12:17 -0400
commitac7318fd164d1371359d6bb03eb4962dab9967e9 (patch)
tree43c2df89fe00303a870eb1312aebac802bf7ffb3
parent55420e17214141e931c6b87a314ee7b8874ecda0 (diff)
downloadnautilus-ac7318fd164d1371359d6bb03eb4962dab9967e9.tar.gz
Move bookmarks to app menu and only show add bookmark in page menu
https://bugzilla.gnome.org/show_bug.cgi?id=680985
-rw-r--r--src/nautilus-app-menu.ui6
-rw-r--r--src/nautilus-application.c11
-rw-r--r--src/nautilus-shell-ui.xml10
-rw-r--r--src/nautilus-window-menus.c27
4 files changed, 36 insertions, 18 deletions
diff --git a/src/nautilus-app-menu.ui b/src/nautilus-app-menu.ui
index 0f234aeaa..f14646fdb 100644
--- a/src/nautilus-app-menu.ui
+++ b/src/nautilus-app-menu.ui
@@ -14,6 +14,12 @@
</section>
<section>
<item>
+ <attribute name="action">app.bookmarks</attribute>
+ <attribute name="label" translatable="yes">_Bookmarks</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
<attribute name="action">app.preferences</attribute>
<attribute name="label" translatable="yes">Prefere_nces</attribute>
</item>
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 272b58565..2bbf1061a 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -833,6 +833,16 @@ action_connect_to_server (GSimpleAction *action,
}
static void
+action_bookmarks (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GtkApplication *application = user_data;
+
+ nautilus_application_edit_bookmarks (NAUTILUS_APPLICATION (application), NAUTILUS_WINDOW (get_focus_window (application)));
+}
+
+static void
action_preferences (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -914,6 +924,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 },
+ { "bookmarks", action_bookmarks, NULL, NULL, NULL },
{ "preferences", action_preferences, NULL, NULL, NULL },
{ "about", action_about, NULL, NULL, NULL },
{ "help", action_help, NULL, NULL, NULL },
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 4ecf8aba6..298e81ab4 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -59,11 +59,11 @@
<separator/>
<menuitem name="Preferences" action="Preferences"/>
</menu>
- <menu action="Bookmarks">
- <menuitem name="Add Bookmark" action="Add Bookmark"/>
- <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
- <menuitem name="Go to Location" action="Go to Location"/>
- </menu>
+ <separator/>
+ <menuitem name="Add Bookmark" action="Add Bookmark"/>
+ <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
+ <menuitem name="Go to Location" action="Go to Location"/>
+ <separator/>
<placeholder name="Extension Actions"/>
<separator/>
<placeholder name="Close Items Placeholder">
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 25f56a71e..5d1c753d8 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -85,6 +85,14 @@ action_connect_to_server_callback (GtkAction *action,
}
static void
+action_bookmarks_callback (GtkAction *action,
+ gpointer user_data)
+{
+ g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
+ "bookmarks", NULL);
+}
+
+static void
action_stop_callback (GtkAction *action,
gpointer user_data)
{
@@ -335,14 +343,6 @@ action_add_bookmark_callback (GtkAction *action,
}
static void
-action_edit_bookmarks_callback (GtkAction *action,
- gpointer user_data)
-{
- NautilusApplication *app = NAUTILUS_APPLICATION (g_application_get_default ());
- nautilus_application_edit_bookmarks (app, NAUTILUS_WINDOW (user_data));
-}
-
-static void
connect_proxy_cb (GtkActionGroup *action_group,
GtkAction *action,
GtkWidget *proxy,
@@ -541,12 +541,12 @@ static const GtkActionEntry main_entries[] = {
/* name, stock id, label */ { "Go to Location", NULL, N_("_Location..."),
"<control>L", N_("Specify a location to open"),
G_CALLBACK (action_go_to_location_callback) },
- /* name, stock id, label */ { "Add Bookmark", GTK_STOCK_ADD, N_("_Add Bookmark"),
- "<control>d", N_("Add a bookmark for the current location to this menu"),
+ /* 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) },
- /* name, stock id, label */ { "Edit Bookmarks", NULL, N_("_Edit Bookmarks..."),
- "<control>b", N_("Display a window that allows editing the bookmarks in this menu"),
- G_CALLBACK (action_edit_bookmarks_callback) },
+ /* name, stock id, label */ { NAUTILUS_ACTION_EDIT_BOOKMARKS, NULL, N_("_Bookmarks..."),
+ "<control>b", N_("Display and edit bookmarks"),
+ G_CALLBACK (action_bookmarks_callback) },
{ "TabsPrevious", NULL, N_("_Previous Tab"), "<control>Page_Up",
N_("Activate previous tab"),
G_CALLBACK (action_tabs_previous_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_EDIT_BOOKMARKS,
NAUTILUS_ACTION_PREFERENCES,
NAUTILUS_ACTION_HELP,
NAUTILUS_ACTION_ABOUT,