~larsu/rhythmbox/relink-toolbar-buttons

« back to all changes in this revision

Viewing changes to debian/patches/restore-traditional-menubar.patch

  • Committer: Sebastien Bacher
  • Date: 2014-02-28 16:58:54 UTC
  • mfrom: (213.1.9 rhythmbox-ubuntu)
  • Revision ID: seb128@ubuntu.com-20140228165854-sk9w6d92g7vgy48r
[ Iain Lane ]
* Use dh_autoreconf; drop explicit libtool.m4 patching. 

[ Lars Uebernickel ]
* Add debian/patches/restore-traditional-menubar.patch
    - add a traditional menu bar on desktops that show it (lp: #1131664)
* Add debian/patches/make-shuffle-repeat-proper-toggle-actions.patch
    - fixes toggle and repeat actions in the menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 16b27bfe1f79cbe19b8f32e035ce4a71716e1610 Mon Sep 17 00:00:00 2001
 
2
From: Lars Uebernickel <lars.uebernickel@canonical.com>
 
3
Date: Fri, 28 Feb 2014 14:42:36 +0100
 
4
Subject: [PATCH] Restore traditional menu bar for desktops that show it
 
5
 
 
6
https://bugzilla.gnome.org/show_bug.cgi?id=712357
 
7
---
 
8
 data/ui/Makefile.am    |   1 +
 
9
 data/ui/menubar.ui     | 241 +++++++++++++++++++++++++++++++++++++++++++++++++
 
10
 po/POTFILES.in         |   1 +
 
11
 shell/rb-application.c |  15 ++-
 
12
 4 files changed, 257 insertions(+), 1 deletion(-)
 
13
 create mode 100644 data/ui/menubar.ui
 
14
 
 
15
diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am
 
16
index cebefea..a2b89f1 100644
 
17
--- a/data/ui/Makefile.am
 
18
+++ b/data/ui/Makefile.am
 
19
@@ -1,6 +1,7 @@
 
20
 
 
21
 GTK_BUILDER_FILES =                                    \
 
22
        app-menu.ui                                     \
 
23
+       menubar.ui                                      \
 
24
        browser-popup.ui                                \
 
25
        create-playlist.ui                              \
 
26
        display-page-add-menu.ui                        \
 
27
diff --git a/data/ui/menubar.ui b/data/ui/menubar.ui
 
28
new file mode 100644
 
29
index 0000000..3459503
 
30
--- /dev/null
 
31
+++ b/data/ui/menubar.ui
 
32
@@ -0,0 +1,241 @@
 
33
+<?xml version="1.0"?>
 
34
+<interface>
 
35
+  <menu id="menubar">
 
36
+    <submenu>
 
37
+      <attribute name="label" translatable="yes">_Music</attribute>
 
38
+      <item>
 
39
+        <attribute name="label" translatable="yes">_Add Music…</attribute>
 
40
+        <attribute name="action">app.library-import</attribute>
 
41
+        <attribute name="accel">&lt;Ctrl&gt;O</attribute>
 
42
+      </item>
 
43
+      <item>
 
44
+        <attribute name="label" translatable="yes">_Check for New Devices</attribute>
 
45
+        <attribute name="action">app.check-devices</attribute>
 
46
+      </item>
 
47
+      <item>
 
48
+        <attribute name="label" translatable="yes">_Playlist</attribute>
 
49
+        <link name="submenu">
 
50
+          <section>
 
51
+            <item>
 
52
+              <attribute name="label" translatable="yes">_New Playlist…</attribute>
 
53
+              <attribute name="action">app.playlist-new</attribute>
 
54
+              <attribute name="accel">&lt;Ctrl&gt;N</attribute>
 
55
+            </item>
 
56
+            <item>
 
57
+              <attribute name="label" translatable="yes">New _Automatic Playlist…</attribute>
 
58
+              <attribute name="action">app.playlist-new-auto</attribute>
 
59
+            </item>
 
60
+            <item>
 
61
+              <attribute name="label" translatable="yes">_Load from File…</attribute>
 
62
+              <attribute name="action">app.playlist-load</attribute>
 
63
+            </item>
 
64
+            <item>
 
65
+              <attribute name="label" translatable="yes">_Save to File…</attribute>
 
66
+              <attribute name="action">app.playlist-save</attribute>
 
67
+              <attribute name="accel">&lt;Ctrl&gt;S</attribute>
 
68
+            </item>
 
69
+            <item>
 
70
+              <attribute name="label" translatable="yes">_Edit…</attribute>
 
71
+              <attribute name="action">app.playlist-edit</attribute>
 
72
+            </item>
 
73
+          </section>
 
74
+          <section>
 
75
+            <item>
 
76
+              <attribute name="label" translatable="yes">_Delete</attribute>
 
77
+              <attribute name="action">app.display-page-remove</attribute>
 
78
+            </item>
 
79
+          </section>
 
80
+        </link>
 
81
+      </item>
 
82
+      <section>
 
83
+        <item>
 
84
+          <attribute name="label" translatable="yes">Pr_operties</attribute>
 
85
+          <attribute name="action">app.clipboard-properties</attribute>
 
86
+        </item>
 
87
+      </section>
 
88
+      <section>
 
89
+        <item>
 
90
+          <attribute name="label" translatable="yes">_Close</attribute>
 
91
+          <attribute name="action">app.quit</attribute>
 
92
+          <attribute name="accel">&lt;Ctrl&gt;W</attribute>
 
93
+        </item>
 
94
+      </section>
 
95
+    </submenu>
 
96
+    <submenu>
 
97
+      <attribute name="label" translatable="yes">_Edit</attribute>
 
98
+      <section>
 
99
+        <item>
 
100
+          <attribute name="label" translatable="yes">Cu_t</attribute>
 
101
+          <attribute name="action">app.clipboard-cut</attribute>
 
102
+          <attribute name="accel">&lt;Ctrl&gt;X</attribute>
 
103
+        </item>
 
104
+        <item>
 
105
+          <attribute name="label" translatable="yes">_Copy</attribute>
 
106
+          <attribute name="action">app.clipboard-copy</attribute>
 
107
+          <attribute name="accel">&lt;Ctrl&gt;C</attribute>
 
108
+        </item>
 
109
+        <item>
 
110
+          <attribute name="label" translatable="yes">_Paste</attribute>
 
111
+          <attribute name="action">app.clipboard-paste</attribute>
 
112
+          <attribute name="accel">&lt;Ctrl&gt;V</attribute>
 
113
+        </item>
 
114
+      </section>
 
115
+      <section>
 
116
+        <item>
 
117
+          <attribute name="label" translatable="yes">Select _All</attribute>
 
118
+          <attribute name="action">app.clipboard-select-all</attribute>
 
119
+          <attribute name="accel">&lt;Ctrl&gt;A</attribute>
 
120
+        </item>
 
121
+        <item>
 
122
+          <attribute name="label" translatable="yes">D_eselect All</attribute>
 
123
+          <attribute name="action">app.clipboard-select-none</attribute>
 
124
+          <attribute name="accel">&lt;Ctrl&gt;&lt;Shift&gt;A</attribute>
 
125
+        </item>
 
126
+      </section>
 
127
+      <section>
 
128
+        <item>
 
129
+          <attribute name="label" translatable="yes">Add _to Play Queue</attribute>
 
130
+          <attribute name="action">app.clipboard-add-to-queue</attribute>
 
131
+        </item>
 
132
+        <item>
 
133
+          <attribute name="label" translatable="yes">Add to _Playlist</attribute>
 
134
+          <link name="submenu">
 
135
+            <item>
 
136
+              <attribute name="label" translatable="yes">_New Playlist</attribute>
 
137
+              <attribute name="action">app.playlist-add-to-new</attribute>
 
138
+            </item>
 
139
+          </link>
 
140
+        </item>
 
141
+      </section>
 
142
+      <section>
 
143
+        <item>
 
144
+          <attribute name="label" translatable="yes">_Move to Trash</attribute>
 
145
+          <attribute name="action">app.clipboard-trash</attribute>
 
146
+        </item>
 
147
+      </section>
 
148
+      <section>
 
149
+        <item>
 
150
+          <attribute name="label" translatable="yes">Prefere_nces</attribute>
 
151
+          <attribute name="action">app.preferences</attribute>
 
152
+        </item>
 
153
+      </section>
 
154
+    </submenu>
 
155
+    <submenu>
 
156
+      <attribute name="label" translatable="yes">_View</attribute>
 
157
+      <section>
 
158
+        <item>
 
159
+          <attribute name="label" translatable="yes">Party _Mode</attribute>
 
160
+          <attribute name="action">win.party-mode</attribute>
 
161
+          <attribute name="accel">F11</attribute>
 
162
+        </item>
 
163
+      </section>
 
164
+      <section>
 
165
+        <item>
 
166
+          <attribute name="label" translatable="yes">Side _Pane</attribute>
 
167
+          <attribute name="action">win.display-page-tree-visible</attribute>
 
168
+          <attribute name="accel">F9</attribute>
 
169
+        </item>
 
170
+        <item>
 
171
+          <attribute name="label" translatable="yes">View _Queue as Side Pane</attribute>
 
172
+          <attribute name="action">win.queue-as-sidebar</attribute>
 
173
+          <attribute name="accel">&lt;Ctrl&gt;K</attribute>
 
174
+        </item>
 
175
+        <item>
 
176
+          <attribute name="label" translatable="yes">S_tatusbar</attribute>
 
177
+          <attribute name="action">win.statusbar-visible</attribute>
 
178
+        </item>
 
179
+        <item>
 
180
+          <attribute name="label" translatable="yes">_Song Position Slider</attribute>
 
181
+          <attribute name="action">win.show-song-position-slider</attribute>
 
182
+        </item>
 
183
+        <item>
 
184
+          <attribute name="label" translatable="yes">_Album Art</attribute>
 
185
+          <attribute name="action">win.show-album-art</attribute>
 
186
+        </item>
 
187
+      </section>
 
188
+      <section>
 
189
+        <item>
 
190
+          <attribute name="label" translatable="yes">_Jump to Playing Song</attribute>
 
191
+          <attribute name="action">win.jump-to-playing</attribute>
 
192
+          <attribute name="accel">&lt;Ctrl&gt;J</attribute>
 
193
+        </item>
 
194
+      </section>
 
195
+      <section>
 
196
+        <attribute name="rb-plugin-menu-link">view</attribute>
 
197
+      </section>
 
198
+    </submenu>
 
199
+    <submenu>
 
200
+      <attribute name="label" translatable="yes">_Control</attribute>
 
201
+      <section>
 
202
+        <item>
 
203
+          <attribute name="label" translatable="yes">_Play</attribute>
 
204
+          <attribute name="action">app.play</attribute>
 
205
+          <attribute name="accel">&lt;Ctrl&gt;space</attribute>
 
206
+        </item>
 
207
+      </section>
 
208
+      <section>
 
209
+        <item>
 
210
+          <attribute name="label" translatable="yes">Pre_vious</attribute>
 
211
+          <attribute name="action">app.play-previous</attribute>
 
212
+          <attribute name="accel">&lt;Alt&gt;Left</attribute>
 
213
+        </item>
 
214
+        <item>
 
215
+          <attribute name="label" translatable="yes">_Next</attribute>
 
216
+          <attribute name="action">app.play-next</attribute>
 
217
+          <attribute name="accel">&lt;Alt&gt;Right</attribute>
 
218
+        </item>
 
219
+      </section>
 
220
+      <section>
 
221
+        <item>
 
222
+          <attribute name="label" translatable="yes">_Increase Volume</attribute>
 
223
+          <attribute name="action">app.volume-up</attribute>
 
224
+          <attribute name="accel">&lt;Ctrl&gt;Up</attribute>
 
225
+        </item>
 
226
+        <item>
 
227
+          <attribute name="label" translatable="yes">_Decrease Volume</attribute>
 
228
+          <attribute name="action">app.volume-down</attribute>
 
229
+          <attribute name="accel">&lt;Ctrl&gt;Down</attribute>
 
230
+        </item>
 
231
+      </section>
 
232
+      <section>
 
233
+        <item>
 
234
+          <attribute name="label" translatable="yes">Sh_uffle</attribute>
 
235
+          <attribute name="action">app.play-shuffle</attribute>
 
236
+          <attribute name="accel">&lt;Ctrl&gt;U</attribute>
 
237
+        </item>
 
238
+        <item>
 
239
+          <attribute name="label" translatable="yes">_Repeat</attribute>
 
240
+          <attribute name="action">app.play-repeat</attribute>
 
241
+          <attribute name="accel">&lt;Ctrl&gt;R</attribute>
 
242
+        </item>
 
243
+      </section>
 
244
+    </submenu>
 
245
+    <submenu>
 
246
+      <attribute name="label" translatable="yes">_Tools</attribute>
 
247
+      <section>
 
248
+        <attribute name="rb-plugin-menu-link">tools</attribute>
 
249
+      </section>
 
250
+      <section>
 
251
+        <item>
 
252
+          <attribute name="label" translatable="yes">Plu_gins…</attribute>
 
253
+          <attribute name="action">app.plugins</attribute>
 
254
+        </item>
 
255
+      </section>
 
256
+    </submenu>
 
257
+    <submenu>
 
258
+      <attribute name="label" translatable="yes">_Help</attribute>
 
259
+      <section>
 
260
+        <item>
 
261
+          <attribute name="label" translatable="yes">_Contents</attribute>
 
262
+          <attribute name="action">app.help</attribute>
 
263
+          <attribute name="accel">F1</attribute>
 
264
+        </item>
 
265
+        <item>
 
266
+          <attribute name="label" translatable="yes">_About</attribute>
 
267
+          <attribute name="action">app.about</attribute>
 
268
+        </item>
 
269
+      </section>
 
270
+    </submenu>
 
271
+  </menu>
 
272
+</interface>
 
273
+
 
274
diff --git a/po/POTFILES.in b/po/POTFILES.in
 
275
index 15d5d81..b6123c5 100644
 
276
--- a/po/POTFILES.in
 
277
+++ b/po/POTFILES.in
 
278
@@ -7,6 +7,7 @@ data/playlists.xml.in
 
279
 data/rhythmbox.desktop.in.in
 
280
 data/rhythmbox-device.desktop.in.in
 
281
 [type: gettext/glade]data/ui/app-menu.ui
 
282
+[type: gettext/glade]data/ui/menubar.ui
 
283
 [type: gettext/glade]data/ui/browser-popup.ui
 
284
 [type: gettext/glade]data/ui/create-playlist.ui
 
285
 [type: gettext/glade]data/ui/display-page-add-menu.ui
 
286
diff --git a/shell/rb-application.c b/shell/rb-application.c
 
287
index 11945ad..c57822c 100644
 
288
--- a/shell/rb-application.c
 
289
+++ b/shell/rb-application.c
 
290
@@ -332,6 +332,7 @@ impl_startup (GApplication *app)
 
291
 {
 
292
        RBApplication *rb = RB_APPLICATION (app);
 
293
        gboolean shell_shows_app_menu;
 
294
+       gboolean shell_shows_menubar;
 
295
        GtkBuilder *builder;
 
296
        GMenuModel *menu;
 
297
        GtkCssProvider *provider;
 
298
@@ -361,6 +362,7 @@ impl_startup (GApplication *app)
 
299
 
 
300
        g_object_get (gtk_settings_get_default (),
 
301
                      "gtk-shell-shows-app-menu", &shell_shows_app_menu,
 
302
+                     "gtk-shell-shows-menubar", &shell_shows_menubar,
 
303
                      NULL);
 
304
 
 
305
        builder = rb_builder_load ("app-menu.ui", NULL);
 
306
@@ -371,9 +373,20 @@ impl_startup (GApplication *app)
 
307
        /* only set the app menu if the shell shows it; otherwise, we'll
 
308
         * stick a menu button in the toolbar.
 
309
         */
 
310
-       if (shell_shows_app_menu) {
 
311
+       if (shell_shows_app_menu && !shell_shows_menubar) {
 
312
                gtk_application_set_app_menu (GTK_APPLICATION (app), menu);
 
313
        }
 
314
+       else if (!shell_shows_app_menu || shell_shows_menubar) {
 
315
+               GtkBuilder *menubar_builder;
 
316
+               GMenuModel *menubar;
 
317
+
 
318
+               menubar_builder = rb_builder_load ("menubar.ui", NULL);
 
319
+               menubar = G_MENU_MODEL (gtk_builder_get_object (menubar_builder, "menubar"));
 
320
+               rb_application_link_shared_menus (rb, G_MENU (menubar));
 
321
+               gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
 
322
+
 
323
+               g_object_unref (menubar_builder);
 
324
+       }
 
325
        
 
326
        g_object_unref (builder);
 
327
 
 
328
-- 
 
329
1.9.0
 
330