summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-01-26 13:02:18 +0100
committerraveit65 <[email protected]>2020-02-10 00:37:02 +0100
commite713760554c0b130b6d3b7e46e2a91746b894224 (patch)
treebdb68464c495388666c507bbd5bd27403d596427
parenta956971b492c65c452dbab46bb81cafb9e0e85d0 (diff)
downloadcaja-extensions-e713760554c0b130b6d3b7e46e2a91746b894224.tar.bz2
caja-extensions-e713760554c0b130b6d3b7e46e2a91746b894224.tar.xz
sendto: use gresources for UI files
-rw-r--r--.travis.yml2
-rw-r--r--configure.ac16
-rw-r--r--sendto/Makefile.am24
-rw-r--r--sendto/caja-sendto-command.c4
-rw-r--r--sendto/org.mate.caja.extensions.sendto.gresource.xml22
5 files changed, 57 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index 1f16c22..094e597 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -94,6 +94,7 @@ requires:
- libgupnp-1.2-dev
- libmate-desktop-dev
- libstartup-notification0-dev
+ - libxml2-utils
- make
- mate-common
- pkg-config
@@ -129,6 +130,7 @@ requires:
- libgupnp-1.2-dev
- libmate-desktop-dev
- libstartup-notification0-dev
+ - libxml2-utils
- make
- mate-common
- pkg-config
diff --git a/configure.ac b/configure.ac
index 1035c98..be4b68d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,6 +34,22 @@ fi
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
+# GLIB_COMPILE_RESOURCES
+
+AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[glib-compile-resources bin])
+AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
+if test -z "$GLIB_COMPILE_RESOURCES"; then
+ AC_MSG_ERROR([glib-compile-resources not found])
+fi
+
+# XMLLINT
+
+AC_ARG_VAR([XMLLINT],[xmllint bin])
+AC_PATH_PROG([XMLLINT],[xmllint],[])
+if test -z "$XMLLINT"; then
+ AC_MSG_ERROR([xmllint not found])
+fi
+
# Common requirements
PKG_CHECK_MODULES(CAJA,
libcaja-extension >= $CAJA_REQUIRED)
diff --git a/sendto/Makefile.am b/sendto/Makefile.am
index 83adfc7..df02252 100644
--- a/sendto/Makefile.am
+++ b/sendto/Makefile.am
@@ -1,3 +1,5 @@
+NULL=
+
SUBDIRS = . docs plugins
AM_CPPFLAGS = \
@@ -5,7 +7,6 @@ AM_CPPFLAGS = \
-DPLUGINDIR=\"$(libdir)/caja-sendto/plugins\" \
-I$(top_srcdir) \
-I$(top_builddir) \
- -DUIDIR=\""$(uidir)"\" \
-DLOCALEDIR="\"$(datadir)/locale\"" \
$(SENDTO_CFLAGS) \
$(CAJA_CFLAGS) \
@@ -18,9 +19,6 @@ caja_sendto_include_HEADERS = caja-sendto-plugin.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = caja-sendto.pc
-ui_DATA = caja-sendto.ui
-uidir = $(datadir)/caja-extensions
-
noinst_LTLIBRARIES = libnstplugin.la
libnstplugin_la_SOURCES = \
caja-sendto-plugin.h \
@@ -30,7 +28,11 @@ libnstplugin_la_LIBADD = $(SENDTO_LIBS)
bin_PROGRAMS = caja-sendto
-caja_sendto_SOURCES = caja-sendto-command.c
+resources_built_sources = caja-sendto-resources.h caja-sendto-resources.c
+$(resources_built_sources): org.mate.caja.extensions.sendto.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.caja.extensions.sendto.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name sendto $<
+
+caja_sendto_SOURCES = caja-sendto-command.c $(resources_built_sources)
caja_sendto_LDADD = $(SENDTO_LIBS) libnstplugin.la
caja_extensiondir = $(CAJA_EXTENSION_DIR)
@@ -81,14 +83,18 @@ $(extension_DATA): $(extension_in_files)
$(AM_V_GEN) $(MSGFMT) --desktop --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@
EXTRA_DIST = \
- $(ui_DATA) \
$(man_MANS) \
caja-sendto.pc.in \
- $(gsettingsschema_in_files)
+ caja-sendto.ui \
+ $(gsettingsschema_in_files) \
+ org.mate.caja.extensions.sendto.gresource.xml \
+ $(NULL)
CLEANFILES = \
$(nst_built_headers) \
$(nst_built_cfiles) \
$(gsettings_SCHEMAS) \
- $(extension_DATA) \
- *.gschema.valid
+ $(extension_DATA) \
+ *.gschema.valid \
+ $(resources_built_sources) \
+ $(NULL)
diff --git a/sendto/caja-sendto-command.c b/sendto/caja-sendto-command.c
index 0d002cb..1b0d7da 100644
--- a/sendto/caja-sendto-command.c
+++ b/sendto/caja-sendto-command.c
@@ -531,8 +531,8 @@ caja_sendto_create_ui (void)
GtkWidget *button_image;
app = gtk_builder_new ();
- if (!gtk_builder_add_from_file (app, UIDIR "/" "caja-sendto.ui", &error)) {
- g_warning ("Couldn't load builder file: %s", error->message);
+ if (gtk_builder_add_from_resource (app, "/org/mate/caja/extensions/sendto/caja-sendto.ui", &error) == 0) {
+ g_warning ("Could not parse UI definition: %s", error->message);
g_error_free (error);
}
diff --git a/sendto/org.mate.caja.extensions.sendto.gresource.xml b/sendto/org.mate.caja.extensions.sendto.gresource.xml
new file mode 100644
index 0000000..65c2b67
--- /dev/null
+++ b/sendto/org.mate.caja.extensions.sendto.gresource.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of Caja Extensions.
+
+ Caja Extensions 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.
+
+ Caja Extensions 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 Caja Extensions. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/caja/extensions/sendto">
+ <file compressed="true">caja-sendto.ui</file>
+ </gresource>
+</gresources>