summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--configure.ac18
-rw-r--r--src/capplet/Makefile.am16
-rw-r--r--src/capplet/mate-notification-properties.c17
-rw-r--r--src/capplet/org.mate.notifications.properties.gresource.xml22
5 files changed, 53 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml
index c524122..ebe52a3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -103,6 +103,7 @@ requires:
- libwnck-3-dev
- libx11-dev
- libxml2-dev
+ - libxml2-utils
- mate-common
- quilt
- shared-mime-info
@@ -146,6 +147,7 @@ requires:
- libwnck-3-dev
- libx11-dev
- libxml2-dev
+ - libxml2-utils
- mate-common
- quilt
- shared-mime-info
diff --git a/configure.ac b/configure.ac
index 1313e11..06a22c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,24 @@ AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE_TARNAME], [Define to the gettext package n
dnl ---------------------------------------------------------------------------
+dnl GLIB_COMPILE_RESOURCES
+dnl ---------------------------------------------------------------------------
+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
+
+dnl ---------------------------------------------------------------------------
+dnl XMLLINT
+dnl ---------------------------------------------------------------------------
+AC_ARG_VAR([XMLLINT],[xmllint bin])
+AC_PATH_PROG([XMLLINT],[xmllint],[])
+if test -z "$XMLLINT"; then
+ AC_MSG_ERROR([xmllint not found])
+fi
+
+dnl ---------------------------------------------------------------------------
dnl Requirements for the themes
dnl ---------------------------------------------------------------------------
diff --git a/src/capplet/Makefile.am b/src/capplet/Makefile.am
index 12110b1..26a188a 100644
--- a/src/capplet/Makefile.am
+++ b/src/capplet/Makefile.am
@@ -2,11 +2,14 @@ bin_PROGRAMS = mate-notification-properties
@INTLTOOL_DESKTOP_RULE@
+BUILT_SOURCES = mate-notification-properties-resources.h mate-notification-properties-resources.c
+
mate_notification_properties_LDADD = $(NOTIFICATION_CAPPLET_LIBS)
-mate_notification_properties_SOURCES = mate-notification-properties.c
+mate_notification_properties_SOURCES = $(BUILT_SOURCES) mate-notification-properties.c
mate_notification_properties_CFLAGS = $(WARN_CFLAGS)
-uidir = $(datadir)/mate-notification-daemon
-ui_DATA = mate-notification-properties.ui
+
+mate-notification-properties-resources.h mate-notification-properties-resources.c: org.mate.notifications.properties.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.notifications.properties.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name notification_properties $<
desktopdir = $(datadir)/applications
desktop_in_files = mate-notification-properties.desktop.in
@@ -19,10 +22,9 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/daemon \
$(NOTIFICATION_CAPPLET_CFLAGS) \
-DENGINES_DIR=\"$(libdir)/mate-notification-daemon/engines\" \
- -DNOTIFICATION_LOCALEDIR=\"$(datadir)/locale\" \
- -DNOTIFICATION_UIDIR=\"$(datadir)/mate-notification-daemon\"
+ -DNOTIFICATION_LOCALEDIR=\"$(datadir)/locale\"
-CLEANFILES = $(desktop_DATA)
-EXTRA_DIST = $(ui_DATA) $(pixmap_DATA) $(desktop_in_files) $(man_MANS)
+CLEANFILES = $(desktop_DATA) $(BUILT_SOURCES)
+EXTRA_DIST = mate-notification-properties.ui $(pixmap_DATA) $(desktop_in_files) $(man_MANS) org.mate.notifications.properties.gresource.xml
-include $(top_srcdir)/git.mk
diff --git a/src/capplet/mate-notification-properties.c b/src/capplet/mate-notification-properties.c
index d0c3acf..6a496da 100644
--- a/src/capplet/mate-notification-properties.c
+++ b/src/capplet/mate-notification-properties.c
@@ -39,8 +39,6 @@
#define GSETTINGS_KEY_USE_ACTIVE_MONITOR "use-active-monitor"
#define GSETTINGS_KEY_DO_NOT_DISTURB "do-not-disturb"
-#define NOTIFICATION_UI_FILE "mate-notification-properties.ui"
-
typedef struct {
GSettings* gsettings;
@@ -539,25 +537,14 @@ static void notification_properties_dialog_destroyed(GtkWidget* widget, Notifica
static gboolean notification_properties_dialog_init(NotificationAppletDialog* dialog)
{
- const char* ui_file;
-
- if (g_file_test(NOTIFICATION_UI_FILE, G_FILE_TEST_EXISTS))
- {
- ui_file = NOTIFICATION_UI_FILE;
- }
- else
- {
- ui_file = NOTIFICATION_UIDIR "/" NOTIFICATION_UI_FILE;
- }
-
GtkBuilder* builder = gtk_builder_new();
GError* error = NULL;
- gtk_builder_add_from_file(builder, ui_file, &error);
+ gtk_builder_add_from_resource (builder, "/org/mate/notifications/properties/mate-notification-properties.ui", &error);
if (error != NULL)
{
- g_warning(_("Could not load user interface file: %s"), error->message);
+ g_warning(_("Could not load user interface: %s"), error->message);
g_error_free(error);
return FALSE;
}
diff --git a/src/capplet/org.mate.notifications.properties.gresource.xml b/src/capplet/org.mate.notifications.properties.gresource.xml
new file mode 100644
index 0000000..734707a
--- /dev/null
+++ b/src/capplet/org.mate.notifications.properties.gresource.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Notification Daemon.
+
+ MATE Notification Daemon 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 Notification Daemon 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 Notification Daemon. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/notifications/properties">
+ <file compressed="true">mate-notification-properties.ui</file>
+ </gresource>
+</gresources>