From eafb5fddf84324ebf6b0cc90422f10ee314b5b28 Mon Sep 17 00:00:00 2001 From: rbuj Date: Tue, 7 May 2019 00:05:26 +0200 Subject: capplets: Use gresources for UI files --- capplets/accessibility/at-properties/Makefile.am | 22 ++++++++++++++++------ capplets/accessibility/at-properties/main.c | 3 +-- .../org.mate.mcc.accessibility.at.gresource.xml | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml (limited to 'capplets/accessibility') diff --git a/capplets/accessibility/at-properties/Makefile.am b/capplets/accessibility/at-properties/Makefile.am index 2af0ca50..a49e54b0 100644 --- a/capplets/accessibility/at-properties/Makefile.am +++ b/capplets/accessibility/at-properties/Makefile.am @@ -1,5 +1,11 @@ bin_PROGRAMS = mate-at-properties +ui_files = at-enable-dialog.ui + +BUILT_SOURCES = \ + mate-at-properties-resources.c \ + mate-at-properties-resources.h +nodist_mate_at_properties_SOURCES= $(BUILT_SOURCES) mate_at_properties_LDADD = $(AT_CAPPLET_LIBS) $(MATECC_CAPPLETS_LIBS) $(top_builddir)/capplets/common/libcommon.la mate_at_properties_SOURCES = \ main.c @@ -16,16 +22,20 @@ pixmap_DATA = \ at-startup.png \ at-support.png -uidir = $(pkgdatadir)/ui -ui_DATA = at-enable-dialog.ui - AM_CPPFLAGS = $(AT_CAPPLET_CFLAGS) \ $(MATECC_CAPPLETS_CFLAGS) \ - -DUIDIR=\""$(uidir)"\" \ -DPIXMAPDIR=\""$(pixmapdir)"\" \ -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ -DMATELOCALEDIR="\"$(datadir)/locale\"" -CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) -EXTRA_DIST = $(ui_DATA) $(pixmap_DATA) $(Desktop_in_files) +CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES) +EXTRA_DIST = \ + $(ui_files) \ + $(pixmap_DATA) \ + $(Desktop_in_files) \ + org.mate.mcc.accessibility.at.gresource.xml + +# Generate resources +mate-at-properties-resources.h mate-at-properties-resources.c: org.mate.mcc.accessibility.at.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.accessibility.at.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name accessibility $< -include $(top_srcdir)/git.mk diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c index f046517e..1640eac8 100644 --- a/capplets/accessibility/at-properties/main.c +++ b/capplets/accessibility/at-properties/main.c @@ -28,11 +28,10 @@ create_builder (void) { GtkBuilder *builder; GError *error = NULL; - static const gchar *uifile = UIDIR "/at-enable-dialog.ui"; builder = gtk_builder_new (); - if (gtk_builder_add_from_file (builder, uifile, &error)) { + if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/accessibility/at/at-enable-dialog.ui", &error)) { GObject *object; gchar *prog; diff --git a/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml b/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml new file mode 100644 index 00000000..16c80370 --- /dev/null +++ b/capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml @@ -0,0 +1,22 @@ + + + + + at-enable-dialog.ui + + -- cgit v1.2.1