summaryrefslogtreecommitdiff
path: root/capplets/mouse
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/mouse
parent962f1b0464dfcac6223b6ae2b8e8228863800ea2 (diff)
downloadmate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.bz2
mate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.xz
capplets: Use gresources for UI files
Diffstat (limited to 'capplets/mouse')
-rw-r--r--capplets/mouse/Makefile.am16
-rw-r--r--capplets/mouse/mate-mouse-properties.c5
-rw-r--r--capplets/mouse/org.mate.mcc.mouse.gresource.xml22
3 files changed, 34 insertions, 9 deletions
diff --git a/capplets/mouse/Makefile.am b/capplets/mouse/Makefile.am
index 1cfc2f1f..158806a4 100644
--- a/capplets/mouse/Makefile.am
+++ b/capplets/mouse/Makefile.am
@@ -4,6 +4,9 @@ cappletname = mouse
bin_PROGRAMS = mate-mouse-properties
mate_mouse_properties_LDADD = $(MATECC_CAPPLETS_LIBS)
+BUILT_SOURCES = mate-mouse-properties-resources.h mate-mouse-properties-resources.c
+nodist_mate_mouse_properties_SOURCES = \
+ $(BUILT_SOURCES)
mate_mouse_properties_SOURCES = \
mate-mouse-properties.c \
msd-input-helper.c \
@@ -17,19 +20,18 @@ pixmap_DATA = \
double-click-off.svg \
double-click-maybe.svg
-uidir = $(pkgdatadir)/ui
-ui_DATA = mate-mouse-properties.ui
-
desktopdir = $(datadir)/applications
Desktop_in_files = mate-settings-mouse.desktop.in
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
+mate-mouse-properties-resources.h mate-mouse-properties-resources.c: org.mate.mcc.mouse.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.mouse.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name mouse $<
+
AM_CPPFLAGS = \
$(MATECC_CAPPLETS_CFLAGS) \
-DMATELOCALEDIR="\"$(datadir)/locale\"" \
- -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \
- -DMATECC_UI_DIR="\"$(uidir)\""
-CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA)
-EXTRA_DIST = $(ui_DATA) $(pixmap_DATA) $(Desktop_in_files)
+ -DMATECC_DATA_DIR="\"$(pkgdatadir)\""
+CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES)
+EXTRA_DIST = mate-mouse-properties.ui $(pixmap_DATA) $(Desktop_in_files) org.mate.mcc.mouse.gresource.xml
-include $(top_srcdir)/git.mk
diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c
index d5fef831..fe8bad31 100644
--- a/capplets/mouse/mate-mouse-properties.c
+++ b/capplets/mouse/mate-mouse-properties.c
@@ -373,9 +373,10 @@ create_dialog (void)
GError *error = NULL;
dialog = gtk_builder_new ();
- gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-mouse-properties.ui", &error);
- if (error != NULL) {
+ if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/mouse/mate-mouse-properties.ui", &error) == 0) {
g_warning ("Error loading UI file: %s", error->message);
+ g_error_free (error);
+ g_object_unref (dialog);
return NULL;
}
diff --git a/capplets/mouse/org.mate.mcc.mouse.gresource.xml b/capplets/mouse/org.mate.mcc.mouse.gresource.xml
new file mode 100644
index 00000000..5024edbe
--- /dev/null
+++ b/capplets/mouse/org.mate.mcc.mouse.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/mouse">
+ <file compressed="true">mate-mouse-properties.ui</file>
+ </gresource>
+</gresources>