[eog] EogApplication: Have the app menu automatically loaded by GtkApplication
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] EogApplication: Have the app menu automatically loaded by GtkApplication
- Date: Sat, 2 Jan 2016 18:52:47 +0000 (UTC)
commit 931e0f818c6d0cd918f47df777a23d62d2fd2420
Author: Felix Riemann <friemann gnome org>
Date: Sat Jan 2 19:05:48 2016 +0100
EogApplication: Have the app menu automatically loaded by GtkApplication
src/eog-application.c | 18 ------------------
src/eog.gresource.xml | 2 +-
2 files changed, 1 insertions(+), 19 deletions(-)
---
diff --git a/src/eog-application.c b/src/eog-application.c
index 2f8aa92..22edacf 100644
--- a/src/eog-application.c
+++ b/src/eog-application.c
@@ -160,28 +160,12 @@ static void
eog_application_init_app_menu (EogApplication *application)
{
EogApplicationPrivate *priv = application->priv;
- GtkBuilder *builder;
- GError *error = NULL;
GAction *action;
g_action_map_add_action_entries (G_ACTION_MAP (application),
app_entries, G_N_ELEMENTS (app_entries),
application);
- builder = gtk_builder_new ();
- gtk_builder_add_from_resource (builder,
- "/org/gnome/eog/ui/eog-app-menu.xml",
- &error);
-
- if (error == NULL) {
- gtk_application_set_app_menu (GTK_APPLICATION (application),
- 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);
- }
-
action = g_action_map_lookup_action (G_ACTION_MAP (application),
"view-gallery");
g_settings_bind_with_mapping (priv->ui_settings,
@@ -207,8 +191,6 @@ eog_application_init_app_menu (EogApplication *application)
_settings_map_get_bool_variant,
_settings_map_set_variant,
NULL, NULL);
-
- g_object_unref (builder);
}
static void
diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml
index 94c8b31..a819445 100644
--- a/src/eog.gresource.xml
+++ b/src/eog.gresource.xml
@@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/org/gnome/eog/ui">
<file>eog.css</file>
- <file compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file>
<file compressed="true" preprocess="xml-stripblanks">eog-gear-menu.ui</file>
<file compressed="true" preprocess="xml-stripblanks">eog-image-properties-dialog.ui</file>
<file compressed="true" preprocess="xml-stripblanks">eog-multiple-save-as-dialog.ui</file>
@@ -13,6 +12,7 @@
<file compressed="true" preprocess="xml-stripblanks">popup-menus.ui</file>
</gresource>
<gresource prefix="/org/gnome/eog/gtk">
+ <file alias="menus.ui" compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file>
<file compressed="true" preprocess="xml-stripblanks">help-overlay.ui</file>
</gresource>
</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]