[libgweather] Add a Glade catalog
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather] Add a Glade catalog
- Date: Sun, 19 May 2013 15:01:28 +0000 (UTC)
commit 10c6f4e0c0522ba4a2c67aeece70a9d14f2506e6
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sun May 19 16:06:52 2013 +0200
Add a Glade catalog
Now that GWeatherLocationEntry and GWeatherTimezoneMenu are
buildable, we can use them in glade.
configure.ac | 37 ++++++++++++++++++++++++++++++++++++-
data/Makefile.am | 7 +++++++
data/glade/Makefile.am | 13 +++++++++++++
data/glade/libgweather.xml.in | 19 +++++++++++++++++++
po/POTFILES.in | 1 +
5 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9e77acd..ff81a68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,7 +146,41 @@ AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
AC_SUBST(DATADIR)
AC_SUBST(LIBDIR)
-AC_SUBST(GLADEDIR)
+
+dnl ***************************************************************************
+dnl *** Glade ***
+dnl ***************************************************************************
+
+AC_ARG_ENABLE([glade-catalog],
+ [AS_HELP_STRING([--enable-glade-catalog],
+ [Install a glade catalog file [default=auto]])],
+ [enable_glade_catalog=$enableval],
+ [enable_glade_catalog=auto])
+
+if test "x$enable_glade_catalog" = "xno"; then
+ found_glade_catalog="no (disabled, use --enable-glade-catalog to enable)"
+else
+ AC_MSG_CHECKING([for Glade.])
+
+ PKG_CHECK_EXISTS([gladeui-2.0],
+ [found_glade_catalog=yes],
+ [found_glade_catalog=no])
+fi
+
+if test "x$enable_glade_catalog" = "xyes" -a "x$found_glade_catalog" = "xno"; then
+ AC_MSG_ERROR([You need to have gladeui-2.0 installed to build libgweather with glade enabled])
+fi
+AC_MSG_RESULT([$found_glade_catalog])
+
+if test "x$found_glade_catalog" = "xyes"; then
+ AC_MSG_CHECKING([for Glade catalog dir])
+ GLADE_DATA_DIR=`$PKG_CONFIG --variable=datadir gladeui-2.0 2>&AS_MESSAGE_LOG_FD`
+ GLADE_CATALOG_DIR=`$PKG_CONFIG --variable=catalogdir gladeui-2.0 2>&AS_MESSAGE_LOG_FD | sed -e
"s#^$GLADE_DATA_DIR#$datadir#"`
+ AC_MSG_RESULT([$GLADE_CATALOG_DIR])
+ AC_SUBST(GLADE_CATALOG_DIR)
+fi
+
+AM_CONDITIONAL([ENABLE_GLADE_CATALOG],[test "x$found_glade_catalog" = "xyes"])
##################################################
# Checks for gtk-doc and docbook-tools
@@ -167,6 +201,7 @@ libgweather/Makefile
libgweather/gweather-3.0.pc
libgweather/gweather-3.0-uninstalled.pc
data/Makefile
+data/glade/Makefile
icons/Makefile
schemas/Makefile
])
diff --git a/data/Makefile.am b/data/Makefile.am
index f1f82c0..e1441d3 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,3 +1,10 @@
+
+SUBDIRS =
+
+if ENABLE_GLADE_CATALOG
+SUBDIRS += glade
+endif
+
libgweatherdtddir = $(pkgdatadir)
libgweatherdtd_DATA = locations.dtd
diff --git a/data/glade/Makefile.am b/data/glade/Makefile.am
new file mode 100644
index 0000000..776fef3
--- /dev/null
+++ b/data/glade/Makefile.am
@@ -0,0 +1,13 @@
+catalogdir = $(GLADE_CATALOG_DIR)
+catalog_in_files = libgweather.xml.in
+catalog_DATA = $(catalog_in_files:.xml.in=.xml)
+
+EXTRA_DIST = \
+ $(catalog_in_files)
+
+check-local: $(catalog_DATA)
+ xmllint --dtdvalid $(GLADE_CATALOG_DIR)/glade-catalog.dtd --noout $<
+
+CLEANFILES = $(catalog_DATA)
+
+ INTLTOOL_XML_NOMERGE_RULE@
diff --git a/data/glade/libgweather.xml.in b/data/glade/libgweather.xml.in
new file mode 100644
index 0000000..291ace1
--- /dev/null
+++ b/data/glade/libgweather.xml.in
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glade-catalog version="3.0" name="libgweather" library="gweather-3" domain="libgweather-3.0" depends="gtk+"
book="libgweather-3.0">
+ <glade-widget-classes>
+ <glade-widget-class name="GWeatherLocationEntry" _title="Location Entry" generic-name="locentry"
get-type-function="gweather_location_entry_get_type">
+ <!-- There are no editable properties, because GtkBuilder can't handle boxed types -->
+ </glade-widget-class>
+
+ <glade-widget-class name="GWeatherTimezoneMenu" _title="Timezone Menu" generic-name="tzmenu"
get-type-function="gweather_timezone_menu_get_type">
+ <properties>
+ <property id="tzid" _name="Timezone" />
+ </properties>
+ </glade-widget-class>
+ </glade-widget-classes>
+
+ <glade-widget-group name="GWeather" _title="GWeather">
+ <glade-widget-class-ref name="GWeatherLocationEntry" />
+ <glade-widget-class-ref name="GWeatherTimezoneMenu" />
+ </glade-widget-group>
+</glade-catalog>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8553a39..6bc0fba 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,6 +2,7 @@
# Please keep this file sorted alphabetically.
#
[encoding: UTF-8]
+data/glade/libgweather.xml.in
libgweather/gweather-timezone.c
libgweather/timezone-menu.c
libgweather/weather.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]