Commit ffbfee07 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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
parent 8ad9cf8b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment