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/keybindings/Makefile.am | 20 +++++++++++++------- capplets/keybindings/mate-keybinding-properties.c | 3 +-- .../org.mate.mcc.keybindings.gresource.xml | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 capplets/keybindings/org.mate.mcc.keybindings.gresource.xml (limited to 'capplets/keybindings') diff --git a/capplets/keybindings/Makefile.am b/capplets/keybindings/Makefile.am index 9501dd8f..24c95a56 100644 --- a/capplets/keybindings/Makefile.am +++ b/capplets/keybindings/Makefile.am @@ -4,6 +4,9 @@ cappletname = keybinding bin_PROGRAMS = mate-keybinding-properties mate_keybinding_properties_LDADD = $(MATECC_CAPPLETS_LIBS) +BUILT_SOURCES = mate-keybinding-properties-resources.h mate-keybinding-properties-resources.c +nodist_mate_keybinding_properties_SOURCES = \ + $(BUILT_SOURCES) mate_keybinding_properties_SOURCES = \ mate-keybinding-properties.c \ eggcellrendererkeys.c \ @@ -13,9 +16,6 @@ mate_keybinding_properties_SOURCES = \ @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui -ui_DATA = mate-keybinding-properties.ui - desktopdir = $(datadir)/applications Desktop_in_files = mate-keybinding.desktop.in desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) @@ -29,16 +29,22 @@ xml_DATA = $(xml_in_files:.xml.in=.xml) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mate-keybindings.pc +mate-keybinding-properties-resources.h mate-keybinding-properties-resources.c: org.mate.mcc.keybindings.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.keybindings.gresource.xml) + $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name keybindings $< + AM_CPPFLAGS = \ $(MATECC_CAPPLETS_CFLAGS) \ -DMATELOCALEDIR="\"$(datadir)/locale\"" \ - -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DMATECC_UI_DIR="\"$(uidir)\"" + -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" CLEANFILES = \ + $(BUILT_SOURCES) \ $(MATECC_CAPPLETS_CLEANFILES) \ $(desktop_DATA) \ $(xml_DATA) -EXTRA_DIST = $(ui_DATA) $(xml_in_files) mate-keybindings.pc.in $(Desktop_in_files) - +EXTRA_DIST = $(xml_in_files) \ + mate-keybindings.pc.in \ + mate-keybinding-properties.ui \ + $(Desktop_in_files) \ + org.mate.mcc.keybindings.gresource.xml -include $(top_srcdir)/git.mk diff --git a/capplets/keybindings/mate-keybinding-properties.c b/capplets/keybindings/mate-keybinding-properties.c index cf1891d2..3a8eefc2 100644 --- a/capplets/keybindings/mate-keybinding-properties.c +++ b/capplets/keybindings/mate-keybinding-properties.c @@ -104,9 +104,8 @@ create_builder (void) { GtkBuilder *builder = gtk_builder_new(); GError *error = NULL; - static const gchar *uifile = MATECC_UI_DIR "/mate-keybinding-properties.ui"; - if (gtk_builder_add_from_file (builder, uifile, &error) == 0) { + if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/keybindings/mate-keybinding-properties.ui", &error) == 0) { g_warning ("Could not load UI: %s", error->message); g_error_free (error); g_object_unref (builder); diff --git a/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml b/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml new file mode 100644 index 00000000..ac479418 --- /dev/null +++ b/capplets/keybindings/org.mate.mcc.keybindings.gresource.xml @@ -0,0 +1,22 @@ + + + + + mate-keybinding-properties.ui + + -- cgit v1.2.1