Compare commits

..

12 Commits

Author SHA1 Message Date
kramo
6f69344a16 v1.5.4 2023-05-27 17:54:43 +02:00
kramo
63951d76ac Fix custom path check logic 2023-05-27 17:53:08 +02:00
kramo
c045ad1f53 Fix prefix formatting 2023-05-27 17:01:18 +02:00
kramo
8a1e00883c Fix gresource prefix 2023-05-27 16:21:31 +02:00
kramo
620a094ff0 v1.5.3 2023-05-27 16:06:43 +02:00
kramo
7b7232d741 Fix flatpak manifest path 2023-05-27 15:14:14 +02:00
kramo
4c1af9245f Update build configuration 2023-05-27 15:11:03 +02:00
kramo
d05a03dee7 Fix custom install locations check logic 2023-05-27 14:03:09 +02:00
kramo
bff225572e v1.5.2 2023-05-27 09:14:36 +02:00
kramo
ac3f3133d9 Use yaml.safe_load for Bottles import 2023-05-27 09:02:53 +02:00
kramo
bda487f26e Fix Steam API response handling - fixes #101 2023-05-27 09:00:29 +02:00
kramo
4711652b4a Set fallback icon-name - fixes #100 2023-05-27 08:58:07 +02:00
32 changed files with 291 additions and 173 deletions

View File

@@ -14,6 +14,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with: with:
bundle: hu.kramo.Cartridges.flatpak bundle: hu.kramo.Cartridges.Devel.flatpak
manifest-path: hu.kramo.Cartridges.json manifest-path: flatpak/hu.kramo.Cartridges.Devel.json
cache-key: flatpak-builder-${{ github.sha }} cache-key: flatpak-builder-${{ github.sha }}

View File

@@ -24,9 +24,9 @@ jobs:
pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-meson git pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-meson git
find /ucrt64/share/locale/ -type f ! -name "*cartridges.mo" -delete find /ucrt64/share/locale/ -type f ! -name "*cartridges.mo" -delete
- name: "Inno Setup" - name: "Inno Setup"
run: iscc ".\.windows\Cartridges.iss" run: iscc ".\windows\Cartridges.iss"
- name: "Upload Artifact" - name: "Upload Artifact"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: "Installer" name: "Installer"
path: ".windows/Output/Cartridges Setup.exe" path: "windows/Output/Cartridges Setup.exe"

View File

