Update project structure

This commit is contained in:
kramo
2023-02-19 20:06:45 +01:00
parent e87e96f3c6
commit a0a67fd2ca
10 changed files with 24 additions and 26 deletions

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/hu/kramo/Cartridges"> <gresource prefix="/hu/kramo/Cartridges">
<file preprocess="xml-stripblanks">window.ui</file> <file preprocess="xml-stripblanks">gtk/window.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file> <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">gtk/game.ui</file> <file preprocess="xml-stripblanks">gtk/game.ui</file>
<file preprocess="xml-stripblanks">gtk/preferences.ui</file> <file preprocess="xml-stripblanks">gtk/preferences.ui</file>
<file>assets/library_placeholder.svg</file> <file>library_placeholder.svg</file>
</gresource> </gresource>
</gresources> </gresources>

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -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( desktop_file = i18n.merge_file(
input: 'hu.kramo.Cartridges.desktop.in', input: 'hu.kramo.Cartridges.desktop.in',
output: 'hu.kramo.Cartridges.desktop', output: 'hu.kramo.Cartridges.desktop',

View File

@@ -7,7 +7,7 @@ project('cartridges',
i18n = import('i18n') i18n = import('i18n')
gnome = import('gnome') gnome = import('gnome')
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
subdir('data') subdir('data')
subdir('src') subdir('src')

View File

@@ -1,25 +1,4 @@
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'cartridges') 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') python = import('python')

View File

@@ -26,7 +26,7 @@ from .get_cover import get_cover
from .get_games import get_games from .get_games import get_games
from .save_games import save_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): class CartridgesWindow(Adw.ApplicationWindow):
__gtype_name__ = "CartridgesWindow" __gtype_name__ = "CartridgesWindow"
@@ -79,7 +79,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
self.overview.set_clip_overlay(self.overview_box, False) self.overview.set_clip_overlay(self.overview_box, False)
self.schema = Gio.Settings.new("hu.kramo.Cartridges") 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() games = get_games()
for game in games: for game in games:
if "removed" in games[game].keys(): if "removed" in games[game].keys():