summaryrefslogtreecommitdiff
path: root/capplets/keyboard
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/keyboard
parent962f1b0464dfcac6223b6ae2b8e8228863800ea2 (diff)
downloadmate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.bz2
mate-control-center-eafb5fddf84324ebf6b0cc90422f10ee314b5b28.tar.xz
capplets: Use gresources for UI files
Diffstat (limited to 'capplets/keyboard')
-rw-r--r--capplets/keyboard/Makefile.am27
-rw-r--r--capplets/keyboard/mate-keyboard-properties-a11y.c8
-rw-r--r--capplets/keyboard/mate-keyboard-properties-xkbltadd.c6
-rw-r--r--capplets/keyboard/mate-keyboard-properties-xkbmc.c10
-rw-r--r--capplets/keyboard/mate-keyboard-properties-xkbot.c6
-rw-r--r--capplets/keyboard/mate-keyboard-properties.c3
-rw-r--r--capplets/keyboard/org.mate.mcc.keyboard.gresource.xml26
7 files changed, 58 insertions, 28 deletions
diff --git a/capplets/keyboard/Makefile.am b/capplets/keyboard/Makefile.am
index b1a7c5af..30c77705 100644
--- a/capplets/keyboard/Makefile.am
+++ b/capplets/keyboard/Makefile.am
@@ -3,6 +3,9 @@ cappletname = keyboard
bin_PROGRAMS = mate-keyboard-properties
+BUILT_SOURCES = mate-keyboard-properties-resources.h mate-keyboard-properties-resources.c
+nodist_mate_keyboard_properties_SOURCES = \
+ $(BUILT_SOURCES)
mate_keyboard_properties_SOURCES = \
mate-keyboard-properties.c \
mate-keyboard-properties-a11y.c \
@@ -19,24 +22,26 @@ mate_keyboard_properties_LDADD = $(MATECC_CAPPLETS_LIBS) $(LIBMATEKBDUI_LIBS)
@INTLTOOL_DESKTOP_RULE@
-uidir = $(pkgdatadir)/ui
-dist_ui_DATA = mate-keyboard-properties-a11y-notifications.ui \
- mate-keyboard-properties-dialog.ui \
- mate-keyboard-properties-layout-chooser.ui \
- mate-keyboard-properties-model-chooser.ui \
- mate-keyboard-properties-options-dialog.ui
-
desktopdir = $(datadir)/applications
Desktop_in_files = mate-keyboard.desktop.in
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
+mate-keyboard-properties-resources.h mate-keyboard-properties-resources.c: org.mate.mcc.keyboard.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.mcc.keyboard.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name keyboard $<
+
AM_CPPFLAGS = \
$(MATECC_CAPPLETS_CFLAGS) \
$(LIBMATEKBDUI_CFLAGS) \
-DMATELOCALEDIR="\"$(datadir)/locale\"" \
- -DMATECC_DATA_DIR="\"$(pkgdatadir)\"" \
- -DMATECC_UI_DIR="\"$(uidir)\""
-CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA)
-EXTRA_DIST = $(ui_DATA) $(Desktop_in_files)
+ -DMATECC_DATA_DIR="\"$(pkgdatadir)\""
+CLEANFILES = $(MATECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(BUILT_SOURCES)
+EXTRA_DIST = \
+ mate-keyboard-properties-a11y-notifications.ui \
+ mate-keyboard-properties-dialog.ui \
+ mate-keyboard-properties-layout-chooser.ui \
+ mate-keyboard-properties-model-chooser.ui \
+ mate-keyboard-properties-options-dialog.ui \
+ $(Desktop_in_files) \
+ org.mate.mcc.keyboard.gresource.xml
-include $(top_srcdir)/git.mk
diff --git a/capplets/keyboard/mate-keyboard-properties-a11y.c b/capplets/keyboard/mate-keyboard-properties-a11y.c
index 9a9779a1..301b1ee1 100644
--- a/capplets/keyboard/mate-keyboard-properties-a11y.c
+++ b/capplets/keyboard/mate-keyboard-properties-a11y.c
@@ -134,10 +134,10 @@ notifications_button_clicked_cb (GtkWidget *button, GtkBuilder *dialog)
{
GtkWidget *w;
- notifications_dialog = gtk_builder_new ();
- gtk_builder_add_from_file (notifications_dialog, MATECC_UI_DIR
- "/mate-keyboard-properties-a11y-notifications.ui",
- NULL);
+ notifications_dialog = gtk_builder_new ();
+ gtk_builder_add_from_resource (notifications_dialog,
+ "/org/mate/mcc/keyboard/mate-keyboard-properties-a11y-notifications.ui",
+ NULL);
stickykeys_enable_toggled_cb (WID ("stickykeys_enable"), dialog);
slowkeys_enable_toggled_cb (WID ("slowkeys_enable"), dialog);
diff --git a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c
index 7ec09919..6b54fff2 100644
--- a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c
+++ b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c
@@ -474,9 +474,9 @@ xkb_layout_choose (GtkBuilder * dialog)
GtkBuilder *chooser_dialog;
chooser_dialog = gtk_builder_new ();
- gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR
- "/mate-keyboard-properties-layout-chooser.ui",
- NULL);
+ gtk_builder_add_from_resource (chooser_dialog,
+ "/org/mate/mcc/keyboard/mate-keyboard-properties-layout-chooser.ui",
+ NULL);
GtkWidget *chooser = CWID ("xkb_layout_chooser");
GtkWidget *lang_chooser = CWID ("xkb_languages_available");
GtkWidget *notebook = CWID ("choosers_nb");
diff --git a/capplets/keyboard/mate-keyboard-properties-xkbmc.c b/capplets/keyboard/mate-keyboard-properties-xkbmc.c
index e6ae7eb7..6ffc69e6 100644
--- a/capplets/keyboard/mate-keyboard-properties-xkbmc.c
+++ b/capplets/keyboard/mate-keyboard-properties-xkbmc.c
@@ -312,12 +312,12 @@ void
choose_model (GtkBuilder * dialog)
{
GtkBuilder *chooser_dialog;
- GtkWidget *chooser;
+ GtkWidget *chooser;
- chooser_dialog = gtk_builder_new ();
- gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR
- "/mate-keyboard-properties-model-chooser.ui",
- NULL);
+ chooser_dialog = gtk_builder_new ();
+ gtk_builder_add_from_resource (chooser_dialog,
+ "/org/mate/mcc/keyboard/mate-keyboard-properties-model-chooser.ui",
+ NULL);
chooser = CWID ("xkb_model_chooser");
gtk_window_set_transient_for (GTK_WINDOW (chooser),
GTK_WINDOW (WID
diff --git a/capplets/keyboard/mate-keyboard-properties-xkbot.c b/capplets/keyboard/mate-keyboard-properties-xkbot.c
index 5be80c2e..e67fcf86 100644
--- a/capplets/keyboard/mate-keyboard-properties-xkbot.c
+++ b/capplets/keyboard/mate-keyboard-properties-xkbot.c
@@ -448,9 +448,9 @@ xkb_options_popup_dialog (GtkBuilder * dialog)
GtkWidget *chooser;
chooser_dialog = gtk_builder_new ();
- gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR
- "/mate-keyboard-properties-options-dialog.ui",
- NULL);
+ gtk_builder_add_from_resource (chooser_dialog,
+ "/org/mate/mcc/keyboard/mate-keyboard-properties-options-dialog.ui",
+ NULL);
chooser = CWID ("xkb_options_dialog");
gtk_window_set_transient_for (GTK_WINDOW (chooser),
diff --git a/capplets/keyboard/mate-keyboard-properties.c b/capplets/keyboard/mate-keyboard-properties.c
index 4cf0f4c9..a5da8f0d 100644
--- a/capplets/keyboard/mate-keyboard-properties.c
+++ b/capplets/keyboard/mate-keyboard-properties.c
@@ -58,10 +58,9 @@ create_dialog (void)
GtkSizeGroup *size_group;
GtkWidget *image;
GError *error = NULL;
- static const gchar *uifile = MATECC_UI_DIR "/mate-keyboard-properties-dialog.ui";
dialog = gtk_builder_new ();
- if (gtk_builder_add_from_file (dialog, uifile, &error) == 0) {
+ if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/keyboard/mate-keyboard-properties-dialog.ui", &error) == 0) {
g_warning ("Could not load UI: %s", error->message);
g_error_free (error);
g_object_unref (dialog);
diff --git a/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml b/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml
new file mode 100644
index 00000000..1bcb8c9c
--- /dev/null
+++ b/capplets/keyboard/org.mate.mcc.keyboard.gresource.xml
@@ -0,0 +1,26 @@
+<?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/keyboard">
+ <file compressed="true">mate-keyboard-properties-a11y-notifications.ui</file>
+ <file compressed="true">mate-keyboard-properties-dialog.ui</file>
+ <file compressed="true">mate-keyboard-properties-layout-chooser.ui</file>
+ <file compressed="true">mate-keyboard-properties-model-chooser.ui</file>
+ <file compressed="true">mate-keyboard-properties-options-dialog.ui</file>
+ </gresource>
+</gresources>