[nautilus] application: let GtkApplication load the appmenu
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] application: let GtkApplication load the appmenu
- Date: Mon, 23 Nov 2015 10:55:26 +0000 (UTC)
commit 7621a5220b5e8fa6a0013af0bedfa3fd7ec05cd6
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Nov 23 11:30:38 2015 +0100
application: let GtkApplication load the appmenu
Since bgo#757826 introduced g_application_set_resource_base_path,
we don't need to use a GtkBuilder to load the appmenu.
GtkApplication automatically loads menus from the GtkBuilder resource
located at "gtk/menus.ui", relative to the application's resource
base path (see g_application_set_resource_base_path ()). The menu
with the ID "app-menu" is taken as the application's app menu.
https://bugzilla.gnome.org/show_bug.cgi?id=757946
src/nautilus-application-actions.c | 13 -------------
.../{ui/nautilus-app-menu.ui => gtk/menus.ui} | 0
src/resources/nautilus.gresource.xml | 2 +-
3 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c
index b5c5134..12fb6ec 100644
--- a/src/nautilus-application-actions.c
+++ b/src/nautilus-application-actions.c
@@ -219,19 +219,6 @@ nautilus_init_application_actions (NautilusApplication *app)
app_entries, G_N_ELEMENTS (app_entries),
app);
- builder = gtk_builder_new ();
- gtk_builder_add_from_resource (builder, "/org/gnome/nautilus/ui/nautilus-app-menu.ui", &error);
-
- if (error == NULL) {
- gtk_application_set_app_menu (GTK_APPLICATION (app),
- G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
- } else {
- g_critical ("Unable to add the application menu: %s\n", error->message);
- g_error_free (error);
- }
-
- g_object_unref (builder);
-
debug_no_app_menu = g_getenv ("NAUTILUS_DEBUG_NO_APP_MENU");
if (debug_no_app_menu) {
DEBUG ("Disabling app menu GtkSetting as requested...");
diff --git a/src/resources/ui/nautilus-app-menu.ui b/src/resources/gtk/menus.ui
similarity index 100%
rename from src/resources/ui/nautilus-app-menu.ui
rename to src/resources/gtk/menus.ui
diff --git a/src/resources/nautilus.gresource.xml b/src/resources/nautilus.gresource.xml
index 92193f7..d6bfd8b 100644
--- a/src/resources/nautilus.gresource.xml
+++ b/src/resources/nautilus.gresource.xml
@@ -3,7 +3,7 @@
<gresource prefix="/org/gnome/nautilus">
<file compressed="true">ui/nautilus-bookmarks-window.ui</file>
<file compressed="true">ui/nautilus-file-management-properties.ui</file>
- <file>ui/nautilus-app-menu.ui</file>
+ <file>gtk/menus.ui</file>
<file>ui/nautilus-pathbar-context-menu.ui</file>
<file>ui/nautilus-toolbar.ui</file>
<file>ui/nautilus-toolbar-view-menu.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]