Merge lp:~3v1n0/nautilus/menubar-visibility-signals into lp:~ubuntu-desktop/nautilus/ubuntu

Proposed by Marco Trevisan (Treviño) on 2016-04-26
Status: Merged
Merged at revision: 511
Proposed branch: lp:~3v1n0/nautilus/menubar-visibility-signals
Merge into: lp:~ubuntu-desktop/nautilus/ubuntu
Diff against target: 300 lines (+97/-56)
2 files modified
debian/changelog (+7/-0)
debian/patches/restore-traditional-menu-bar.patch (+90/-56)
To merge this branch: bzr merge lp:~3v1n0/nautilus/menubar-visibility-signals
Reviewer Review Type Date Requested Status
Ubuntu Desktop 2016-04-26 Pending
Review via email: mp+292925@code.launchpad.net

Commit message

debian/patches/restore-traditional-menu-bar.patch: update menubar visibility on GktSettings changes

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-03-18 19:50:21 +0000
3+++ debian/changelog 2016-04-26 12:20:49 +0000
4@@ -1,3 +1,10 @@
5+nautilus (1:3.18.4.is.3.14.3-0ubuntu5) UNRELEASED; urgency=medium
6+
7+ * debian/patches/restore-traditional-menu-bar.patch:
8+ - update menubar visibility on GktSettings changes
9+
10+ -- Marco Trevisan (Treviño) <marco@ubuntu.com> Tue, 26 Apr 2016 14:08:09 +0200
11+
12 nautilus (1:3.18.4.is.3.14.3-0ubuntu4) xenial; urgency=medium
13
14 * debian/nautilus.migrations,
15
16=== modified file 'debian/patches/restore-traditional-menu-bar.patch'
17--- debian/patches/restore-traditional-menu-bar.patch 2016-02-03 11:49:50 +0000
18+++ debian/patches/restore-traditional-menu-bar.patch 2016-04-26 12:20:49 +0000
19@@ -17,13 +17,18 @@
20 src/nautilus-window.c | 10 +++--
21 9 files changed, 299 insertions(+), 69 deletions(-)
22
23-Index: b/src/nautilus-application-actions.c
24+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-application-actions.c
25 ===================================================================
26---- a/src/nautilus-application-actions.c
27-+++ b/src/nautilus-application-actions.c
28-@@ -258,8 +258,8 @@
29- void
30- nautilus_init_application_actions (NautilusApplication *app)
31+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-application-actions.c
32++++ nautilus-3.18.4.is.3.14.3/src/nautilus-application-actions.c
33+@@ -255,36 +255,64 @@ static GActionEntry app_entries[] = {
34+ { "close-desktop", action_close_desktop, NULL, NULL, NULL },
35+ };
36+
37+-void
38+-nautilus_init_application_actions (NautilusApplication *app)
39++static void
40++update_menubar_visibility (NautilusApplication *app)
41 {
42 - GtkBuilder *builder;
43 - GError *error = NULL;
44@@ -31,18 +36,14 @@
45 + gboolean show_menubar;
46 const gchar *debug_no_app_menu;
47
48- g_action_map_add_action_entries (G_ACTION_MAP (app),
49-@@ -267,18 +267,31 @@
50- app);
51- gtk_application_add_accelerator (GTK_APPLICATION (app), "F10", "win.gear-menu", NULL);
52-
53+- g_action_map_add_action_entries (G_ACTION_MAP (app),
54+- app_entries, G_N_ELEMENTS (app_entries),
55+- app);
56+- gtk_application_add_accelerator (GTK_APPLICATION (app), "F10", "win.gear-menu", NULL);
57+-
58 - builder = gtk_builder_new ();
59 - gtk_builder_add_from_resource (builder, "/org/gnome/nautilus/nautilus-app-menu.ui", &error);
60-+ g_object_get (gtk_settings_get_default (),
61-+ "gtk-shell-shows-app-menu", &show_app_menu,
62-+ "gtk-shell-shows-menubar", &show_menubar,
63-+ NULL);
64-
65+-
66 - if (error == NULL) {
67 - gtk_application_set_app_menu (GTK_APPLICATION (app),
68 - G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
69@@ -50,6 +51,24 @@
70 - g_critical ("Unable to add the application menu: %s\n", error->message);
71 - g_error_free (error);
72 - }
73+-
74+- g_object_unref (builder);
75+-
76+ debug_no_app_menu = g_getenv ("NAUTILUS_DEBUG_NO_APP_MENU");
77+ if (debug_no_app_menu) {
78+ DEBUG ("Disabling app menu GtkSetting as requested...");
79+ g_object_set (gtk_settings_get_default (),
80+ "gtk-shell-shows-app-menu", FALSE,
81+ NULL);
82++
83++ return;
84++ }
85++
86++ g_object_get (gtk_settings_get_default (),
87++ "gtk-shell-shows-app-menu", &show_app_menu,
88++ "gtk-shell-shows-menubar", &show_menubar,
89++ NULL);
90++
91 + /* Only add the app menu when the shell doesn't show the menu
92 + * bar, because we merge the app menu into the menu bar.
93 + */
94@@ -59,8 +78,7 @@
95 +
96 + builder = gtk_builder_new ();
97 + gtk_builder_add_from_resource (builder, "/org/gnome/nautilus/nautilus-app-menu.ui", &error);
98-
99-- g_object_unref (builder);
100++
101 + if (error == NULL) {
102 + gtk_application_set_app_menu (GTK_APPLICATION (app),
103 + G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
104@@ -70,14 +88,30 @@
105 + }
106 +
107 + g_object_unref (builder);
108-+ }
109-
110- debug_no_app_menu = g_getenv ("NAUTILUS_DEBUG_NO_APP_MENU");
111- if (debug_no_app_menu) {
112-Index: b/src/nautilus-canvas-view-ui.xml
113+ }
114+ }
115++
116++void
117++nautilus_init_application_actions (NautilusApplication *app)
118++{
119++ g_action_map_add_action_entries (G_ACTION_MAP (app),
120++ app_entries, G_N_ELEMENTS (app_entries),
121++ app);
122++ gtk_application_add_accelerator (GTK_APPLICATION (app), "F10", "win.gear-menu", NULL);
123++
124++ update_menubar_visibility (app);
125++
126++ g_signal_connect_swapped (gtk_settings_get_default (),
127++ "notify::gtk-shell-shows-app-menu",
128++ G_CALLBACK (update_menubar_visibility), app);
129++ g_signal_connect_swapped (gtk_settings_get_default (),
130++ "notify::gtk-shell-shows-menubar",
131++ G_CALLBACK (update_menubar_visibility), app);
132++}
133+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-canvas-view-ui.xml
134 ===================================================================
135---- a/src/nautilus-canvas-view-ui.xml
136-+++ b/src/nautilus-canvas-view-ui.xml
137+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-canvas-view-ui.xml
138++++ nautilus-3.18.4.is.3.14.3/src/nautilus-canvas-view-ui.xml
139 @@ -1,4 +1,23 @@
140 <ui>
141 + <menubar name="menubar">
142@@ -102,10 +136,10 @@
143 <popup name="ViewMenu" accelerators="true">
144 <placeholder name="Layout Options">
145 <menuitem name="Manual Layout" action="Manual Layout"/>
146-Index: b/src/nautilus-directory-view-ui.xml
147+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-directory-view-ui.xml
148 ===================================================================
149---- a/src/nautilus-directory-view-ui.xml
150-+++ b/src/nautilus-directory-view-ui.xml
151+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-directory-view-ui.xml
152++++ nautilus-3.18.4.is.3.14.3/src/nautilus-directory-view-ui.xml
153 @@ -4,6 +4,85 @@
154 <accelerator action="OpenCloseParent"/>
155 <accelerator action="PropertiesAccel"/>
156@@ -192,10 +226,10 @@
157 <popup name="ViewMenu" accelerators="true">
158 <placeholder name="View Details">
159 <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
160-Index: b/src/nautilus-list-view-ui.xml
161+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-list-view-ui.xml
162 ===================================================================
163---- a/src/nautilus-list-view-ui.xml
164-+++ b/src/nautilus-list-view-ui.xml
165+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-list-view-ui.xml
166++++ nautilus-3.18.4.is.3.14.3/src/nautilus-list-view-ui.xml
167 @@ -1,4 +1,11 @@
168 <ui>
169 + <menubar name="menubar">
170@@ -208,10 +242,10 @@
171 <popup name="ViewMenu" accelerators="true">
172 <placeholder name="View Details">
173 <menuitem name="Visible Columns" action="Visible Columns"/>
174-Index: b/src/nautilus-shell-ui.xml
175+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-shell-ui.xml
176 ===================================================================
177---- a/src/nautilus-shell-ui.xml
178-+++ b/src/nautilus-shell-ui.xml
179+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-shell-ui.xml
180++++ nautilus-3.18.4.is.3.14.3/src/nautilus-shell-ui.xml
181 @@ -74,4 +74,96 @@
182 <separator/>
183 <placeholder name="After Zoom Items"/>
184@@ -309,11 +343,11 @@
185 + </menu>
186 +</menubar>
187 </ui>
188-Index: b/src/nautilus-toolbar.c
189+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-toolbar.c
190 ===================================================================
191---- a/src/nautilus-toolbar.c
192-+++ b/src/nautilus-toolbar.c
193-@@ -377,6 +377,18 @@
194+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-toolbar.c
195++++ nautilus-3.18.4.is.3.14.3/src/nautilus-toolbar.c
196+@@ -377,6 +377,18 @@ gear_menu_key_press (GtkWidget *widget,
197 return FALSE;
198 }
199
200@@ -332,7 +366,7 @@
201 static void
202 nautilus_toolbar_constructed (GObject *obj)
203 {
204-@@ -426,16 +438,18 @@
205+@@ -426,16 +438,18 @@ nautilus_toolbar_constructed (GObject *o
206 self->priv->location_entry = nautilus_location_entry_new ();
207 gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), self->priv->location_entry);
208
209@@ -360,7 +394,7 @@
210
211 /* View buttons */
212 box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
213-@@ -446,11 +460,14 @@
214+@@ -446,11 +460,14 @@ nautilus_toolbar_constructed (GObject *o
215 button = toolbar_create_toolbutton (self, FALSE, TRUE, NAUTILUS_ACTION_VIEW_GRID, NULL);
216 gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
217 gtk_container_add (GTK_CONTAINER (box), button);
218@@ -380,11 +414,11 @@
219
220 gtk_style_context_add_class (gtk_widget_get_style_context (box),
221 GTK_STYLE_CLASS_RAISED);
222-Index: b/src/nautilus-window-menus.c
223+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-window-menus.c
224 ===================================================================
225---- a/src/nautilus-window-menus.c
226-+++ b/src/nautilus-window-menus.c
227-@@ -473,6 +473,11 @@
228+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-window-menus.c
229++++ nautilus-3.18.4.is.3.14.3/src/nautilus-window-menus.c
230+@@ -473,6 +473,11 @@ action_view_radio_changed (GtkRadioActio
231 }
232
233 static const GtkActionEntry main_entries[] = {
234@@ -396,7 +430,7 @@
235 /* name, stock id, label */ { "Help", NULL, N_("_Help") },
236 /* name, stock id */ { NAUTILUS_ACTION_CLOSE, NULL,
237 /* label, accelerator */ N_("_Close"), "<control>W",
238-@@ -628,7 +633,7 @@
239+@@ -628,7 +633,7 @@ static const GtkToggleActionEntry main_t
240 static const GtkRadioActionEntry view_radio_entries[] = {
241 { NAUTILUS_ACTION_VIEW_LIST, "view-list-symbolic", N_("List"),
242 "<control>1", N_("View items as a list"), 0 },
243@@ -405,7 +439,7 @@
244 "<control>2", N_("View items as a grid of icons"), 1 }
245 };
246
247-@@ -662,14 +667,19 @@
248+@@ -662,14 +667,19 @@ nautilus_window_initialize_actions (Naut
249 *
250 * Create and install the set of menus for this window.
251 * @window: A recently-created NautilusWindow.
252@@ -426,7 +460,7 @@
253
254 window->details->ui_manager = gtk_ui_manager_new ();
255 ui_manager = window->details->ui_manager;
256-@@ -728,7 +738,17 @@
257+@@ -728,7 +738,17 @@ nautilus_window_initialize_menus (Nautil
258 G_CALLBACK (connect_proxy_cb), window);
259
260 /* add the UI */
261@@ -444,11 +478,11 @@
262 }
263
264 static GList *
265-Index: b/src/nautilus-window-private.h
266+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-window-private.h
267 ===================================================================
268---- a/src/nautilus-window-private.h
269-+++ b/src/nautilus-window-private.h
270-@@ -108,7 +108,7 @@
271+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-window-private.h
272++++ nautilus-3.18.4.is.3.14.3/src/nautilus-window-private.h
273+@@ -108,7 +108,7 @@ void nautilus_window_sync_up_button
274
275 /* window menus */
276 void nautilus_window_initialize_actions (NautilusWindow *window);
277@@ -457,11 +491,11 @@
278
279 void nautilus_window_update_show_hide_menu_items (NautilusWindow *window);
280
281-Index: b/src/nautilus-window.c
282+Index: nautilus-3.18.4.is.3.14.3/src/nautilus-window.c
283 ===================================================================
284---- a/src/nautilus-window.c
285-+++ b/src/nautilus-window.c
286-@@ -1439,6 +1439,7 @@
287+--- nautilus-3.18.4.is.3.14.3.orig/src/nautilus-window.c
288++++ nautilus-3.18.4.is.3.14.3/src/nautilus-window.c
289+@@ -1439,6 +1439,7 @@ nautilus_window_constructed (GObject *se
290 GtkWidget *grid;
291 NautilusWindowSlot *slot;
292 NautilusApplication *application;
293@@ -469,7 +503,7 @@
294 const gchar * desktop;
295
296 window = NAUTILUS_WINDOW (self);
297-@@ -1460,9 +1461,14 @@
298+@@ -1460,9 +1461,14 @@ nautilus_window_constructed (GObject *se
299 gtk_widget_show (grid);
300 gtk_container_add (GTK_CONTAINER (window), grid);
301

Subscribers

People subscribed via source and target branches

to all changes: