[gtk+] GtkApplication: load gtk/menus-common.ui resource
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkApplication: load gtk/menus-common.ui resource
- Date: Wed, 30 Jul 2014 07:57:49 +0000 (UTC)
commit ffbfee073866608db665f24aeabcb1c3365240b7
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Jul 29 17:29:09 2014 +0200
GtkApplication: load gtk/menus-common.ui resource
Allow the app to install a resource called gtk/menus-common.ui which
will always be loaded, regardless of which type of menus we are using.
https://bugzilla.gnome.org/show_bug.cgi?id=733925
gtk/gtkapplication.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index d2a8dad..6df6d21 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -559,6 +559,20 @@ gtk_application_load_resources (GtkApplication *application)
g_free (menuspath);
}
+ /* Always load from -common as well, if we have it */
+ menuspath = g_strconcat (base_path, "/gtk/menus-common.ui", NULL);
+ if (g_resources_get_info (menuspath, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
+ {
+ GError *error = NULL;
+
+ if (application->priv->menus_builder == NULL)
+ application->priv->menus_builder = gtk_builder_new ();
+
+ if (!gtk_builder_add_from_resource (application->priv->menus_builder, menuspath, &error))
+ g_error ("failed to load menus-common.ui: %s", error->message);
+ }
+ g_free (menuspath);
+
if (application->priv->menus_builder)
{
GObject *menu;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]