[gnome-tetravex] Store the .ui file as a gresource
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tetravex] Store the .ui file as a gresource
- Date: Tue, 8 Oct 2013 19:35:33 +0000 (UTC)
commit cb7f8a2306fc271f9f536dea99fe464e2cdf3d5f
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Tue Oct 8 23:13:43 2013 +0200
Store the .ui file as a gresource
configure.ac | 7 +++++++
data/Makefile.am | 4 ----
src/Makefile.am | 15 ++++++++++++++-
src/gnome-tetravex.gresource.xml | 2 +-
{data => src}/gnome-tetravex.ui | 0
src/gnome-tetravex.vala | 2 +-
6 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6f16694..8873dcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,13 @@ AC_PATH_PROG(APPDATA_VALIDATE, appdata-validate)
AC_PATH_PROG(DESKTOP_FILE_VALIDATE, desktop-file-validate)
dnl ###########################################################################
+dnl GResources
+dnl ###########################################################################
+
+GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
+AC_SUBST(GLIB_COMPILE_RESOURCES)
+
+dnl ###########################################################################
dnl Internationalization
dnl ###########################################################################
diff --git a/data/Makefile.am b/data/Makefile.am
index 3fe56a3..3445ef9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,8 +1,5 @@
SUBDIRS = icons
-uidir = $(datadir)/gnome-tetravex
-ui_DATA = gnome-tetravex.ui
-
desktop_in_files = gnome-tetravex.desktop.in
desktopdir = $(datadir)/applications
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@@ -21,7 +18,6 @@ man_MANS = gnome-tetravex.6
EXTRA_DIST = \
$(appdata_in_files) \
$(desktop_in_files) \
- $(ui_DATA) \
$(gsettings_SCHEMAS) \
$(man_MANS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b0128a..e3d733a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,12 +1,19 @@
bin_PROGRAMS = gnome-tetravex
+BUILT_SOURCES = \
+ gnome-tetravex-resources.c
+
gnome_tetravex_SOURCES = \
config.vapi \
gnome-tetravex.vala \
history.vala \
puzzle.vala \
puzzle-view.vala \
- theme.vala
+ theme.vala \
+ $(BUILT_SOURCES)
+
+UI_FILES = \
+ gnome-tetravex.ui
gnome_tetravex_VALAFLAGS = \
--pkg posix \
@@ -23,6 +30,12 @@ gnome_tetravex_CFLAGS = \
gnome_tetravex_LDADD = \
$(GNOME_TETRAVEX_LIBS)
+gnome-tetravex-resources.c: gnome-tetravex.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES)
--generate-dependencies gnome-tetravex.gresource.xml)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source
gnome-tetravex.gresource.xml
+
+EXTRA_DIST = \
+ five-or-more.gresource.xml
+
CLEANFILES = \
$(patsubst %.vala,%.c,$(filter %.vala, $(SOURCES))) \
*_vala.stamp
diff --git a/src/gnome-tetravex.gresource.xml b/src/gnome-tetravex.gresource.xml
index 7b63f81..b03f1c2 100644
--- a/src/gnome-tetravex.gresource.xml
+++ b/src/gnome-tetravex.gresource.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/tetravex">
- <file>gnome-tetravex-menu.ui</file>
+ <file preprocess="xml-stripblanks">gnome-tetravex.ui</file>
</gresource>
</gresources>
diff --git a/data/gnome-tetravex.ui b/src/gnome-tetravex.ui
similarity index 100%
rename from data/gnome-tetravex.ui
rename to src/gnome-tetravex.ui
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 96cd78d..a39b4fe 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -68,7 +68,7 @@ public class Tetravex : Gtk.Application
var builder = new Gtk.Builder ();
try
{
- builder.add_from_file (Path.build_filename (DATA_DIRECTORY, "gnome-tetravex.ui"));
+ builder.add_from_resource ("/org/gnome/tetravex/gnome-tetravex.ui");
}
catch (Error e)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]