@@ -53,15 +53,12 @@ For updates and questions, join our [Discord server][discord-url]!
## Linux ## Linux
### Flathub (Recommended) ### Flathub
The app is available on Flathub.
<a href=https://flathub.org/apps/hu.kramo.Cartridges><img width='240' alt='Download on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-en.png'/></a> <a href=https://flathub.org/apps/hu.kramo.Cartridges><img width='240' alt='Download on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-en.png'/></a>
### From Releases
1. Download the latest release from [Releases](https://github.com/kra-mo/cartridges/releases).
2. Install the downloaded file via GNOME Software or `flatpak install hu.kramo.Cartridges.flatpak`.
## Windows ## Windows
### From Releases ### From Releases

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/hu/kramo/Cartridges"> <gresource prefix="@PREFIX@">
<file preprocess="xml-stripblanks">gtk/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>

View File

@@ -18,7 +18,6 @@ Adw.StatusPage hidden_notice_no_results {
} }
Adw.StatusPage notice_empty { Adw.StatusPage notice_empty {
icon-name: "hu.kramo.Cartridges-symbolic";
title: _("No Games"); title: _("No Games");
description: _("Use the + button to add games."); description: _("Use the + button to add games.");
vexpand: true; vexpand: true;

View File

@@ -3,7 +3,7 @@ Name=Cartridges
GenericName=Game Launcher GenericName=Game Launcher
Comment=Launch all your games Comment=Launch all your games
Exec=cartridges Exec=cartridges
Icon=hu.kramo.Cartridges Icon=@APP_ID@
Terminal=false Terminal=false
Type=Application Type=Application
Categories=GNOME;GTK;Game; Categories=GNOME;GTK;Game;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="cartridges"> <schemalist gettext-domain="cartridges">
<schema id="hu.kramo.Cartridges" path="/hu/kramo/Cartridges/"> <schema id="@APP_ID@" path="@PREFIX@/">
<key name="exit-after-launch" type="b"> <key name="exit-after-launch" type="b">
<default>false</default> <default>false</default>
</key> </key>
@@ -68,7 +68,7 @@
<default>false</default> <default>false</default>
</key> </key>
</schema> </schema>
<schema id="hu.kramo.Cartridges.State" path="/hu/kramo/Cartridges/State/"> <schema id="@APP_ID@.State" path="@PREFIX@/State/">
<key name="width" type="i"> <key name="width" type="i">
<default>1110</default> <default>1110</default>
</key> </key>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application"> <component type="desktop-application">
<id>hu.kramo.Cartridges.desktop</id> <id>@APP_ID@.desktop</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license> <project_license>GPL-3.0-or-later</project_license>
<name>Cartridges</name> <name>Cartridges</name>
@@ -15,7 +15,7 @@
<url type="vcs-browser">https://github.com/kra-mo/cartridges</url> <url type="vcs-browser">https://github.com/kra-mo/cartridges</url>
<url type="contribute">https://github.com/kra-mo/cartridges/blob/main/CONTRIBUTING.md</url> <url type="contribute">https://github.com/kra-mo/cartridges/blob/main/CONTRIBUTING.md</url>
<developer_name translatable="no">kramo</developer_name> <developer_name translatable="no">kramo</developer_name>
<launchable type="desktop-id">hu.kramo.Cartridges.desktop</launchable> <launchable type="desktop-id">@APP_ID@.desktop</launchable>
<supports> <supports>
<control>pointing</control> <control>pointing</control>
<control>keyboard</control> <control>keyboard</control>
@@ -44,10 +44,11 @@
</screenshots> </screenshots>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="1.5.1" date="2023-05-26"> <release version="1.5.4" date="2023-05-27">
<description translatable="no"> <description translatable="no">
<ul> <ul>
<li>Fixes an issue with search</li> <li>Fixes a bug with custom install locations</li>
<li>Fixes a potential bug with deleted Steam libraries</li>
<li>Translations since 1.5</li> <li>Translations since 1.5</li>
</ul> </ul>
</description> </description>

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="9" x2="119" y1="115" y2="115">
<stop offset="0" stop-color="#613583"/>
<stop offset="0.05" stop-color="#9141ac"/>
<stop offset="0.22" stop-color="#613583"/>
<stop offset="0.78" stop-color="#613583"/>
<stop offset="0.95" stop-color="#9141ac"/>
<stop offset="1" stop-color="#613583"/>
</linearGradient>
<linearGradient id="b" gradientUnits="userSpaceOnUse" x1="45" x2="45" y1="50" y2="82">
<stop offset="0" stop-color="#bdd0d5"/>
<stop offset="1" stop-color="#305749"/>
</linearGradient>
<clipPath id="c">
<rect height="128" width="128"/>
</clipPath>
<clipPath id="d">
<rect height="128" width="128"/>
</clipPath>
<filter id="e" height="100%" width="100%" x="0%" y="0%">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
</filter>
<mask id="f">
<g clip-path="url(#d)" filter="url(#e)">
<g clip-path="url(#c)">
<path d="m 111 29 h -94 c -4.417969 0 -8 3.582031 -8 8 v 70 c 0 4.417969 3.582031 8 8 8 h 94 c 4.417969 0 8 -3.582031 8 -8 v -70 c 0 -4.417969 -3.582031 -8 -8 -8 z m 0 0" fill="url(#a)"/>
<path d="m 111 29 h -94 c -4.417969 0 -8 3.679688 -8 8.222656 v 57.554688 c 0 4.539062 3.582031 8.222656 8 8.222656 h 94 c 4.417969 0 8 -3.679688 8 -8.222656 v -57.554688 c 0 -4.539062 -3.582031 -8.222656 -8 -8.222656 z m 0 0" fill="#c061cb"/>
<path d="m 84 42 h -40 c -2.210938 0 -4 1.789062 -4 4 v 40 c 0 2.210938 1.789062 4 4 4 h 40 c 2.210938 0 4 -1.789062 4 -4 v -40 c 0 -2.210938 -1.789062 -4 -4 -4 z m 0 0"/>
<path d="m 81 50 h -34 c -1.105469 0 -2 0.894531 -2 2 v 28 c 0 1.105469 0.894531 2 2 2 h 34 c 1.105469 0 2 -0.894531 2 -2 v -28 c 0 -1.105469 -0.894531 -2 -2 -2 z m 0 0" fill="url(#b)"/>
<path d="m 102 61 v -1 c 0 -2.761719 -2.238281 -5 -5 -5 s -5 2.238281 -5 5 v 1 c 0 2.761719 2.238281 5 5 5 s 5 -2.238281 5 -5 z m 12 -6 v -1 c 0 -2.761719 -2.238281 -5 -5 -5 s -5 2.238281 -5 5 v 1 c 0 2.761719 2.238281 5 5 5 s 5 -2.238281 5 -5 z m 0 0"/>
<path d="m 97 64 c 2.761719 0 5 -2.015625 5 -4.5 s -2.238281 -4.5 -5 -4.5 s -5 2.015625 -5 4.5 s 2.238281 4.5 5 4.5 z m 12 -6 c 2.761719 0 5 -2.015625 5 -4.5 s -2.238281 -4.5 -5 -4.5 s -5 2.015625 -5 4.5 s 2.238281 4.5 5 4.5 z m 0 0" fill="#3d3846"/>
<path d="m 29 56.5 c 0 -1.933594 -1.566406 -3.5 -3.5 -3.5 s -3.5 1.566406 -3.5 3.5 v 13 c 0 1.933594 1.566406 3.5 3.5 3.5 s 3.5 -1.566406 3.5 -3.5 z m 0 0"/>
<path d="m 33 58 h -15 c -1.65625 0 -3 1.34375 -3 3 v 2 c 0 1.65625 1.34375 3 3 3 h 15 c 1.65625 0 3 -1.34375 3 -3 v -2 c 0 -1.65625 -1.34375 -3 -3 -3 z m 0 0"/>
<path d="m 29 54.5 c 0 -1.933594 -1.566406 -3.5 -3.5 -3.5 s -3.5 1.566406 -3.5 3.5 v 13 c 0 1.933594 1.566406 3.5 3.5 3.5 s 3.5 -1.566406 3.5 -3.5 z m 0 0" fill="#3d3846"/>
<path d="m 33 58 h -15 c -1.65625 0 -3 1.34375 -3 3 s 1.34375 3 3 3 h 15 c 1.65625 0 3 -1.34375 3 -3 s -1.34375 -3 -3 -3 z m 0 0" fill="#3d3846"/>
<path d="m 71 109 c 0 -1.105469 0.894531 -2 2 -2 s 2 0.894531 2 2 s -0.894531 2 -2 2 s -2 -0.894531 -2 -2 z m 0 0"/>
<path d="m 71.0625 108.5 c 0.226562 0.882812 1.023438 1.503906 1.9375 1.503906 s 1.710938 -0.621094 1.9375 -1.503906 c 0.195312 0.757812 -0.066406 1.558594 -0.671875 2.050781 c -0.605469 0.492188 -1.445313 0.585938 -2.144531 0.242188 c -0.855469 -0.414063 -1.296875 -1.375 -1.058594 -2.292969 z m 0 0" fill="#9141ac"/>
<path d="m 66 107 h -10 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 10 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0"/>
<path d="m 54.0625 108.5 c -0.152344 0.597656 -0.023438 1.234375 0.355469 1.726562 c 0.378906 0.488282 0.964843 0.773438 1.582031 0.773438 h 10 c 0.617188 0 1.203125 -0.285156 1.582031 -0.773438 c 0.378907 -0.492187 0.511719 -1.128906 0.355469 -1.726562 c -0.226562 0.882812 -1.023438 1.5 -1.9375 1.5 h -10 c -0.914062 0 -1.710938 -0.617188 -1.9375 -1.5 z m 0 0" fill="#9141ac"/>
<path d="m 110 74 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 5 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 5 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 0" fill="#613583"/>
<path d="m 21.5 79 h -3 c -1.378906 0 -2.5 1.121094 -2.5 2.5 s 1.121094 2.5 2.5 2.5 h 3 c 1.378906 0 2.5 -1.121094 2.5 -2.5 s -1.121094 -2.5 -2.5 -2.5 z m 11 0 h -3 c -1.378906 0 -2.5 1.121094 -2.5 2.5 s 1.121094 2.5 2.5 2.5 h 3 c 1.378906 0 2.5 -1.121094 2.5 -2.5 s -1.121094 -2.5 -2.5 -2.5 z m 0 0"/>
<path d="m 22 79 h -4 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 4 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 11 0 h -4 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 4 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0" fill="#3d3846"/>
</g>
</g>
</mask>
<mask id="g">
<g filter="url(#e)">
<rect fill-opacity="0.8" height="128" width="128"/>
</g>
</mask>
<linearGradient id="h" gradientTransform="matrix(0 0.37 -0.98462 0 295.38501 -30.360001)" gradientUnits="userSpaceOnUse" x1="300" x2="428" y1="235" y2="235">
<stop offset="0" stop-color="#f9f06b"/>
<stop offset="1" stop-color="#f5c211"/>
</linearGradient>
<clipPath id="i">
<rect height="128" width="128"/>
</clipPath>
<clipPath id="j">
<rect height="128" width="128"/>
</clipPath>
<path d="m 111 29 h -94 c -4.417969 0 -8 3.582031 -8 8 v 70 c 0 4.417969 3.582031 8 8 8 h 94 c 4.417969 0 8 -3.582031 8 -8 v -70 c 0 -4.417969 -3.582031 -8 -8 -8 z m 0 0" fill="url(#a)"/>
<path d="m 111 29 h -94 c -4.417969 0 -8 3.679688 -8 8.222656 v 57.554688 c 0 4.539062 3.582031 8.222656 8 8.222656 h 94 c 4.417969 0 8 -3.679688 8 -8.222656 v -57.554688 c 0 -4.539062 -3.582031 -8.222656 -8 -8.222656 z m 0 0" fill="#c061cb"/>
<path d="m 84 42 h -40 c -2.210938 0 -4 1.789062 -4 4 v 40 c 0 2.210938 1.789062 4 4 4 h 40 c 2.210938 0 4 -1.789062 4 -4 v -40 c 0 -2.210938 -1.789062 -4 -4 -4 z m 0 0"/>
<path d="m 81 50 h -34 c -1.105469 0 -2 0.894531 -2 2 v 28 c 0 1.105469 0.894531 2 2 2 h 34 c 1.105469 0 2 -0.894531 2 -2 v -28 c 0 -1.105469 -0.894531 -2 -2 -2 z m 0 0" fill="url(#b)"/>
<path d="m 102 61 v -1 c 0 -2.761719 -2.238281 -5 -5 -5 s -5 2.238281 -5 5 v 1 c 0 2.761719 2.238281 5 5 5 s 5 -2.238281 5 -5 z m 12 -6 v -1 c 0 -2.761719 -2.238281 -5 -5 -5 s -5 2.238281 -5 5 v 1 c 0 2.761719 2.238281 5 5 5 s 5 -2.238281 5 -5 z m 0 0"/>
<path d="m 97 64 c 2.761719 0 5 -2.015625 5 -4.5 s -2.238281 -4.5 -5 -4.5 s -5 2.015625 -5 4.5 s 2.238281 4.5 5 4.5 z m 12 -6 c 2.761719 0 5 -2.015625 5 -4.5 s -2.238281 -4.5 -5 -4.5 s -5 2.015625 -5 4.5 s 2.238281 4.5 5 4.5 z m 0 0" fill="#3d3846"/>
<path d="m 29 56.5 c 0 -1.933594 -1.566406 -3.5 -3.5 -3.5 s -3.5 1.566406 -3.5 3.5 v 13 c 0 1.933594 1.566406 3.5 3.5 3.5 s 3.5 -1.566406 3.5 -3.5 z m 0 0"/>
<path d="m 33 58 h -15 c -1.65625 0 -3 1.34375 -3 3 v 2 c 0 1.65625 1.34375 3 3 3 h 15 c 1.65625 0 3 -1.34375 3 -3 v -2 c 0 -1.65625 -1.34375 -3 -3 -3 z m 0 0"/>
<path d="m 29 54.5 c 0 -1.933594 -1.566406 -3.5 -3.5 -3.5 s -3.5 1.566406 -3.5 3.5 v 13 c 0 1.933594 1.566406 3.5 3.5 3.5 s 3.5 -1.566406 3.5 -3.5 z m 0 0" fill="#3d3846"/>
<path d="m 33 58 h -15 c -1.65625 0 -3 1.34375 -3 3 s 1.34375 3 3 3 h 15 c 1.65625 0 3 -1.34375 3 -3 s -1.34375 -3 -3 -3 z m 0 0" fill="#3d3846"/>
<path d="m 71 109 c 0 -1.105469 0.894531 -2 2 -2 s 2 0.894531 2 2 s -0.894531 2 -2 2 s -2 -0.894531 -2 -2 z m 0 0"/>
<path d="m 71.0625 108.5 c 0.226562 0.882812 1.023438 1.503906 1.9375 1.503906 s 1.710938 -0.621094 1.9375 -1.503906 c 0.195312 0.757812 -0.066406 1.558594 -0.671875 2.050781 c -0.605469 0.492188 -1.445313 0.585938 -2.144531 0.242188 c -0.855469 -0.414063 -1.296875 -1.375 -1.058594 -2.292969 z m 0 0" fill="#9141ac"/>
<path d="m 66 107 h -10 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 10 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0"/>
<path d="m 54.0625 108.5 c -0.152344 0.597656 -0.023438 1.234375 0.355469 1.726562 c 0.378906 0.488282 0.964843 0.773438 1.582031 0.773438 h 10 c 0.617188 0 1.203125 -0.285156 1.582031 -0.773438 c 0.378907 -0.492187 0.511719 -1.128906 0.355469 -1.726562 c -0.226562 0.882812 -1.023438 1.5 -1.9375 1.5 h -10 c -0.914062 0 -1.710938 -0.617188 -1.9375 -1.5 z m 0 0" fill="#9141ac"/>
<path d="m 110 74 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 5 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 5 h -14 c -0.550781 0 -1 0.449219 -1 1 s 0.449219 1 1 1 h 14 c 0.550781 0 1 -0.449219 1 -1 s -0.449219 -1 -1 -1 z m 0 0" fill="#613583"/>
<path d="m 21.5 79 h -3 c -1.378906 0 -2.5 1.121094 -2.5 2.5 s 1.121094 2.5 2.5 2.5 h 3 c 1.378906 0 2.5 -1.121094 2.5 -2.5 s -1.121094 -2.5 -2.5 -2.5 z m 11 0 h -3 c -1.378906 0 -2.5 1.121094 -2.5 2.5 s 1.121094 2.5 2.5 2.5 h 3 c 1.378906 0 2.5 -1.121094 2.5 -2.5 s -1.121094 -2.5 -2.5 -2.5 z m 0 0"/>
<path d="m 22 79 h -4 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 4 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 11 0 h -4 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 h 4 c 1.105469 0 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0" fill="#3d3846"/>
<g clip-path="url(#j)" mask="url(#f)">
<g clip-path="url(#i)" mask="url(#g)">
<path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#h)"/>
<path d="m 13.308594 80.640625 l 47.355468 47.359375 h 21.214844 l -47.359375 -47.359375 z m 42.421875 0 l 47.363281 47.359375 h 21.214844 l -47.363282 -47.359375 z m 42.429687 0 l 29.839844 29.839844 v -21.210938 l -8.628906 -8.628906 z m -98.160156 7.90625 v 21.214844 l 18.238281 18.238281 h 21.214844 z m 0 0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 3C1.89543 3 1 3.89543 1 5V11C1 12.1046 1.89543 13 3 13H13C14.1046 13 15 12.1046 15 11V5C15 3.89543 14.1046 3 13 3H3ZM6 5C5.44772 5 5 5.44772 5 6V10C5 10.5523 5.44772 11 6 11H10C10.5523 11 11 10.5523 11 10V6C11 5.44772 10.5523 5 10 5H6ZM12 8C12 7.44772 12.4477 7 13 7C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9C12.4477 9 12 8.55228 12 8ZM3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 618 B

View File

@@ -1,13 +1,11 @@
application_id = 'hu.kramo.Cartridges'
scalable_dir = join_paths('hicolor', 'scalable', 'apps') scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data( install_data(
join_paths(scalable_dir, ('@0@.svg').format(application_id)), join_paths(scalable_dir, ('@0@.svg').format(app_id)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir) install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
) )
symbolic_dir = join_paths('hicolor', 'symbolic', 'apps') symbolic_dir = join_paths('hicolor', 'symbolic', 'apps')
install_data( install_data(
join_paths(symbolic_dir, ('@0@-symbolic.svg').format(application_id)), join_paths(symbolic_dir, ('@0@-symbolic.svg').format(app_id)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir) install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir)
) )

View File

@@ -11,7 +11,11 @@ blueprints = custom_target('blueprints',
) )
gnome.compile_resources('cartridges', gnome.compile_resources('cartridges',
'cartridges.gresource.xml', configure_file(
input: 'cartridges.gresource.xml.in',
output: 'cartridges.gresource.xml',
configuration: conf
),
gresource_bundle: true, gresource_bundle: true,
install: true, install: true,
install_dir: pkgdatadir, install_dir: pkgdatadir,
@@ -19,8 +23,12 @@ gnome.compile_resources('cartridges',
) )
desktop_file = i18n.merge_file( desktop_file = i18n.merge_file(
input: 'hu.kramo.Cartridges.desktop.in', input: configure_file(
output: 'hu.kramo.Cartridges.desktop', input: 'hu.kramo.Cartridges.desktop.in',
output: app_id + '.desktop.in',
configuration: conf
),
output: app_id + '.desktop',
type: 'desktop', type: 'desktop',
po_dir: '../po', po_dir: '../po',
install: true, install: true,
@@ -33,8 +41,12 @@ if desktop_utils.found()
endif endif
appstream_file = i18n.merge_file( appstream_file = i18n.merge_file(
input: 'hu.kramo.Cartridges.metainfo.xml.in', input: configure_file(
output: 'hu.kramo.Cartridges.metainfo.xml', input: 'hu.kramo.Cartridges.metainfo.xml.in',
output: app_id + '.metainfo.xml.in',
configuration: conf
),
output: app_id + '.metainfo.xml',
po_dir: '../po', po_dir: '../po',
install: true, install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo') install_dir: join_paths(get_option('datadir'), 'metainfo')
@@ -45,7 +57,12 @@ if appstream_util.found()
test('Validate appstream file', appstream_util, args: ['validate', appstream_file]) test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
endif endif
install_data('hu.kramo.Cartridges.gschema.xml', install_data(
configure_file(
input: 'hu.kramo.Cartridges.gschema.xml.in',
output: app_id + '.gschema.xml',
configuration: conf
),
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
) )

View File

@@ -1,5 +1,5 @@
{ {
"id" : "hu.kramo.Cartridges", "id" : "hu.kramo.Cartridges.Devel",
"runtime" : "org.gnome.Platform", "runtime" : "org.gnome.Platform",
"runtime-version" : "44", "runtime-version" : "44",
"sdk" : "org.gnome.Sdk", "sdk" : "org.gnome.Sdk",
@@ -117,10 +117,13 @@
"name" : "cartridges", "name" : "cartridges",
"builddir" : true, "builddir" : true,
"buildsystem" : "meson", "buildsystem" : "meson",
"config-opts": [
"-Dprofile=development"
],
"sources" : [ "sources" : [
{ {
"type" : "dir", "type" : "dir",
"path" : "." "path" : ".."
} }
] ]
} }

View File

@@ -1,14 +1,32 @@
project('cartridges', project('cartridges',
version: '1.5.1', version: '1.5.4',
meson_version: '>= 0.59.0', meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2', 'werror=false', ], default_options: [ 'warning_level=2', 'werror=false', ],
) )
i18n = import('i18n') i18n = import('i18n')
gnome = import('gnome') gnome = import('gnome')
python = import('python')
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
profile = get_option('profile')
if profile == 'development'
app_id = 'hu.kramo.Cartridges.Devel'
prefix = '/hu/kramo/Cartridges/Devel'
elif profile == 'release'
app_id = 'hu.kramo.Cartridges'
prefix = '/hu/kramo/Cartridges'
endif
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').full_path())
conf.set('APP_ID', app_id)
conf.set('PREFIX', prefix)
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
subdir('data') subdir('data')
subdir('src') subdir('src')
subdir('po') subdir('po')

9
meson_options.txt Normal file
View File

@@ -0,0 +1,9 @@
option(
'profile',
type: 'combo',
choices: [
'release',
'development',
],
value: 'release'
)

View File

@@ -1,5 +1,5 @@
data/hu.kramo.Cartridges.desktop.in data/hu.kramo.Cartridges.desktop.in
data/hu.kramo.Cartridges.gschema.xml data/hu.kramo.Cartridges.gschema.xml.in
data/hu.kramo.Cartridges.metainfo.xml.in data/hu.kramo.Cartridges.metainfo.xml.in
data/gtk/details_window.blp data/gtk/details_window.blp

View File

@@ -32,7 +32,7 @@ from .save_cover import resize_cover, save_cover
from .steamgriddb import SGDBSave from .steamgriddb import SGDBSave
@Gtk.Template(resource_path="/hu/kramo/Cartridges/gtk/details_window.ui") @Gtk.Template(resource_path=shared.PREFIX + "/gtk/details_window.ui")
class DetailsWindow(Adw.Window): class DetailsWindow(Adw.Window):
__gtype_name__ = "DetailsWindow" __gtype_name__ = "DetailsWindow"

View File

@@ -24,13 +24,13 @@ import subprocess
from pathlib import Path from pathlib import Path
from time import time from time import time
from gi.repository import Adw, Gio, Gtk from gi.repository import Adw, Gtk
from . import shared from . import shared
from .game_cover import GameCover from .game_cover import GameCover
@Gtk.Template(resource_path="/hu/kramo/Cartridges/gtk/game.ui") @Gtk.Template(resource_path=shared.PREFIX + "/gtk/game.ui")
class Game(Gtk.Box): class Game(Gtk.Box):
__gtype_name__ = "Game" __gtype_name__ = "Game"
@@ -65,7 +65,7 @@ class Game(Gtk.Box):
self.win = shared.win self.win = shared.win
self.app = self.win.get_application() self.app = self.win.get_application()
self.version = shared.spec_version self.version = shared.SPEC_VERSION
self.update_values(data) self.update_values(data)
@@ -189,7 +189,7 @@ class Game(Gtk.Box):
args = ( args = (
"flatpak-spawn --host /bin/sh -c " + shlex.quote(string) # Flatpak "flatpak-spawn --host /bin/sh -c " + shlex.quote(string) # Flatpak
if os.getenv("FLATPAK_ID") == "hu.kramo.Cartridges" if os.getenv("FLATPAK_ID") == shared.APP_ID
else string # Others else string # Others
) )
@@ -201,7 +201,7 @@ class Game(Gtk.Box):
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0,
) )
if Gio.Settings.new("hu.kramo.Cartridges").get_boolean("exit-after-launch"): if shared.schema.get_boolean("exit-after-launch"):
self.app.quit() self.app.quit()
# The variable is the title of the game # The variable is the title of the game

View File

@@ -20,6 +20,8 @@
from gi.repository import GdkPixbuf, Gio, GLib from gi.repository import GdkPixbuf, Gio, GLib
from PIL import Image, ImageFilter, ImageStat from PIL import Image, ImageFilter, ImageStat
from . import shared
class GameCover: class GameCover:
pixbuf = None pixbuf = None
@@ -30,7 +32,7 @@ class GameCover:
anim_iter = None anim_iter = None
placeholder_pixbuf = GdkPixbuf.Pixbuf.new_from_resource_at_scale( placeholder_pixbuf = GdkPixbuf.Pixbuf.new_from_resource_at_scale(
"/hu/kramo/Cartridges/library_placeholder.svg", 400, 600, False shared.PREFIX + "/library_placeholder.svg", 400, 600, False
) )
def __init__(self, pictures, path=None): def __init__(self, pictures, path=None):
@@ -91,7 +93,7 @@ class GameCover:
) )
else: else:
self.blurred = GdkPixbuf.Pixbuf.new_from_resource_at_scale( self.blurred = GdkPixbuf.Pixbuf.new_from_resource_at_scale(
"/hu/kramo/Cartridges/library_placeholder.svg", 2, 2, False shared.PREFIX + "/library_placeholder.svg", 2, 2, False
) )
self.luminance = (0.1, 0.8) self.luminance = (0.1, 0.8)

View File

@@ -28,22 +28,19 @@ from .check_install import check_install
def bottles_installed(path=None): def bottles_installed(path=None):
location_key = "bottles-location" location_key = "bottles-location"
bottles_dir = (
path if path else Path(shared.schema.get_string(location_key)).expanduser()
)
check = "library.yml" check = "library.yml"
if not (bottles_dir / check).is_file(): locations = (
locations = ( (path,)
(Path(),) if path
if path else (
else ( Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/com.usebottles.bottles/data/bottles", Path.home() / ".var/app/com.usebottles.bottles/data/bottles",
shared.data_dir / "bottles", shared.data_dir / "bottles",
)
) )
)
bottles_dir = check_install(check, locations, (shared.schema, location_key)) bottles_dir = check_install(check, locations, (shared.schema, location_key))
return bottles_dir return bottles_dir
@@ -57,7 +54,7 @@ def bottles_importer():
data = (bottles_dir / "library.yml").read_text("utf-8") data = (bottles_dir / "library.yml").read_text("utf-8")
library = yaml.load(data, Loader=yaml.Loader) library = yaml.safe_load(data)
importer = shared.importer importer = shared.importer
importer.total_queue += len(library) importer.total_queue += len(library)

View File

@@ -29,25 +29,22 @@ from .check_install import check_install
def heroic_installed(path=None): def heroic_installed(path=None):
location_key = "heroic-location" location_key = "heroic-location"
heroic_dir = (
path if path else Path(shared.schema.get_string(location_key)).expanduser()
)
check = "config.json" check = "config.json"
if not (heroic_dir / check).is_file(): locations = (
locations = ( (path,)
(Path(),) if path
if path else (
else ( Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/com.heroicgameslauncher.hgl/config/heroic", Path.home() / ".var/app/com.heroicgameslauncher.hgl/config/heroic",
shared.config_dir / "heroic", shared.config_dir / "heroic",
)
) )
)
if os.name == "nt" and not path: if os.name == "nt" and not path:
locations += (Path(os.getenv("appdata")) / "heroic",) locations += (Path(os.getenv("appdata")) / "heroic",)
heroic_dir = check_install(check, locations, (shared.schema, location_key)) heroic_dir = check_install(check, locations, (shared.schema, location_key))
return heroic_dir return heroic_dir
@@ -63,7 +60,7 @@ def heroic_importer():
# Import Epic games # Import Epic games
if not shared.schema.get_boolean("heroic-import-epic"): if not shared.schema.get_boolean("heroic-import-epic"):
pass pass
elif (heroic_dir / "store_cache" / "legendary_library.json").exists(): elif (heroic_dir / "store_cache" / "legendary_library.json").is_file():
library = json.load( library = json.load(
(heroic_dir / "store_cache" / "legendary_library.json").open() (heroic_dir / "store_cache" / "legendary_library.json").open()
) )
@@ -108,7 +105,7 @@ def heroic_importer():
).hexdigest() ).hexdigest()
) )
importer.save_game(values, image_path if image_path.exists() else None) importer.save_game(values, image_path if image_path.is_file() else None)
except KeyError: except KeyError:
pass pass
@@ -116,9 +113,9 @@ def heroic_importer():
# Import GOG games # Import GOG games
if not shared.schema.get_boolean("heroic-import-gog"): if not shared.schema.get_boolean("heroic-import-gog"):
pass pass
elif (heroic_dir / "gog_store" / "installed.json").exists() and ( elif (heroic_dir / "gog_store" / "installed.json").is_file() and (
heroic_dir / "store_cache" / "gog_library.json" heroic_dir / "store_cache" / "gog_library.json"
).exists(): ).is_file():
installed = json.load((heroic_dir / "gog_store" / "installed.json").open()) installed = json.load((heroic_dir / "gog_store" / "installed.json").open())
importer.total_queue += len(installed["installed"]) importer.total_queue += len(installed["installed"])
@@ -161,12 +158,12 @@ def heroic_importer():
values["added"] = current_time values["added"] = current_time
values["last_played"] = 0 values["last_played"] = 0
importer.save_game(values, image_path if image_path.exists() else None) importer.save_game(values, image_path if image_path.is_file() else None)
# Import sideloaded games # Import sideloaded games
if not shared.schema.get_boolean("heroic-import-sideload"): if not shared.schema.get_boolean("heroic-import-sideload"):
pass pass
elif (heroic_dir / "sideload_apps" / "library.json").exists(): elif (heroic_dir / "sideload_apps" / "library.json").is_file():
library = json.load((heroic_dir / "sideload_apps" / "library.json").open()) library = json.load((heroic_dir / "sideload_apps" / "library.json").open())
importer.total_queue += len(library["games"]) importer.total_queue += len(library["games"])
@@ -201,4 +198,4 @@ def heroic_importer():
/ sha256(item["art_square"].encode()).hexdigest() / sha256(item["art_square"].encode()).hexdigest()
) )
importer.save_game(values, image_path if image_path.exists() else None) importer.save_game(values, image_path if image_path.is_file() else None)

