summaryrefslogtreecommitdiff
path: root/capplets/about-me
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-05-07 00:05:26 +0200
committerlukefromdc <[email protected]>2019-05-11 00:59:53 +0000
commiteafb5fddf84324ebf6b0cc90422f10ee314b5b28 (patch)
treeb7569aab227398638c9504056c1892bc8ea605cd /capplets/about-me
parent962f1b0464dfcac6223b6ae2b8e8228863800ea2 (diff)
downloadmate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.bz2
mate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.xz
capplets: Use gresources for UI files
Diffstat (limited to 'capplets/about-me')
-rw-r--r--capplets/about-me/Makefile.am21
-rw-r--r--capplets/about-me/mate-about-me-fingerprint.c7
-rw-r--r--capplets/about-me/mate-about-me-password.c11
-rw-r--r--capplets/about-me/mate-about-me.c9
-rw-r--r--capplets/about-me/org.mate.mcc.am.gresource.xml24
5 files changed, 56 insertions, 16 deletions
diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am
index 453474c0..aee23c53 100644
--- a/capplets/about-me/Makefile.am
+++ b/capplets/about-me/Makefile.am
@@ -4,6 +4,9 @@ cappletname = about-me
ui_files = mate-about-me-dialog.ui mate-about-me-password.ui mate-about-me-fingerprint.ui
Desktop_in_files = mate-about-me.desktop.in
+BUILT_SOURCES = marshal.c marshal.h mate-about-me-resources.h mate-about-me-resources.c
+nodist_mate_about_me_SOURCES = \
+ $(BUILT_SOURCES)
mate_about_me_SOURCES = \
mate-about-me-password.c \
mate-about-me-password.h \
@@ -11,17 +14,15 @@ mate_about_me_SOURCES = \
e-image-chooser.h \
mate-about-me-fingerprint.c \
mate-about-me-fingerprint.h \
- $(MARSHALFILES) \
fingerprint-strings.h \
mate-about-me.c
-MARSHALFILES = marshal.c marshal.h
-BUILT_SOURCES = $(MARSHALFILES)
-
marshal.h: fprintd-marshal.list
@GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --header > $@
marshal.c: fprintd-marshal.list
@GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --body --header > $@
+mate-about-me-resources.h mate-about-me-resources.c: org.mate.mcc.am.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.am.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name about_me $<
bin_PROGRAMS = mate-about-me
@@ -36,15 +37,11 @@ mate_about_me_LDFLAGS = -export-dynamic
desktopdir = $(datadir)/applications
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
-uidir = $(pkgdatadir)/ui
-ui_DATA = $(ui_files)
-
AM_CPPFLAGS = \
$(MATECC_CAPPLETS_CFLAGS) \
$(LIBEBOOK_CFLAGS) \
-DDATADIR="\"$(datadir)\"" \
-DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \
- -DMATECC_UI_DIR="\"$(uidir)\"" \
-DMATECC_PIXMAP_DIR="\"$(pkgdatadir)/pixmaps\"" \
-DMATELOCALEDIR="\"$(datadir)/locale\""
@@ -53,7 +50,11 @@ AM_CPPFLAGS += \
$(ACCOUNTSSERVICE_CFLAGS)
endif
-CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(MARSHALFILES)
-EXTRA_DIST = $(ui_files) fprintd-marshal.list $(Desktop_in_files)
+CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES)
+EXTRA_DIST = \
+ $(ui_files) \
+ fprintd-marshal.list \
+ $(Desktop_in_files) \
+ org.mate.mcc.am.gresource.xml
-include $(top_srcdir)/git.mk
diff --git a/capplets/about-me/mate-about-me-fingerprint.c b/capplets/about-me/mate-about-me-fingerprint.c
index 095be8d2..9b30384e 100644
--- a/capplets/about-me/mate-about-me-fingerprint.c
+++ b/capplets/about-me/mate-about-me-fingerprint.c
@@ -506,6 +506,7 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
EnrollData *data;
GtkWidget *ass;
char *msg;
+ GError *error = NULL;
device = NULL;
@@ -547,7 +548,11 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
g_object_unref (p);
dialog = gtk_builder_new ();
- gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-fingerprint.ui", NULL);
+ if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-fingerprint.ui", &error) == 0)
+ {
+ g_warning ("Could not parse UI definition: %s", error->message);
+ g_error_free (error);
+ }
data->dialog = dialog;
ass = WID ("assistant");
diff --git a/capplets/about-me/mate-about-me-password.c b/capplets/about-me/mate-about-me-password.c
index c2e1242d..0f053f7f 100644
--- a/capplets/about-me/mate-about-me-password.c
+++ b/capplets/about-me/mate-about-me-password.c
@@ -1011,13 +1011,18 @@ passdlg_activate (GtkEntry *entry, GtkWidget *w)
static void
passdlg_init (PasswordDialog *pdialog, GtkWindow *parent)
{
- GtkBuilder *dialog;
- GtkWidget *wpassdlg;
+ GtkBuilder *dialog;
+ GtkWidget *wpassdlg;
GtkAccelGroup *group;
+ GError *error = NULL;
/* Initialize dialog */
dialog = gtk_builder_new ();
- gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-password.ui", NULL);
+ if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-password.ui", &error) == 0)
+ {
+ g_warning ("Could not parse UI definition: %s", error->message);
+ g_error_free (error);
+ }
pdialog->ui = dialog;
wpassdlg = WID ("change-password");
diff --git a/capplets/about-me/mate-about-me.c b/capplets/about-me/mate-about-me.c
index b66beb32..417dac3c 100644
--- a/capplets/about-me/mate-about-me.c
+++ b/capplets/about-me/mate-about-me.c
@@ -125,7 +125,7 @@ static void
about_me_update_photo (MateAboutMe *me)
{
gchar *file;
- GError *error;
+ GError *error = NULL;
guchar *data;
gsize length;
@@ -428,6 +428,7 @@ about_me_setup_dialog (void)
GtkWidget *main_dialog;
GtkIconInfo *icon;
GtkBuilder *dialog;
+ GError *error = NULL;
gchar *str;
#if HAVE_ACCOUNTSSERVICE
ActUserManager* manager;
@@ -437,7 +438,11 @@ about_me_setup_dialog (void)
me->image = NULL;
dialog = gtk_builder_new ();
- gtk_builder_add_from_file (dialog, MATECC_UI_DIR "/mate-about-me-dialog.ui", NULL);
+ if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-dialog.ui", &error) == 0)
+ {
+ g_warning ("Could not parse UI definition: %s", error->message);
+ g_error_free (error);
+ }
me->image_chooser = e_image_chooser_new_with_size (MAX_WIDTH, MAX_HEIGHT);
gtk_container_add (GTK_CONTAINER (WID ("button-image")), me->image_chooser);
diff --git a/capplets/about-me/org.mate.mcc.am.gresource.xml b/capplets/about-me/org.mate.mcc.am.gresource.xml
new file mode 100644
index 00000000..875df52d
--- /dev/null
+++ b/capplets/about-me/org.mate.mcc.am.gresource.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Control Center.
+
+ MATE Control Center 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 Control Center 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 Control Center. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/mcc/am">
+ <file compressed="true">mate-about-me-dialog.ui</file>
+ <file compressed="true">mate-about-me-fingerprint.ui</file>
+ <file compressed="true">mate-about-me-password.ui</file>
+ </gresource>
+</gresources>