Commit 0653773e authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Bastien Nocera
Browse files

online-accounts: use a GResource for GtkBuilder UI definition

https://bugzilla.gnome.org/show_bug.cgi?id=691132
parent 5975b177
......@@ -4,15 +4,18 @@ SUBDIRS = icons
INCLUDES = \
$(PANEL_CFLAGS) \
$(ONLINE_ACCOUNTS_PANEL_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
$(ONLINE_ACCOUNTS_PANEL_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
noinst_LTLIBRARIES = libonline-accounts.la
BUILT_SOURCES = \
cc-online-accounts-resources.c \
cc-online-accounts-resources.h
libonline_accounts_la_SOURCES = \
$(BUILT_SOURCES) \
cc-online-accounts-add-account-dialog.c \
cc-online-accounts-add-account-dialog.h \
cc-online-accounts-model.c \
......@@ -23,8 +26,11 @@ libonline_accounts_la_SOURCES = \
libonline_accounts_la_LIBADD = $(PANEL_LIBS) $(ONLINE_ACCOUNTS_PANEL_LIBS)
libonline_accounts_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = online-accounts.ui
resource_files = $(shell glib-compile-resources --generate-dependencies $(srcdir)/online-accounts.gresource.xml)
cc-online-accounts-resources.c: online-accounts.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_online_accounts $<
cc-online-accounts-resources.h: online-accounts.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_online_accounts $<
@INTLTOOL_DESKTOP_RULE@
......@@ -32,6 +38,7 @@ desktopdir = $(datadir)/applications
desktop_in_files = gnome-online-accounts-panel.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(BUILT_SOURCES)
EXTRA_DIST = $(resource_files) online-accounts.gresource.xml
-include $(top_srcdir)/git.mk
......@@ -143,13 +143,14 @@ cc_goa_panel_init (CcGoaPanel *panel)
GtkTreeIter iter;
GNetworkMonitor *monitor;
g_resources_register (cc_online_accounts_get_resource ());
monitor = g_network_monitor_get_default();
panel->builder = gtk_builder_new ();
error = NULL;
if (gtk_builder_add_from_file (panel->builder,
GNOMECC_UI_DIR "/online-accounts.ui",
&error) == 0)
if (gtk_builder_add_from_resource (panel->builder,
"/org/gnome/control-center/online-accounts/online-accounts.ui",
&error) == 0)
{
goa_warning ("Error loading UI file: %s (%s, %d)",
error->message, g_quark_to_string (error->domain), error->code);
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/online-accounts">
<file preprocess="xml-stripblanks">online-accounts.ui</file>
</gresource>
</gresources>
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