summaryrefslogtreecommitdiff
path: root/capplets/accessibility
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-05-07 00:05:26 +0200
committerlukefromdc <[email protected]>2019-05-11 00:59:53 +0000
commiteafb5fddf84324ebf6b0cc90422f10ee314b5b28 (patch)
treeb7569aab227398638c9504056c1892bc8ea605cd /capplets/accessibility
parent962f1b0464dfcac6223b6ae2b8e8228863800ea2 (diff)
downloadmate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.bz2
mate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.xz
capplets: Use gresources for UI files
Diffstat (limited to 'capplets/accessibility')
-rw-r--r--capplets/accessibility/at-properties/Makefile.am22
-rw-r--r--capplets/accessibility/at-properties/main.c3
-rw-r--r--capplets/accessibility/at-properties/org.mate.mcc.accessibility.at.gresource.xml22
3 files changed, 39 insertions, 8 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Control Center.
+
+ MATE Control Center is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ MATE Control Center is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with MATE Control Center. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/mcc/accessibility/at">
+ <file compressed="true">at-enable-dialog.ui</file>
+ </gresource>
+</gresources>