From 66d99ce41f4e5dceb4d7db34f6162490d9209747 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Fri, 28 Feb 2014 14:42:36 +0100 Subject: [PATCH] Restore traditional menu bar for desktops that show it https://bugzilla.gnome.org/show_bug.cgi?id=712357 --- data/ui/Makefile.am | 1 + data/ui/menubar.ui | 235 +++++++++++++++++++++++++++++++++++++++++++++++++ po/POTFILES.in | 1 + shell/rb-application.c | 15 +++- 4 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 data/ui/menubar.ui diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am index cebefea..a2b89f1 100644 --- a/data/ui/Makefile.am +++ b/data/ui/Makefile.am @@ -1,6 +1,7 @@ GTK_BUILDER_FILES = \ app-menu.ui \ + menubar.ui \ browser-popup.ui \ create-playlist.ui \ display-page-add-menu.ui \ diff --git a/data/ui/menubar.ui b/data/ui/menubar.ui new file mode 100644 index 0000000..d4e1a84 --- /dev/null +++ b/data/ui/menubar.ui @@ -0,0 +1,235 @@ + + + + + _File + + _Add Music… + app.library-import + <Ctrl>O + + + _Playlist + +
+ + _New Playlist… + app.playlist-new + <Ctrl>N + + + New _Automatic Playlist… + app.playlist-new-auto + + + _Load from File… + app.playlist-load + + + _Save to File… + app.playlist-save + <Ctrl>S + + + _Edit… + app.playlist-edit + +
+
+ + _Delete + app.display-page-remove + +
+ +
+
+ + Pr_operties + app.clipboard-properties + +
+
+ + _Close + app.quit + <Ctrl>W + +
+
+ + _Edit +
+ + Cu_t + app.clipboard-cut + <Ctrl>X + + + _Copy + app.clipboard-copy + <Ctrl>C + + + _Paste + app.clipboard-paste + <Ctrl>V + +
+
+ + Select _All + app.clipboard-select-all + <Ctrl>A + + + D_eselect All + app.clipboard-select-none + <Ctrl><Shift>A + +
+
+ + Add _to Play Queue + app.clipboard-add-to-queue + + + Add to _Playlist + + + _New Playlist + app.playlist-add-to-new + + + +
+
+ + _Move to Trash + app.clipboard-trash + +
+
+ + Prefere_nces + app.preferences + +
+
+ + _View +
+ + _Fullscreen + win.party-mode + F11 + +
+
+ + Side _Pane + win.display-page-tree-visible + F9 + + + View _Queue as Side Pane + win.queue-as-sidebar + <Ctrl>K + + + S_tatusbar + win.statusbar-visible + + + _Song Position Slider + win.show-song-position-slider + + + _Album Art + win.show-album-art + +
+
+ + _Jump to Playing Song + win.jump-to-playing + <Ctrl>J + +
+
+ view +
+
+ + _Control +
+ + _Play + app.play + <Ctrl>space + +
+
+ + Pre_vious + app.play-previous + <Ctrl>Left + + + _Next + app.play-next + <Ctrl>Right + +
+
+ + _Increase Volume + app.volume-up + <Ctrl>Up + + + _Decrease Volume + app.volume-down + <Ctrl>Down + +
+
+ + Sh_uffle + app.play-shuffle + <Ctrl>U + + + _Repeat + app.play-repeat + <Ctrl>R + +
+
+ + _Tools +
+ tools +
+
+ + Plu_gins… + app.plugins + +
+
+ + _Help +
+ + _Contents + app.help + F1 + + + _About + app.about + +
+
+
+
+ diff --git a/po/POTFILES.in b/po/POTFILES.in index ec639aa..7f8fb82 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -7,6 +7,7 @@ data/playlists.xml.in data/rhythmbox.desktop.in.in data/rhythmbox-device.desktop.in.in [type: gettext/glade]data/ui/app-menu.ui +[type: gettext/glade]data/ui/menubar.ui [type: gettext/glade]data/ui/browser-popup.ui [type: gettext/glade]data/ui/create-playlist.ui [type: gettext/glade]data/ui/display-page-add-menu.ui diff --git a/shell/rb-application.c b/shell/rb-application.c index 68e7a5e..6533087 100644 --- a/shell/rb-application.c +++ b/shell/rb-application.c @@ -332,6 +332,7 @@ impl_startup (GApplication *app) { RBApplication *rb = RB_APPLICATION (app); gboolean shell_shows_app_menu; + gboolean shell_shows_menubar; GtkBuilder *builder; GMenuModel *menu; GtkCssProvider *provider; @@ -361,6 +362,7 @@ impl_startup (GApplication *app) g_object_get (gtk_settings_get_default (), "gtk-shell-shows-app-menu", &shell_shows_app_menu, + "gtk-shell-shows-menubar", &shell_shows_menubar, NULL); builder = rb_builder_load ("app-menu.ui", NULL); @@ -371,9 +373,20 @@ impl_startup (GApplication *app) /* only set the app menu if the shell shows it; otherwise, we'll * stick a menu button in the toolbar. */ - if (shell_shows_app_menu) { + if (shell_shows_app_menu && !shell_shows_menubar) { gtk_application_set_app_menu (GTK_APPLICATION (app), menu); } + else if (!shell_shows_app_menu || shell_shows_menubar) { + GtkBuilder *menubar_builder; + GMenuModel *menubar; + + menubar_builder = rb_builder_load ("menubar.ui", NULL); + menubar = G_MENU_MODEL (gtk_builder_get_object (menubar_builder, "menubar")); + rb_application_link_shared_menus (rb, G_MENU (menubar)); + gtk_application_set_menubar (GTK_APPLICATION (app), menubar); + + g_object_unref (menubar_builder); + } g_object_unref (builder); -- 1.9.0