summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-08-17 00:08:16 +0200
committerVictor Kareh <[email protected]>2019-08-22 13:48:25 -0400
commit2ce29e42f9ad5b5b618fb726e264b850f59cbebc (patch)
treeb698708fd487af3086d14a52a93b8d2e927ab987
parentd46b6e8d7a6e8df18d2c8605979e86b10f7920d5 (diff)
downloadmate-screensaver-2ce29e42f9ad5b5b618fb726e264b850f59cbebc.tar.bz2
mate-screensaver-2ce29e42f9ad5b5b618fb726e264b850f59cbebc.tar.xz
Use gresources for mate-screensaver-preferences.ui
-rw-r--r--configure.ac15
-rw-r--r--data/Makefile.am5
-rw-r--r--data/org.mate.screensaver.gresource.xml22
-rw-r--r--src/Makefile.am9
-rw-r--r--src/mate-screensaver-preferences.c9
5 files changed, 51 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 05984ec..ee88500 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,6 +99,21 @@ SAVER_LIBS="$ALL_X_LIBS"
AC_PATH_PROG(GLIB_GENMARSHAL, 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
MATE_COMPILE_WARNINGS(yes)
diff --git a/data/Makefile.am b/data/Makefile.am
index 9d7316d..46dff6a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -30,7 +30,6 @@ menu_DATA = \
gtkbuilderdir = $(pkgdatadir)
gtkbuilder_DATA = \
- mate-screensaver-preferences.ui \
lock-dialog-default.ui \
$(NULL)
@@ -54,7 +53,9 @@ EXTRA_DIST = \
$(man_MANS) \
mate-screensaver \
mate-screensaver.pc.in \
- org.mate.ScreenSaver.service.in\
+ mate-screensaver-preferences.ui \
+ org.mate.screensaver.gresource.xml \
+ org.mate.ScreenSaver.service.in \
xscreensaver-config.xsl \
migrate-xscreensaver-config.sh \
$(NULL)
diff --git a/data/org.mate.screensaver.gresource.xml b/data/org.mate.screensaver.gresource.xml
new file mode 100644
index 0000000..2de00d9
--- /dev/null
+++ b/data/org.mate.screensaver.gresource.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Screensaver.
+
+ MATE Screensaver 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 Screensaver 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 Screensaver. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/screensaver">
+ <file compressed="true" alias="preferences.ui">mate-screensaver-preferences.ui</file>
+ </gresource>
+</gresources>
diff --git a/src/Makefile.am b/src/Makefile.am
index 37cbbca..3de1112 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -222,6 +222,13 @@ mate_screensaver_LDADD = \
mate_screensaver_LDFLAGS = -export-dynamic
+mate-screensaver-preferences-resources.h mate-screensaver-preferences-resources.c: $(srcdir)/../data/org.mate.screensaver.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/../data $(srcdir)/../data/org.mate.screensaver.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir)/../data --generate --c-name screensaver $<
+
+nodist_mate_screensaver_preferences_SOURCES = \
+ mate-screensaver-preferences-resources.h \
+ mate-screensaver-preferences-resources.c \
+ $(NULL)
mate_screensaver_preferences_SOURCES = \
mate-screensaver-preferences.c \
copy-theme-dialog.c \
@@ -249,6 +256,8 @@ EXTRA_DIST = \
CLEANFILES = \
$(desktop_DATA) \
mate-screensaver.desktop.in \
+ mate-screensaver-preferences-resources.h \
+ mate-screensaver-preferences-resources.c \
$(BUILT_SOURCES)
MAINTAINERCLEANFILES = \
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index b9eb702..db96788 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -47,8 +47,6 @@
#include "gs-job.h"
#include "gs-prefs.h" /* for GS_MODE enum */
-#define GTK_BUILDER_FILE "mate-screensaver-preferences.ui"
-
#define LOCKDOWN_SETTINGS_SCHEMA "org.mate.lockdown"
#define KEY_LOCK_DISABLE "disable-lock-screen"
@@ -1534,21 +1532,18 @@ init_capplet (void)
GtkWidget *fullscreen_preview_previous;
GtkWidget *fullscreen_preview_next;
GtkWidget *fullscreen_preview_close;
- char *gtk_builder_file;
gdouble activate_delay;
gboolean enabled;
gboolean is_writable;
GError *error=NULL;
gint mode;
- gtk_builder_file = g_build_filename (GTKBUILDERDIR, GTK_BUILDER_FILE, NULL);
builder = gtk_builder_new();
- if (!gtk_builder_add_from_file(builder, gtk_builder_file, &error))
+ if (!gtk_builder_add_from_resource (builder, "/org/mate/screensaver/preferences.ui", &error))
{
- g_warning("Couldn't load builder file: %s", error->message);
+ g_warning("Couldn't load builder resource: %s", error->message);
g_error_free(error);
}
- g_free (gtk_builder_file);
if (builder == NULL)
{