diff --git a/src/cartridges.gresource.xml b/data/cartridges.gresource.xml similarity index 75% rename from src/cartridges.gresource.xml rename to data/cartridges.gresource.xml index 26d71c0..89d5a9b 100644 --- a/src/cartridges.gresource.xml +++ b/data/cartridges.gresource.xml @@ -1,10 +1,10 @@ - window.ui + gtk/window.ui gtk/help-overlay.ui gtk/game.ui gtk/preferences.ui - assets/library_placeholder.svg + library_placeholder.svg diff --git a/src/gtk/game.blp b/data/gtk/game.blp similarity index 100% rename from src/gtk/game.blp rename to data/gtk/game.blp diff --git a/src/gtk/help-overlay.blp b/data/gtk/help-overlay.blp similarity index 100% rename from src/gtk/help-overlay.blp rename to data/gtk/help-overlay.blp diff --git a/src/gtk/preferences.blp b/data/gtk/preferences.blp similarity index 100% rename from src/gtk/preferences.blp rename to data/gtk/preferences.blp diff --git a/src/window.blp b/data/gtk/window.blp similarity index 100% rename from src/window.blp rename to data/gtk/window.blp diff --git a/src/assets/library_placeholder.svg b/data/library_placeholder.svg similarity index 100% rename from src/assets/library_placeholder.svg rename to data/library_placeholder.svg diff --git a/data/meson.build b/data/meson.build index 67488af..b57150e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,3 +1,22 @@ +blueprints = custom_target('blueprints', + input: files( + 'gtk/help-overlay.blp', + 'gtk/window.blp', + 'gtk/game.blp', + 'gtk/preferences.blp' + ), + output: '.', + command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], +) + +gnome.compile_resources('cartridges', + 'cartridges.gresource.xml', + gresource_bundle: true, + install: true, + install_dir: pkgdatadir, + dependencies: blueprints, +) + desktop_file = i18n.merge_file( input: 'hu.kramo.Cartridges.desktop.in', output: 'hu.kramo.Cartridges.desktop', diff --git a/meson.build b/meson.build index 0cc1813..ed5e3f3 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project('cartridges', i18n = import('i18n') gnome = import('gnome') - +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) subdir('data') subdir('src') diff --git a/src/meson.build b/src/meson.build index be9faba..78d6144 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,25 +1,4 @@ -pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) moduledir = join_paths(pkgdatadir, 'cartridges') -gnome = import('gnome') - -blueprints = custom_target('blueprints', - input: files( - 'gtk/help-overlay.blp', - 'window.blp', - 'gtk/game.blp', - 'gtk/preferences.blp' - ), - output: '.', - command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], -) - -gnome.compile_resources('cartridges', - 'cartridges.gresource.xml', - gresource_bundle: true, - install: true, - install_dir: pkgdatadir, - dependencies: blueprints, -) python = import('python') diff --git a/src/window.py b/src/window.py index 74d55d2..0c85672 100644 --- a/src/window.py +++ b/src/window.py @@ -26,7 +26,7 @@ from .get_cover import get_cover from .get_games import get_games from .save_games import save_games -@Gtk.Template(resource_path="/hu/kramo/Cartridges/window.ui") +@Gtk.Template(resource_path="/hu/kramo/Cartridges/gtk/window.ui") class CartridgesWindow(Adw.ApplicationWindow): __gtype_name__ = "CartridgesWindow" @@ -79,7 +79,7 @@ class CartridgesWindow(Adw.ApplicationWindow): self.overview.set_clip_overlay(self.overview_box, False) self.schema = Gio.Settings.new("hu.kramo.Cartridges") - self.placeholder_pixbuf = GdkPixbuf.Pixbuf.new_from_resource_at_scale("/hu/kramo/Cartridges/assets/library_placeholder.svg", 200, 300, False) + self.placeholder_pixbuf = GdkPixbuf.Pixbuf.new_from_resource_at_scale("/hu/kramo/Cartridges/library_placeholder.svg", 200, 300, False) games = get_games() for game in games: if "removed" in games[game].keys():