summaryrefslogtreecommitdiff
path: root/logview
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-12-09 23:05:56 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2019-12-23 08:55:37 +0100
commitd6318fc5174c6e5915ed22c53b17a681850c97c0 (patch)
tree52e0c82b9e6318f70ffb07fac79b0d396970a6f9 /logview
parentb8b0f4f70656476e51c0a645875d07c8c8225626 (diff)
downloadmate-utils-d6318fc5174c6e5915ed22c53b17a681850c97c0.tar.bz2
mate-utils-d6318fc5174c6e5915ed22c53b17a681850c97c0.tar.xz
Use gresources for UI files
Diffstat (limited to 'logview')
-rw-r--r--logview/data/Makefile.am9
-rw-r--r--logview/data/org.mate.system-log.gresource.xml23
-rw-r--r--logview/src/Makefile.am24
-rw-r--r--logview/src/logview-filter-manager.c6
-rw-r--r--logview/src/logview-window.c6
5 files changed, 47 insertions, 21 deletions
diff --git a/logview/data/Makefile.am b/logview/data/Makefile.am
index 1fda2fb1..451f93fa 100644
--- a/logview/data/Makefile.am
+++ b/logview/data/Makefile.am
@@ -1,8 +1,5 @@
SUBDIRS=icons
-xmldir = $(pkgdatadir)
-xml_DATA = logview-toolbar.xml logview-filter.ui
-
desktopdir = $(datadir)/applications
desktop_in_files = mate-system-log.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@@ -19,9 +16,11 @@ gsettings_SCHEMAS = org.mate.system-log.gschema.xml
@GSETTINGS_RULES@
EXTRA_DIST = \
+ logview-filter.ui \
+ logview-toolbar.xml \
mate-system-log.desktop.in.in \
- $(xml_DATA) \
- $(man_MANS)
+ $(man_MANS) \
+ org.mate.system-log.gresource.xml
DISTCLEANFILES = \
$(desktop_DATA) \
diff --git a/logview/data/org.mate.system-log.gresource.xml b/logview/data/org.mate.system-log.gresource.xml
new file mode 100644
index 00000000..14b1103d
--- /dev/null
+++ b/logview/data/org.mate.system-log.gresource.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Utils.
+
+ MATE Utils 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 Utils 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 Utils. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/system-log">
+ <file compressed="true">logview-filter.ui</file>
+ <file compressed="true">logview-toolbar.xml</file>
+ </gresource>
+</gresources>
diff --git a/logview/src/Makefile.am b/logview/src/Makefile.am
index b270678e..a0268760 100644
--- a/logview/src/Makefile.am
+++ b/logview/src/Makefile.am
@@ -5,14 +5,18 @@ AM_CPPFLAGS = \
-DMATELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DDATADIR=\""$(datadir)"\" \
-DLOGVIEWINSTALLPREFIX=\""$(prefix)/\"" \
- -DLOGVIEW_DATADIR=\""$(pkgdatadir)"\" \
$(NULL)
bin_PROGRAMS = mate-system-log
BUILT_SOURCES = \
logview-marshal.c \
- logview-marshal.h
+ logview-marshal.h \
+ logview-resources.c \
+ logview-resources.h
+
+nodist_mate_system_log_SOURCES = \
+ $(BUILT_SOURCES)
mate_system_log_SOURCES = \
logview-app.c \
@@ -33,11 +37,10 @@ mate_system_log_SOURCES = \
logview-findbar.c \
logview-prefs.c \
logview-prefs.h \
- logview-filter.h \
- logview-filter.c \
- logview-filter-manager.h \
- logview-filter-manager.c \
- $(BUILT_SOURCES)
+ logview-filter.h \
+ logview-filter.c \
+ logview-filter-manager.h \
+ logview-filter-manager.c
mate_system_log_CFLAGS = \
$(GLIB_CFLAGS) \
@@ -47,7 +50,7 @@ mate_system_log_CFLAGS = \
$(WARN_CFLAGS) \
$(NULL)
-mate_system_log_LDADD = \
+mate_system_log_LDADD = \
$(GLIB_LIBS) \
$(GIO_LIBS) \
$(GTHREAD_LIBS) \
@@ -62,9 +65,12 @@ logview-marshal.c: logview-marshal.list $(GLIB_GENMARSHAL)
echo "#include \"logview-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=logview_marshal >> $@
+logview-resources.h logview-resources.c: $(srcdir)/../data/org.mate.system-log.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/../data $(srcdir)/../data/org.mate.system-log.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir)/../data --generate --c-name logview $<
+
EXTRA_DIST = logview-marshal.list
-CLEANFILES = \
+CLEANFILES = \
$(BUILT_SOURCES)
dist-hook:
diff --git a/logview/src/logview-filter-manager.c b/logview/src/logview-filter-manager.c
index 4f3df30c..e086ba76 100644
--- a/logview/src/logview-filter-manager.c
+++ b/logview/src/logview-filter-manager.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <glib/gi18n.h>
-#define UI_FILE LOGVIEW_DATADIR "/logview-filter.ui"
+#define UI_RESOURCE "/org/mate/system-log/logview-filter.ui"
struct _LogviewFilterManagerPrivate {
GtkWidget *tree;
@@ -280,9 +280,7 @@ run_add_edit_dialog (LogviewFilterManager *manager, LogviewFilter *filter)
error = NULL;
name = NULL;
- gtk_builder_add_from_file (builder, UI_FILE, &error);
-
- if (error) {
+ if (gtk_builder_add_from_resource (builder, UI_RESOURCE, &error) == 0) {
g_warning ("Could not load filter ui: %s", error->message);
g_error_free (error);
return;
diff --git a/logview/src/logview-window.c b/logview/src/logview-window.c
index d36e69ea..8c419dce 100644
--- a/logview/src/logview-window.c
+++ b/logview/src/logview-window.c
@@ -1311,9 +1311,9 @@ logview_window_init (LogviewWindow *logview)
accel_group = gtk_ui_manager_get_accel_group (priv->ui_manager);
gtk_window_add_accel_group (GTK_WINDOW (logview), accel_group);
- res = gtk_ui_manager_add_ui_from_file (priv->ui_manager,
- LOGVIEW_DATADIR "/logview-toolbar.xml",
- &error);
+ res = gtk_ui_manager_add_ui_from_resource (priv->ui_manager,
+ "/org/mate/system-log/logview-toolbar.xml",
+ &error);
if (res == FALSE) {
priv->ui_manager = NULL;