View File

@@ -123,25 +123,22 @@ def get_games_async(rows, importer):
def itch_installed(path=None): def itch_installed(path=None):
location_key = "itch-location" location_key = "itch-location"
itch_dir = (
path if path else Path(shared.schema.get_string(location_key)).expanduser()
)
check = Path("db") / "butler.db" check = Path("db") / "butler.db"
if not (itch_dir / check).is_file(): locations = (
locations = ( (path,)
(Path(),) if path
if path else (
else ( Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/io.itch.itch/config/itch", Path.home() / ".var/app/io.itch.itch/config/itch",
shared.config_dir / "itch", shared.config_dir / "itch",
)
) )
)
if os.name == "nt" and not path: if os.name == "nt" and not path:
locations += (Path(os.getenv("appdata")) / "itch",) locations += (Path(os.getenv("appdata")) / "itch",)
itch_dir = check_install(check, locations, (shared.schema, location_key)) itch_dir = check_install(check, locations, (shared.schema, location_key))
return itch_dir return itch_dir

View File

@@ -28,44 +28,38 @@ from .check_install import check_install
def lutris_installed(path=None): def lutris_installed(path=None):
location_key = "lutris-location" location_key = "lutris-location"
lutris_dir = (
path if path else Path(shared.schema.get_string(location_key)).expanduser()
)
check = "pga.db" check = "pga.db"
if not (lutris_dir / check).is_file(): locations = (
locations = ( (path,)
(Path(),) if path
if path else (
else ( Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/net.lutris.Lutris/data/lutris", Path.home() / ".var/app/net.lutris.Lutris/data/lutris",
shared.data_dir / "lutris", shared.data_dir / "lutris",
)
) )
)
lutris_dir = check_install(check, locations, (shared.schema, location_key)) lutris_dir = check_install(check, locations, (shared.schema, location_key))
return lutris_dir return lutris_dir
def lutris_cache_exists(path=None): def lutris_cache_exists(path=None):
cache_key = "lutris-cache-location" cache_key = "lutris-cache-location"
cache_dir = path if path else Path(shared.schema.get_string(cache_key)).expanduser()
cache_check = "coverart" cache_check = "coverart"
if not (cache_dir / cache_check).exists(): cache_locations = (
cache_locations = ( (path,)
(Path(),) if path
if path else (
else ( Path(shared.schema.get_string(cache_key)).expanduser(),
Path.home() / ".var" / "app" / "net.lutris.Lutris" / "cache" / "lutris", Path.home() / ".var" / "app" / "net.lutris.Lutris" / "cache" / "lutris",
shared.cache_dir / "lutris", shared.cache_dir / "lutris",
)
) )
)
cache_dir = check_install( cache_dir = check_install(cache_check, cache_locations, (shared.schema, cache_key))
cache_check, cache_locations, (shared.schema, cache_key)
)
return cache_dir return cache_dir
@@ -137,4 +131,4 @@ def lutris_importer():
values["source"] = f"lutris_{row[3]}" values["source"] = f"lutris_{row[3]}"
image_path = cache_dir / "coverart" / f"{row[2]}.jpg" image_path = cache_dir / "coverart" / f"{row[2]}.jpg"
importer.save_game(values, image_path if image_path.exists() else None) importer.save_game(values, image_path if image_path.is_file() else None)

