[simple-scan] resources: Move and reorganize UI files and icons into data/
- From: Bartosz <bkosiorek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] resources: Move and reorganize UI files and icons into data/
- Date: Mon, 14 Dec 2020 13:55:20 +0000 (UTC)
commit 03bfcf6fb1d9a198af4e2082f61584a39a5c238b
Author: vanadiae <vanadiae35 gmail com>
Date: Fri Dec 11 19:58:18 2020 +0100
resources: Move and reorganize UI files and icons into data/
This commit also ensures at build time that the resource files are
correctly used, by depending on it in the meson.build.
The icons now live in data/icons/scalable/actions/, to avoid having them
mixed with the code in src/. The UI files are now also gathered in
data/ui/, because it's how it's usually done and it avoids having
the gresource having to look for files in ../src
.../icons/scalable/actions}/scan-type-adf-symbolic.svg | 0
.../icons/scalable/actions}/scan-type-batch-symbolic.svg | 0
data/meson.build | 14 ++++++++++++++
data/simple-scan.gresource.xml | 12 ++++++++++++
{src => data/ui}/app-window.ui | 0
{src => data/ui}/authorize-dialog.ui | 0
{src => data/ui}/help-overlay.ui | 0
{src => data/ui}/preferences-dialog.ui | 0
src/app-window.vala | 2 +-
src/authorize-dialog.vala | 2 +-
src/meson.build | 4 ----
src/preferences-dialog.vala | 2 +-
src/simple-scan.gresource.xml | 15 ---------------
13 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/src/scan-type-adf-symbolic.svg b/data/icons/scalable/actions/scan-type-adf-symbolic.svg
similarity index 100%
rename from src/scan-type-adf-symbolic.svg
rename to data/icons/scalable/actions/scan-type-adf-symbolic.svg
diff --git a/src/scan-type-batch-symbolic.svg b/data/icons/scalable/actions/scan-type-batch-symbolic.svg
similarity index 100%
rename from src/scan-type-batch-symbolic.svg
rename to data/icons/scalable/actions/scan-type-batch-symbolic.svg
diff --git a/data/meson.build b/data/meson.build
index aa1d0ec1..adc3541b 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -24,3 +24,17 @@ i18n.merge_file ('appdata-file',
po_dir: '../po')
install_man ('simple-scan.1')
+
+icon_dir = 'icons/scalable/actions'
+resource_files = files([
+ icon_dir / 'scan-type-adf-symbolic.svg',
+ icon_dir / 'scan-type-batch-symbolic.svg',
+ 'ui/app-window.ui',
+ 'ui/authorize-dialog.ui',
+ 'ui/help-overlay.ui',
+ 'ui/preferences-dialog.ui',
+])
+resources = gnome.compile_resources ('resources', 'simple-scan.gresource.xml',
+ dependencies: resource_files,
+ source_dir: '.',
+ c_name: 'resources')
diff --git a/data/simple-scan.gresource.xml b/data/simple-scan.gresource.xml
new file mode 100644
index 00000000..7d0c56e6
--- /dev/null
+++ b/data/simple-scan.gresource.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/SimpleScan">
+ <file preprocess="xml-stripblanks">ui/app-window.ui</file>
+ <file preprocess="xml-stripblanks">ui/preferences-dialog.ui</file>
+ <file preprocess="xml-stripblanks">ui/authorize-dialog.ui</file>
+ <file preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/help-overlay.ui</file>
+
+ <file preprocess="xml-stripblanks">icons/scalable/actions/scan-type-adf-symbolic.svg</file>
+ <file preprocess="xml-stripblanks">icons/scalable/actions/scan-type-batch-symbolic.svg</file>
+ </gresource>
+</gresources>
diff --git a/src/app-window.ui b/data/ui/app-window.ui
similarity index 100%
rename from src/app-window.ui
rename to data/ui/app-window.ui
diff --git a/src/authorize-dialog.ui b/data/ui/authorize-dialog.ui
similarity index 100%
rename from src/authorize-dialog.ui
rename to data/ui/authorize-dialog.ui
diff --git a/src/help-overlay.ui b/data/ui/help-overlay.ui
similarity index 100%
rename from src/help-overlay.ui
rename to data/ui/help-overlay.ui
diff --git a/src/preferences-dialog.ui b/data/ui/preferences-dialog.ui
similarity index 100%
rename from src/preferences-dialog.ui
rename to data/ui/preferences-dialog.ui
diff --git a/src/app-window.vala b/src/app-window.vala
index f651e715..6c619129 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -13,7 +13,7 @@
private const int DEFAULT_TEXT_DPI = 150;
private const int DEFAULT_PHOTO_DPI = 300;
-[GtkTemplate (ui = "/org/gnome/SimpleScan/app-window.ui")]
+[GtkTemplate (ui = "/org/gnome/SimpleScan/ui/app-window.ui")]
public class AppWindow : Gtk.ApplicationWindow
{
private const GLib.ActionEntry[] action_entries =
diff --git a/src/authorize-dialog.vala b/src/authorize-dialog.vala
index a6e5ab00..3b61e00f 100644
--- a/src/authorize-dialog.vala
+++ b/src/authorize-dialog.vala
@@ -10,7 +10,7 @@
* license.
*/
-[GtkTemplate (ui = "/org/gnome/SimpleScan/authorize-dialog.ui")]
+[GtkTemplate (ui = "/org/gnome/SimpleScan/ui/authorize-dialog.ui")]
private class AuthorizeDialog : Gtk.Dialog
{
[GtkChild]
diff --git a/src/meson.build b/src/meson.build
index 419ed067..a2c5adea 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,7 +1,3 @@
-resources = gnome.compile_resources ('resources', 'simple-scan.gresource.xml',
- source_dir: '.',
- c_name: 'resources')
-
vala_args = [ '--pkg=posix', '--vapidir=' + meson.current_source_dir () ]
dependencies = [ glib_dep, gtk_dep, zlib_dep, cairo_dep, gdk_pixbuf_dep, gusb_dep, sane_dep ]
if colord_dep.found ()
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 6a0e7b7b..ee3d031b 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -10,7 +10,7 @@
* license.
*/
-[GtkTemplate (ui = "/org/gnome/SimpleScan/preferences-dialog.ui")]
+[GtkTemplate (ui = "/org/gnome/SimpleScan/ui/preferences-dialog.ui")]
private class PreferencesDialog : Gtk.Dialog
{
private Settings settings;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]