summaryrefslogtreecommitdiff
path: root/logview/src
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/src
parentb8b0f4f70656476e51c0a645875d07c8c8225626 (diff)
downloadmate-utils-d6318fc5174c6e5915ed22c53b17a681850c97c0.tar.bz2
mate-utils-d6318fc5174c6e5915ed22c53b17a681850c97c0.tar.xz
Use gresources for UI files
Diffstat (limited to 'logview/src')
-rw-r--r--logview/src/Makefile.am24
-rw-r--r--logview/src/logview-filter-manager.c6
-rw-r--r--logview/src/logview-window.c6
3 files changed, 20 insertions, 16 deletions
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;