View File

@@ -35,9 +35,10 @@ def update_values_from_data(content, values):
values["blacklisted"] = True values["blacklisted"] = True
else: else:
data = basic_data["data"] data = basic_data["data"]
values["developer"] = ", ".join(data["developers"]) if data.get("developers"):
values["developer"] = ", ".join(data["developers"])
if data["type"] != "game": if data.get("type") != "game":
values["blacklisted"] = True values["blacklisted"] = True
return values return values
@@ -89,11 +90,11 @@ def get_game(task, datatypes, current_time, appmanifest, steam_dir):
open_file.raise_for_status() open_file.raise_for_status()
content = open_file.json() content = open_file.json()
except requests.exceptions.RequestException: except requests.exceptions.RequestException:
task.return_value((values, image_path if image_path.exists() else None)) task.return_value((values, image_path if image_path.is_file() else None))
return return
values = update_values_from_data(content, values) values = update_values_from_data(content, values)
task.return_value((values, image_path if image_path.exists() else None)) task.return_value((values, image_path if image_path.is_file() else None))
def get_games_async(appmanifests, steam_dir, importer): def get_games_async(appmanifests, steam_dir, importer):
@@ -125,28 +126,24 @@ def get_games_async(appmanifests, steam_dir, importer):
def steam_installed(path=None): def steam_installed(path=None):
location_key = "steam-location" location_key = "steam-location"
steam_dir = Path(shared.schema.get_string(location_key)).expanduser()
check = "steamapps" check = "steamapps"
if not (steam_dir / check).is_file(): subdirs = ("steam", "Steam")
subdirs = ("steam", "Steam") locations = (
locations = ( (path,)
(path,) if path
if path else (
else ( Path(shared.schema.get_string(location_key)).expanduser(),
steam_dir, Path.home() / ".steam",
Path.home() / ".steam", shared.data_dir / "Steam",
shared.data_dir / "Steam", Path.home() / ".var/app/com.valvesoftware.Steam/data/Steam",
Path.home() / ".var/app/com.valvesoftware.Steam/data/Steam",
)
) )
)
if os.name == "nt": if os.name == "nt":
locations += (Path(os.getenv("programfiles(x86)")) / "Steam",) locations += (Path(os.getenv("programfiles(x86)")) / "Steam",)
steam_dir = check_install( steam_dir = check_install(check, locations, (shared.schema, location_key), subdirs)
check, locations, (shared.schema, location_key), subdirs
)
return steam_dir return steam_dir
@@ -167,13 +164,12 @@ def steam_importer():
steam_dirs = [steam_dir] steam_dirs = [steam_dir]
for directory in steam_dirs: for directory in steam_dirs:
if not (directory / "steamapps").exists(): try:
steam_dirs.remove(directory) for open_file in (directory / "steamapps").iterdir():
if open_file.is_file() and "appmanifest" in open_file.name:
for directory in steam_dirs: appmanifests.append(open_file)
for open_file in (directory / "steamapps").iterdir(): except FileNotFoundError:
if open_file.is_file() and "appmanifest" in open_file.name: continue
appmanifests.append(open_file)
importer = shared.importer importer = shared.importer
importer.total_queue += len(appmanifests) importer.total_queue += len(appmanifests)

