summaryrefslogtreecommitdiff
path: root/capplets/default-applications
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/default-applications
parent962f1b0464dfcac6223b6ae2b8e8228863800ea2 (diff)
downloadmate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.bz2
mate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.xz
capplets: Use gresources for UI files
Diffstat (limited to 'capplets/default-applications')
-rw-r--r--capplets/default-applications/Makefile.am23
-rw-r--r--capplets/default-applications/mate-da-capplet.c9
-rw-r--r--capplets/default-applications/org.mate.mcc.da.gresource.xml22
3 files changed, 39 insertions, 15 deletions
diff --git a/capplets/default-applications/Makefile.am b/capplets/default-applications/Makefile.am
index 756018fe..5a5e2e41 100644
--- a/capplets/default-applications/Makefile.am
+++ b/capplets/default-applications/Makefile.am
@@ -3,15 +3,18 @@ cappletname = mate-default-applications-properties
bin_PROGRAMS = mate-default-applications-properties
+BUILT_SOURCES = \
+ mate-default-applications-properties-resources.h \
+ mate-default-applications-properties-resources.c
+
mate_default_applications_properties_LDADD = $(MATECC_CAPPLETS_LIBS)
+nodist_mate_default_applications_properties_SOURCES = \
+ $(BUILT_SOURCES)
mate_default_applications_properties_SOURCES = \
mate-da-capplet.c mate-da-capplet.h
@INTLTOOL_DESKTOP_RULE@
-uidir = $(pkgdatadir)/ui
-dist_ui_DATA = mate-default-applications-properties.ui
-
desktopdir = $(datadir)/applications
Desktop_in_files = mate-default-applications-properties.desktop.in
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
@@ -23,10 +26,16 @@ AM_CPPFLAGS = \
$(MATECC_CAPPLETS_CFLAGS) \
$(DEFAULT_APPLICATIONS_CAPPLET_CFLAGS) \
-DAPPLICATIONSDIR=\""$(datadir)/applications"\"\
- -DMATELOCALEDIR=\""$(datadir)/locale"\"\
- -DMATECC_UI_DIR=\""$(uidir)"\"
+ -DMATELOCALEDIR=\""$(datadir)/locale"\"
+
+mate-default-applications-properties-resources.h mate-default-applications-properties-resources.c: org.mate.mcc.da.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.da.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name default_applications $<
-CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(autostart_DATA)
-EXTRA_DIST = mate-default-applications.pc.in $(Desktop_in_files)
+CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(autostart_DATA) $(BUILT_SOURCES)
+EXTRA_DIST = \
+ mate-default-applications.pc.in \
+ mate-default-applications-properties.ui \
+ $(Desktop_in_files) \
+ org.mate.mcc.da.gresource.xml
-include $(top_srcdir)/git.mk
diff --git a/capplets/default-applications/mate-da-capplet.c b/capplets/default-applications/mate-da-capplet.c
index 1ecde4c0..de7c36bd 100644
--- a/capplets/default-applications/mate-da-capplet.c
+++ b/capplets/default-applications/mate-da-capplet.c
@@ -563,14 +563,7 @@ show_dialog(MateDACapplet* capplet, const gchar* start_page)
capplet->builder = builder = gtk_builder_new ();
- if (g_file_test(MATECC_UI_DIR "/mate-default-applications-properties.ui", G_FILE_TEST_EXISTS) != FALSE)
- {
- builder_result = gtk_builder_add_from_file(builder, MATECC_UI_DIR "/mate-default-applications-properties.ui", NULL);
- }
- else
- {
- builder_result = gtk_builder_add_from_file(builder, "./mate-default-applications-properties.ui", NULL);
- }
+ builder_result = gtk_builder_add_from_resource (builder, "/org/mate/mcc/da/mate-default-applications-properties.ui", NULL);
if (builder_result == 0)
{
diff --git a/capplets/default-applications/org.mate.mcc.da.gresource.xml b/capplets/default-applications/org.mate.mcc.da.gresource.xml
new file mode 100644
index 00000000..6527fe68
--- /dev/null
+++ b/capplets/default-applications/org.mate.mcc.da.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/da">
+ <file compressed="true">mate-default-applications-properties.ui</file>
+ </gresource>
+</gresources>