Commit 6f48e0f4 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Bastien Nocera
Browse files

privacy: use a GResource for GtkBuilder UI definition

https://bugzilla.gnome.org/show_bug.cgi?id=691132
parent 30644257
......@@ -3,24 +3,28 @@ cappletname = privacy
INCLUDES = \
$(PANEL_CFLAGS) \
$(PRIVACY_PANEL_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DDATADIR="\"$(datadir)\"" \
-I$(top_srcdir)/panels/common/ \
$(NULL)
noinst_LTLIBRARIES = libprivacy.la
BUILT_SOURCES = \
cc-privacy-resources.c \
cc-privacy-resources.h
libprivacy_la_SOURCES = \
$(BUILT_SOURCES) \
cc-privacy-panel.c \
cc-privacy-panel.h
libprivacy_la_LIBADD = $(PANEL_LIBS) $(PRIVACY_PANEL_LIBS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = \
privacy.ui
resource_files = $(shell glib-compile-resources --generate-dependencies $(srcdir)/privacy.gresource.xml)
cc-privacy-resources.c: privacy.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_privacy $<
cc-privacy-resources.h: privacy.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_privacy $<
@INTLTOOL_DESKTOP_RULE@
......@@ -28,6 +32,7 @@ desktopdir = $(datadir)/applications
desktop_in_files = gnome-privacy-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) privacy.gresource.xml
-include $(top_srcdir)/git.mk
......@@ -20,6 +20,7 @@
*/
#include "cc-privacy-panel.h"
#include "cc-privacy-resources.h"
#include <egg-list-box/egg-list-box.h>
#include <gio/gdesktopappinfo.h>
......@@ -666,13 +667,14 @@ cc_privacy_panel_init (CcPrivacyPanel *self)
guint res;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_PRIVACY_PANEL, CcPrivacyPanelPrivate);
g_resources_register (cc_privacy_get_resource ());
self->priv->builder = gtk_builder_new ();
error = NULL;
res = gtk_builder_add_from_file (self->priv->builder,
GNOMECC_UI_DIR "/privacy.ui",
&error);
res = gtk_builder_add_from_resource (self->priv->builder,
"/org/gnome/control-center/privacy/privacy.ui",
&error);
if (res == 0)
{
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/privacy">
<file preprocess="xml-stripblanks">privacy.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