View File

@@ -44,10 +44,13 @@ class CartridgesApplication(Adw.Application):
def __init__(self): def __init__(self):
super().__init__( super().__init__(
application_id="hu.kramo.Cartridges", flags=Gio.ApplicationFlags.FLAGS_NONE application_id=shared.APP_ID, flags=Gio.ApplicationFlags.FLAGS_NONE
) )
def do_activate(self): # pylint: disable=arguments-differ def do_activate(self): # pylint: disable=arguments-differ
# Set fallback icon-name
Gtk.Window.set_default_icon_name(shared.APP_ID)
# Create the main window # Create the main window
self.win = self.props.active_window # pylint: disable=no-member self.win = self.props.active_window # pylint: disable=no-member
if not self.win: if not self.win:
@@ -107,9 +110,9 @@ class CartridgesApplication(Adw.Application):
about = Adw.AboutWindow( about = Adw.AboutWindow(
transient_for=self.win, transient_for=self.win,
application_name=_("Cartridges"), application_name=_("Cartridges"),
application_icon="hu.kramo.Cartridges", application_icon=shared.APP_ID,
developer_name="kramo", developer_name="kramo",
version="1.5.1", version=shared.VERSION,
developers=[ developers=[
"kramo https://kramo.hu", "kramo https://kramo.hu",
"Arcitec https://github.com/Arcitec", "Arcitec https://github.com/Arcitec",

View File

@@ -1,13 +1,5 @@
moduledir = join_paths(pkgdatadir, 'cartridges') moduledir = join_paths(pkgdatadir, 'cartridges')
python = import('python')
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
configure_file( configure_file(
input: 'cartridges.in', input: 'cartridges.in',
output: 'cartridges', output: 'cartridges',
@@ -17,6 +9,11 @@ configure_file(
) )
cartridges_sources = [ cartridges_sources = [
configure_file(
input: 'shared.py.in',
output: 'shared.py',
configuration: conf
),
'__init__.py', '__init__.py',
'main.py', 'main.py',
'window.py', 'window.py',
@@ -24,7 +21,6 @@ cartridges_sources = [
'details_window.py', 'details_window.py',
'game.py', 'game.py',
'game_cover.py', 'game_cover.py',
'shared.py',
'importers/steam_importer.py', 'importers/steam_importer.py',
'importers/lutris_importer.py', 'importers/lutris_importer.py',
'importers/heroic_importer.py', 'importers/heroic_importer.py',

View File

@@ -33,7 +33,7 @@ from .lutris_importer import lutris_cache_exists, lutris_installed
from .steam_importer import steam_installed from .steam_importer import steam_installed
@Gtk.Template(resource_path="/hu/kramo/Cartridges/gtk/preferences.ui") @Gtk.Template(resource_path=shared.PREFIX + "/gtk/preferences.ui")
class PreferencesWindow(Adw.PreferencesWindow): class PreferencesWindow(Adw.PreferencesWindow):
__gtype_name__ = "PreferencesWindow" __gtype_name__ = "PreferencesWindow"
@@ -126,7 +126,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
if response == "choose_folder": if response == "choose_folder":
self.choose_folder(widget, set_cache_dir) self.choose_folder(widget, set_cache_dir)
if lutris_cache_exists(self.win, path): if lutris_cache_exists(path):
self.import_changed = True self.import_changed = True
self.set_subtitle(self, "lutris-cache") self.set_subtitle(self, "lutris-cache")
@@ -257,7 +257,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
getattr(win, f'{source_id.replace("-", "_")}_action_row').set_subtitle( getattr(win, f'{source_id.replace("-", "_")}_action_row').set_subtitle(
# Remove the path if the dir is picked via the Flatpak portal # Remove the path if the dir is picked via the Flatpak portal
re.sub( re.sub(
"/run/user/\\d*/doc/......../", "/run/user/\\d*/doc/.*/",
"", "",
str( str(
Path(shared.schema.get_string(f"{source_id}-location")).expanduser() Path(shared.schema.get_string(f"{source_id}-location")).expanduser()

View File

@@ -1,4 +1,4 @@
# shared.py # shared.py.in
# #
# Copyright 2022-2023 kramo # Copyright 2022-2023 kramo
# #
@@ -22,8 +22,13 @@ from pathlib import Path
from gi.repository import Gdk, Gio from gi.repository import Gdk, Gio
schema = Gio.Settings.new("hu.kramo.Cartridges") APP_ID = "@APP_ID@"
state_schema = Gio.Settings.new("hu.kramo.Cartridges.State") VERSION = "@VERSION@"
PREFIX = "@PREFIX@"
SPEC_VERSION = 1.5 # The version of the game_id.json spec
schema = Gio.Settings.new(APP_ID)
state_schema = Gio.Settings.new(APP_ID + ".State")
data_dir = ( data_dir = (
Path(os.getenv("XDG_DATA_HOME")) Path(os.getenv("XDG_DATA_HOME"))
@@ -52,4 +57,3 @@ image_size = (200 * scale_factor, 300 * scale_factor)
# pylint: disable=invalid-name # pylint: disable=invalid-name
win = None win = None
importer = None importer = None
spec_version = 1.5 # The version of the game_id.json spec

View File

@@ -23,10 +23,9 @@ from pathlib import Path
def check_install(check, locations, setting=None, subdirs=(Path(),)): def check_install(check, locations, setting=None, subdirs=(Path(),)):
for location in locations: for location in locations:
for subdir in (Path(),) + subdirs: for subdir in (Path(),) + subdirs:
if (location / subdir / check).is_file() or ( if (location / subdir / check).exists():
location / subdir / check
).exists():
if setting: if setting:
setting[0].set_string(setting[1], str(location / subdir)) setting[0].set_string(setting[1], str(location / subdir))
return location / subdir return location / subdir
return False

View File

@@ -20,13 +20,13 @@
import json import json
from datetime import datetime from datetime import datetime
from gi.repository import Adw, Gio, GLib, Gtk from gi.repository import Adw, GLib, Gtk
from . import shared from . import shared
from .game import Game from .game import Game
@Gtk.Template(resource_path="/hu/kramo/Cartridges/gtk/window.ui") @Gtk.Template(resource_path=shared.PREFIX + "/gtk/window.ui")
class CartridgesWindow(Adw.ApplicationWindow): class CartridgesWindow(Adw.ApplicationWindow):
__gtype_name__ = "CartridgesWindow" __gtype_name__ = "CartridgesWindow"
@@ -92,15 +92,20 @@ class CartridgesWindow(Adw.ApplicationWindow):
self.set_library_child() self.set_library_child()
self.notice_empty.set_icon_name(shared.APP_ID + "-symbolic")
if "Devel" in shared.APP_ID:
self.add_css_class("devel")
games = {} games = {}
if shared.games_dir.exists(): if shared.games_dir.is_dir():
for open_file in shared.games_dir.iterdir(): for open_file in shared.games_dir.iterdir():
data = json.load(open_file.open()) data = json.load(open_file.open())
games[data["game_id"]] = data games[data["game_id"]] = data
for game_id, game in games.items(): for game_id, game in games.items():
if (version := game.get("version")) and version > shared.spec_version: if (version := game.get("version")) and version > shared.SPEC_VERSION:
continue continue
if game.get("removed"): if game.get("removed"):
@@ -318,9 +323,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
self.sort_state = str(state).strip("'") self.sort_state = str(state).strip("'")
self.library.invalidate_sort() self.library.invalidate_sort()
Gio.Settings(schema_id="hu.kramo.Cartridges.State").set_string( shared.state_schema.set_string("sort-mode", self.sort_state)
"sort-mode", self.sort_state
)
def on_toggle_search_action(self, *_args): def on_toggle_search_action(self, *_args):
if self.stack.get_visible_child() == self.library_view: if self.stack.get_visible_child() == self.library_view:

View File

@@ -1,5 +1,5 @@
#define MyAppName "Cartridges" #define MyAppName "Cartridges"
#define MyAppVersion "1.5.1" #define MyAppVersion "1.5.4"
#define MyAppPublisher "kramo" #define MyAppPublisher "kramo"
#define MyAppURL "https://github.com/kra-mo/cartridges" #define MyAppURL "https://github.com/kra-mo/cartridges"
#define MyAppExeName "pythonw.exe" #define MyAppExeName "pythonw.exe"

View File

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB