Commit 10f71d7b authored by Cosimo Cecchi's avatar Cosimo Cecchi
Browse files

all: use GResource for GtkBuilder/GtkUIManager data

parent 006118a8
SUBDIRS=icons
xmldir = $(pkgdatadir)
xml_DATA = logview-toolbar.xml logview-filter.ui
desktopdir = $(datadir)/applications
desktop_in_files = gnome-system-log.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
......@@ -25,7 +22,6 @@ convert_DATA = logview.convert
EXTRA_DIST = \
gnome-system-log.desktop.in.in \
$(xml_DATA) \
$(man_MANS) \
$(gsettingsschema_in_files) \
$(convert_DATA)
......
......@@ -11,9 +11,21 @@ INCLUDES = \
bin_PROGRAMS = gnome-system-log
ui_files = \
logview-filter.ui \
logview-menubar.xml
logview-resources.c: logview.gresource.xml $(ui_files)
$(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name logview $(srcdir)/logview.gresource.xml
logview-resources.h: logview.gresource.xml $(ui_files)
$(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name logview $(srcdir)/logview.gresource.xml
BUILT_SOURCES = \
logview-marshal.c \
logview-marshal.h
logview-marshal.h \
logview-resources.c \
logview-resources.h
gnome_system_log_SOURCES = \
logview-app.c \
......@@ -56,7 +68,10 @@ logview-marshal.c: logview-marshal.list $(GLIB_GENMARSHAL)
echo "#include \"logview-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=logview_marshal >> $@
EXTRA_DIST = logview-marshal.list
EXTRA_DIST =
logview-marshal.list \
logview.gresource.xml \
$(ui_files)
CLEANFILES = \
$(BUILT_SOURCES)
......
......@@ -27,8 +27,6 @@
#include <string.h>
#include <glib/gi18n.h>
#define UI_FILE LOGVIEW_DATADIR "/logview-filter.ui"
struct _LogviewFilterManagerPrivate {
GtkWidget *tree;
......@@ -283,7 +281,7 @@ run_add_edit_dialog (LogviewFilterManager *manager, LogviewFilter *filter)
error = NULL;
name = NULL;
gtk_builder_add_from_file (builder, UI_FILE, &error);
gtk_builder_add_from_resource (builder, "/org/gnome/logview/logview-filter.ui", &error);
if (error) {
g_warning ("Could not load filter ui: %s", error->message);
......
......@@ -1279,9 +1279,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/gnome/logview/logview-menubar.xml",
&error);
if (res == FALSE) {
priv->ui_manager = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment