Rename to Cartridges

This commit is contained in:
kramo
2023-02-01 16:34:26 +01:00
parent de4fd79144
commit a9a5a1d3c2
28 changed files with 70 additions and 71 deletions

View File

@@ -1,8 +1,8 @@
<div align="center">
<img src="data/icons/hicolor/scalable/apps/hu.kramo.GameShelf.svg" width="128" height="128">
<img src="data/icons/hicolor/scalable/apps/hu.kramo.Cartridges.svg" width="128" height="128">
# Game Shelf
# Cartridges
A GTK4 + Libadwaita game launcher
<img src="data/screenshot.webp">
@@ -10,7 +10,7 @@
## The Project
Game Shelf is a simple game launcher written in Python using GTK4 + Libadwaita.
Cartridges is a simple game launcher written in Python using GTK4 + Libadwaita.
### Features
- Manually adding and editing games
- Importing games from Steam and Heroic
@@ -31,7 +31,7 @@ Game Shelf is a simple game launcher written in Python using GTK4 + Libadwaita.
### From Releases
1. Install `org.gnome.Platform` from the [gnome-nightly repository](https://wiki.gnome.org/Apps/Nightly) if needed.
2. Download the latest release from Releases.
3. Install it via GNOME Software or `flatpak install hu.kramo.GameShelf.flatpak`.
3. Install it via GNOME Software or `flatpak install hu.kramo.Cartridges.flatpak`.
### From GNOME Builder
Click the down arrow next to the hammer at the top of your GNOME Builder window, then click "Export". This will create a flatpak that then can be installed on your system.
@@ -45,6 +45,6 @@ Fork the repository, make your changes, then create a pull request.
Currently, translations can be added manually with the following steps:
1. Clone the repository.
2. If it isn't already there, add your language to `/po/LINGUAS`.
3. Create a new translation from the `/po/gameshelf.pot` file with a program such as [Poedit](https://poedit.net/).
3. Create a new translation from the `/po/cartridges.pot` file with a program such as [Poedit](https://poedit.net/).
4. Save the file as `[YOUR LANGUAGE CODE].po` to `/po/`.
5. Create a pull request with your translations.

View File

@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Game Shelf
Exec=gameshelf
Icon=hu.kramo.GameShelf
Name=Cartridges
Exec=cartridges
Icon=hu.kramo.Cartridges
Terminal=false
Type=Application
Categories=Game;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="gameshelf">
<schema id="hu.kramo.GameShelf" path="/hu/kramo/GameShelf/">
<schemalist gettext-domain="cartridges">
<schema id="hu.kramo.Cartridges" path="/hu/kramo/Cartridges/">
<key name="exit-after-launch" type="b">
<default>false</default>
</key>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>hu.kramo.GameShelf.desktop</id>
<id>hu.kramo.Cartridges.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Game Shelf</name>
<name>Cartridges</name>
<summary>Launch all your games</summary>
<description>
<p>Game Shelf is a simple game launcher. It has support for importing your games from Steam and Heroic with organizational features such as hiding and sorting by date added or last played.</p>
<p>Cartridges is a simple game launcher. It has support for importing your games from Steam and Heroic with organizational features such as hiding and sorting by date added or last played.</p>
</description>
<launchable type="desktop-id">hu.kramo.GameShelf.desktop</launchable>
<launchable type="desktop-id">hu.kramo.Cartridges.desktop</launchable>
<developer_name>kramo</developer_name>
</component>

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

View File

@@ -1,4 +1,4 @@
application_id = 'hu.kramo.GameShelf'
application_id = 'hu.kramo.Cartridges'
scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(

View File

@@ -1,6 +1,6 @@
desktop_file = i18n.merge_file(
input: 'hu.kramo.GameShelf.desktop.in',
output: 'hu.kramo.GameShelf.desktop',
input: 'hu.kramo.Cartridges.desktop.in',
output: 'hu.kramo.Cartridges.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
@@ -13,8 +13,8 @@ if desktop_utils.found()
endif
appstream_file = i18n.merge_file(
input: 'hu.kramo.GameShelf.metainfo.xml.in',
output: 'hu.kramo.GameShelf.metainfo.xml',
input: 'hu.kramo.Cartridges.metainfo.xml.in',
output: 'hu.kramo.Cartridges.metainfo.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
@@ -25,7 +25,7 @@ if appstream_util.found()
test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
endif
install_data('hu.kramo.GameShelf.gschema.xml',
install_data('hu.kramo.Cartridges.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)

View File

@@ -1,9 +1,9 @@
{
"app-id" : "hu.kramo.GameShelf",
"app-id" : "hu.kramo.Cartridges",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "gameshelf",
"command" : "cartridges",
"finish-args" : [
"--share=ipc",
"--socket=fallback-x11",
@@ -27,7 +27,7 @@
],
"modules" : [
{
"name" : "gameshelf",
"name" : "cartridges",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [

View File

@@ -1,4 +1,4 @@
project('gameshelf',
project('cartridges',
version: '0.1.1',
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2', 'werror=false', ],

View File

@@ -68,7 +68,7 @@ msgid "Games you hide will appear here."
msgstr ""
#: src/window.blp:29
msgid "Game Shelf"
msgid "Cartridges"
msgstr ""
#: src/window.blp:52
@@ -124,7 +124,7 @@ msgid "Keyboard Shortcuts"
msgstr ""
#: src/window.blp:351
msgid "About Game Shelf"
msgid "About Cartridges"
msgstr ""
#: src/window.blp:360

View File

@@ -69,7 +69,7 @@ msgid "Games you hide will appear here."
msgstr "A rejtett játékaid itt lesznek megtalálhatók."
#: src/window.blp:29
msgid "Game Shelf"
msgid "Cartridges"
msgstr "Játékpolc"
#: src/window.blp:52
@@ -125,7 +125,7 @@ msgid "Keyboard Shortcuts"
msgstr "Billentyűparancsok"
#: src/window.blp:351
msgid "About Game Shelf"
msgid "About Cartridges"
msgstr "A Játékpolcról"
#: src/window.blp:360

View File

@@ -1 +1 @@
i18n.gettext('gameshelf', preset: 'glib')
i18n.gettext('cartridges', preset: 'glib')

View File

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

View File

@@ -1,6 +1,6 @@
#!@PYTHON@
# gameshelf.in
# cartridges.in
#
# Copyright 2022 kramo
#
@@ -31,16 +31,16 @@ localedir = '@localedir@'
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
locale.bindtextdomain('gameshelf', localedir)
locale.textdomain('gameshelf')
gettext.install('gameshelf', localedir)
locale.bindtextdomain('cartridges', localedir)
locale.textdomain('cartridges')
gettext.install('cartridges', localedir)
if __name__ == '__main__':
import gi
from gi.repository import Gio
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'gameshelf.gresource'))
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'cartridges.gresource'))
resource._register()
from gameshelf import main
from cartridges import main
sys.exit(main.main(VERSION))

View File

@@ -19,7 +19,7 @@
from gi.repository import Gtk
@Gtk.Template(resource_path='/hu/kramo/GameShelf/gtk/game.ui')
@Gtk.Template(resource_path='/hu/kramo/Cartridges/gtk/game.ui')
class game(Gtk.Box):
__gtype_name__ = 'game'

View File

@@ -24,7 +24,7 @@ gi.require_version("Adw", "1")
from gi.repository import Gtk, Gio, GLib, Adw
from .window import GameShelfWindow
from .window import CartridgesWindow
from .preferences import PreferencesWindow
from .toggle_hidden import toggle_hidden
from .save_games import save_games
@@ -33,9 +33,9 @@ from .steam_parser import steam_parser
from .heroic_parser import heroic_parser
from .create_details_window import create_details_window
class GameShelfApplication(Adw.Application):
class CartridgesApplication(Adw.Application):
def __init__(self):
super().__init__(application_id="hu.kramo.GameShelf", flags=Gio.ApplicationFlags.FLAGS_NONE)
super().__init__(application_id="hu.kramo.Cartridges", flags=Gio.ApplicationFlags.FLAGS_NONE)
self.create_action("quit", self.on_quit_action, ["<primary>q"])
self.create_action("about", self.on_about_action)
self.create_action("preferences", self.on_preferences_action)
@@ -52,7 +52,7 @@ class GameShelfApplication(Adw.Application):
# Create the main window
win = self.props.active_window
if not win:
win = GameShelfWindow(application=self)
win = CartridgesWindow(application=self)
win.present()
@@ -70,8 +70,8 @@ class GameShelfApplication(Adw.Application):
def on_about_action(self, widget, callback=None):
about = Adw.AboutWindow(transient_for=self.props.active_window,
application_name="Game Shelf",
application_icon="hu.kramo.GameShelf",
application_name="Cartridges",
application_icon="hu.kramo.Cartridges",
developer_name="kramo",
version="0.1.1",
developers=["kramo"],
@@ -119,7 +119,7 @@ class GameShelfApplication(Adw.Application):
# Add "removed=True" to the game properties so it can be deleted on next init
game_id = self.props.active_window.active_game_id
open_file = open(os.path.join(os.path.join(os.environ.get("XDG_DATA_HOME"), "games", game_id + ".json")), "r")
open_file = open(os.path.join(os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games", game_id + ".json")), "r")
data = json.loads(open_file.read())
open_file.close()
data["removed"] = True
@@ -153,6 +153,6 @@ class GameShelfApplication(Adw.Application):
self.set_accels_for_action(f"win.{name}", shortcuts)
def main(version):
app = GameShelfApplication()
app = CartridgesApplication()
return app.run(sys.argv)

View File

@@ -1,5 +1,5 @@
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'gameshelf')
moduledir = join_paths(pkgdatadir, 'cartridges')
gnome = import('gnome')
blueprints = custom_target('blueprints',
@@ -13,8 +13,8 @@ blueprints = custom_target('blueprints',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
gnome.compile_resources('gameshelf',
'gameshelf.gresource.xml',
gnome.compile_resources('cartridges',
'cartridges.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
@@ -30,14 +30,14 @@ conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
configure_file(
input: 'gameshelf.in',
output: 'gameshelf',
input: 'cartridges.in',
output: 'cartridges',
configuration: conf,
install: true,
install_dir: get_option('bindir')
)
gameshelf_sources = [
cartridges_sources = [
'__init__.py',
'main.py',
'window.py',
@@ -55,4 +55,4 @@ gameshelf_sources = [
'utils/create_details_window.py'
]
install_data(gameshelf_sources, install_dir: moduledir)
install_data(cartridges_sources, install_dir: moduledir)

View File

@@ -19,7 +19,7 @@
from gi.repository import Adw, Gtk, Gio, GLib
@Gtk.Template(resource_path='/hu/kramo/GameShelf/gtk/preferences.ui')
@Gtk.Template(resource_path='/hu/kramo/Cartridges/gtk/preferences.ui')
class PreferencesWindow(Adw.PreferencesWindow):
__gtype_name__ = 'PreferencesWindow'

View File

@@ -131,7 +131,6 @@ def create_details_window(parent_widget, game_id = None):
values = {}
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "games")
final_name = name.get_buffer().get_text()
final_executable = executable.get_buffer().get_text()

View File

@@ -21,7 +21,7 @@ def get_cover(game, parent_widget):
from gi.repository import GdkPixbuf
import os
cover_path = os.path.join(os.environ.get("XDG_DATA_HOME"), "covers", game["game_id"] + ".dat")
cover_path = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "covers", game["game_id"] + ".dat")
if os.path.isfile(cover_path) == False:
return parent_widget.placeholder_pixbuf

View File

@@ -20,7 +20,7 @@
def get_games():
import os, json
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "games")
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games")
games = {}
if os.path.exists(games_dir) == False:

View File

@@ -24,5 +24,5 @@ def run_command(parent_widget, executable):
subprocess.Popen(["flatpak-spawn --host " + executable], shell=True, start_new_session=True)
if Gio.Settings.new("hu.kramo.GameShelf").get_boolean("exit-after-launch") == True:
if Gio.Settings.new("hu.kramo.Cartridges").get_boolean("exit-after-launch") == True:
sys.exit()

View File

@@ -21,7 +21,7 @@ def save_cover(game, parent_widget, file_path, pixbuf = None, game_id = None):
from gi.repository import GdkPixbuf
import os
covers_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "covers")
covers_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "covers")
if os.path.exists(covers_dir) == False:
os.makedirs(covers_dir)

View File

@@ -19,7 +19,7 @@
def save_games(games):
import os, json
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "games")
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games")
existing = []
if os.path.exists(games_dir) == False:

View File

@@ -19,7 +19,7 @@
def toggle_hidden(game):
import os, json
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "games")
games_dir = os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games")
if os.path.exists(games_dir) == False:
return

View File

@@ -25,8 +25,8 @@ Adw.StatusPage hidden_notice_empty {
valign: center;
}
template GameShelfWindow : Adw.ApplicationWindow {
title: _("Game Shelf");
template CartridgesWindow : Adw.ApplicationWindow {
title: _("Cartridges");
default-width: 1110;
default-height: 820;
@@ -348,7 +348,7 @@ menu primary_menu {
}
item {
label: _("About Game Shelf");
label: _("About Cartridges");
action: "app.about";
}
}

View File

@@ -26,9 +26,9 @@ from .get_cover import get_cover
from .get_games import get_games
from .save_games import save_games
@Gtk.Template(resource_path="/hu/kramo/GameShelf/window.ui")
class GameShelfWindow(Adw.ApplicationWindow):
__gtype_name__ = "GameShelfWindow"
@Gtk.Template(resource_path="/hu/kramo/Cartridges/window.ui")
class CartridgesWindow(Adw.ApplicationWindow):
__gtype_name__ = "CartridgesWindow"
toast_overlay = Gtk.Template.Child()
stack = Gtk.Template.Child()
@@ -77,14 +77,14 @@ class GameShelfWindow(Adw.ApplicationWindow):
self.overview.set_measure_overlay(self.overview_box, True)
self.overview.set_clip_overlay(self.overview_box, False)
self.schema = Gio.Settings.new("hu.kramo.GameShelf")
self.placeholder_pixbuf = GdkPixbuf.Pixbuf.new_from_resource_at_scale("/hu/kramo/GameShelf/assets/library_placeholder.svg", 200, 300, 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)
games = get_games()
for game in games:
if "removed" in games[game].keys():
os.remove(os.path.join(os.environ.get("XDG_DATA_HOME"), "games", game + ".json"))
os.remove(os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games", game + ".json"))
try:
os.remove(os.path.join(os.environ.get("XDG_DATA_HOME"), "covers", game + ".dat"))
os.remove(os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "covers", game + ".dat"))
except FileNotFoundError:
pass
@@ -374,7 +374,7 @@ class GameShelfWindow(Adw.ApplicationWindow):
game_id = list(self.toasts)[-1]
except IndexError:
return
open_file = open(os.path.join(os.path.join(os.environ.get("XDG_DATA_HOME"), "games", game_id + ".json")), "r")
open_file = open(os.path.join(os.path.join(os.environ.get("XDG_DATA_HOME"), "cartridges", "games", game_id + ".json")), "r")
data = json.loads(open_file.read())
open_file.close()
data.pop("removed")