Commit 214b514f authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Bastien Nocera
Browse files

info: use a GResource for GtkBuilder UI definition

https://bugzilla.gnome.org/show_bug.cgi?id=691132
parent b7571896
......@@ -3,11 +3,8 @@ cappletname = info
INCLUDES = \
$(PANEL_CFLAGS) \
$(INFO_PANEL_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DDATADIR="\"$(datadir)\"" \
-DLIBEXECDIR="\"$(libexecdir)\"" \
$(NULL)
noinst_PROGRAMS = test-hostname
......@@ -22,7 +19,12 @@ check-local: test-hostname
noinst_LTLIBRARIES = libinfo.la
BUILT_SOURCES = \
cc-info-resources.c \
cc-info-resources.h
libinfo_la_SOURCES = \
$(BUILT_SOURCES) \
cc-info-panel.c \
cc-info-panel.h \
hostname-helper.c \
......@@ -32,8 +34,11 @@ libinfo_la_SOURCES = \
libinfo_la_LIBADD = $(PANEL_LIBS) $(INFO_PANEL_LIBS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = info.ui GnomeLogoVerticalMedium.svg
resource_files = $(shell glib-compile-resources --generate-dependencies $(srcdir)/info.gresource.xml)
cc-info-resources.c: info.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_info $<
cc-info-resources.h: info.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_info $<
@INTLTOOL_DESKTOP_RULE@
......@@ -47,7 +52,7 @@ update-from-gsd:
FILES="$(SPACEFILES)" DIR="$(SPACEDIR)" $(top_srcdir)/update-from-gsd.sh && changed=true ; \
git commit -m "info: Update from gnome-settings-daemon" $(SPACEFILES)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
EXTRA_DIST = hostnames-test.txt
CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(BUILT_SOURCES)
EXTRA_DIST = hostnames-test.txt $(resource_files) info.gresource.xml
-include $(top_srcdir)/git.mk
......@@ -22,6 +22,7 @@
#include <config.h>
#include "cc-info-panel.h"
#include "cc-info-resources.h"
#include <polkit/polkit.h>
......@@ -2047,6 +2048,7 @@ cc_info_panel_init (CcInfoPanel *self)
GtkWidget *widget;
self->priv = INFO_PANEL_PRIVATE (self);
g_resources_register (cc_info_get_resource ());
self->priv->builder = gtk_builder_new ();
......@@ -2056,9 +2058,9 @@ cc_info_panel_init (CcInfoPanel *self)
g_assert (self->priv->session_bus);
if (gtk_builder_add_from_file (self->priv->builder,
GNOMECC_UI_DIR "/info.ui",
&error) == 0)
if (gtk_builder_add_from_resource (self->priv->builder,
"/org/gnome/control-center/info/info.ui",
&error) == 0)
{
g_warning ("Could not load interface file: %s", error->message);
g_error_free (error);
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/info">
<file preprocess="xml-stripblanks">info.ui</file>
<file>GnomeLogoVerticalMedium.svg</file>
</gresource>
</gresources>
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