[totem/wip/hadess/remove-plugin-interface: 2/5] screenshot: Use GResources to load UI file
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/remove-plugin-interface: 2/5] screenshot: Use GResources to load UI file
- Date: Tue, 11 May 2021 12:42:17 +0000 (UTC)
commit d11274946521d6d8e250a91f47b45695d53680bd
Author: Bastien Nocera <hadess hadess net>
Date: Tue May 11 14:31:58 2021 +0200
screenshot: Use GResources to load UI file
Removes the error handling, simplifies our code.
src/plugins/screenshot/meson.build | 13 ++++++++-----
src/plugins/screenshot/screenshot.gresource.xml | 6 ++++++
src/plugins/screenshot/totem-gallery.c | 6 +-----
3 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/screenshot/meson.build b/src/plugins/screenshot/meson.build
index ed1ef65d0..70d5fe3f8 100644
--- a/src/plugins/screenshot/meson.build
+++ b/src/plugins/screenshot/meson.build
@@ -9,6 +9,14 @@ plugin_files = files(
'totem-gallery-progress.c'
)
+plugin_files += gnome.compile_resources(
+ 'screenshotresources',
+ 'screenshot.gresource.xml',
+ export: true,
+ source_dir: '.',
+ c_name: 'screenshot'
+)
+
test_cflags = [
'-Wno-error=format-nonliteral',
'-Wno-format-nonliteral'
@@ -42,8 +50,3 @@ custom_target(
install: true,
install_dir: plugin_dir
)
-
-install_data(
- 'gallery.ui',
- install_dir: plugin_dir
-)
diff --git a/src/plugins/screenshot/screenshot.gresource.xml b/src/plugins/screenshot/screenshot.gresource.xml
new file mode 100644
index 000000000..b9ae1e7bf
--- /dev/null
+++ b/src/plugins/screenshot/screenshot.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/totem/plugins/screenshot">
+ <file compressed="true">gallery.ui</file>
+ </gresource>
+</gresources>
diff --git a/src/plugins/screenshot/totem-gallery.c b/src/plugins/screenshot/totem-gallery.c
index 928261408..0ce354c0b 100644
--- a/src/plugins/screenshot/totem-gallery.c
+++ b/src/plugins/screenshot/totem-gallery.c
@@ -72,11 +72,7 @@ totem_gallery_new (Totem *totem)
/* Create the gallery and its interface */
gallery = g_object_new (TOTEM_TYPE_GALLERY, NULL);
- builder = totem_plugin_load_interface ("screenshot", "gallery.ui", TRUE, NULL, gallery);
- if (builder == NULL) {
- g_object_unref (gallery);
- return NULL;
- }
+ builder = gtk_builder_new_from_resource ("/org/gnome/totem/plugins/screenshot/gallery.ui");
/* Grab the widgets */
gallery->priv->default_screenshot_count = GTK_CHECK_BUTTON (gtk_builder_get_object (builder,
"default_screenshot_count"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]