Compare commits
293 Commits
v2.3
...
AshleyPika
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5135127bd4 | ||
|
|
777ed9838a | ||
|
|
304a33b49c | ||
|
|
314bb00d36 | ||
|
|
8e86aca804 | ||
|
|
6a38b9556d | ||
|
|
597c668d69 | ||
|
|
0216705576 | ||
|
|
f9f0319a8b | ||
|
|
a63d7c0373 | ||
|
|
77d7572ad1 | ||
|
|
a6325e73b2 | ||
|
|
aa8f377860 | ||
|
|
2e7bd9d469 | ||
|
|
1535d0a593 | ||
|
|
242f8b0e34 | ||
|
|
b30a337fef | ||
|
|
00368f7a3c | ||
|
|
a31d43a322 | ||
|
|
6851e37e93 | ||
|
|
8199a817eb | ||
|
|
8a020970fd | ||
|
|
91cab62f9a | ||
|
|
3e9c947cf0 | ||
|
|
965b6d94f2 | ||
|
|
d0042d443b | ||
|
|
c25573d198 | ||
|
|
c3b1c5aa8b | ||
|
|
2d0576f201 | ||
|
|
0c73315652 | ||
|
|
86887367a3 | ||
|
|
95c101d55e | ||
|
|
004c5985ec | ||
|
|
cbffec6f13 | ||
|
|
4ee3fe2473 | ||
|
|
bdb067af64 | ||
|
|
1437a31658 | ||
|
|
fbc4e05327 | ||
|
|
247649fce1 | ||
|
|
498f99e771 | ||
|
|
ce584a09c2 | ||
|
|
bb3780f048 | ||
|
|
babe489676 | ||
|
|
e32b30d343 | ||
|
|
863344b6ab | ||
|
|
eee2a2f949 | ||
|
|
03b9c8627f | ||
|
|
46036c57b2 | ||
|
|
61e9a29c6d | ||
|
|
83ae99ff8a | ||
|
|
e4ceac6392 | ||
|
|
8a8b0525b4 | ||
|
|
256f6f2325 | ||
|
|
4938bacd55 | ||
|
|
5050c4f6ca | ||
|
|
9e4644ab2f | ||
|
|
19d0e27e88 | ||
|
|
2801e777f7 | ||
|
|
fc5b5447fc | ||
|
|
0a50072e2c | ||
|
|
e5287c9d3f | ||
|
|
22a755c2e4 | ||
|
|
239420148a | ||
|
|
35acb56a62 | ||
|
|
adacdefdb9 | ||
|
|
7367e40cb3 | ||
|
|
7efa17915f | ||
|
|
bdcded93f3 | ||
|
|
b3a65c3d23 | ||
|
|
06730248a9 | ||
|
|
b46faa951f | ||
|
|
43a04e7d44 | ||
|
|
d74c8aba1a | ||
|
|
eac6d63010 | ||
|
|
beda52b575 | ||
|
|
13cefac34d | ||
|
|
d79686b9a1 | ||
|
|
eff60d5990 | ||
|
|
823641d909 | ||
|
|
6c2ab8099b | ||
|
|
d8137871c5 | ||
|
|
f396a4679c | ||
|
|
c1226197f8 | ||
|
|
8504689426 | ||
|
|
aafc64023c | ||
|
|
eab96edfc7 | ||
|
|
72f15ba7fd | ||
|
|
63a797ce33 | ||
|
|
8640e37252 | ||
|
|
57db530af5 | ||
|
|
bfff596c39 | ||
|
|
d09d27517e | ||
|
|
33c83b65d9 | ||
|
|
942be92a9e | ||
|
|
ae7819a264 | ||
|
|
ed31a2f61e | ||
|
|
38f85d2f4a | ||
|
|
e8db732868 | ||
|
|
7d937c7027 | ||
|
|
2eef3344a2 | ||
|
|
f3bd8b898b | ||
|
|
ee9422feae | ||
|
|
8244b16c17 | ||
|
|
4a530ce92e | ||
|
|
40d6b45291 | ||
|
|
ac57f1d0b6 | ||
|
|
05c6851d40 | ||
|
|
9f2228e7c8 | ||
|
|
5671597089 | ||
|
|
eee4e3e2f2 | ||
|
|
6b1fe1bd8d | ||
|
|
4198810cca | ||
|
|
451819a005 | ||
|
|
a0fe463f03 | ||
|
|
d9384308fe | ||
|
|
f4b44477e9 | ||
|
|
fc3dac6586 | ||
|
|
ffd293a92d | ||
|
|
34ae366772 | ||
|
|
3e5b914ed6 | ||
|
|
c847560e0c | ||
|
|
1623a35e63 | ||
|
|
92c81293b4 | ||
|
|
ce7cb797bb | ||
|
|
fe7fe0fefa | ||
|
|
10c6f5704c | ||
|
|
f2e5e5b03f | ||
|
|
afd1972a76 | ||
|
|
8a7875b843 | ||
|
|
aec8a4efa7 | ||
|
|
2b93a1feeb | ||
|
|
5306b7c81c | ||
|
|
c5675efa48 | ||
|
|
83399c7882 | ||
|
|
04900c7acf | ||
|
|
3ae6b40773 | ||
|
|
4a5ebb3221 | ||
|
|
778caead01 | ||
|
|
2b7f520f2a | ||
|
|
c80f5271da | ||
|
|
f7cf7c4a3b | ||
|
|
c4aa903752 | ||
|
|
4559516b5a | ||
|
|
d4dbf9e589 | ||
|
|
1f7c9a8b0b | ||
|
|
725267c7b9 | ||
|
|
78d6416285 | ||
|
|
c86f14c4f5 | ||
|
|
97e8f93744 | ||
|
|
6d47629bd0 | ||
|
|
ccd97c73ea | ||
|
|
8ec776a04c | ||
|
|
8efce829ca | ||
|
|
6155ace0ec | ||
|
|
35d85a607f | ||
|
|
7ed7814e51 | ||
|
|
b086766b77 | ||
|
|
389b904455 | ||
|
|
303f2a2063 | ||
|
|
3e1ef88a1f | ||
|
|
124d2c8ec7 | ||
|
|
f741b9f100 | ||
|
|
7c9d9a317b | ||
|
|
b707f90a3f | ||
|
|
06e4dadf3c | ||
|
|
80c8566535 | ||
|
|
3f5d3eb3b1 | ||
|
|
64ae27a8a4 | ||
|
|
0482167237 | ||
|
|
2c9c9febfc | ||
|
|
8825c09ae8 | ||
|
|
ec69361826 | ||
|
|
f8bc23991a | ||
|
|
29da7feba9 | ||
|
|
93049f3908 | ||
|
|
5ab3085083 | ||
|
|
7d0b9854d3 | ||
|
|
bcc3c57117 | ||
|
|
08a90365a8 | ||
|
|
a6884b5c3c | ||
|
|
f7a3e01cee | ||
|
|
9bce2190f7 | ||
|
|
8f4ddb37b2 | ||
|
|
551acccbd9 | ||
|
|
b521ea6daf | ||
|
|
248cd10367 | ||
|
|
387430d5cd | ||
|
|
6017c57e6c | ||
|
|
50bc67bb1b | ||
|
|
76fd2f97ef | ||
|
|
e5f8e81c2e | ||
|
|
b574439328 | ||
|
|
2b52391229 | ||
|
|
9b24f7c473 | ||
|
|
644bf10713 | ||
|
|
2962988727 | ||
|
|
6d3d6e6a8f | ||
|
|
9557caecbc | ||
|
|
a48841e5cb | ||
|
|
59966e9198 | ||
|
|
69394d01ec | ||
|
|
684f457713 | ||
|
|
baa4d6f0c4 | ||
|
|
2662d66058 | ||
|
|
2cd670fcfe | ||
|
|
38bed27c61 | ||
|
|
815c1ec088 | ||
|
|
89ba4aecaa | ||
|
|
82ff5b3b46 | ||
|
|
3a052b6367 | ||
|
|
6a78f6d55e | ||
|
|
a352d21864 | ||
|
|
6f51f8ad7a | ||
|
|
cfbd68bf12 | ||
|
|
ad545921b7 | ||
|
|
69928a8b4f | ||
|
|
61e7e0274c | ||
|
|
406d0c281c | ||
|
|
27bc40e6f6 | ||
|
|
ac36118d57 | ||
|
|
38e71e32b9 | ||
|
|
c3226e33e8 | ||
|
|
3513f29435 | ||
|
|
bd7cda12e3 | ||
|
|
0c7f2f2800 | ||
|
|
5f9c990b25 | ||
|
|
29a3e6e9d3 | ||
|
|
bebc8f3d7f | ||
|
|
df2b8c40c9 | ||
|
|
69b168ca01 | ||
|
|
8e01f125f1 | ||
|
|
6d3762b31b | ||
|
|
8df64c4d05 | ||
|
|
42927032c1 | ||
|
|
d3b2615bce | ||
|
|
bb41fc5345 | ||
|
|
22ba068bd3 | ||
|
|
294a846374 | ||
|
|
2982129bfe | ||
|
|
2d9c954932 | ||
|
|
776a9683f7 | ||
|
|
90f9dd0b54 | ||
|
|
99c8dad184 | ||
|
|
189b381a5a | ||
|
|
2f90d2306b | ||
|
|
1835910284 | ||
|
|
421d534d79 | ||
|
|
a8b1791d8f | ||
|
|
ea5617518b | ||
|
|
5860a47072 | ||
|
|
0eada1edf7 | ||
|
|
65e870f6b8 | ||
|
|
34ab816a09 | ||
|
|
273955749a | ||
|
|
3bef033e5e | ||
|
|
81a65a7c10 | ||
|
|
82acfcd67c | ||
|
|
8511c87410 | ||
|
|
f3a0db6e2e | ||
|
|
89c1b5eca0 | ||
|
|
4a9b554f0f | ||
|
|
89bc0877fd | ||
|
|
e67977287d | ||
|
|
57a7c98f7a | ||
|
|
70063172aa | ||
|
|
2655b60806 | ||
|
|
21952e635a | ||
|
|
9670a98246 | ||
|
|
3ebd2dd883 | ||
|
|
4510daf8cc | ||
|
|
8bb2368b3d | ||
|
|
62ebcba590 | ||
|
|
c00234754f | ||
|
|
8ab3cf274e | ||
|
|
de4a7ae303 | ||
|
|
cc8256d945 | ||
|
|
036aad32cd | ||
|
|
33e847ef94 | ||
|
|
8f4e4e619a | ||
|
|
ec7f9bd560 | ||
|
|
6db3557cff | ||
|
|
22200be167 | ||
|
|
eb0d3584cf | ||
|
|
6d9d594caf | ||
|
|
cf6b69619a | ||
|
|
fe5b85c79c | ||
|
|
e7d27cc1c4 | ||
|
|
2d00d3a1bc | ||
|
|
b577b3ec7b | ||
|
|
6893551f1c | ||
|
|
df461421c3 | ||
|
|
536e6792e7 | ||
|
|
5fd6ea20f4 |
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
github: [kra-mo]
|
||||
liberapay: kramo
|
||||
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
61
.github/workflows/ci.yml
vendored
@@ -1,8 +1,9 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
name: CI
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.sha }}
|
||||
jobs:
|
||||
@@ -10,24 +11,24 @@ jobs:
|
||||
name: Flatpak
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: bilelmoussaoui/flatpak-github-actions:gnome-44
|
||||
image: bilelmoussaoui/flatpak-github-actions:gnome-47
|
||||
options: --privileged
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Flatpak Builder
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.4
|
||||
with:
|
||||
bundle: hu.kramo.Cartridges.Devel.flatpak
|
||||
manifest-path: flatpak/hu.kramo.Cartridges.Devel.json
|
||||
bundle: page.kramo.Cartridges.Devel.flatpak
|
||||
manifest-path: build-aux/flatpak/page.kramo.Cartridges.Devel.json
|
||||
|
||||
windows:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
@@ -42,7 +43,6 @@ jobs:
|
||||
meson setup _build
|
||||
ninja -C _build install
|
||||
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
|
||||
|
||||
- name: Test
|
||||
shell: msys2 {0}
|
||||
@@ -51,10 +51,49 @@ jobs:
|
||||
timeout 2 cartridges; [ "$?" -eq "124" ]
|
||||
|
||||
- name: Inno Setup
|
||||
run: iscc ".\_build\windows\Cartridges.iss"
|
||||
run: iscc ".\_build\build-aux\windows\Cartridges.iss"
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows Installer
|
||||
path: _build/windows/Output/Cartridges Setup.exe
|
||||
path: _build/build-aux/windows/Output/Cartridges Windows.exe
|
||||
|
||||
macos:
|
||||
name: macOS
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
brew install meson pygobject3 libadwaita adwaita-icon-theme desktop-file-utils pyinstaller pillow
|
||||
pip3 install --break-system-packages requests PyYAML pyobjc
|
||||
|
||||
- name: Meson Build
|
||||
run: |
|
||||
meson setup _build -Dtiff_compression=jpeg
|
||||
ninja install -C _build
|
||||
|
||||
- name: PyInstaller
|
||||
env:
|
||||
PYTHONPATH: /opt/homebrew/opt/homebrew/lib/python3.12/site-packages
|
||||
run: |
|
||||
cd build-aux/macos
|
||||
pyinstaller ./cartridges.spec
|
||||
|
||||
- name: Zip
|
||||
run: |
|
||||
cd build-aux/macos/dist
|
||||
zip -yr Cartridges\ macOS.zip Cartridges.app
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build-aux/macos/dist/Cartridges macOS.zip
|
||||
name: macOS Application
|
||||
|
||||
19
.github/workflows/publish-release.yml
vendored
@@ -1,20 +1,21 @@
|
||||
name: Publish Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
"*"
|
||||
name: Publish Release
|
||||
tags: "*"
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.sha }}
|
||||
|
||||
jobs:
|
||||
publish-release:
|
||||
name: Publish Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download workflow artifact
|
||||
uses: dawidd6/action-download-artifact@v2.27.0
|
||||
uses: dawidd6/action-download-artifact@v9
|
||||
with:
|
||||
workflow: ci.yml
|
||||
commit: ${{ github.sha }}
|
||||
@@ -23,7 +24,7 @@ jobs:
|
||||
shell: python
|
||||
run: |
|
||||
import re, textwrap
|
||||
open_file = open("./data/hu.kramo.Cartridges.metainfo.xml.in", "r", encoding="utf-8")
|
||||
open_file = open("./data/page.kramo.Cartridges.metainfo.xml.in", "r", encoding="utf-8")
|
||||
string = open_file.read()
|
||||
open_file.close()
|
||||
string = re.findall("<release.*>\s*<description.*>\n([\s\S]*?)\s*</description>\s*<\/release>", string)[0]
|
||||
@@ -37,9 +38,11 @@ jobs:
|
||||
run: echo tag_name=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
uses: softprops/action-gh-release@v2.2.1
|
||||
with:
|
||||
files: Windows Installer/Cartridges Setup.exe
|
||||
files: |
|
||||
Windows Installer/Cartridges Windows.exe
|
||||
macOS Application/Cartridges macOS.zip
|
||||
fail_on_unmatched_files: true
|
||||
tag_name: ${{ steps.get_tag_name.outputs.tag_name }}
|
||||
body_path: release_notes
|
||||
5
.gitignore
vendored
@@ -1,4 +1,9 @@
|
||||
build-aux/flatpak/page.kramo.Cartridges.json
|
||||
/subprojects/blueprint-compiler
|
||||
/build-aux/macos/build
|
||||
/build-aux/macos/dist
|
||||
/.flatpak
|
||||
/.flatpak-builder
|
||||
/.vscode
|
||||
.DS_Store
|
||||
.prettierignore
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
ignore=importers
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
disable=raw-checker-failed,
|
||||
bad-inline-option,
|
||||
|
||||
49
Added Games - Emulator Cheat Sheet
Normal file
@@ -0,0 +1,49 @@
|
||||
--------------------------------
|
||||
General Explanation & Tips
|
||||
--------------------------------
|
||||
* Content added to Cartridges manually will be in the "Added" Category.
|
||||
* First load the Application ID and then apply an Argument (Args) for a specific game.
|
||||
* Be mindful of what extensions your emulator supports, and be sure to replace the placeholder material with your directories.
|
||||
* On Linux if your folder name has spaces you may need to add "" in those sections.
|
||||
* On Windows make sure your folders do not use spaces.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
--------------------------------
|
||||
Linux Retroarch Flatpak Example - This example does work in Lutris
|
||||
--------------------------------
|
||||
Application ID
|
||||
org.libretro.RetroArch
|
||||
|
||||
Args
|
||||
--libretro "/home/usernamehere/.var/app/org.libretro.RetroArch/config/retroarch/cores/corename_libretro.so" "/pathtogame.fileextension"
|
||||
|
||||
--------------------------------
|
||||
Windows Retroarch Example
|
||||
--------------------------------
|
||||
Application ID
|
||||
RetroarchInstallDirectory\retroarch.exe
|
||||
|
||||
Args
|
||||
--libretro RetroarchInstallDirectory\cores\corename.dll --fullscreen "gamefolder\gamename.fileextension"
|
||||
|
||||
|
||||
ACTUAL FORMATTING
|
||||
--------------------------------
|
||||
Retroarch Linux - Flatpak
|
||||
--------------------------------
|
||||
org.libretro.RetroArch --libretro "/home/usernamehere/.var/app/org.libretro.RetroArch/config/retroarch/cores/corename_libretro.so" "/pathtogame.fileextension"
|
||||
|
||||
--------------------------------
|
||||
Retroarch Windows - Installer, Portable & Itch
|
||||
--------------------------------
|
||||
RetroarchInstallDirectory\retroarch.exe --libretro RetroarchInstallDirectory\cores\corename.dll --fullscreen "gamefolder\gamename.fileextension"
|
||||
|
||||
--------------------------------
|
||||
Simple 64 - No Zip Files
|
||||
--------------------------------
|
||||
Linux Flatpak
|
||||
io.github.simple64.simple64 "gamefolder\gamename.fileextension"
|
||||
|
||||
Windows
|
||||
Simple64InstallFolder\simple64-gui.exe "gamefolder\gamename.fileextension"
|
||||
@@ -1,3 +1,3 @@
|
||||
The project follows the [GNOME Code of Conduct](https://wiki.gnome.org/Foundation/CodeOfConduct).
|
||||
The project follows the [GNOME Code of Conduct](https://conduct.gnome.org/).
|
||||
|
||||
If you believe that someone is violating the Code of Conduct, or have any other concerns, please contact us via [cartridges-community@kramo.hu](mailto:cartridges-community@kramo.hu).
|
||||
If you believe that someone is violating the Code of Conduct, or have any other concerns, please contact us via [cartridges-community@kramo.page](mailto:cartridges-community@kramo.page).
|
||||
|
||||
@@ -33,6 +33,11 @@ The project can be translated on [Weblate](https://hosted.weblate.org/engage/car
|
||||
2. From the MSYS2 shell, install the required dependencies listed [here](https://github.com/kra-mo/cartridges/blob/main/.github/workflows/ci.yml).
|
||||
3. Build it via Meson.
|
||||
|
||||
## For macOS
|
||||
1. Install [Homebrew](https://brew.sh/).
|
||||
2. Using `brew` and `pip3`, install the required dependencies listed [here](https://github.com/kra-mo/cartridges/blob/main/.github/workflows/ci.yml).
|
||||
3. Build it via Meson.
|
||||
|
||||
## Meson
|
||||
```bash
|
||||
git clone https://github.com/kra-mo/cartridges.git
|
||||
@@ -59,4 +64,4 @@ VSCode extensions are available for all of these and you can set them up with th
|
||||
"isort.args":["--profile", "black"],
|
||||
```
|
||||
|
||||
For other code editors, you can install them via `pip` and invoke them via the command line.
|
||||
For other code editors, you can install them via `pip` and invoke them from the command line.
|
||||
|
||||
33
README.md
@@ -7,12 +7,12 @@
|
||||
[discord-image]: https://img.shields.io/discord/1088155799299313754?color=%235865F2&label=discord&logo=discord&logoColor=%23FFFFFF&style=for-the-badge
|
||||
[matrix-url]: https://matrix.to/#/#cartridges:matrix.org
|
||||
[matrix-image]: https://img.shields.io/matrix/cartridges:matrix.org?label=Matrix&logo=matrix&color=%230dbd8b&style=for-the-badge
|
||||
[flathub-url]: https://flathub.org/apps/hu.kramo.Cartridges
|
||||
[flathub-image]: https://img.shields.io/flathub/v/hu.kramo.Cartridges?logo=flathub&style=for-the-badge
|
||||
[installs-image]: https://img.shields.io/flathub/downloads/hu.kramo.Cartridges?style=for-the-badge
|
||||
[flathub-url]: https://flathub.org/apps/page.kramo.Cartridges
|
||||
[flathub-image]: https://img.shields.io/flathub/v/page.kramo.Cartridges?logo=flathub&style=for-the-badge
|
||||
[installs-image]: https://img.shields.io/flathub/downloads/page.kramo.Cartridges?style=for-the-badge
|
||||
|
||||
<div align="center">
|
||||
<img src="data/icons/hicolor/scalable/apps/hu.kramo.Cartridges.svg" width="128" height="128">
|
||||
<img src="data/icons/hicolor/scalable/apps/page.kramo.Cartridges.svg" width="128" height="128">
|
||||
|
||||
# Cartridges
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
# The Project
|
||||
|
||||
Cartridges is a simple game launcher written in Python using GTK4 and Libadwaita.
|
||||
Cartridges is an easy-to-use, elegant game launcher written in Python using GTK4 and Libadwaita.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -45,23 +45,29 @@ Cartridges is a simple game launcher written in Python using GTK4 and Libadwaita
|
||||
- Legendary
|
||||
- RetroArch
|
||||
- Flatpak
|
||||
- Hiding games
|
||||
- Desktop Entries
|
||||
- Filtering games by source
|
||||
- Searching and sorting by title, date added and last played
|
||||
- Hiding games
|
||||
- Automatically downloading cover art from [SteamGridDB](https://www.steamgriddb.com/)
|
||||
- Searching for games on various databases
|
||||
- Animated covers
|
||||
- A search provider for GNOME
|
||||
|
||||
For updates and questions, join our [Discord server][discord-url] (bridged to [Matrix](https://matrix.to/#/#cartridges:matrix.org))!
|
||||
|
||||
## Donations
|
||||
I accept donations through [GitHub Sponsors](https://github.com/sponsors/kra-mo) and [Liberapay](https://liberapay.com/kramo).
|
||||
|
||||
Thank you for your generosity! 💜
|
||||
|
||||
# Installation
|
||||
|
||||
## Linux
|
||||
|
||||
### 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/page.kramo.Cartridges><img alt='Download on Flathub' src='https://flathub.org/api/badge?svg&locale=en'/></a>
|
||||
|
||||
## Windows
|
||||
|
||||
@@ -76,6 +82,13 @@ Note: Windows might present you with a warning when trying to install the app. T
|
||||
|
||||
Install the latest release with the command: `winget install cartridges`.
|
||||
|
||||
## macOS
|
||||
|
||||
1. Download the latest release from [Releases](https://github.com/kra-mo/cartridges/releases).
|
||||
2. Move the app into your Applications folder.
|
||||
|
||||
Note: macOS might tell you that the application could not be checked for malicious software or something similar. In this case, open System Settings > Privacy & Security, scroll down, find the warning about Cartridges and click "Open Anyway". More information can be found [here](https://support.apple.com/en-us/102445).
|
||||
|
||||
## Building manually
|
||||
|
||||
See [Building](https://github.com/kra-mo/cartridges/blob/main/CONTRIBUTING.md#building).
|
||||
@@ -88,6 +101,6 @@ Thanks to [Weblate](https://weblate.org/) for hosting our translations!
|
||||
|
||||
# Code of Conduct
|
||||
|
||||
The project follows the [GNOME Code of Conduct](https://wiki.gnome.org/Foundation/CodeOfConduct).
|
||||
The project follows the [GNOME Code of Conduct](https://conduct.gnome.org/).
|
||||
|
||||
See [CODE_OF_CONDUCT.md](https://github.com/kra-mo/cartridges/blob/main/CODE_OF_CONDUCT.md).
|
||||
|
||||
134
build-aux/flatpak/page.kramo.Cartridges.Devel.json
Normal file
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"id": "page.kramo.Cartridges.Devel",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "47",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "cartridges",
|
||||
"finish-args": [
|
||||
"--share=network",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--device=dri",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.freedesktop.Flatpak",
|
||||
"--filesystem=host",
|
||||
"--filesystem=~/.var/app/com.valvesoftware.Steam/data/Steam/:ro",
|
||||
"--filesystem=~/.var/app/net.lutris.Lutris/:ro",
|
||||
"--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/:ro",
|
||||
"--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/legendary/:ro",
|
||||
"--filesystem=~/.var/app/com.usebottles.bottles/data/bottles/:ro",
|
||||
"--filesystem=~/.var/app/io.itch.itch/config/itch/:ro",
|
||||
"--filesystem=~/.var/app/org.libretro.RetroArch/config/retroarch/:ro",
|
||||
"--filesystem=/var/lib/flatpak/app:ro",
|
||||
"--filesystem=/var/lib/flatpak/exports:ro",
|
||||
"--filesystem=xdg-data/flatpak/app:ro",
|
||||
"--filesystem=xdg-data/flatpak/exports:ro"
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/man",
|
||||
"/share/doc",
|
||||
"/share/gtk-doc",
|
||||
"/share/man",
|
||||
"/share/pkgconfig",
|
||||
"*.la",
|
||||
"*.a"
|
||||
],
|
||||
"modules": [
|
||||
{
|
||||
"name": "python3-modules",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [],
|
||||
"modules": [
|
||||
{
|
||||
"name": "python3-pyyaml",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyyaml\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz",
|
||||
"sha256": "d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "python3-pillow",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pillow\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/cd/74/ad3d526f3bf7b6d3f408b73fde271ec69dfac8b81341a318ce825f2b3812/pillow-10.4.0.tar.gz",
|
||||
"sha256": "166c1cd4d24309b30d61f79f4a9114b7b2313d7450912277855ff5dfd7cd4a06"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "python3-requests",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/12/90/3c9ff0512038035f59d279fddeb79f5f1eccd8859f06d6163c58798b9487/certifi-2024.8.30-py3-none-any.whl",
|
||||
"sha256": "922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/63/09/c1bc53dab74b1816a00d8d030de5bf98f724c52c1635e07681d312f20be8/charset-normalizer-3.3.2.tar.gz",
|
||||
"sha256": "f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl",
|
||||
"sha256": "946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl",
|
||||
"sha256": "70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl",
|
||||
"sha256": "ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "blueprint-compiler",
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/jwestman/blueprint-compiler",
|
||||
"tag": "v0.16.0"
|
||||
}
|
||||
],
|
||||
"cleanup": ["*"]
|
||||
},
|
||||
{
|
||||
"name": "cartridges",
|
||||
"builddir": true,
|
||||
"buildsystem": "meson",
|
||||
"run-tests": true,
|
||||
"config-opts": ["-Dprofile=development"],
|
||||
"sources": [
|
||||
{
|
||||
"type": "dir",
|
||||
"path": "../.."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
59
build-aux/macos/cartridges.spec
Normal file
@@ -0,0 +1,59 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
|
||||
a = Analysis(
|
||||
["../../_build/cartridges/cartridges"],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[("../../_build/data/cartridges.gresource", "Resources")],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={
|
||||
"gi": {
|
||||
"module-versions": {
|
||||
"Gtk": "4.0",
|
||||
},
|
||||
},
|
||||
},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
exclude_binaries=True,
|
||||
name="Cartridges",
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=False,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
name="Cartridges",
|
||||
)
|
||||
app = BUNDLE(
|
||||
coll,
|
||||
name="Cartridges.app",
|
||||
icon="./icon.icns",
|
||||
bundle_identifier="page.kramo.Cartridges",
|
||||
info_plist={
|
||||
"LSApplicationCategoryType": "public.app-category.games",
|
||||
},
|
||||
)
|
||||
BIN
build-aux/macos/icon.icns
Normal file
@@ -15,10 +15,10 @@ AppSupportURL=https://github.com/kra-mo/cartridges/issues
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
DefaultDirName={autopf64}\{#MyAppName}
|
||||
DisableProgramGroupPage=yes
|
||||
LicenseFile=..\..\LICENSE
|
||||
LicenseFile=..\..\..\LICENSE
|
||||
PrivilegesRequiredOverridesAllowed=dialog
|
||||
OutputBaseFilename=Cartridges Setup
|
||||
SetupIconFile=..\..\windows\icon.ico
|
||||
OutputBaseFilename=Cartridges Windows
|
||||
SetupIconFile=..\..\..\build-aux\windows\icon.ico
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
@@ -48,9 +48,8 @@ Source: "D:\a\_temp\msys64\ucrt64\share\cartridges\*"; DestDir: "{app}\share\car
|
||||
Source: "D:\a\_temp\msys64\ucrt64\share\icons\*"; DestDir: "{app}\share\icons"; Excludes: "*.png,cursors\*"; Flags: recursesubdirs ignoreversion
|
||||
Source: "D:\a\_temp\msys64\ucrt64\share\glib-2.0\*"; DestDir: "{app}\share\glib-2.0"; Flags: recursesubdirs ignoreversion
|
||||
Source: "D:\a\_temp\msys64\ucrt64\share\gtk-4.0\*"; DestDir: "{app}\share\gtk-4.0"; Flags: recursesubdirs ignoreversion
|
||||
Source: "D:\a\_temp\msys64\ucrt64\share\locale\*"; DestDir: "{app}\share\locale"; Flags: recursesubdirs ignoreversion
|
||||
|
||||
Source: "..\..\windows\icon.ico"; DestDir: "{app}"; Flags: recursesubdirs ignoreversion
|
||||
Source: "..\..\..\build-aux\windows\icon.ico"; DestDir: "{app}"; Flags: recursesubdirs ignoreversion
|
||||
|
||||
[Icons]
|
||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"; Parameters: """{app}\bin\cartridges"""; IconFilename: "{app}\icon.ico"
|
||||
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
@@ -3,5 +3,5 @@ configure_file(
|
||||
output: 'Cartridges.iss',
|
||||
configuration: conf,
|
||||
install: true,
|
||||
install_dir: '.'
|
||||
install_dir: '.',
|
||||
)
|
||||
@@ -22,7 +22,7 @@ Cartridges is a simple game launcher for all of your games. It has support for i
|
||||
<maintainer>
|
||||
<foaf:Person>
|
||||
<foaf:name>kramo</foaf:name>
|
||||
<foaf:mbox rdf:resource="mailto:contact@kramo.hu" />
|
||||
<foaf:mbox rdf:resource="mailto:contact@kramo.page" />
|
||||
<foaf:account>
|
||||
<foaf:OnlineAccount>
|
||||
<foaf:accountServiceHomepage rdf:resource="https://github.com"/>
|
||||
@@ -37,23 +37,5 @@ Cartridges is a simple game launcher for all of your games. It has support for i
|
||||
</foaf:account>
|
||||
</foaf:Person>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<foaf:Person>
|
||||
<foaf:name>Geoffrey Coulaud</foaf:name>
|
||||
<foaf:mbox rdf:resource="mailto:geoffrey.coulaud@gmail.com" />
|
||||
<foaf:account>
|
||||
<foaf:OnlineAccount>
|
||||
<foaf:accountServiceHomepage rdf:resource="https://github.com"/>
|
||||
<foaf:accountName>GeoffreyCoulaud</foaf:accountName>
|
||||
</foaf:OnlineAccount>
|
||||
</foaf:account>
|
||||
<foaf:account>
|
||||
<foaf:OnlineAccount>
|
||||
<foaf:accountServiceHomepage rdf:resource="https://gitlab.gnome.org"/>
|
||||
<foaf:accountName>GeoffreyCoulaud</foaf:accountName>
|
||||
</foaf:OnlineAccount>
|
||||
</foaf:account>
|
||||
</foaf:Person>
|
||||
</maintainer>
|
||||
|
||||
</Project>
|
||||
121
cartridges/application_delegate.py
Normal file
@@ -0,0 +1,121 @@
|
||||
# application_delegate.py
|
||||
#
|
||||
# Copyright 2024 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
"""A set of methods that manage your app’s life cycle and its interaction
|
||||
with common system services."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from AppKit import NSApp, NSApplication, NSMenu, NSMenuItem # type: ignore
|
||||
from Foundation import NSObject # type: ignore
|
||||
from gi.repository import Gio # type: ignore
|
||||
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
class ApplicationDelegate(NSObject): # type: ignore
|
||||
"""A set of methods that manage your app’s life cycle and its interaction
|
||||
with common system services."""
|
||||
|
||||
def applicationDidFinishLaunching_(self, *_args: Any) -> None:
|
||||
main_menu = NSApp.mainMenu()
|
||||
|
||||
add_game_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Add Game", "add:", "n"
|
||||
)
|
||||
|
||||
import_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Import", "import:", "i"
|
||||
)
|
||||
|
||||
file_menu = NSMenu.alloc().init()
|
||||
file_menu.addItem_(add_game_menu_item)
|
||||
file_menu.addItem_(import_menu_item)
|
||||
|
||||
file_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"File", None, ""
|
||||
)
|
||||
file_menu_item.setSubmenu_(file_menu)
|
||||
main_menu.addItem_(file_menu_item)
|
||||
|
||||
show_hidden_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Show Hidden", "hidden:", "h"
|
||||
)
|
||||
|
||||
windows_menu = NSMenu.alloc().init()
|
||||
|
||||
view_menu = NSMenu.alloc().init()
|
||||
view_menu.addItem_(show_hidden_menu_item)
|
||||
|
||||
view_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"View", None, ""
|
||||
)
|
||||
view_menu_item.setSubmenu_(view_menu)
|
||||
main_menu.addItem_(view_menu_item)
|
||||
|
||||
windows_menu = NSMenu.alloc().init()
|
||||
|
||||
windows_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Window", None, ""
|
||||
)
|
||||
windows_menu_item.setSubmenu_(windows_menu)
|
||||
main_menu.addItem_(windows_menu_item)
|
||||
|
||||
NSApp.setWindowsMenu_(windows_menu)
|
||||
|
||||
keyboard_shortcuts_menu_item = (
|
||||
NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Keyboard Shortcuts", "shortcuts:", "?"
|
||||
)
|
||||
)
|
||||
|
||||
help_menu = NSMenu.alloc().init()
|
||||
help_menu.addItem_(keyboard_shortcuts_menu_item)
|
||||
|
||||
help_menu_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
|
||||
"Help", None, ""
|
||||
)
|
||||
help_menu_item.setSubmenu_(help_menu)
|
||||
main_menu.addItem_(help_menu_item)
|
||||
|
||||
NSApp.setHelpMenu_(help_menu)
|
||||
|
||||
def add_(self, *_args: Any) -> None:
|
||||
if (not shared.win) or (not (app := shared.win.get_application())):
|
||||
return
|
||||
|
||||
app.lookup_action("add_game").activate()
|
||||
|
||||
def import_(self, *_args: Any) -> None:
|
||||
if (not shared.win) or (not (app := shared.win.get_application())):
|
||||
return
|
||||
|
||||
app.lookup_action("import").activate()
|
||||
|
||||
def hidden_(self, *_args: Any) -> None:
|
||||
if not shared.win:
|
||||
return
|
||||
|
||||
shared.win.lookup_action("show_hidden").activate()
|
||||
|
||||
def shortcuts_(self, *_args: Any) -> None:
|
||||
if (not shared.win) or (not (overlay := shared.win.get_help_overlay())):
|
||||
return
|
||||
|
||||
overlay.present()
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# cartridges.in
|
||||
#
|
||||
# Copyright 2022-2023 kramo
|
||||
# Copyright 2022-2024 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -19,42 +19,44 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
import locale
|
||||
import gettext
|
||||
import locale
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from platform import system
|
||||
|
||||
VERSION = "@VERSION@"
|
||||
|
||||
if os.name == "nt":
|
||||
from ctypes import windll
|
||||
|
||||
os.environ["LANGUAGE"] = locale.windows_locale[
|
||||
windll.kernel32.GetUserDefaultUILanguage()
|
||||
]
|
||||
pkgdatadir = os.path.join(os.path.dirname(__file__), "..", "share", "cartridges")
|
||||
localedir = os.path.join(os.path.dirname(__file__), "..", "share", "locale")
|
||||
PKGDATADIR = os.path.join(os.path.dirname(__file__), "..", "share", "cartridges")
|
||||
else:
|
||||
pkgdatadir = "@pkgdatadir@"
|
||||
localedir = "@localedir@"
|
||||
PKGDATADIR = "@pkgdatadir@"
|
||||
LOCALEDIR = "@localedir@"
|
||||
|
||||
sys.path.insert(1, pkgdatadir)
|
||||
sys.path.insert(1, PKGDATADIR)
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
||||
if os.name != "nt":
|
||||
locale.bindtextdomain("cartridges", localedir)
|
||||
if system() == "Linux":
|
||||
locale.bindtextdomain("cartridges", LOCALEDIR)
|
||||
locale.textdomain("cartridges")
|
||||
|
||||
gettext.install("cartridges", localedir)
|
||||
gettext.install("cartridges", LOCALEDIR, names=['ngettext'])
|
||||
else:
|
||||
gettext.install("cartridges", names=['ngettext'])
|
||||
|
||||
if __name__ == "__main__":
|
||||
import gi
|
||||
from gi.repository import Gio, GLib
|
||||
|
||||
from gi.repository import Gio
|
||||
try:
|
||||
# For a macOS application bundle
|
||||
resource = Gio.Resource.load(
|
||||
str(Path(__file__).parent / "Resources" / "cartridges.gresource")
|
||||
)
|
||||
except GLib.GError:
|
||||
resource = Gio.Resource.load(os.path.join(PKGDATADIR, "cartridges.gresource"))
|
||||
resource._register() # pylint: disable=protected-access
|
||||
|
||||
resource = Gio.Resource.load(os.path.join(pkgdatadir, "cartridges.gresource"))
|
||||
resource._register()
|
||||
|
||||
from src import main
|
||||
from cartridges import main
|
||||
|
||||
sys.exit(main.main(VERSION))
|
||||
@@ -1,6 +1,6 @@
|
||||
# details_window.py
|
||||
#
|
||||
# Copyright 2022-2023 kramo
|
||||
# Copyright 2022-2024 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -17,55 +17,61 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
# pyright: reportAssignmentType=none
|
||||
|
||||
import shlex
|
||||
from pathlib import Path
|
||||
from sys import platform
|
||||
from time import time
|
||||
from typing import Any, Optional
|
||||
|
||||
from gi.repository import Adw, Gio, GLib, Gtk
|
||||
from PIL import Image, UnidentifiedImageError
|
||||
|
||||
from src import shared
|
||||
from src.errors.friendly_error import FriendlyError
|
||||
from src.game import Game
|
||||
from src.game_cover import GameCover
|
||||
from src.store.managers.cover_manager import CoverManager
|
||||
from src.store.managers.sgdb_manager import SGDBManager
|
||||
from src.utils.create_dialog import create_dialog
|
||||
from src.utils.save_cover import convert_cover, save_cover
|
||||
from cartridges import shared
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
from cartridges.game_cover import GameCover
|
||||
from cartridges.store.managers.cover_manager import CoverManager
|
||||
from cartridges.store.managers.sgdb_manager import SgdbManager
|
||||
from cartridges.utils.create_dialog import create_dialog
|
||||
from cartridges.utils.save_cover import convert_cover, save_cover
|
||||
|
||||
|
||||
@Gtk.Template(resource_path=shared.PREFIX + "/gtk/details-window.ui")
|
||||
class DetailsWindow(Adw.Window):
|
||||
__gtype_name__ = "DetailsWindow"
|
||||
@Gtk.Template(resource_path=shared.PREFIX + "/gtk/details-dialog.ui")
|
||||
class DetailsDialog(Adw.Dialog):
|
||||
__gtype_name__ = "DetailsDialog"
|
||||
|
||||
cover_overlay = Gtk.Template.Child()
|
||||
cover = Gtk.Template.Child()
|
||||
cover_button_edit = Gtk.Template.Child()
|
||||
cover_button_delete_revealer = Gtk.Template.Child()
|
||||
cover_button_delete = Gtk.Template.Child()
|
||||
spinner = Gtk.Template.Child()
|
||||
cover_overlay: Gtk.Overlay = Gtk.Template.Child()
|
||||
cover: Gtk.Picture = Gtk.Template.Child()
|
||||
cover_button_edit: Gtk.Button = Gtk.Template.Child()
|
||||
cover_button_delete_revealer: Gtk.Revealer = Gtk.Template.Child()
|
||||
cover_button_delete: Gtk.Button = Gtk.Template.Child()
|
||||
spinner: Adw.Spinner = Gtk.Template.Child()
|
||||
|
||||
name = Gtk.Template.Child()
|
||||
developer = Gtk.Template.Child()
|
||||
executable = Gtk.Template.Child()
|
||||
name: Adw.EntryRow = Gtk.Template.Child()
|
||||
developer: Adw.EntryRow = Gtk.Template.Child()
|
||||
executable: Adw.EntryRow = Gtk.Template.Child()
|
||||
|
||||
exec_info_label = Gtk.Template.Child()
|
||||
exec_info_popover = Gtk.Template.Child()
|
||||
file_chooser_button = Gtk.Template.Child()
|
||||
exec_info_label: Gtk.Label = Gtk.Template.Child()
|
||||
exec_info_popover: Gtk.Popover = Gtk.Template.Child()
|
||||
file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
apply_button = Gtk.Template.Child()
|
||||
apply_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
cover_changed: bool = False
|
||||
|
||||
is_open: bool = False
|
||||
|
||||
def __init__(self, game: Optional[Game] = None, **kwargs: Any):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.game: Game = game
|
||||
self.game_cover: GameCover = GameCover({self.cover})
|
||||
# Make it so only one dialog can be open at a time
|
||||
self.__class__.is_open = True
|
||||
self.connect("closed", lambda *_: self.set_is_open(False))
|
||||
|
||||
self.set_transient_for(shared.win)
|
||||
self.game: Optional[Game] = game
|
||||
self.game_cover: GameCover = GameCover({self.cover})
|
||||
|
||||
if self.game:
|
||||
self.set_title(_("Game Details"))
|
||||
@@ -83,8 +89,11 @@ class DetailsWindow(Adw.Window):
|
||||
self.apply_button.set_label(_("Add"))
|
||||
|
||||
image_filter = Gtk.FileFilter(name=_("Images"))
|
||||
for extension in Image.registered_extensions():
|
||||
|
||||
# .palm and .pdf are write-only
|
||||
for extension in set(Image.registered_extensions()) - {".palm", ".pdf"}:
|
||||
image_filter.add_suffix(extension[1:])
|
||||
|
||||
image_filter.add_suffix("svg") # Gdk.Texture supports .svg but PIL doesn't
|
||||
|
||||
image_filters = Gio.ListStore.new(Gtk.FileFilter)
|
||||
@@ -109,7 +118,7 @@ class DetailsWindow(Adw.Window):
|
||||
# As in software
|
||||
exe_name = _("program")
|
||||
|
||||
if os.name == "nt":
|
||||
if platform == "win32":
|
||||
exe_name += ".exe"
|
||||
# Translate this string as you would translate "path to {}"
|
||||
exe_path = _("C:\\path\\to\\{}").format(exe_name)
|
||||
@@ -121,7 +130,7 @@ class DetailsWindow(Adw.Window):
|
||||
exe_path = _("/path/to/{}").format(exe_name)
|
||||
# Translate this string as you would translate "path to {}"
|
||||
file_path = _("/path/to/{}").format(file_name)
|
||||
command = "xdg-open"
|
||||
command = "open" if platform == "darwin" else "xdg-open"
|
||||
|
||||
# pylint: disable=line-too-long
|
||||
exec_info_text = _(
|
||||
@@ -152,7 +161,6 @@ class DetailsWindow(Adw.Window):
|
||||
self.executable.connect("entry-activated", self.apply_preferences)
|
||||
|
||||
self.set_focus(self.name)
|
||||
self.present()
|
||||
|
||||
def delete_pixbuf(self, *_args: Any) -> None:
|
||||
self.game_cover.new_cover()
|
||||
@@ -199,6 +207,12 @@ class DetailsWindow(Adw.Window):
|
||||
}
|
||||
)
|
||||
|
||||
if shared.win.sidebar.get_selected_row().get_child() not in (
|
||||
shared.win.all_games_row_box,
|
||||
shared.win.added_row_box,
|
||||
):
|
||||
shared.win.sidebar.select_row(shared.win.added_row_box.get_parent())
|
||||
|
||||
else:
|
||||
if final_name == "":
|
||||
create_dialog(
|
||||
@@ -239,16 +253,16 @@ class DetailsWindow(Adw.Window):
|
||||
# Get a cover from SGDB if none is present
|
||||
if not self.game_cover.get_texture():
|
||||
self.game.set_loading(1)
|
||||
sgdb_manager: SGDBManager = shared.store.managers[SGDBManager]
|
||||
sgdb_manager = shared.store.managers[SgdbManager]
|
||||
sgdb_manager.reset_cancellable()
|
||||
sgdb_manager.process_game(self.game, {}, self.update_cover_callback)
|
||||
|
||||
self.game_cover.pictures.remove(self.cover)
|
||||
|
||||
self.close()
|
||||
shared.win.show_details_view(self.game)
|
||||
shared.win.show_details_page(self.game)
|
||||
|
||||
def update_cover_callback(self, manager: SGDBManager) -> None:
|
||||
def update_cover_callback(self, manager: SgdbManager) -> None:
|
||||
# Set the game as not loading
|
||||
self.game.set_loading(-1)
|
||||
self.game.update()
|
||||
@@ -274,13 +288,13 @@ class DetailsWindow(Adw.Window):
|
||||
|
||||
def toggle_loading(self) -> None:
|
||||
self.apply_button.set_sensitive(not self.apply_button.get_sensitive())
|
||||
self.spinner.set_spinning(not self.spinner.get_spinning())
|
||||
self.spinner.set_visible(not self.spinner.get_visible())
|
||||
self.cover_overlay.set_opacity(not self.cover_overlay.get_opacity())
|
||||
|
||||
def set_cover(self, _source: Any, result: Gio.Task, *_args: Any) -> None:
|
||||
try:
|
||||
path = self.image_file_dialog.open_finish(result).get_path()
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
return
|
||||
|
||||
def thread_func() -> None:
|
||||
@@ -313,13 +327,16 @@ class DetailsWindow(Adw.Window):
|
||||
def set_executable(self, _source: Any, result: Gio.Task, *_args: Any) -> None:
|
||||
try:
|
||||
path = self.exec_file_dialog.open_finish(result).get_path()
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
return
|
||||
|
||||
self.executable.set_text(shlex.quote(path))
|
||||
|
||||
def choose_executable(self, *_args: Any) -> None:
|
||||
self.exec_file_dialog.open(self, None, self.set_executable)
|
||||
self.exec_file_dialog.open(self.get_root(), None, self.set_executable)
|
||||
|
||||
def choose_cover(self, *_args: Any) -> None:
|
||||
self.image_file_dialog.open(self, None, self.set_cover)
|
||||
self.image_file_dialog.open(self.get_root(), None, self.set_cover)
|
||||
|
||||
def set_is_open(self, is_open: bool) -> None:
|
||||
self.__class__.is_open = is_open
|
||||
@@ -17,18 +17,16 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import logging
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import Any, Optional
|
||||
|
||||
from gi.repository import Adw, GLib, GObject, Gtk
|
||||
from gi.repository import Adw, GObject, Gtk
|
||||
|
||||
from src import shared
|
||||
from src.game_cover import GameCover
|
||||
from cartridges import shared
|
||||
from cartridges.game_cover import GameCover
|
||||
from cartridges.utils.run_executable import run_executable
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
@@ -66,8 +64,7 @@ class Game(Gtk.Box):
|
||||
def __init__(self, data: dict[str, Any], **kwargs: Any) -> None:
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.win = shared.win
|
||||
self.app = self.win.get_application()
|
||||
self.app = shared.win.get_application()
|
||||
self.version = shared.SPEC_VERSION
|
||||
|
||||
self.update_values(data)
|
||||
@@ -100,39 +97,26 @@ class Game(Gtk.Box):
|
||||
def create_toast(self, title: str, action: Optional[str] = None) -> None:
|
||||
toast = Adw.Toast.new(title.format(self.name))
|
||||
toast.set_priority(Adw.ToastPriority.HIGH)
|
||||
toast.set_use_markup(False)
|
||||
|
||||
if action:
|
||||
toast.set_button_label(_("Undo"))
|
||||
toast.connect("button-clicked", self.win.on_undo_action, self, action)
|
||||
toast.connect("button-clicked", shared.win.on_undo_action, self, action)
|
||||
|
||||
if (self, action) in self.win.toasts.keys():
|
||||
if (self, action) in shared.win.toasts.keys():
|
||||
# Dismiss the toast if there already is one
|
||||
self.win.toasts[(self, action)].dismiss()
|
||||
shared.win.toasts[(self, action)].dismiss()
|
||||
|
||||
self.win.toasts[(self, action)] = toast
|
||||
shared.win.toasts[(self, action)] = toast
|
||||
|
||||
self.win.toast_overlay.add_toast(toast)
|
||||
shared.win.toast_overlay.add_toast(toast)
|
||||
|
||||
def launch(self) -> None:
|
||||
self.last_played = int(time())
|
||||
self.save()
|
||||
self.update()
|
||||
|
||||
args = (
|
||||
"flatpak-spawn --host /bin/sh -c " + shlex.quote(self.executable) # Flatpak
|
||||
if os.getenv("FLATPAK_ID") == shared.APP_ID
|
||||
else self.executable # Others
|
||||
)
|
||||
|
||||
logging.info("Starting %s: %s", self.name, str(args))
|
||||
# pylint: disable=consider-using-with
|
||||
subprocess.Popen(
|
||||
args,
|
||||
cwd=shared.home,
|
||||
shell=True,
|
||||
start_new_session=True,
|
||||
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0, # type: ignore
|
||||
)
|
||||
run_executable(self.executable)
|
||||
|
||||
if shared.schema.get_boolean("exit-after-launch"):
|
||||
self.app.quit()
|
||||
@@ -144,17 +128,15 @@ class Game(Gtk.Box):
|
||||
self.hidden = not self.hidden
|
||||
self.save()
|
||||
|
||||
if self.win.stack.get_visible_child() == self.win.details_view:
|
||||
self.win.on_go_back_action()
|
||||
if shared.win.navigation_view.get_visible_page() == shared.win.details_page:
|
||||
shared.win.navigation_view.pop()
|
||||
|
||||
self.update()
|
||||
|
||||
if toast:
|
||||
self.create_toast(
|
||||
# The variable is the title of the game
|
||||
(_("{} hidden") if self.hidden else _("{} unhidden")).format(
|
||||
GLib.markup_escape_text(self.name)
|
||||
),
|
||||
(_("{} hidden") if self.hidden else _("{} unhidden")).format(self.name),
|
||||
"hide",
|
||||
)
|
||||
|
||||
@@ -164,21 +146,18 @@ class Game(Gtk.Box):
|
||||
self.save()
|
||||
self.update()
|
||||
|
||||
if self.win.stack.get_visible_child() == self.win.details_view:
|
||||
self.win.on_go_back_action()
|
||||
if shared.win.navigation_view.get_visible_page() == shared.win.details_page:
|
||||
shared.win.navigation_view.pop()
|
||||
|
||||
self.create_toast(
|
||||
# The variable is the title of the game
|
||||
_("{} removed").format(GLib.markup_escape_text(self.name)),
|
||||
"remove",
|
||||
)
|
||||
self.create_toast(_("{} removed").format(self.name), "remove")
|
||||
|
||||
def set_loading(self, state: int) -> None:
|
||||
self.loading += state
|
||||
loading = self.loading > 0
|
||||
|
||||
self.cover.set_opacity(int(not loading))
|
||||
self.spinner.set_spinning(loading)
|
||||
self.spinner.set_visible(loading)
|
||||
|
||||
def get_cover_path(self) -> Optional[Path]:
|
||||
cover_path = shared.covers_dir / f"{self.game_id}.gif"
|
||||
@@ -202,7 +181,7 @@ class Game(Gtk.Box):
|
||||
if shared.schema.get_boolean("cover-launches-game") ^ button:
|
||||
self.launch()
|
||||
else:
|
||||
self.win.show_details_view(self)
|
||||
shared.win.show_details_page(self)
|
||||
|
||||
def set_play_icon(self) -> None:
|
||||
self.play_button.set_icon_name(
|
||||
@@ -17,13 +17,14 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk
|
||||
from PIL import Image, ImageFilter, ImageStat
|
||||
|
||||
from src import shared
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
class GameCover:
|
||||
@@ -83,10 +84,11 @@ class GameCover:
|
||||
.filter(ImageFilter.GaussianBlur(20))
|
||||
)
|
||||
|
||||
tmp_path = Gio.File.new_tmp(None)[0].get_path()
|
||||
image.save(tmp_path, "tiff", compression=None)
|
||||
buffer = BytesIO()
|
||||
image.save(buffer, "tiff", compression=None)
|
||||
gbytes = GLib.Bytes.new(buffer.getvalue())
|
||||
|
||||
self.blurred = Gdk.Texture.new_from_filename(tmp_path)
|
||||
self.blurred = Gdk.Texture.new_from_bytes(gbytes)
|
||||
|
||||
stat = ImageStat.Stat(image.convert("L"))
|
||||
|
||||
@@ -117,6 +119,7 @@ class GameCover:
|
||||
else:
|
||||
for picture in self.pictures:
|
||||
picture.set_paintable(texture or self.placeholder)
|
||||
picture.queue_draw()
|
||||
|
||||
def update_animation(self, data: GdkPixbuf.PixbufAnimation) -> None:
|
||||
if self.animation == data[1]:
|
||||
@@ -23,10 +23,10 @@ from typing import NamedTuple
|
||||
|
||||
import yaml
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import SourceIterable, URLExecutableSource
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import SourceIterable, URLExecutableSource
|
||||
|
||||
|
||||
class BottlesSourceIterable(SourceIterable):
|
||||
@@ -98,7 +98,7 @@ class BottlesSource(URLExecutableSource):
|
||||
candidates=(
|
||||
shared.flatpak_dir / "com.usebottles.bottles" / "data" / "bottles",
|
||||
shared.data_dir / "bottles/",
|
||||
shared.home / ".local" / "share" / "bottles",
|
||||
shared.host_data_dir / "bottles",
|
||||
),
|
||||
paths={
|
||||
"library.yml": LocationSubPath("library.yml"),
|
||||
@@ -25,9 +25,9 @@ from typing import NamedTuple
|
||||
|
||||
from gi.repository import GLib, Gtk
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.source import Source, SourceIterable
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.source import Source, SourceIterable
|
||||
|
||||
|
||||
class DesktopSourceIterable(SourceIterable):
|
||||
@@ -39,7 +39,7 @@ class DesktopSourceIterable(SourceIterable):
|
||||
icon_theme = Gtk.IconTheme.new()
|
||||
|
||||
search_paths = [
|
||||
shared.home / ".local" / "share",
|
||||
shared.host_data_dir,
|
||||
"/run/host/usr/local/share",
|
||||
"/run/host/usr/share",
|
||||
"/run/host/usr/share/pixmaps",
|
||||
@@ -60,7 +60,7 @@ class DesktopSourceIterable(SourceIterable):
|
||||
|
||||
icon_theme.add_search_path(str(path))
|
||||
|
||||
launch_command, full_path = self.check_launch_command()
|
||||
launch_command, full_path = self.check_launch_commands()
|
||||
|
||||
for path in search_paths:
|
||||
if str(path).startswith("/app/"):
|
||||
@@ -93,9 +93,17 @@ class DesktopSourceIterable(SourceIterable):
|
||||
executable = keyfile.get_string("Desktop Entry", "Exec").split(
|
||||
" %"
|
||||
)[0]
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
continue
|
||||
|
||||
try:
|
||||
try_exec = "which " + keyfile.get_string("Desktop Entry", "TryExec")
|
||||
if not self.check_command(try_exec):
|
||||
continue
|
||||
|
||||
except GLib.Error:
|
||||
pass
|
||||
|
||||
# Skip Steam games
|
||||
if "steam://rungameid/" in executable:
|
||||
continue
|
||||
@@ -111,7 +119,13 @@ class DesktopSourceIterable(SourceIterable):
|
||||
try:
|
||||
if keyfile.get_boolean("Desktop Entry", "NoDisplay"):
|
||||
continue
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
pass
|
||||
|
||||
try:
|
||||
if keyfile.get_boolean("Desktop Entry", "Hidden"):
|
||||
continue
|
||||
except GLib.Error:
|
||||
pass
|
||||
|
||||
# Strip /run/host from Flatpak paths
|
||||
@@ -133,7 +147,7 @@ class DesktopSourceIterable(SourceIterable):
|
||||
|
||||
try:
|
||||
icon_str = keyfile.get_string("Desktop Entry", "Icon")
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
yield game
|
||||
continue
|
||||
else:
|
||||
@@ -156,31 +170,36 @@ class DesktopSourceIterable(SourceIterable):
|
||||
.get_path()
|
||||
):
|
||||
additional_data = {"local_icon_path": Path(icon_path)}
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
pass
|
||||
|
||||
yield (game, additional_data)
|
||||
|
||||
def check_launch_command(self) -> (str, bool):
|
||||
def check_command(self, command) -> bool:
|
||||
flatpak_str = "flatpak-spawn --host /bin/sh -c "
|
||||
|
||||
if os.getenv("FLATPAK_ID") == shared.APP_ID:
|
||||
command = flatpak_str + shlex.quote(command)
|
||||
|
||||
try:
|
||||
subprocess.run(command, shell=True, check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def check_launch_commands(self) -> (str, bool):
|
||||
"""Check whether `gio launch` `gtk4-launch` or `gtk-launch` are available on the system"""
|
||||
commands = (("gio launch", True), ("gtk4-launch", False), ("gtk-launch", False))
|
||||
flatpak_str = "flatpak-spawn --host /bin/sh -c "
|
||||
|
||||
for command, full_path in commands:
|
||||
# Even if `gio` is available, `gio launch` is only available on GLib >= 2.67.2
|
||||
check_command = (
|
||||
"gio help launch"
|
||||
if command == "gio launch"
|
||||
else f"type {command} &> /dev/null"
|
||||
command_to_check = (
|
||||
"gio help launch" if command == "gio launch" else f"which {command}"
|
||||
)
|
||||
if os.getenv("FLATPAK_ID") == shared.APP_ID:
|
||||
check_command = flatpak_str + shlex.quote(check_command)
|
||||
|
||||
try:
|
||||
subprocess.run(check_command, shell=True, check=True)
|
||||
if self.check_command(command_to_check):
|
||||
return command, full_path
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
return commands[2]
|
||||
|
||||
@@ -193,7 +212,7 @@ class DesktopSource(Source):
|
||||
"""Generic Flatpak source"""
|
||||
|
||||
source_id = "desktop"
|
||||
name = _("Desktop")
|
||||
name = _("Desktop Entries")
|
||||
iterable_class = DesktopSourceIterable
|
||||
available_on = {"linux"}
|
||||
|
||||
@@ -17,15 +17,16 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from itertools import chain
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
from gi.repository import GLib, Gtk
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import ExecutableFormatSource, SourceIterable
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import ExecutableFormatSource, SourceIterable
|
||||
|
||||
|
||||
class FlatpakSourceIterable(SourceIterable):
|
||||
@@ -35,14 +36,28 @@ class FlatpakSourceIterable(SourceIterable):
|
||||
"""Generator method producing games"""
|
||||
|
||||
icon_theme = Gtk.IconTheme.new()
|
||||
icon_theme.add_search_path(str(self.source.locations.data["icons"]))
|
||||
if user_data := self.source.locations.user_data["icons"]:
|
||||
icon_theme.add_search_path(str(user_data))
|
||||
|
||||
if system_data := self.source.locations.system_data["icons"]:
|
||||
icon_theme.add_search_path(str(system_data))
|
||||
|
||||
if not (system_data or user_data):
|
||||
return
|
||||
|
||||
blacklist = (
|
||||
{"hu.kramo.Cartridges", "hu.kramo.Cartridges.Devel"}
|
||||
{
|
||||
"hu.kramo.Cartridges",
|
||||
"hu.kramo.Cartridges.Devel",
|
||||
"page.kramo.Cartridges",
|
||||
"page.kramo.Cartridges.Devel",
|
||||
}
|
||||
if shared.schema.get_boolean("flatpak-import-launchers")
|
||||
else {
|
||||
"hu.kramo.Cartridges",
|
||||
"hu.kramo.Cartridges.Devel",
|
||||
"page.kramo.Cartridges",
|
||||
"page.kramo.Cartridges.Devel",
|
||||
"com.valvesoftware.Steam",
|
||||
"net.lutris.Lutris",
|
||||
"com.heroicgameslauncher.hgl",
|
||||
@@ -52,7 +67,16 @@ class FlatpakSourceIterable(SourceIterable):
|
||||
}
|
||||
)
|
||||
|
||||
for entry in (self.source.locations.data["applications"]).iterdir():
|
||||
generators = set(
|
||||
location.iterdir()
|
||||
for location in (
|
||||
self.source.locations.user_data["applications"],
|
||||
self.source.locations.system_data["applications"],
|
||||
)
|
||||
if location
|
||||
)
|
||||
|
||||
for entry in chain(*generators):
|
||||
if entry.suffix != ".desktop":
|
||||
continue
|
||||
|
||||
@@ -71,7 +95,7 @@ class FlatpakSourceIterable(SourceIterable):
|
||||
|
||||
name = keyfile.get_string("Desktop Entry", "Name")
|
||||
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
continue
|
||||
|
||||
values = {
|
||||
@@ -101,14 +125,15 @@ class FlatpakSourceIterable(SourceIterable):
|
||||
additional_data = {"local_icon_path": Path(icon_path)}
|
||||
else:
|
||||
pass
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
pass
|
||||
|
||||
yield (game, additional_data)
|
||||
|
||||
|
||||
class FlatpakLocations(NamedTuple):
|
||||
data: Location
|
||||
system_data: Location
|
||||
user_data: Location
|
||||
|
||||
|
||||
class FlatpakSource(ExecutableFormatSource):
|
||||
@@ -126,15 +151,23 @@ class FlatpakSource(ExecutableFormatSource):
|
||||
super().__init__()
|
||||
self.locations = FlatpakLocations(
|
||||
Location(
|
||||
schema_key="flatpak-location",
|
||||
candidates=(
|
||||
"/var/lib/flatpak/",
|
||||
shared.data_dir / "flatpak",
|
||||
),
|
||||
schema_key="flatpak-system-location",
|
||||
candidates=("/var/lib/flatpak/",),
|
||||
paths={
|
||||
"applications": LocationSubPath("exports/share/applications", True),
|
||||
"icons": LocationSubPath("exports/share/icons", True),
|
||||
},
|
||||
invalid_subtitle=Location.DATA_INVALID_SUBTITLE,
|
||||
)
|
||||
optional=True,
|
||||
),
|
||||
Location(
|
||||
schema_key="flatpak-user-location",
|
||||
candidates=(shared.data_dir / "flatpak",),
|
||||
paths={
|
||||
"applications": LocationSubPath("exports/share/applications", True),
|
||||
"icons": LocationSubPath("exports/share/icons", True),
|
||||
},
|
||||
invalid_subtitle=Location.DATA_INVALID_SUBTITLE,
|
||||
optional=True,
|
||||
),
|
||||
)
|
||||
@@ -27,10 +27,10 @@ from json import JSONDecodeError
|
||||
from pathlib import Path
|
||||
from typing import Iterable, NamedTuple, Optional, TypedDict
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import (
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import (
|
||||
SourceIterable,
|
||||
SourceIterationResult,
|
||||
URLExecutableSource,
|
||||
@@ -233,7 +233,7 @@ class LegendaryIterable(StoreSubSourceIterable):
|
||||
else:
|
||||
# Heroic native
|
||||
logging.debug("Using Heroic native <= 2.8 legendary file")
|
||||
path = shared.home / ".config"
|
||||
path = shared.host_config_dir
|
||||
|
||||
path = path / "legendary" / "installed.json"
|
||||
logging.debug("Using Heroic %s installed.json path %s", self.name, path)
|
||||
@@ -355,7 +355,7 @@ class HeroicSource(URLExecutableSource):
|
||||
name = _("Heroic")
|
||||
iterable_class = HeroicSourceIterable
|
||||
url_format = "heroic://launch/{runner}/{app_name}"
|
||||
available_on = {"linux", "win32"}
|
||||
available_on = {"linux", "win32", "darwin"}
|
||||
|
||||
locations: HeroicLocations
|
||||
|
||||
@@ -371,12 +371,13 @@ class HeroicSource(URLExecutableSource):
|
||||
schema_key="heroic-location",
|
||||
candidates=(
|
||||
shared.config_dir / "heroic",
|
||||
shared.home / ".config" / "heroic",
|
||||
shared.host_config_dir / "heroic",
|
||||
shared.flatpak_dir
|
||||
/ "com.heroicgameslauncher.hgl"
|
||||
/ "config"
|
||||
/ "heroic",
|
||||
shared.appdata_dir / "heroic",
|
||||
shared.app_support_dir / "heroic",
|
||||
),
|
||||
paths={
|
||||
"config.json": LocationSubPath("config.json"),
|
||||
@@ -24,14 +24,14 @@ from typing import Any, Optional
|
||||
|
||||
from gi.repository import Adw, Gio, GLib, Gtk
|
||||
|
||||
from src import shared
|
||||
from src.errors.error_producer import ErrorProducer
|
||||
from src.errors.friendly_error import FriendlyError
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import UnresolvableLocationError
|
||||
from src.importer.sources.source import Source
|
||||
from src.store.managers.async_manager import AsyncManager
|
||||
from src.store.pipeline import Pipeline
|
||||
from cartridges import shared
|
||||
from cartridges.errors.error_producer import ErrorProducer
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import UnresolvableLocationError
|
||||
from cartridges.importer.source import Source
|
||||
from cartridges.store.managers.async_manager import AsyncManager
|
||||
from cartridges.store.pipeline import Pipeline
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
@@ -40,7 +40,7 @@ class Importer(ErrorProducer):
|
||||
|
||||
progressbar: Gtk.ProgressBar
|
||||
import_statuspage: Adw.StatusPage
|
||||
import_dialog: Adw.MessageDialog
|
||||
import_dialog: Adw.AlertDialog
|
||||
summary_toast: Optional[Adw.Toast] = None
|
||||
|
||||
sources: set[Source]
|
||||
@@ -53,6 +53,8 @@ class Importer(ErrorProducer):
|
||||
removed_game_ids: set[str]
|
||||
imported_game_ids: set[str]
|
||||
|
||||
close_attempt_id: int
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
@@ -104,13 +106,21 @@ class Importer(ErrorProducer):
|
||||
|
||||
def run(self) -> None:
|
||||
"""Use several Gio.Task to import games from added sources"""
|
||||
shared.win.get_application().state = shared.AppState.IMPORT
|
||||
|
||||
if self.__class__.summary_toast:
|
||||
self.__class__.summary_toast.dismiss()
|
||||
|
||||
shared.win.get_application().lookup_action("import").set_enabled(False)
|
||||
shared.win.get_application().lookup_action("add_game").set_enabled(False)
|
||||
shared.win.get_application().lookup_action("preferences").set_enabled(False)
|
||||
|
||||
self.n_pipelines_done = 0
|
||||
self.n_source_tasks_done = 0
|
||||
|
||||
self.create_dialog()
|
||||
GLib.timeout_add(100, self.monitor_import)
|
||||
GLib.timeout_add(100, self.__watchdog)
|
||||
|
||||
# Collect all errors and reset the cancellables for the managers
|
||||
# - Only one importer exists at any given time
|
||||
@@ -131,24 +141,70 @@ class Importer(ErrorProducer):
|
||||
)
|
||||
)
|
||||
|
||||
self.progress_changed_callback()
|
||||
# Workaround: Adw bug: Dialog won't close if closed too soon after opening
|
||||
def __watchdog(self) -> bool:
|
||||
"""Make sure import dialog closes when import is finished"""
|
||||
if not self.finished:
|
||||
return True
|
||||
|
||||
def create_dialog(self) -> None:
|
||||
"""Create the import dialog"""
|
||||
self.progressbar = Gtk.ProgressBar(margin_start=12, margin_end=12)
|
||||
self.import_statuspage = Adw.StatusPage(
|
||||
title=_("Importing Games…"),
|
||||
child=self.progressbar,
|
||||
)
|
||||
self.import_dialog = Adw.Window(
|
||||
content=self.import_statuspage,
|
||||
modal=True,
|
||||
default_width=350,
|
||||
default_height=-1,
|
||||
transient_for=shared.win,
|
||||
deletable=False,
|
||||
)
|
||||
self.import_dialog.present()
|
||||
self.import_dialog.force_close()
|
||||
return shared.win.get_visible_dialog() == self.import_dialog
|
||||
|
||||
|
||||
def monitor_import(self) -> bool:
|
||||
"""Monitor import progress to update dialog and to trigger import cleanup
|
||||
once the work has finished"""
|
||||
if not self.finished:
|
||||
self.update_progressbar()
|
||||
return True
|
||||
|
||||
self.finish_import()
|
||||
return False
|
||||
|
||||
def finish_import(self) -> None:
|
||||
"""Callback called when importing has finished"""
|
||||
logging.info("Import done")
|
||||
self.remove_games()
|
||||
self.imported_game_ids = shared.store.new_game_ids
|
||||
shared.store.new_game_ids = set()
|
||||
shared.store.duplicate_game_ids = set()
|
||||
# Disconnect the close-attempt signal that closes the main window
|
||||
self.import_dialog.disconnect(self.close_attempt_id)
|
||||
# Workaround: Dialog won't close if closed too soon after opening.
|
||||
self.import_dialog.force_close()
|
||||
self.__class__.summary_toast = self.create_summary_toast()
|
||||
self.create_error_dialog()
|
||||
shared.win.get_application().lookup_action("import").set_enabled(True)
|
||||
shared.win.get_application().lookup_action("add_game").set_enabled(True)
|
||||
shared.win.get_application().lookup_action("preferences").set_enabled(True)
|
||||
shared.win.get_application().state = shared.AppState.DEFAULT
|
||||
shared.win.create_source_rows()
|
||||
|
||||
def remove_games(self) -> None:
|
||||
"""Set removed to True for missing games"""
|
||||
if not shared.schema.get_boolean("remove-missing"):
|
||||
return
|
||||
|
||||
for game in shared.store:
|
||||
if game.removed:
|
||||
continue
|
||||
if game.source == "imported":
|
||||
continue
|
||||
if not shared.schema.get_boolean(game.base_source):
|
||||
continue
|
||||
if game.game_id in shared.store.duplicate_game_ids:
|
||||
continue
|
||||
if game.game_id in shared.store.new_game_ids:
|
||||
continue
|
||||
|
||||
logging.debug("Removing missing game %s (%s)", game.name, game.game_id)
|
||||
|
||||
game.removed = True
|
||||
game.save()
|
||||
game.update()
|
||||
self.removed_game_ids.add(game.game_id)
|
||||
|
||||
"""Import Actions — Threaded; None of this should touch GUI"""
|
||||
|
||||
def source_task_thread_func(self, data: tuple) -> None:
|
||||
"""Source import task code"""
|
||||
@@ -201,9 +257,44 @@ class Importer(ErrorProducer):
|
||||
pipeline: Pipeline = shared.store.add_game(game, additional_data)
|
||||
if pipeline is not None:
|
||||
logging.info("Imported %s (%s)", game.name, game.game_id)
|
||||
pipeline.connect("advanced", self.pipeline_advanced_callback)
|
||||
pipeline.connect(
|
||||
"advanced",
|
||||
self.pipeline_advanced_callback,
|
||||
)
|
||||
self.game_pipelines.add(pipeline)
|
||||
|
||||
def source_callback(self, _obj: Any, _result: Any, data: tuple) -> None:
|
||||
"""Callback executed when a source is fully scanned"""
|
||||
source, *_rest = data
|
||||
logging.debug("Import done for source %s", source.source_id)
|
||||
self.n_source_tasks_done += 1
|
||||
|
||||
def pipeline_advanced_callback(self, pipeline: Pipeline) -> None:
|
||||
"""Callback called when a pipeline for a game has advanced"""
|
||||
if pipeline.is_done:
|
||||
self.n_pipelines_done += 1
|
||||
|
||||
"""GUI Actions"""
|
||||
|
||||
def create_dialog(self) -> None:
|
||||
"""Create the import dialog"""
|
||||
self.progressbar = Gtk.ProgressBar(margin_start=12, margin_end=12)
|
||||
self.import_statuspage = Adw.StatusPage(
|
||||
title=_("Importing Games…"),
|
||||
child=self.progressbar,
|
||||
)
|
||||
self.import_dialog = Adw.Dialog(
|
||||
child=self.import_statuspage,
|
||||
content_width=350,
|
||||
can_close=False,
|
||||
)
|
||||
|
||||
self.close_attempt_id = self.import_dialog.connect(
|
||||
"close-attempt", lambda *_: shared.win.close()
|
||||
)
|
||||
|
||||
self.import_dialog.present(shared.win)
|
||||
|
||||
def update_progressbar(self) -> None:
|
||||
"""Update the progressbar to show the overall import progress"""
|
||||
# Reserve 10% for the sources discovery, the rest is the pipelines
|
||||
@@ -211,68 +302,6 @@ class Importer(ErrorProducer):
|
||||
(0.1 * self.sources_progress) + (0.9 * self.pipelines_progress)
|
||||
)
|
||||
|
||||
def source_callback(self, _obj: Any, _result: Any, data: tuple) -> None:
|
||||
"""Callback executed when a source is fully scanned"""
|
||||
source, *_rest = data
|
||||
logging.debug("Import done for source %s", source.source_id)
|
||||
self.n_source_tasks_done += 1
|
||||
self.progress_changed_callback()
|
||||
|
||||
def pipeline_advanced_callback(self, pipeline: Pipeline) -> None:
|
||||
"""Callback called when a pipeline for a game has advanced"""
|
||||
if pipeline.is_done:
|
||||
self.n_pipelines_done += 1
|
||||
self.progress_changed_callback()
|
||||
|
||||
def progress_changed_callback(self) -> None:
|
||||
"""
|
||||
Callback called when the import process has progressed
|
||||
|
||||
Triggered when:
|
||||
* All sources have been started
|
||||
* A source finishes
|
||||
* A pipeline finishes
|
||||
"""
|
||||
self.update_progressbar()
|
||||
if self.finished:
|
||||
self.import_callback()
|
||||
|
||||
def remove_games(self) -> None:
|
||||
"""Set removed to True for missing games"""
|
||||
if not shared.schema.get_boolean("remove-missing"):
|
||||
return
|
||||
|
||||
for game in shared.store:
|
||||
if game.removed:
|
||||
continue
|
||||
if game.source == "imported":
|
||||
continue
|
||||
if not shared.schema.get_boolean(game.base_source):
|
||||
continue
|
||||
if game.game_id in shared.store.duplicate_game_ids:
|
||||
continue
|
||||
if game.game_id in shared.store.new_game_ids:
|
||||
continue
|
||||
|
||||
logging.debug("Removing missing game %s (%s)", game.name, game.game_id)
|
||||
|
||||
game.removed = True
|
||||
game.save()
|
||||
game.update()
|
||||
self.removed_game_ids.add(game.game_id)
|
||||
|
||||
def import_callback(self) -> None:
|
||||
"""Callback called when importing has finished"""
|
||||
logging.info("Import done")
|
||||
self.remove_games()
|
||||
self.imported_game_ids = shared.store.new_game_ids
|
||||
shared.store.new_game_ids = set()
|
||||
shared.store.duplicate_game_ids = set()
|
||||
self.import_dialog.close()
|
||||
self.__class__.summary_toast = self.create_summary_toast()
|
||||
self.create_error_dialog()
|
||||
shared.win.get_application().lookup_action("import").set_enabled(True)
|
||||
|
||||
def create_error_dialog(self) -> None:
|
||||
"""Dialog containing all errors raised by importers"""
|
||||
|
||||
@@ -298,13 +327,12 @@ class Importer(ErrorProducer):
|
||||
return
|
||||
|
||||
# Create error dialog
|
||||
dialog = Adw.MessageDialog()
|
||||
dialog = Adw.AlertDialog()
|
||||
dialog.set_heading(_("Warning"))
|
||||
dialog.add_response("close", _("Dismiss"))
|
||||
dialog.add_response("open_preferences_import", _("Preferences"))
|
||||
dialog.set_default_response("open_preferences_import")
|
||||
dialog.connect("response", self.dialog_response_callback)
|
||||
dialog.set_transient_for(shared.win)
|
||||
|
||||
if len(errors) == 1:
|
||||
dialog.set_heading((error := next(iter(errors)))[0])
|
||||
@@ -323,7 +351,7 @@ class Importer(ErrorProducer):
|
||||
dialog.set_body(_("The following errors occured during import:"))
|
||||
dialog.set_extra_child(list_box)
|
||||
|
||||
dialog.present()
|
||||
dialog.present(shared.win)
|
||||
|
||||
def undo_import(self, *_args: Any) -> None:
|
||||
for game_id in self.imported_game_ids:
|
||||
@@ -360,20 +388,17 @@ class Importer(ErrorProducer):
|
||||
"import",
|
||||
)
|
||||
|
||||
elif self.n_games_added == 1:
|
||||
toast_title = _("1 game imported")
|
||||
elif self.n_games_added >= 1:
|
||||
# The variable is the number of games.
|
||||
toast_title = ngettext(
|
||||
"{} game imported", "{} games imported", self.n_games_added
|
||||
).format(self.n_games_added)
|
||||
|
||||
elif self.n_games_added > 1:
|
||||
# The variable is the number of games
|
||||
toast_title = _("{} games imported").format(self.n_games_added)
|
||||
|
||||
if (removed_length := len(self.removed_game_ids)) == 1:
|
||||
# A single game removed
|
||||
toast_title += ", " + _("1 removed")
|
||||
|
||||
elif removed_length > 1:
|
||||
# The variable is the number of games removed
|
||||
toast_title += ", " + _("{} removed").format(removed_length)
|
||||
if (removed_length := len(self.removed_game_ids)) >= 1:
|
||||
# The variable is the number of games. This text comes after "{0} games imported".
|
||||
toast_title += ngettext(
|
||||
", {} removed", ", {} removed", removed_length
|
||||
).format(removed_length)
|
||||
|
||||
if self.n_games_added or self.removed_game_ids:
|
||||
toast.set_button_label(_("Undo"))
|
||||
@@ -381,14 +406,20 @@ class Importer(ErrorProducer):
|
||||
|
||||
toast.set_title(toast_title)
|
||||
|
||||
if not (
|
||||
self.n_games_added == 0
|
||||
and removed_length == 0
|
||||
and shared.schema.get_boolean("auto-import")
|
||||
):
|
||||
shared.win.toast_overlay.add_toast(toast)
|
||||
|
||||
return toast
|
||||
|
||||
def open_preferences(
|
||||
self,
|
||||
page_name: Optional[str] = None,
|
||||
expander_row: Optional[Adw.ExpanderRow] = None,
|
||||
) -> Adw.PreferencesWindow:
|
||||
) -> Adw.PreferencesDialog:
|
||||
return shared.win.get_application().on_preferences_action(
|
||||
page_name=page_name, expander_row=expander_row
|
||||
)
|
||||
@@ -22,11 +22,11 @@ from shutil import rmtree
|
||||
from sqlite3 import connect
|
||||
from typing import NamedTuple
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import SourceIterable, URLExecutableSource
|
||||
from src.utils.sqlite import copy_db
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import SourceIterable, URLExecutableSource
|
||||
from cartridges.utils.sqlite import copy_db
|
||||
|
||||
|
||||
class ItchSourceIterable(SourceIterable):
|
||||
@@ -81,7 +81,7 @@ class ItchSource(URLExecutableSource):
|
||||
name = _("itch")
|
||||
iterable_class = ItchSourceIterable
|
||||
url_format = "itch://caves/{cave_id}/launch"
|
||||
available_on = {"linux", "win32"}
|
||||
available_on = {"linux", "win32", "darwin"}
|
||||
|
||||
locations: ItchLocations
|
||||
|
||||
@@ -93,8 +93,9 @@ class ItchSource(URLExecutableSource):
|
||||
candidates=(
|
||||
shared.flatpak_dir / "io.itch.itch" / "config" / "itch",
|
||||
shared.config_dir / "itch",
|
||||
shared.home / ".config" / "itch",
|
||||
shared.host_config_dir / "itch",
|
||||
shared.appdata_dir / "itch",
|
||||
shared.app_support_dir / "itch",
|
||||
),
|
||||
paths={
|
||||
"butler.db": LocationSubPath("db/butler.db"),
|
||||
@@ -22,10 +22,10 @@ import logging
|
||||
from json import JSONDecodeError
|
||||
from typing import NamedTuple
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import (
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import (
|
||||
ExecutableFormatSource,
|
||||
SourceIterable,
|
||||
SourceIterationResult,
|
||||
@@ -108,7 +108,7 @@ class LegendarySource(ExecutableFormatSource):
|
||||
schema_key="legendary-location",
|
||||
candidates=(
|
||||
shared.config_dir / "legendary",
|
||||
shared.home / ".config" / "legendary",
|
||||
shared.host_config_dir / "legendary",
|
||||
),
|
||||
paths={
|
||||
"installed.json": LocationSubPath("installed.json"),
|
||||
@@ -3,7 +3,7 @@ from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Iterable, Mapping, NamedTuple, Optional
|
||||
|
||||
from src import shared
|
||||
from cartridges import shared
|
||||
|
||||
PathSegment = str | PathLike | Path
|
||||
PathSegments = Iterable[PathSegment]
|
||||
@@ -16,7 +16,8 @@ class LocationSubPath(NamedTuple):
|
||||
|
||||
|
||||
class UnresolvableLocationError(Exception):
|
||||
pass
|
||||
def __init__(self, optional: Optional[bool] = False):
|
||||
self.optional = optional
|
||||
|
||||
|
||||
class Location:
|
||||
@@ -49,12 +50,14 @@ class Location:
|
||||
candidates: Iterable[Candidate],
|
||||
paths: Mapping[str, LocationSubPath],
|
||||
invalid_subtitle: str,
|
||||
optional: Optional[bool] = False,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.schema_key = schema_key
|
||||
self.candidates = candidates
|
||||
self.paths = paths
|
||||
self.invalid_subtitle = invalid_subtitle
|
||||
self.optional = optional
|
||||
|
||||
def check_candidate(self, candidate: Path) -> bool:
|
||||
"""Check if a candidate root has the necessary files and directories"""
|
||||
@@ -87,7 +90,7 @@ class Location:
|
||||
break
|
||||
else:
|
||||
# No good candidate found
|
||||
raise UnresolvableLocationError()
|
||||
raise UnresolvableLocationError(self.optional)
|
||||
|
||||
# Update the schema with the found candidate
|
||||
value = str(candidate)
|
||||
@@ -96,7 +99,13 @@ class Location:
|
||||
|
||||
def __getitem__(self, key: str) -> Optional[Path]:
|
||||
"""Get the computed path from its key for the location"""
|
||||
try:
|
||||
self.resolve()
|
||||
except UnresolvableLocationError as error:
|
||||
if error.optional:
|
||||
return None
|
||||
raise UnresolvableLocationError from error
|
||||
|
||||
if self.root:
|
||||
return self.root / self.paths[key].segment
|
||||
return None
|
||||
@@ -1,6 +1,6 @@
|
||||
# lutris_source.py
|
||||
#
|
||||
# Copyright 2022-2023 kramo
|
||||
# Copyright 2022-2024 kramo
|
||||
# Copyright 2023 Geoffrey Coulaud
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -21,11 +21,11 @@ from shutil import rmtree
|
||||
from sqlite3 import connect
|
||||
from typing import NamedTuple
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import SourceIterable, URLExecutableSource
|
||||
from src.utils.sqlite import copy_db
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import SourceIterable, URLExecutableSource
|
||||
from cartridges.utils.sqlite import copy_db
|
||||
|
||||
|
||||
class LutrisSourceIterable(SourceIterable):
|
||||
@@ -36,24 +36,38 @@ class LutrisSourceIterable(SourceIterable):
|
||||
|
||||
# Query the database
|
||||
request = """
|
||||
SELECT id, name, slug, runner, hidden
|
||||
FROM 'games'
|
||||
SELECT
|
||||
games.id,
|
||||
games.name,
|
||||
games.slug,
|
||||
games.runner,
|
||||
categories.name = ".hidden" as hidden
|
||||
FROM
|
||||
games
|
||||
LEFT JOIN
|
||||
games_categories ON games_categories.game_id = games.id
|
||||
FULL JOIN
|
||||
categories ON games_categories.category_id = categories.id
|
||||
WHERE
|
||||
name IS NOT NULL
|
||||
AND slug IS NOT NULL
|
||||
AND configPath IS NOT NULL
|
||||
AND installed
|
||||
AND (runner IS NOT "steam" OR :import_steam)
|
||||
AND (runner IS NOT "flatpak" OR :import_flatpak)
|
||||
games.name IS NOT NULL
|
||||
AND games.slug IS NOT NULL
|
||||
AND games.configPath IS NOT NULL
|
||||
AND games.installed
|
||||
AND (games.runner IS NOT "steam" OR :import_steam)
|
||||
AND (games.runner IS NOT "flatpak" OR :import_flatpak)
|
||||
;
|
||||
"""
|
||||
|
||||
params = {
|
||||
"import_steam": shared.schema.get_boolean("lutris-import-steam"),
|
||||
"import_flatpak": shared.schema.get_boolean("lutris-import-flatpak"),
|
||||
}
|
||||
db_path = copy_db(self.source.locations.config["pga.db"])
|
||||
db_path = copy_db(self.source.locations.data["pga.db"])
|
||||
connection = connect(db_path)
|
||||
cursor = connection.execute(request, params)
|
||||
coverart_is_dir = (
|
||||
coverart_path := self.source.locations.data.root / "coverart"
|
||||
).is_dir()
|
||||
|
||||
# Create games from the DB results
|
||||
for row in cursor:
|
||||
@@ -69,10 +83,12 @@ class LutrisSourceIterable(SourceIterable):
|
||||
"executable": self.source.make_executable(game_id=row[0]),
|
||||
}
|
||||
game = Game(values)
|
||||
additional_data = {}
|
||||
|
||||
# Get official image path
|
||||
image_path = self.source.locations.cache["coverart"] / f"{row[2]}.jpg"
|
||||
additional_data = {"local_image_path": image_path}
|
||||
if coverart_is_dir:
|
||||
image_path = coverart_path / f"{row[2]}.jpg"
|
||||
additional_data["local_image_path"] = image_path
|
||||
|
||||
yield (game, additional_data)
|
||||
|
||||
@@ -81,8 +97,7 @@ class LutrisSourceIterable(SourceIterable):
|
||||
|
||||
|
||||
class LutrisLocations(NamedTuple):
|
||||
config: Location
|
||||
cache: Location
|
||||
data: Location
|
||||
|
||||
|
||||
class LutrisSource(URLExecutableSource):
|
||||
@@ -94,8 +109,6 @@ class LutrisSource(URLExecutableSource):
|
||||
url_format = "lutris:rungameid/{game_id}"
|
||||
available_on = {"linux"}
|
||||
|
||||
# FIXME possible bug: config picks ~/.var... and cache picks ~/.local...
|
||||
|
||||
locations: LutrisLocations
|
||||
|
||||
@property
|
||||
@@ -110,23 +123,11 @@ class LutrisSource(URLExecutableSource):
|
||||
candidates=(
|
||||
shared.flatpak_dir / "net.lutris.Lutris" / "data" / "lutris",
|
||||
shared.data_dir / "lutris",
|
||||
shared.home / ".local" / "share" / "lutris",
|
||||
shared.host_data_dir / "lutris",
|
||||
),
|
||||
paths={
|
||||
"pga.db": LocationSubPath("pga.db"),
|
||||
},
|
||||
invalid_subtitle=Location.DATA_INVALID_SUBTITLE,
|
||||
),
|
||||
Location(
|
||||
schema_key="lutris-cache-location",
|
||||
candidates=(
|
||||
shared.flatpak_dir / "net.lutris.Lutris" / "cache" / "lutris",
|
||||
shared.cache_dir / "lutris",
|
||||
shared.home / ".cache" / "lutris",
|
||||
),
|
||||
paths={
|
||||
"coverart": LocationSubPath("coverart", True),
|
||||
},
|
||||
invalid_subtitle=Location.CACHE_INVALID_SUBTITLE,
|
||||
),
|
||||
)
|
||||
)
|
||||
@@ -26,16 +26,16 @@ from pathlib import Path
|
||||
from shlex import quote as shell_quote
|
||||
from typing import NamedTuple
|
||||
|
||||
from src import shared
|
||||
from src.errors.friendly_error import FriendlyError
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import (
|
||||
from cartridges import shared
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import (
|
||||
Location,
|
||||
LocationSubPath,
|
||||
UnresolvableLocationError,
|
||||
)
|
||||
from src.importer.sources.source import Source, SourceIterable
|
||||
from src.importer.sources.steam_source import SteamSource
|
||||
from cartridges.importer.source import Source, SourceIterable
|
||||
from cartridges.importer.steam_source import SteamSource
|
||||
|
||||
|
||||
class RetroarchSourceIterable(SourceIterable):
|
||||
@@ -157,7 +157,7 @@ class RetroarchSource(Source):
|
||||
/ "config"
|
||||
/ "retroarch",
|
||||
shared.config_dir / "retroarch",
|
||||
shared.home / ".config" / "retroarch",
|
||||
shared.host_config_dir / "retroarch",
|
||||
# TODO: Windows support, waiting for executable path setting improvement
|
||||
# Path("C:\\RetroArch-Win64"),
|
||||
# Path("C:\\RetroArch-Win32"),
|
||||
@@ -22,8 +22,8 @@ from abc import abstractmethod
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, Collection, Generator, Optional
|
||||
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, UnresolvableLocationError
|
||||
|
||||
# Type of the data returned by iterating on a Source
|
||||
SourceIterationResult = Optional[Game | tuple[Game, tuple[Any]]]
|
||||
@@ -76,7 +76,7 @@ class Source(Iterable):
|
||||
|
||||
@property
|
||||
def is_available(self) -> bool:
|
||||
return sys.platform in self.available_on
|
||||
return any(sys.platform.startswith(platform) for platform in self.available_on)
|
||||
|
||||
def make_executable(self, *args, **kwargs) -> str:
|
||||
"""
|
||||
@@ -87,10 +87,15 @@ class Source(Iterable):
|
||||
def __iter__(self) -> Generator[SourceIterationResult, None, None]:
|
||||
"""
|
||||
Get an iterator for the source
|
||||
:raises UnresolvableLocationError: Not iterable if any of the locations are unresolvable
|
||||
:raises UnresolvableLocationError: Not iterable
|
||||
if any of the mandatory locations are unresolvable
|
||||
"""
|
||||
for location in self.locations:
|
||||
try:
|
||||
location.resolve()
|
||||
except UnresolvableLocationError as error:
|
||||
if not error.optional:
|
||||
raise UnresolvableLocationError from error
|
||||
return iter(self.iterable_class(self))
|
||||
|
||||
|
||||
@@ -115,12 +120,15 @@ class URLExecutableSource(ExecutableFormatSource):
|
||||
|
||||
@property
|
||||
def executable_format(self) -> str:
|
||||
match sys.platform:
|
||||
case "win32":
|
||||
return "start " + self.url_format
|
||||
case "linux":
|
||||
return "xdg-open " + self.url_format
|
||||
case other:
|
||||
if sys.platform.startswith("win32"):
|
||||
return f"start {self.url_format}"
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
return f"xdg-open {self.url_format}"
|
||||
|
||||
if sys.platform.startswith("darwin"):
|
||||
return f"open {self.url_format}"
|
||||
|
||||
raise NotImplementedError(
|
||||
f"No URL handler command available for {other}"
|
||||
f"No URL handler command available for {sys.platform}"
|
||||
)
|
||||
@@ -23,11 +23,11 @@ import re
|
||||
from pathlib import Path
|
||||
from typing import Iterable, NamedTuple
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.location import Location, LocationSubPath
|
||||
from src.importer.sources.source import SourceIterable, URLExecutableSource
|
||||
from src.utils.steam import SteamFileHelper, SteamInvalidManifestError
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.location import Location, LocationSubPath
|
||||
from cartridges.importer.source import SourceIterable, URLExecutableSource
|
||||
from cartridges.utils.steam import SteamFileHelper, SteamInvalidManifestError
|
||||
|
||||
|
||||
class SteamSourceIterable(SourceIterable):
|
||||
@@ -98,7 +98,8 @@ class SteamSourceIterable(SourceIterable):
|
||||
# Add official cover image
|
||||
image_path = (
|
||||
self.source.locations.data["librarycache"]
|
||||
/ f"{appid}_library_600x900.jpg"
|
||||
/ appid
|
||||
/ "library_600x900.jpg"
|
||||
)
|
||||
additional_data = {"local_image_path": image_path, "steam_appid": appid}
|
||||
|
||||
@@ -112,7 +113,7 @@ class SteamLocations(NamedTuple):
|
||||
class SteamSource(URLExecutableSource):
|
||||
source_id = "steam"
|
||||
name = _("Steam")
|
||||
available_on = {"linux", "win32"}
|
||||
available_on = {"linux", "win32", "darwin"}
|
||||
iterable_class = SteamSourceIterable
|
||||
url_format = "steam://rungameid/{game_id}"
|
||||
|
||||
@@ -128,6 +129,7 @@ class SteamSource(URLExecutableSource):
|
||||
shared.data_dir / "Steam",
|
||||
shared.flatpak_dir / "com.valvesoftware.Steam" / "data" / "Steam",
|
||||
shared.programfiles32_dir / "Steam",
|
||||
shared.app_support_dir / "Steam",
|
||||
),
|
||||
paths={
|
||||
"libraryfolders.vdf": LocationSubPath(
|
||||
@@ -25,7 +25,7 @@ from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from src import shared
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
class SessionFileHandler(StreamHandler):
|
||||
@@ -24,7 +24,7 @@ import platform
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from src import shared
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
def setup_logging() -> None:
|
||||
@@ -47,12 +47,12 @@ def setup_logging() -> None:
|
||||
},
|
||||
"console_formatter": {
|
||||
"format": "%(name)s %(levelname)s - %(message)s",
|
||||
"class": "src.logging.color_log_formatter.ColorLogFormatter",
|
||||
"class": "cartridges.logging.color_log_formatter.ColorLogFormatter",
|
||||
},
|
||||
},
|
||||
"handlers": {
|
||||
"file_handler": {
|
||||
"class": "src.logging.session_file_handler.SessionFileHandler",
|
||||
"class": "cartridges.logging.session_file_handler.SessionFileHandler",
|
||||
"formatter": "file_formatter",
|
||||
"level": "DEBUG",
|
||||
"filename": log_filename,
|
||||
419
cartridges/main.py
Normal file
@@ -0,0 +1,419 @@
|
||||
# main.py
|
||||
#
|
||||
# Copyright 2022-2024 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import json
|
||||
import lzma
|
||||
import os
|
||||
import shlex
|
||||
import sys
|
||||
from time import time
|
||||
from typing import Any, Optional
|
||||
from urllib.parse import quote
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "4.0")
|
||||
gi.require_version("Adw", "1")
|
||||
|
||||
# pylint: disable=wrong-import-position
|
||||
from gi.repository import Adw, Gio, GLib, Gtk
|
||||
|
||||
from cartridges import shared
|
||||
from cartridges.details_dialog import DetailsDialog
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.bottles_source import BottlesSource
|
||||
from cartridges.importer.desktop_source import DesktopSource
|
||||
from cartridges.importer.flatpak_source import FlatpakSource
|
||||
from cartridges.importer.heroic_source import HeroicSource
|
||||
from cartridges.importer.importer import Importer # yo dawg
|
||||
from cartridges.importer.itch_source import ItchSource
|
||||
from cartridges.importer.legendary_source import LegendarySource
|
||||
from cartridges.importer.lutris_source import LutrisSource
|
||||
from cartridges.importer.retroarch_source import RetroarchSource
|
||||
from cartridges.importer.steam_source import SteamSource
|
||||
from cartridges.logging.setup import log_system_info, setup_logging
|
||||
from cartridges.preferences import CartridgesPreferences
|
||||
from cartridges.store.managers.cover_manager import CoverManager
|
||||
from cartridges.store.managers.display_manager import DisplayManager
|
||||
from cartridges.store.managers.file_manager import FileManager
|
||||
from cartridges.store.managers.sgdb_manager import SgdbManager
|
||||
from cartridges.store.managers.steam_api_manager import SteamAPIManager
|
||||
from cartridges.store.store import Store
|
||||
from cartridges.utils.run_executable import run_executable
|
||||
from cartridges.window import CartridgesWindow
|
||||
|
||||
if sys.platform.startswith("darwin"):
|
||||
from AppKit import NSApp # type: ignore
|
||||
from PyObjCTools import AppHelper
|
||||
|
||||
from cartridges.application_delegate import ApplicationDelegate
|
||||
|
||||
|
||||
class CartridgesApplication(Adw.Application):
|
||||
state = shared.AppState.DEFAULT
|
||||
win: CartridgesWindow
|
||||
init_search_term: Optional[str] = None
|
||||
|
||||
def __init__(self) -> None:
|
||||
shared.store = Store()
|
||||
super().__init__(application_id=shared.APP_ID)
|
||||
|
||||
search = GLib.OptionEntry()
|
||||
search.long_name = "search"
|
||||
search.short_name = ord("s")
|
||||
search.flags = 0
|
||||
search.arg = int(GLib.OptionArg.STRING)
|
||||
search.arg_data = None
|
||||
search.description = "Open the app with this term in the search entry"
|
||||
search.arg_description = "TERM"
|
||||
|
||||
launch = GLib.OptionEntry()
|
||||
launch.long_name = "launch"
|
||||
launch.short_name = ord("l")
|
||||
launch.flags = int(GLib.OptionFlags.NONE)
|
||||
launch.arg = int(GLib.OptionArg.STRING)
|
||||
launch.arg_data = None
|
||||
launch.description = "Run a game with the given game_id"
|
||||
launch.arg_description = "GAME_ID"
|
||||
|
||||
self.add_main_option_entries((search, launch))
|
||||
|
||||
if sys.platform.startswith("darwin"):
|
||||
if settings := Gtk.Settings.get_default():
|
||||
settings.props.gtk_decoration_layout = "close,minimize,maximize:"
|
||||
|
||||
def setup_app_delegate() -> None:
|
||||
NSApp.setDelegate_(ApplicationDelegate.alloc().init()) # type: ignore
|
||||
AppHelper.runEventLoop() # type: ignore
|
||||
|
||||
GLib.Thread.new(None, setup_app_delegate)
|
||||
|
||||
def do_activate(self) -> None: # pylint: disable=arguments-differ
|
||||
"""Called on app creation"""
|
||||
|
||||
if os.getenv("XDG_CURRENT_DESKOP") == "COSMIC":
|
||||
Gio.AppInfo.launch_default_for_uri("https://stopthemingmy.app")
|
||||
self.quit()
|
||||
|
||||
try:
|
||||
setup_logging()
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
log_system_info()
|
||||
|
||||
# Create the main window
|
||||
win = self.props.active_window # pylint: disable=no-member
|
||||
if not win:
|
||||
shared.win = win = CartridgesWindow(application=self)
|
||||
|
||||
# Save window geometry
|
||||
shared.state_schema.bind(
|
||||
"width", shared.win, "default-width", Gio.SettingsBindFlags.DEFAULT
|
||||
)
|
||||
shared.state_schema.bind(
|
||||
"height", shared.win, "default-height", Gio.SettingsBindFlags.DEFAULT
|
||||
)
|
||||
shared.state_schema.bind(
|
||||
"is-maximized", shared.win, "maximized", Gio.SettingsBindFlags.DEFAULT
|
||||
)
|
||||
|
||||
# Load games from disk
|
||||
shared.store.add_manager(FileManager(), False)
|
||||
shared.store.add_manager(DisplayManager())
|
||||
self.state = shared.AppState.LOAD_FROM_DISK
|
||||
self.load_games_from_disk()
|
||||
self.state = shared.AppState.DEFAULT
|
||||
shared.win.create_source_rows()
|
||||
|
||||
# Add rest of the managers for game imports
|
||||
shared.store.add_manager(CoverManager())
|
||||
shared.store.add_manager(SteamAPIManager())
|
||||
shared.store.add_manager(SgdbManager())
|
||||
shared.store.toggle_manager_in_pipelines(FileManager, True)
|
||||
|
||||
# Create actions
|
||||
self.create_actions(
|
||||
{
|
||||
("quit", ("<primary>q",)),
|
||||
("about",),
|
||||
("preferences", ("<primary>comma",)),
|
||||
("launch_game",),
|
||||
("hide_game",),
|
||||
("edit_game",),
|
||||
("add_game", ("<primary>n",)),
|
||||
("import", ("<primary>i",)),
|
||||
("remove_game_details_view", ("Delete",)),
|
||||
("remove_game",),
|
||||
("igdb_search",),
|
||||
("sgdb_search",),
|
||||
("protondb_search",),
|
||||
("lutris_search",),
|
||||
("hltb_search",),
|
||||
("show_sidebar", ("F9",), shared.win),
|
||||
("show_hidden", ("<primary>h",), shared.win),
|
||||
("go_to_parent", ("<alt>Up",), shared.win),
|
||||
("go_home", ("<alt>Home",), shared.win),
|
||||
("toggle_search", ("<primary>f",), shared.win),
|
||||
("undo", ("<primary>z",), shared.win),
|
||||
("open_menu", ("F10",), shared.win),
|
||||
("close", ("<primary>w",), shared.win),
|
||||
}
|
||||
)
|
||||
|
||||
sort_action = Gio.SimpleAction.new_stateful(
|
||||
"sort_by",
|
||||
GLib.VariantType.new("s"),
|
||||
sort_mode := GLib.Variant("s", shared.state_schema.get_string("sort-mode")),
|
||||
)
|
||||
sort_action.connect("activate", shared.win.on_sort_action)
|
||||
shared.win.add_action(sort_action)
|
||||
shared.win.on_sort_action(sort_action, sort_mode)
|
||||
|
||||
if self.init_search_term: # For command line activation
|
||||
shared.win.search_bar.set_search_mode(True)
|
||||
shared.win.search_entry.set_text(self.init_search_term)
|
||||
shared.win.search_entry.set_position(-1)
|
||||
|
||||
shared.win.present()
|
||||
|
||||
if shared.schema.get_boolean("auto-import"):
|
||||
self.on_import_action()
|
||||
|
||||
def do_handle_local_options(self, options: GLib.VariantDict) -> int:
|
||||
if search := options.lookup_value("search"):
|
||||
self.init_search_term = search.get_string()
|
||||
elif game_id := options.lookup_value("launch"):
|
||||
try:
|
||||
data = json.load(
|
||||
(path := shared.games_dir / (game_id.get_string() + ".json")).open(
|
||||
"r", encoding="utf-8"
|
||||
)
|
||||
)
|
||||
executable = (
|
||||
shlex.join(data["executable"])
|
||||
if isinstance(data["executable"], list)
|
||||
else data["executable"]
|
||||
)
|
||||
name = data["name"]
|
||||
|
||||
run_executable(executable)
|
||||
|
||||
data["last_played"] = int(time())
|
||||
json.dump(data, path.open("w", encoding="utf-8"))
|
||||
|
||||
except (IndexError, KeyError, OSError, json.decoder.JSONDecodeError):
|
||||
return 1
|
||||
|
||||
self.register()
|
||||
self.send_notification(
|
||||
"launch", Gio.Notification.new(_("{} launched").format(name))
|
||||
)
|
||||
|
||||
# Sleep for 6 seconds before withdrawing the notification
|
||||
# The amount a notification stays up is ~5, so leave an extra second for the animation
|
||||
GLib.usleep(6000000)
|
||||
self.withdraw_notification("launch")
|
||||
|
||||
return 0
|
||||
return -1
|
||||
|
||||
def load_games_from_disk(self) -> None:
|
||||
if shared.games_dir.is_dir():
|
||||
for game_file in shared.games_dir.iterdir():
|
||||
try:
|
||||
data = json.load(game_file.open())
|
||||
except (OSError, json.decoder.JSONDecodeError):
|
||||
continue
|
||||
game = Game(data)
|
||||
shared.store.add_game(game, {"skip_save": True})
|
||||
|
||||
def get_source_name(self, source_id: str) -> Any:
|
||||
if source_id == "all":
|
||||
name = _("All Games")
|
||||
elif source_id == "imported":
|
||||
name = _("Added")
|
||||
else:
|
||||
name = globals()[f'{source_id.split("_")[0].title()}Source'].name
|
||||
return name
|
||||
|
||||
def on_about_action(self, *_args: Any) -> None:
|
||||
# Get the debug info from the log files
|
||||
debug_str = ""
|
||||
for index, path in enumerate(shared.log_files):
|
||||
# Add a horizontal line between runs
|
||||
if index > 0:
|
||||
debug_str += "─" * 37 + "\n"
|
||||
# Add the run's logs
|
||||
log_file = (
|
||||
lzma.open(path, "rt", encoding="utf-8")
|
||||
if path.name.endswith(".xz")
|
||||
else open(path, "r", encoding="utf-8")
|
||||
)
|
||||
debug_str += log_file.read()
|
||||
log_file.close()
|
||||
|
||||
about = Adw.AboutDialog.new_from_appdata(
|
||||
shared.PREFIX + "/" + shared.APP_ID + ".metainfo.xml", shared.VERSION
|
||||
)
|
||||
about.set_developers(
|
||||
(
|
||||
"kramo https://kramo.page",
|
||||
"Geoffrey Coulaud https://geoffrey-coulaud.fr",
|
||||
"Rilic https://rilic.red",
|
||||
"Arcitec https://github.com/Arcitec",
|
||||
"Paweł Lidwin https://github.com/imLinguin",
|
||||
"Domenico https://github.com/Domefemia",
|
||||
"Rafael Mardojai CM https://mardojai.com",
|
||||
"Clara Hobbs https://github.com/Ratfink",
|
||||
"Sabri Ünal https://github.com/sabriunal",
|
||||
)
|
||||
)
|
||||
about.set_designers(("kramo https://kramo.page",))
|
||||
about.set_copyright("© 2022-2024 kramo")
|
||||
# Translators: Replace this with Your Name, Your Name <your.email@example.com>, or Your Name https://your-site.com for it to show up in the About dialog.
|
||||
about.set_translator_credits(_("translator-credits"))
|
||||
about.set_debug_info(debug_str)
|
||||
about.set_debug_info_filename("cartridges.log")
|
||||
about.add_legal_section(
|
||||
"Steam Branding",
|
||||
"© 2023 Valve Corporation",
|
||||
Gtk.License.CUSTOM,
|
||||
"Steam and the Steam logo are trademarks and/or registered trademarks of Valve Corporation in the U.S. and/or other countries.", # pylint: disable=line-too-long
|
||||
)
|
||||
about.present(shared.win)
|
||||
|
||||
def on_preferences_action(
|
||||
self,
|
||||
_action: Any = None,
|
||||
_parameter: Any = None,
|
||||
page_name: Optional[str] = None,
|
||||
expander_row: Optional[str] = None,
|
||||
) -> Optional[CartridgesPreferences]:
|
||||
if CartridgesPreferences.is_open:
|
||||
return
|
||||
|
||||
win = CartridgesPreferences()
|
||||
if page_name:
|
||||
win.set_visible_page_name(page_name)
|
||||
if expander_row:
|
||||
getattr(win, expander_row).set_expanded(True)
|
||||
win.present(shared.win)
|
||||
|
||||
return win
|
||||
|
||||
def on_launch_game_action(self, *_args: Any) -> None:
|
||||
shared.win.active_game.launch()
|
||||
|
||||
def on_hide_game_action(self, *_args: Any) -> None:
|
||||
shared.win.active_game.toggle_hidden()
|
||||
|
||||
def on_edit_game_action(self, *_args: Any) -> None:
|
||||
DetailsDialog(shared.win.active_game).present(shared.win)
|
||||
|
||||
def on_add_game_action(self, *_args: Any) -> None:
|
||||
if DetailsDialog.is_open:
|
||||
return
|
||||
|
||||
DetailsDialog().present(shared.win)
|
||||
|
||||
def on_import_action(self, *_args: Any) -> None:
|
||||
shared.importer = Importer()
|
||||
|
||||
if shared.schema.get_boolean("lutris"):
|
||||
shared.importer.add_source(LutrisSource())
|
||||
|
||||
if shared.schema.get_boolean("steam"):
|
||||
shared.importer.add_source(SteamSource())
|
||||
|
||||
if shared.schema.get_boolean("heroic"):
|
||||
shared.importer.add_source(HeroicSource())
|
||||
|
||||
if shared.schema.get_boolean("bottles"):
|
||||
shared.importer.add_source(BottlesSource())
|
||||
|
||||
if shared.schema.get_boolean("flatpak"):
|
||||
shared.importer.add_source(FlatpakSource())
|
||||
|
||||
if shared.schema.get_boolean("desktop"):
|
||||
shared.importer.add_source(DesktopSource())
|
||||
|
||||
if shared.schema.get_boolean("itch"):
|
||||
shared.importer.add_source(ItchSource())
|
||||
|
||||
if shared.schema.get_boolean("legendary"):
|
||||
shared.importer.add_source(LegendarySource())
|
||||
|
||||
if shared.schema.get_boolean("retroarch"):
|
||||
shared.importer.add_source(RetroarchSource())
|
||||
|
||||
shared.importer.run()
|
||||
|
||||
def on_remove_game_action(self, *_args: Any) -> None:
|
||||
shared.win.active_game.remove_game()
|
||||
|
||||
def on_remove_game_details_view_action(self, *_args: Any) -> None:
|
||||
if shared.win.navigation_view.get_visible_page() == shared.win.details_page:
|
||||
self.on_remove_game_action()
|
||||
|
||||
def search(self, uri: str) -> None:
|
||||
Gio.AppInfo.launch_default_for_uri(f"{uri}{quote(shared.win.active_game.name)}")
|
||||
|
||||
def on_igdb_search_action(self, *_args: Any) -> None:
|
||||
self.search("https://www.igdb.com/search?type=1&q=")
|
||||
|
||||
def on_sgdb_search_action(self, *_args: Any) -> None:
|
||||
self.search("https://www.steamgriddb.com/search/grids?term=")
|
||||
|
||||
def on_protondb_search_action(self, *_args: Any) -> None:
|
||||
self.search("https://www.protondb.com/search?q=")
|
||||
|
||||
def on_lutris_search_action(self, *_args: Any) -> None:
|
||||
self.search("https://lutris.net/games?q=")
|
||||
|
||||
def on_hltb_search_action(self, *_args: Any) -> None:
|
||||
self.search("https://howlongtobeat.com/?q=")
|
||||
|
||||
def on_quit_action(self, *_args: Any) -> None:
|
||||
self.quit()
|
||||
|
||||
def create_actions(self, actions: set) -> None:
|
||||
for action in actions:
|
||||
simple_action = Gio.SimpleAction.new(action[0], None)
|
||||
|
||||
scope = action[2] if action[2:3] else self
|
||||
simple_action.connect("activate", getattr(scope, f"on_{action[0]}_action"))
|
||||
|
||||
if action[1:2]:
|
||||
self.set_accels_for_action(
|
||||
f"app.{action[0]}" if scope == self else f"win.{action[0]}",
|
||||
(
|
||||
tuple(s.replace("<primary>", "<meta>") for s in action[1])
|
||||
if sys.platform.startswith("darwin")
|
||||
else action[1]
|
||||
),
|
||||
)
|
||||
|
||||
scope.add_action(simple_action)
|
||||
|
||||
|
||||
def main(_version: int) -> Any:
|
||||
"""App entry point"""
|
||||
app = CartridgesApplication()
|
||||
return app.run(sys.argv)
|
||||
@@ -1,11 +1,11 @@
|
||||
moduledir = join_paths(pkgdatadir, 'src')
|
||||
moduledir = python_dir / 'cartridges'
|
||||
|
||||
configure_file(
|
||||
input: 'cartridges.in',
|
||||
output: 'cartridges',
|
||||
configuration: conf,
|
||||
install: true,
|
||||
install_dir: get_option('bindir')
|
||||
install_dir: get_option('bindir'),
|
||||
)
|
||||
|
||||
install_subdir('importer', install_dir: moduledir)
|
||||
@@ -15,17 +15,14 @@ install_subdir('logging', install_dir: moduledir)
|
||||
install_subdir('errors', install_dir: moduledir)
|
||||
install_data(
|
||||
[
|
||||
'application_delegate.py',
|
||||
'main.py',
|
||||
'window.py',
|
||||
'preferences.py',
|
||||
'details_window.py',
|
||||
'details_dialog.py',
|
||||
'game.py',
|
||||
'game_cover.py',
|
||||
configure_file(
|
||||
input: 'shared.py.in',
|
||||
output: 'shared.py',
|
||||
configuration: conf
|
||||
)
|
||||
configure_file(input: 'shared.py.in', output: 'shared.py', configuration: conf),
|
||||
],
|
||||
install_dir: moduledir
|
||||
install_dir: moduledir,
|
||||
)
|
||||
@@ -17,108 +17,121 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# pyright: reportAssignmentType=none
|
||||
|
||||
import logging
|
||||
import re
|
||||
from pathlib import Path
|
||||
from shutil import rmtree
|
||||
from sys import platform
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from gi.repository import Adw, Gio, GLib, Gtk
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.importer.sources.bottles_source import BottlesSource
|
||||
from src.importer.sources.flatpak_source import FlatpakSource
|
||||
from src.importer.sources.heroic_source import HeroicSource
|
||||
from src.importer.sources.itch_source import ItchSource
|
||||
from src.importer.sources.legendary_source import LegendarySource
|
||||
from src.importer.sources.location import UnresolvableLocationError
|
||||
from src.importer.sources.lutris_source import LutrisSource
|
||||
from src.importer.sources.retroarch_source import RetroarchSource
|
||||
from src.importer.sources.source import Source
|
||||
from src.importer.sources.steam_source import SteamSource
|
||||
from src.utils.create_dialog import create_dialog
|
||||
from cartridges import shared
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
from cartridges.importer.bottles_source import BottlesSource
|
||||
from cartridges.importer.desktop_source import DesktopSource
|
||||
from cartridges.importer.flatpak_source import FlatpakSource
|
||||
from cartridges.importer.heroic_source import HeroicSource
|
||||
from cartridges.importer.itch_source import ItchSource
|
||||
from cartridges.importer.legendary_source import LegendarySource
|
||||
from cartridges.importer.location import UnresolvableLocationError
|
||||
from cartridges.importer.lutris_source import LutrisSource
|
||||
from cartridges.importer.retroarch_source import RetroarchSource
|
||||
from cartridges.importer.source import Source
|
||||
from cartridges.importer.steam_source import SteamSource
|
||||
from cartridges.store.managers.sgdb_manager import SgdbManager
|
||||
from cartridges.utils.create_dialog import create_dialog
|
||||
|
||||
|
||||
@Gtk.Template(resource_path=shared.PREFIX + "/gtk/preferences.ui")
|
||||
class PreferencesWindow(Adw.PreferencesWindow):
|
||||
__gtype_name__ = "PreferencesWindow"
|
||||
class CartridgesPreferences(Adw.PreferencesDialog):
|
||||
__gtype_name__ = "CartridgesPreferences"
|
||||
|
||||
general_page = Gtk.Template.Child()
|
||||
import_page = Gtk.Template.Child()
|
||||
sgdb_page = Gtk.Template.Child()
|
||||
general_page: Adw.PreferencesPage = Gtk.Template.Child()
|
||||
import_page: Adw.PreferencesPage = Gtk.Template.Child()
|
||||
sgdb_page: Adw.PreferencesPage = Gtk.Template.Child()
|
||||
|
||||
sources_group = Gtk.Template.Child()
|
||||
sources_group: Adw.PreferencesGroup = Gtk.Template.Child()
|
||||
|
||||
exit_after_launch_switch = Gtk.Template.Child()
|
||||
cover_launches_game_switch = Gtk.Template.Child()
|
||||
high_quality_images_switch = Gtk.Template.Child()
|
||||
exit_after_launch_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
cover_launches_game_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
high_quality_images_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
remove_missing_switch = Gtk.Template.Child()
|
||||
auto_import_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
remove_missing_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
steam_expander_row = Gtk.Template.Child()
|
||||
steam_data_action_row = Gtk.Template.Child()
|
||||
steam_data_file_chooser_button = Gtk.Template.Child()
|
||||
steam_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
steam_data_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
steam_data_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
lutris_expander_row = Gtk.Template.Child()
|
||||
lutris_data_action_row = Gtk.Template.Child()
|
||||
lutris_data_file_chooser_button = Gtk.Template.Child()
|
||||
lutris_cache_action_row = Gtk.Template.Child()
|
||||
lutris_cache_file_chooser_button = Gtk.Template.Child()
|
||||
lutris_import_steam_switch = Gtk.Template.Child()
|
||||
lutris_import_flatpak_switch = Gtk.Template.Child()
|
||||
lutris_expander_row: Adw.ExpanderRowClass = Gtk.Template.Child()
|
||||
lutris_data_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
lutris_data_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
lutris_import_steam_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
lutris_import_flatpak_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
heroic_expander_row = Gtk.Template.Child()
|
||||
heroic_config_action_row = Gtk.Template.Child()
|
||||
heroic_config_file_chooser_button = Gtk.Template.Child()
|
||||
heroic_import_epic_switch = Gtk.Template.Child()
|
||||
heroic_import_gog_switch = Gtk.Template.Child()
|
||||
heroic_import_amazon_switch = Gtk.Template.Child()
|
||||
heroic_import_sideload_switch = Gtk.Template.Child()
|
||||
heroic_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
heroic_config_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
heroic_config_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
heroic_import_epic_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
heroic_import_gog_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
heroic_import_amazon_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
heroic_import_sideload_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
bottles_expander_row = Gtk.Template.Child()
|
||||
bottles_data_action_row = Gtk.Template.Child()
|
||||
bottles_data_file_chooser_button = Gtk.Template.Child()
|
||||
bottles_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
bottles_data_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
bottles_data_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
itch_expander_row = Gtk.Template.Child()
|
||||
itch_config_action_row = Gtk.Template.Child()
|
||||
itch_config_file_chooser_button = Gtk.Template.Child()
|
||||
itch_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
itch_config_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
itch_config_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
legendary_expander_row = Gtk.Template.Child()
|
||||
legendary_config_action_row = Gtk.Template.Child()
|
||||
legendary_config_file_chooser_button = Gtk.Template.Child()
|
||||
legendary_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
legendary_config_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
legendary_config_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
retroarch_expander_row = Gtk.Template.Child()
|
||||
retroarch_config_action_row = Gtk.Template.Child()
|
||||
retroarch_config_file_chooser_button = Gtk.Template.Child()
|
||||
retroarch_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
retroarch_config_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
retroarch_config_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
flatpak_expander_row = Gtk.Template.Child()
|
||||
flatpak_data_action_row = Gtk.Template.Child()
|
||||
flatpak_data_file_chooser_button = Gtk.Template.Child()
|
||||
flatpak_import_launchers_switch = Gtk.Template.Child()
|
||||
flatpak_expander_row: Adw.ExpanderRow = Gtk.Template.Child()
|
||||
flatpak_system_data_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
flatpak_system_data_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
flatpak_user_data_action_row: Adw.ActionRow = Gtk.Template.Child()
|
||||
flatpak_user_data_file_chooser_button: Gtk.Button = Gtk.Template.Child()
|
||||
flatpak_import_launchers_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
desktop_switch = Gtk.Template.Child()
|
||||
desktop_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
|
||||
sgdb_key_group = Gtk.Template.Child()
|
||||
sgdb_key_entry_row = Gtk.Template.Child()
|
||||
sgdb_switch = Gtk.Template.Child()
|
||||
sgdb_switch_row = Gtk.Template.Child()
|
||||
sgdb_prefer_switch = Gtk.Template.Child()
|
||||
sgdb_animated_switch = Gtk.Template.Child()
|
||||
sgdb_key_group: Adw.PreferencesGroup = Gtk.Template.Child()
|
||||
sgdb_key_entry_row: Adw.EntryRow = Gtk.Template.Child()
|
||||
sgdb_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
sgdb_prefer_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
sgdb_animated_switch: Adw.SwitchRow = Gtk.Template.Child()
|
||||
sgdb_fetch_button: Gtk.Button = Gtk.Template.Child()
|
||||
sgdb_stack: Gtk.Stack = Gtk.Template.Child()
|
||||
sgdb_spinner: Adw.Spinner = Gtk.Template.Child()
|
||||
|
||||
danger_zone_group = Gtk.Template.Child()
|
||||
reset_action_row = Gtk.Template.Child()
|
||||
reset_button = Gtk.Template.Child()
|
||||
remove_all_games_button = Gtk.Template.Child()
|
||||
remove_all_games_button_row = Gtk.Template.Child()
|
||||
reset_button_row = Gtk.Template.Child()
|
||||
|
||||
removed_games: set[Game] = set()
|
||||
warning_menu_buttons: dict = {}
|
||||
|
||||
is_open = False
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
super().__init__(**kwargs)
|
||||
self.win = shared.win
|
||||
|
||||
# Make it so only one dialog can be open at a time
|
||||
self.__class__.is_open = True
|
||||
self.connect("closed", lambda *_: self.set_is_open(False))
|
||||
|
||||
self.file_chooser = Gtk.FileDialog()
|
||||
self.set_transient_for(self.win)
|
||||
|
||||
self.toast = Adw.Toast.new(_("All games removed"))
|
||||
self.toast.set_button_label(_("Undo"))
|
||||
@@ -134,13 +147,12 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
self.add_controller(shortcut_controller)
|
||||
|
||||
# General
|
||||
self.remove_all_games_button.connect("clicked", self.remove_all_games)
|
||||
self.remove_all_games_button_row.connect("activated", self.remove_all_games)
|
||||
|
||||
# Debug
|
||||
if shared.PROFILE == "development":
|
||||
self.reset_action_row.set_visible(True)
|
||||
self.reset_button.connect("clicked", self.reset_app)
|
||||
self.set_default_size(-1, 560)
|
||||
self.reset_button_row.set_visible(True)
|
||||
self.reset_button_row.connect("activated", self.reset_app)
|
||||
|
||||
# Sources settings
|
||||
for source_class in (
|
||||
@@ -160,6 +172,10 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
else:
|
||||
self.init_source_row(source)
|
||||
|
||||
# Special case for the desktop source
|
||||
if not DesktopSource().is_available:
|
||||
self.desktop_switch.set_visible(False)
|
||||
|
||||
# SteamGridDB
|
||||
def sgdb_key_changed(*_args: Any) -> None:
|
||||
shared.schema.set_string("sgdb-key", self.sgdb_key_entry_row.get_text())
|
||||
@@ -175,14 +191,46 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
)
|
||||
)
|
||||
|
||||
def set_sgdb_sensitive(widget: Adw.EntryRow) -> None:
|
||||
if not widget.get_text():
|
||||
shared.schema.set_boolean("sgdb", False)
|
||||
def update_sgdb(*_args: Any) -> None:
|
||||
counter = 0
|
||||
games_len = len(shared.store)
|
||||
sgdb_manager = shared.store.managers[SgdbManager]
|
||||
sgdb_manager.reset_cancellable()
|
||||
|
||||
self.sgdb_switch_row.set_sensitive(widget.get_text())
|
||||
self.sgdb_spinner.set_visible(True)
|
||||
self.sgdb_stack.set_visible_child(self.sgdb_spinner)
|
||||
|
||||
self.sgdb_key_entry_row.connect("changed", set_sgdb_sensitive)
|
||||
set_sgdb_sensitive(self.sgdb_key_entry_row)
|
||||
self.add_toast(download_toast := Adw.Toast.new(_("Downloading covers…")))
|
||||
|
||||
def update_cover_callback(manager: SgdbManager) -> None:
|
||||
nonlocal counter
|
||||
nonlocal games_len
|
||||
nonlocal download_toast
|
||||
|
||||
counter += 1
|
||||
if counter != games_len:
|
||||
return
|
||||
|
||||
for error in manager.collect_errors():
|
||||
if isinstance(error, FriendlyError):
|
||||
create_dialog(self, error.title, error.subtitle)
|
||||
break
|
||||
|
||||
for game in shared.store:
|
||||
game.update()
|
||||
|
||||
toast = Adw.Toast.new(_("Covers updated"))
|
||||
toast.set_priority(Adw.ToastPriority.HIGH)
|
||||
download_toast.dismiss()
|
||||
self.add_toast(toast)
|
||||
|
||||
self.sgdb_spinner.set_visible(False)
|
||||
self.sgdb_stack.set_visible_child(self.sgdb_fetch_button)
|
||||
|
||||
for game in shared.store:
|
||||
sgdb_manager.process_game(game, {}, update_cover_callback)
|
||||
|
||||
self.sgdb_fetch_button.connect("clicked", update_sgdb)
|
||||
|
||||
# Switches
|
||||
self.bind_switches(
|
||||
@@ -190,6 +238,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
"exit-after-launch",
|
||||
"cover-launches-game",
|
||||
"high-quality-images",
|
||||
"auto-import",
|
||||
"remove-missing",
|
||||
"lutris-import-steam",
|
||||
"lutris-import-flatpak",
|
||||
@@ -205,6 +254,18 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
}
|
||||
)
|
||||
|
||||
def set_sgdb_sensitive(widget: Adw.EntryRow) -> None:
|
||||
if not widget.get_text():
|
||||
shared.schema.set_boolean("sgdb", False)
|
||||
|
||||
self.sgdb_switch.set_sensitive(widget.get_text())
|
||||
|
||||
self.sgdb_key_entry_row.connect("changed", set_sgdb_sensitive)
|
||||
set_sgdb_sensitive(self.sgdb_key_entry_row)
|
||||
|
||||
def set_is_open(self, is_open: bool) -> None:
|
||||
self.__class__.is_open = is_open
|
||||
|
||||
def get_switch(self, setting: str) -> Any:
|
||||
return getattr(self, f'{setting.replace("-", "_")}_switch')
|
||||
|
||||
@@ -220,9 +281,10 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
def choose_folder(
|
||||
self, _widget: Any, callback: Callable, callback_data: Optional[str] = None
|
||||
) -> None:
|
||||
self.file_chooser.select_folder(self.win, None, callback, callback_data)
|
||||
self.file_chooser.select_folder(shared.win, None, callback, callback_data)
|
||||
|
||||
def undo_remove_all(self, *_args: Any) -> None:
|
||||
def undo_remove_all(self, *_args: Any) -> bool:
|
||||
shared.win.get_application().state = shared.AppState.UNDO_REMOVE_ALL_GAMES
|
||||
for game in self.removed_games:
|
||||
game.removed = False
|
||||
game.save()
|
||||
@@ -230,8 +292,14 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
|
||||
self.removed_games = set()
|
||||
self.toast.dismiss()
|
||||
shared.win.get_application().state = shared.AppState.DEFAULT
|
||||
shared.win.create_source_rows()
|
||||
|
||||
return True
|
||||
|
||||
def remove_all_games(self, *_args: Any) -> None:
|
||||
shared.win.get_application().state = shared.AppState.REMOVE_ALL_GAMES
|
||||
shared.win.row_selected(None, shared.win.all_games_row_box.get_parent())
|
||||
for game in shared.store:
|
||||
if not game.removed:
|
||||
self.removed_games.add(game)
|
||||
@@ -239,10 +307,12 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
game.save()
|
||||
game.update()
|
||||
|
||||
if self.win.stack.get_visible_child() == self.win.details_view:
|
||||
self.win.on_go_back_action()
|
||||
if shared.win.navigation_view.get_visible_page() == shared.win.details_page:
|
||||
shared.win.navigation_view.pop()
|
||||
|
||||
self.add_toast(self.toast)
|
||||
shared.win.get_application().state = shared.AppState.DEFAULT
|
||||
shared.win.create_source_rows()
|
||||
|
||||
def reset_app(self, *_args: Any) -> None:
|
||||
rmtree(shared.data_dir / "cartridges", True)
|
||||
@@ -271,9 +341,16 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
)
|
||||
if not action_row:
|
||||
continue
|
||||
path = Path(shared.schema.get_string(location.schema_key)).expanduser()
|
||||
|
||||
subtitle = str(Path(shared.schema.get_string(location.schema_key)))
|
||||
|
||||
if platform == "linux":
|
||||
# Remove the path prefix if picked via Flatpak portal
|
||||
subtitle = re.sub("/run/user/\\d*/doc/.*/", "", str(path))
|
||||
subtitle = re.sub("/run/user/\\d*/doc/.*/", "", subtitle)
|
||||
|
||||
# Replace the home directory with "~"
|
||||
subtitle = re.sub(f"^{str(shared.home)}", "~", subtitle)
|
||||
|
||||
action_row.set_subtitle(subtitle)
|
||||
|
||||
def resolve_locations(self, source: Source) -> None:
|
||||
@@ -291,7 +368,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
|
||||
except UnresolvableLocationError:
|
||||
title = _("Installation Not Found")
|
||||
description = _("Select a valid directory.")
|
||||
description = _("Select a valid directory")
|
||||
format_start = '<span rise="12pt"><b><big>'
|
||||
format_end = "</big></b></span>\n"
|
||||
|
||||
@@ -341,7 +418,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
||||
"""Callback called when a dir picker button is clicked"""
|
||||
try:
|
||||
path = Path(self.file_chooser.select_folder_finish(result).get_path())
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
return
|
||||
|
||||
# Good picked location
|
||||
@@ -17,41 +17,68 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
from enum import IntEnum, auto
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
|
||||
from gi.repository import Gdk, Gio, GLib
|
||||
|
||||
|
||||
class AppState(IntEnum):
|
||||
DEFAULT = auto()
|
||||
LOAD_FROM_DISK = auto()
|
||||
IMPORT = auto()
|
||||
REMOVE_ALL_GAMES = auto()
|
||||
UNDO_REMOVE_ALL_GAMES = auto()
|
||||
|
||||
|
||||
APP_ID = "@APP_ID@"
|
||||
VERSION = "@VERSION@"
|
||||
PREFIX = "@PREFIX@"
|
||||
PROFILE = "@PROFILE@"
|
||||
TIFF_COMPRESSION = "@TIFF_COMPRESSION@"
|
||||
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")
|
||||
|
||||
home = Path.home()
|
||||
|
||||
data_dir = Path(GLib.get_user_data_dir())
|
||||
host_data_dir = Path(getenv("HOST_XDG_DATA_HOME", Path.home() / ".local" / "share"))
|
||||
|
||||
config_dir = Path(GLib.get_user_config_dir())
|
||||
host_config_dir = Path(getenv("HOST_XDG_CONFIG_HOME", Path.home() / ".config"))
|
||||
|
||||
cache_dir = Path(GLib.get_user_cache_dir())
|
||||
host_cache_dir = Path(getenv("HOST_XDG_CACHE_HOME", Path.home() / ".cache"))
|
||||
|
||||
flatpak_dir = home / ".var" / "app"
|
||||
|
||||
games_dir = data_dir / "cartridges" / "games"
|
||||
covers_dir = data_dir / "cartridges" / "covers"
|
||||
|
||||
appdata_dir = Path(os.getenv("appdata") or "C:\\Users\\Default\\AppData\\Roaming")
|
||||
local_appdata_dir = Path(os.getenv("csidl_local_appdata") or "C:\\Users\\Default\\AppData\\Local")
|
||||
programfiles32_dir = Path(os.getenv("programfiles(x86)") or "C:\\Program Files (x86)")
|
||||
|
||||
scale_factor = max(
|
||||
monitor.get_scale_factor() for monitor in Gdk.Display.get_default().get_monitors()
|
||||
appdata_dir = Path(getenv("appdata") or r"C:\Users\Default\AppData\Roaming")
|
||||
local_appdata_dir = Path(
|
||||
getenv("csidl_local_appdata") or r"C:\Users\Default\AppData\Local"
|
||||
)
|
||||
image_size = (200 * scale_factor, 300 * scale_factor)
|
||||
programfiles32_dir = Path(getenv("programfiles(x86)") or r"C:\Program Files (x86)")
|
||||
|
||||
app_support_dir = home / "Library" / "Application Support"
|
||||
|
||||
try:
|
||||
scale_factor = max(
|
||||
monitor.get_scale_factor()
|
||||
for monitor in Gdk.Display.get_default().get_monitors()
|
||||
)
|
||||
except AttributeError: # If shared.py is imported by the search provider
|
||||
pass
|
||||
else:
|
||||
image_size = (200 * scale_factor, 300 * scale_factor)
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
win = None
|
||||
importer = None
|
||||
import_time = None
|
||||
store = None
|
||||
log_files = None
|
||||
log_files = []
|
||||
78
cartridges/shared.pyi
Normal file
@@ -0,0 +1,78 @@
|
||||
# shared.pyi
|
||||
#
|
||||
# Copyright 2024 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from gi.repository import Gio
|
||||
|
||||
from cartridges.importer.importer import Importer
|
||||
from cartridges.store.store import Store
|
||||
from cartridges.window import CartridgesWindow
|
||||
|
||||
|
||||
class AppState:
|
||||
DEFAULT: int
|
||||
LOAD_FROM_DISK: int
|
||||
IMPORT: int
|
||||
REMOVE_ALL_GAMES: int
|
||||
UNDO_REMOVE_ALL_GAMES: int
|
||||
|
||||
|
||||
APP_ID: str
|
||||
VERSION: str
|
||||
PREFIX: str
|
||||
PROFILE: str
|
||||
TIFF_COMPRESSION: str
|
||||
SPEC_VERSION: float
|
||||
|
||||
schema: Gio.Settings
|
||||
state_schema: Gio.Settings
|
||||
|
||||
home: Path
|
||||
|
||||
data_dir: Path
|
||||
host_data_dir: Path
|
||||
|
||||
config_dir: Path
|
||||
host_config_dir: Path
|
||||
|
||||
cache_dir: Path
|
||||
host_cache_dir: Path
|
||||
|
||||
flatpak_dir: Path
|
||||
|
||||
games_dir: Path
|
||||
covers_dir: Path
|
||||
|
||||
appdata_dir: Path
|
||||
local_appdata_dir: Path
|
||||
programfiles32_dir: Path
|
||||
|
||||
app_support_dir: Path
|
||||
|
||||
|
||||
scale_factor: int
|
||||
image_size: int
|
||||
|
||||
win: Optional[CartridgesWindow]
|
||||
importer: Optional[Importer]
|
||||
import_time: Optional[int]
|
||||
store = Optional[Store]
|
||||
log_files: list[Path]
|
||||
@@ -21,8 +21,8 @@ from typing import Any, Callable
|
||||
|
||||
from gi.repository import Gio
|
||||
|
||||
from src.game import Game
|
||||
from src.store.managers.manager import Manager
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.manager import Manager
|
||||
|
||||
|
||||
class AsyncManager(Manager):
|
||||
@@ -25,11 +25,11 @@ import requests
|
||||
from gi.repository import GdkPixbuf, Gio
|
||||
from requests.exceptions import HTTPError, SSLError
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.store.managers.manager import Manager
|
||||
from src.store.managers.steam_api_manager import SteamAPIManager
|
||||
from src.utils.save_cover import convert_cover, save_cover
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.manager import Manager
|
||||
from cartridges.store.managers.steam_api_manager import SteamAPIManager
|
||||
from cartridges.utils.save_cover import convert_cover, save_cover
|
||||
|
||||
|
||||
class ImageSize(NamedTuple):
|
||||
@@ -17,17 +17,18 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from src.game import Game
|
||||
from src.game_cover import GameCover
|
||||
from src.store.managers.manager import Manager
|
||||
from src.store.managers.sgdb_manager import SGDBManager
|
||||
from src.store.managers.steam_api_manager import SteamAPIManager
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.game_cover import GameCover
|
||||
from cartridges.store.managers.manager import Manager
|
||||
from cartridges.store.managers.sgdb_manager import SgdbManager
|
||||
from cartridges.store.managers.steam_api_manager import SteamAPIManager
|
||||
|
||||
|
||||
class DisplayManager(Manager):
|
||||
"""Manager in charge of adding a game to the UI"""
|
||||
|
||||
run_after = (SteamAPIManager, SGDBManager)
|
||||
run_after = (SteamAPIManager, SgdbManager)
|
||||
signals = {"update-ready"}
|
||||
|
||||
def main(self, game: Game, _additional_data: dict) -> None:
|
||||
@@ -46,27 +47,30 @@ class DisplayManager(Manager):
|
||||
"notify::visible", game.toggle_play, None
|
||||
)
|
||||
game.menu_button.get_popover().connect(
|
||||
"notify::visible", game.win.set_active_game, game
|
||||
"notify::visible", shared.win.set_active_game, game
|
||||
)
|
||||
|
||||
if game.game_id in game.win.game_covers:
|
||||
game.game_cover = game.win.game_covers[game.game_id]
|
||||
if game.game_id in shared.win.game_covers:
|
||||
game.game_cover = shared.win.game_covers[game.game_id]
|
||||
game.game_cover.add_picture(game.cover)
|
||||
else:
|
||||
game.game_cover = GameCover({game.cover}, game.get_cover_path())
|
||||
game.win.game_covers[game.game_id] = game.game_cover
|
||||
shared.win.game_covers[game.game_id] = game.game_cover
|
||||
|
||||
if (
|
||||
game.win.stack.get_visible_child() == game.win.details_view
|
||||
and game.win.active_game == game
|
||||
shared.win.navigation_view.get_visible_page() == shared.win.details_page
|
||||
and shared.win.active_game == game
|
||||
):
|
||||
game.win.show_details_view(game)
|
||||
shared.win.show_details_page(game)
|
||||
|
||||
if not game.removed and not game.blacklisted:
|
||||
if game.hidden:
|
||||
game.win.hidden_library.append(game)
|
||||
shared.win.hidden_library.append(game)
|
||||
else:
|
||||
game.win.library.append(game)
|
||||
shared.win.library.append(game)
|
||||
game.get_parent().set_focusable(False)
|
||||
|
||||
game.win.set_library_child()
|
||||
shared.win.set_library_child()
|
||||
|
||||
if shared.win.get_application().state == shared.AppState.DEFAULT:
|
||||
shared.win.create_source_rows()
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
import json
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.store.managers.async_manager import AsyncManager
|
||||
from src.store.managers.steam_api_manager import SteamAPIManager
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.async_manager import AsyncManager
|
||||
from cartridges.store.managers.steam_api_manager import SteamAPIManager
|
||||
|
||||
|
||||
class FileManager(AsyncManager):
|
||||
@@ -53,7 +53,7 @@ class FileManager(AsyncManager):
|
||||
|
||||
json.dump(
|
||||
{attr: getattr(game, attr) for attr in attrs if attr},
|
||||
(shared.games_dir / f"{game.game_id}.json").open("w"),
|
||||
(shared.games_dir / f"{game.game_id}.json").open("w", encoding="utf-8"),
|
||||
indent=4,
|
||||
sort_keys=True,
|
||||
)
|
||||
@@ -22,9 +22,9 @@ from abc import abstractmethod
|
||||
from time import sleep
|
||||
from typing import Any, Callable, Container
|
||||
|
||||
from src.errors.error_producer import ErrorProducer
|
||||
from src.errors.friendly_error import FriendlyError
|
||||
from src.game import Game
|
||||
from cartridges.errors.error_producer import ErrorProducer
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
|
||||
|
||||
class Manager(ErrorProducer):
|
||||
@@ -21,15 +21,15 @@ from json import JSONDecodeError
|
||||
|
||||
from requests.exceptions import HTTPError, SSLError
|
||||
|
||||
from src.errors.friendly_error import FriendlyError
|
||||
from src.game import Game
|
||||
from src.store.managers.async_manager import AsyncManager
|
||||
from src.store.managers.cover_manager import CoverManager
|
||||
from src.store.managers.steam_api_manager import SteamAPIManager
|
||||
from src.utils.steamgriddb import SGDBAuthError, SGDBHelper
|
||||
from cartridges.errors.friendly_error import FriendlyError
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.async_manager import AsyncManager
|
||||
from cartridges.store.managers.cover_manager import CoverManager
|
||||
from cartridges.store.managers.steam_api_manager import SteamAPIManager
|
||||
from cartridges.utils.steamgriddb import SgdbAuthError, SgdbHelper
|
||||
|
||||
|
||||
class SGDBManager(AsyncManager):
|
||||
class SgdbManager(AsyncManager):
|
||||
"""Manager in charge of downloading a game's cover from SteamGridDB"""
|
||||
|
||||
run_after = (SteamAPIManager, CoverManager)
|
||||
@@ -37,9 +37,9 @@ class SGDBManager(AsyncManager):
|
||||
|
||||
def main(self, game: Game, _additional_data: dict) -> None:
|
||||
try:
|
||||
sgdb = SGDBHelper()
|
||||
sgdb = SgdbHelper()
|
||||
sgdb.conditionaly_update_cover(game)
|
||||
except SGDBAuthError as error:
|
||||
except SgdbAuthError as error:
|
||||
# If invalid auth, cancel all SGDBManager tasks
|
||||
self.cancellable.cancel()
|
||||
raise FriendlyError(
|
||||
@@ -20,9 +20,9 @@
|
||||
from requests.exceptions import HTTPError, SSLError
|
||||
from urllib3.exceptions import ConnectionError as Urllib3ConnectionError
|
||||
|
||||
from src.game import Game
|
||||
from src.store.managers.async_manager import AsyncManager
|
||||
from src.utils.steam import (
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.async_manager import AsyncManager
|
||||
from cartridges.utils.steam import (
|
||||
SteamAPIHelper,
|
||||
SteamGameNotFoundError,
|
||||
SteamNotAGameError,
|
||||
@@ -22,8 +22,8 @@ from typing import Iterable
|
||||
|
||||
from gi.repository import GObject
|
||||
|
||||
from src.game import Game
|
||||
from src.store.managers.manager import Manager
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.manager import Manager
|
||||
|
||||
|
||||
class Pipeline(GObject.Object):
|
||||
@@ -20,10 +20,10 @@
|
||||
import logging
|
||||
from typing import Any, Generator, MutableMapping, Optional
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.store.managers.manager import Manager
|
||||
from src.store.pipeline import Pipeline
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.store.managers.manager import Manager
|
||||
from cartridges.store.pipeline import Pipeline
|
||||
|
||||
|
||||
class Store:
|
||||
@@ -48,7 +48,7 @@ class Store:
|
||||
"""Check if the game is present in the store with the `in` keyword"""
|
||||
if not isinstance(obj, Game):
|
||||
return False
|
||||
if not (source_mapping := self.source_games.get(obj.source)):
|
||||
if not (source_mapping := self.source_games.get(obj.base_source)):
|
||||
return False
|
||||
return obj.game_id in source_mapping
|
||||
|
||||
@@ -60,7 +60,7 @@ class Store:
|
||||
|
||||
def __len__(self) -> int:
|
||||
"""Get the number of games in the store with the `len` builtin"""
|
||||
return sum(len(source_mapping) for source_mapping in self.source_games)
|
||||
return sum(len(source_mapping) for source_mapping in self.source_games.values())
|
||||
|
||||
def __getitem__(self, game_id: str) -> Game:
|
||||
"""Get a game by its id with `store["game_id_goes_here"]`"""
|
||||
@@ -150,9 +150,9 @@ class Store:
|
||||
game.connect(signal, manager.run)
|
||||
|
||||
# Add the game to the store
|
||||
if not game.source in self.source_games:
|
||||
self.source_games[game.source] = {}
|
||||
self.source_games[game.source][game.game_id] = game
|
||||
if not game.base_source in self.source_games:
|
||||
self.source_games[game.base_source] = {}
|
||||
self.source_games[game.base_source][game.game_id] = game
|
||||
|
||||
# Run the pipeline for the game
|
||||
if not run_pipeline:
|
||||
@@ -28,12 +28,12 @@ def create_dialog(
|
||||
body: str,
|
||||
extra_option: Optional[str] = None,
|
||||
extra_label: Optional[str] = None,
|
||||
) -> Adw.MessageDialog:
|
||||
dialog = Adw.MessageDialog.new(win, heading, body)
|
||||
) -> Adw.AlertDialog:
|
||||
dialog = Adw.AlertDialog.new(heading, body)
|
||||
dialog.add_response("dismiss", _("Dismiss"))
|
||||
|
||||
if extra_option:
|
||||
dialog.add_response(extra_option, _(extra_label))
|
||||
dialog.add_response(extra_option, extra_label or "")
|
||||
|
||||
dialog.present()
|
||||
dialog.choose(win)
|
||||
return dialog
|
||||
43
cartridges/utils/run_executable.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# run_executable.py
|
||||
#
|
||||
# Copyright 2023 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
from shlex import quote
|
||||
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
def run_executable(executable) -> None:
|
||||
args = (
|
||||
"flatpak-spawn --host /bin/sh -c " + quote(executable) # Flatpak
|
||||
if os.getenv("FLATPAK_ID") == shared.APP_ID
|
||||
else executable # Others
|
||||
)
|
||||
|
||||
logging.info("Launching `%s`", str(args))
|
||||
# pylint: disable=consider-using-with
|
||||
subprocess.Popen(
|
||||
args,
|
||||
cwd=shared.home,
|
||||
shell=True,
|
||||
start_new_session=True,
|
||||
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0, # type: ignore
|
||||
)
|
||||
@@ -25,7 +25,7 @@ from typing import Optional
|
||||
from gi.repository import Gdk, GdkPixbuf, Gio, GLib
|
||||
from PIL import Image, ImageSequence, UnidentifiedImageError
|
||||
|
||||
from src import shared
|
||||
from cartridges import shared
|
||||
|
||||
|
||||
def convert_cover(
|
||||
@@ -61,7 +61,6 @@ def convert_cover(
|
||||
tmp_path,
|
||||
save_all=True,
|
||||
append_images=frames[1:],
|
||||
disposal=2,
|
||||
)
|
||||
|
||||
else:
|
||||
@@ -75,7 +74,7 @@ def convert_cover(
|
||||
tmp_path,
|
||||
compression="tiff_adobe_deflate"
|
||||
if shared.schema.get_boolean("high-quality-images")
|
||||
else "webp",
|
||||
else shared.TIFF_COMPRESSION,
|
||||
)
|
||||
except UnidentifiedImageError:
|
||||
try:
|
||||
@@ -83,7 +82,7 @@ def convert_cover(
|
||||
tmp_path := Gio.File.new_tmp("XXXXXX.tiff")[0].get_path()
|
||||
)
|
||||
return convert_cover(tmp_path)
|
||||
except GLib.GError:
|
||||
except GLib.Error:
|
||||
return None
|
||||
|
||||
return tmp_path
|
||||
@@ -27,8 +27,8 @@ from typing import TypedDict
|
||||
import requests
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from src import shared
|
||||
from src.utils.rate_limiter import RateLimiter
|
||||
from cartridges import shared
|
||||
from cartridges.utils.rate_limiter import RateLimiter
|
||||
|
||||
|
||||
class SteamError(Exception):
|
||||
@@ -26,32 +26,32 @@ import requests
|
||||
from gi.repository import Gio
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from src import shared
|
||||
from src.game import Game
|
||||
from src.utils.save_cover import convert_cover, save_cover
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.utils.save_cover import convert_cover, save_cover
|
||||
|
||||
|
||||
class SGDBError(Exception):
|
||||
class SgdbError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SGDBAuthError(SGDBError):
|
||||
class SgdbAuthError(SgdbError):
|
||||
pass
|
||||
|
||||
|
||||
class SGDBGameNotFoundError(SGDBError):
|
||||
class SgdbGameNotFound(SgdbError):
|
||||
pass
|
||||
|
||||
|
||||
class SGDBBadRequestError(SGDBError):
|
||||
class SgdbBadRequest(SgdbError):
|
||||
pass
|
||||
|
||||
|
||||
class SGDBNoImageFoundError(SGDBError):
|
||||
class SgdbNoImageFound(SgdbError):
|
||||
pass
|
||||
|
||||
|
||||
class SGDBHelper:
|
||||
class SgdbHelper:
|
||||
"""Helper class to make queries to SteamGridDB"""
|
||||
|
||||
base_url = "https://www.steamgriddb.com/api/v2/"
|
||||
@@ -70,9 +70,9 @@ class SGDBHelper:
|
||||
case 200:
|
||||
return res.json()["data"][0]["id"]
|
||||
case 401:
|
||||
raise SGDBAuthError(res.json()["errors"][0])
|
||||
raise SgdbAuthError(res.json()["errors"][0])
|
||||
case 404:
|
||||
raise SGDBGameNotFoundError(res.status_code)
|
||||
raise SgdbGameNotFound(res.status_code)
|
||||
case _:
|
||||
res.raise_for_status()
|
||||
|
||||
@@ -86,12 +86,12 @@ class SGDBHelper:
|
||||
case 200:
|
||||
data = res.json()["data"]
|
||||
if len(data) == 0:
|
||||
raise SGDBNoImageFoundError()
|
||||
raise SgdbNoImageFound()
|
||||
return data[0]["url"]
|
||||
case 401:
|
||||
raise SGDBAuthError(res.json()["errors"][0])
|
||||
raise SgdbAuthError(res.json()["errors"][0])
|
||||
case 404:
|
||||
raise SGDBGameNotFoundError(res.status_code)
|
||||
raise SgdbGameNotFound(res.status_code)
|
||||
case _:
|
||||
res.raise_for_status()
|
||||
|
||||
@@ -115,7 +115,7 @@ class SGDBHelper:
|
||||
# Get ID for the game
|
||||
try:
|
||||
sgdb_id = self.get_game_id(game)
|
||||
except (HTTPError, SGDBError) as error:
|
||||
except (HTTPError, SgdbError) as error:
|
||||
logging.warning(
|
||||
"%s while getting SGDB ID for %s", type(error).__name__, game.name
|
||||
)
|
||||
@@ -135,10 +135,10 @@ class SGDBHelper:
|
||||
tmp_file_path = tmp_file.get_path()
|
||||
Path(tmp_file_path).write_bytes(response.content)
|
||||
save_cover(game.game_id, convert_cover(tmp_file_path))
|
||||
except SGDBAuthError as error:
|
||||
except SgdbAuthError as error:
|
||||
# Let caller handle auth errors
|
||||
raise error
|
||||
except (HTTPError, SGDBError) as error:
|
||||
except (HTTPError, SgdbError) as error:
|
||||
logging.warning(
|
||||
"%s while getting image for %s kwargs=%s",
|
||||
type(error).__name__,
|
||||
@@ -156,4 +156,4 @@ class SGDBHelper:
|
||||
game.name,
|
||||
sgdb_id,
|
||||
)
|
||||
raise SGDBNoImageFoundError()
|
||||
raise SgdbNoImageFound()
|
||||
537
cartridges/window.py
Normal file
@@ -0,0 +1,537 @@
|
||||
# window.py
|
||||
#
|
||||
# Copyright 2022-2023 kramo
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# pyright: reportAssignmentType=none
|
||||
|
||||
from sys import platform
|
||||
from typing import Any, Optional
|
||||
|
||||
from cartridges import shared
|
||||
from cartridges.game import Game
|
||||
from cartridges.game_cover import GameCover
|
||||
from cartridges.utils.relative_date import relative_date
|
||||
from gi.repository import Adw, Gio, GLib, Gtk, Pango
|
||||
|
||||
|
||||
@Gtk.Template(resource_path=shared.PREFIX + "/gtk/window.ui")
|
||||
class CartridgesWindow(Adw.ApplicationWindow):
|
||||
__gtype_name__ = "CartridgesWindow"
|
||||
|
||||
overlay_split_view: Adw.OverlaySplitView = Gtk.Template.Child()
|
||||
navigation_view: Adw.NavigationView = Gtk.Template.Child()
|
||||
sidebar_navigation_page: Adw.NavigationPage = Gtk.Template.Child()
|
||||
sidebar: Gtk.ListBox = Gtk.Template.Child()
|
||||
all_games_row_box: Gtk.Box = Gtk.Template.Child()
|
||||
all_games_no_label: Gtk.Label = Gtk.Template.Child()
|
||||
added_row_box: Gtk.Box = Gtk.Template.Child()
|
||||
added_games_no_label: Gtk.Label = Gtk.Template.Child()
|
||||
toast_overlay: Adw.ToastOverlay = Gtk.Template.Child()
|
||||
primary_menu_button: Gtk.MenuButton = Gtk.Template.Child()
|
||||
show_sidebar_button: Gtk.Button = Gtk.Template.Child()
|
||||
details_view: Gtk.Overlay = Gtk.Template.Child()
|
||||
library_page: Adw.NavigationPage = Gtk.Template.Child()
|
||||
library_view: Adw.ToolbarView = Gtk.Template.Child()
|
||||
library: Gtk.FlowBox = Gtk.Template.Child()
|
||||
scrolledwindow: Gtk.ScrolledWindow = Gtk.Template.Child()
|
||||
library_overlay: Gtk.Overlay = Gtk.Template.Child()
|
||||
notice_empty: Adw.StatusPage = Gtk.Template.Child()
|
||||
notice_no_results: Adw.StatusPage = Gtk.Template.Child()
|
||||
search_bar: Gtk.SearchBar = Gtk.Template.Child()
|
||||
search_entry: Gtk.SearchEntry = Gtk.Template.Child()
|
||||
search_button: Gtk.ToggleButton = Gtk.Template.Child()
|
||||
|
||||
details_page: Adw.NavigationPage = Gtk.Template.Child()
|
||||
details_view_toolbar_view: Adw.ToolbarView = Gtk.Template.Child()
|
||||
details_view_cover: Gtk.Picture = Gtk.Template.Child()
|
||||
details_view_spinner: Adw.Spinner = Gtk.Template.Child()
|
||||
details_view_title: Gtk.Label = Gtk.Template.Child()
|
||||
details_view_blurred_cover: Gtk.Picture = Gtk.Template.Child()
|
||||
details_view_play_button: Gtk.Button = Gtk.Template.Child()
|
||||
details_view_developer: Gtk.Label = Gtk.Template.Child()
|
||||
details_view_added: Gtk.ShortcutLabel = Gtk.Template.Child()
|
||||
details_view_last_played: Gtk.Label = Gtk.Template.Child()
|
||||
details_view_hide_button: Gtk.Button = Gtk.Template.Child()
|
||||
|
||||
hidden_library_page: Adw.NavigationPage = Gtk.Template.Child()
|
||||
hidden_primary_menu_button: Gtk.MenuButton = Gtk.Template.Child()
|
||||
hidden_library: Gtk.FlowBox = Gtk.Template.Child()
|
||||
hidden_library_view: Adw.ToolbarView = Gtk.Template.Child()
|
||||
hidden_scrolledwindow: Gtk.ScrolledWindow = Gtk.Template.Child()
|
||||
hidden_library_overlay: Gtk.Overlay = Gtk.Template.Child()
|
||||
hidden_notice_empty: Adw.StatusPage = Gtk.Template.Child()
|
||||
hidden_notice_no_results: Adw.StatusPage = Gtk.Template.Child()
|
||||
hidden_search_bar: Gtk.SearchBar = Gtk.Template.Child()
|
||||
hidden_search_entry: Gtk.SearchEntry = Gtk.Template.Child()
|
||||
hidden_search_button: Gtk.ToggleButton = Gtk.Template.Child()
|
||||
|
||||
game_covers: dict = {}
|
||||
toasts: dict = {}
|
||||
active_game: Game
|
||||
details_view_game_cover: Optional[GameCover] = None
|
||||
sort_state: str = "last_played"
|
||||
filter_state: str = "all"
|
||||
source_rows: dict = {}
|
||||
|
||||
def create_source_rows(self) -> None:
|
||||
def get_removed(source_id: str) -> Any:
|
||||
removed = tuple(
|
||||
game.removed or game.hidden or game.blacklisted
|
||||
for game in shared.store.source_games[source_id].values()
|
||||
)
|
||||
return (
|
||||
(count,) if (count := sum(removed)) != len(removed) else False
|
||||
) # Return a tuple because 0 == False and 1 == True
|
||||
|
||||
total_games_no = 0
|
||||
restored = False
|
||||
|
||||
selected_id = (
|
||||
self.source_rows[selected_row][0]
|
||||
if (selected_row := self.sidebar.get_selected_row()) in self.source_rows
|
||||
else None
|
||||
)
|
||||
|
||||
if selected_row == self.added_row_box.get_parent():
|
||||
self.sidebar.select_row(self.added_row_box.get_parent())
|
||||
restored = True
|
||||
|
||||
if added_missing := (
|
||||
not shared.store.source_games.get("imported")
|
||||
or not (removed := get_removed("imported"))
|
||||
):
|
||||
self.sidebar.select_row(self.all_games_row_box.get_parent())
|
||||
else:
|
||||
games_no = len(shared.store.source_games["imported"]) - removed[0]
|
||||
self.added_games_no_label.set_label(str(games_no))
|
||||
total_games_no += games_no
|
||||
self.added_row_box.get_parent().set_visible(not added_missing)
|
||||
|
||||
self.sidebar.get_row_at_index(2).set_visible(False)
|
||||
|
||||
while row := self.sidebar.get_row_at_index(3):
|
||||
self.sidebar.remove(row)
|
||||
|
||||
for source_id in shared.store.source_games:
|
||||
if source_id == "imported":
|
||||
continue
|
||||
if not (removed := get_removed(source_id)):
|
||||
continue
|
||||
|
||||
row = Gtk.Box(
|
||||
margin_top=12,
|
||||
margin_bottom=12,
|
||||
margin_start=6,
|
||||
margin_end=6,
|
||||
spacing=12,
|
||||
)
|
||||
games_no = len(shared.store.source_games[source_id]) - removed[0]
|
||||
total_games_no += games_no
|
||||
|
||||
row.append(
|
||||
Gtk.Image.new_from_icon_name(
|
||||
"user-desktop-symbolic"
|
||||
if (split_id := source_id.split("_")[0]) == "desktop"
|
||||
else f"{split_id}-source-symbolic"
|
||||
)
|
||||
)
|
||||
|
||||
row.append(
|
||||
Gtk.Label(
|
||||
label=self.get_application().get_source_name(source_id),
|
||||
halign=Gtk.Align.START,
|
||||
wrap=True,
|
||||
wrap_mode=Pango.WrapMode.CHAR,
|
||||
)
|
||||
)
|
||||
|
||||
row.append(
|
||||
games_no_label := Gtk.Label(
|
||||
label=games_no,
|
||||
hexpand=True,
|
||||
halign=Gtk.Align.END,
|
||||
)
|
||||
)
|
||||
|
||||
games_no_label.add_css_class("dim-label")
|
||||
|
||||
# Order rows based on the number of games in them
|
||||
index = 3
|
||||
while source_row := self.sidebar.get_row_at_index(index):
|
||||
if self.source_rows[source_row][1] < games_no:
|
||||
self.sidebar.insert(row, index)
|
||||
break
|
||||
index += 1
|
||||
if not row.get_parent():
|
||||
self.sidebar.append(row)
|
||||
|
||||
self.source_rows[row.get_parent()] = (
|
||||
source_id,
|
||||
games_no,
|
||||
)
|
||||
|
||||
if source_id == selected_id:
|
||||
self.sidebar.select_row(row.get_parent())
|
||||
restored = True
|
||||
|
||||
self.sidebar.get_row_at_index(2).set_visible(True)
|
||||
|
||||
self.all_games_no_label.set_label(str(total_games_no))
|
||||
|
||||
if not restored:
|
||||
self.sidebar.select_row(self.all_games_row_box.get_parent())
|
||||
|
||||
def row_selected(self, _widget: Any, row: Gtk.ListBoxRow | None) -> None:
|
||||
if not row:
|
||||
return
|
||||
match row.get_child():
|
||||
case self.all_games_row_box:
|
||||
value = "all"
|
||||
case self.added_row_box:
|
||||
value = "imported"
|
||||
case _:
|
||||
value = self.source_rows[row][0]
|
||||
|
||||
self.library_page.set_title(self.get_application().get_source_name(value))
|
||||
|
||||
self.filter_state = value
|
||||
self.library.invalidate_filter()
|
||||
|
||||
if self.overlay_split_view.get_collapsed():
|
||||
self.overlay_split_view.set_show_sidebar(False)
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if platform == "darwin":
|
||||
self.sidebar_navigation_page.set_title("")
|
||||
|
||||
self.details_view.set_measure_overlay(self.details_view_toolbar_view, True)
|
||||
self.details_view.set_clip_overlay(self.details_view_toolbar_view, False)
|
||||
|
||||
self.library.set_filter_func(self.filter_func)
|
||||
self.hidden_library.set_filter_func(self.filter_func)
|
||||
|
||||
self.library.set_sort_func(self.sort_func)
|
||||
self.hidden_library.set_sort_func(self.sort_func)
|
||||
|
||||
self.set_library_child()
|
||||
|
||||
self.notice_empty.set_icon_name(shared.APP_ID + "-symbolic")
|
||||
|
||||
self.overlay_split_view.set_show_sidebar(
|
||||
shared.state_schema.get_boolean("show-sidebar")
|
||||
)
|
||||
|
||||
self.sidebar.select_row(self.all_games_row_box.get_parent())
|
||||
|
||||
if shared.PROFILE == "development":
|
||||
self.add_css_class("devel")
|
||||
|
||||
# Connect search entries
|
||||
self.search_bar.connect_entry(self.search_entry)
|
||||
self.hidden_search_bar.connect_entry(self.hidden_search_entry)
|
||||
|
||||
# Connect signals
|
||||
self.search_entry.connect("search-changed", self.search_changed, False)
|
||||
self.hidden_search_entry.connect("search-changed", self.search_changed, True)
|
||||
|
||||
self.search_entry.connect("activate", self.show_details_page_search)
|
||||
self.hidden_search_entry.connect("activate", self.show_details_page_search)
|
||||
|
||||
self.navigation_view.connect("popped", self.set_show_hidden)
|
||||
self.navigation_view.connect("pushed", self.set_show_hidden)
|
||||
|
||||
self.sidebar.connect("row-selected", self.row_selected)
|
||||
|
||||
style_manager = Adw.StyleManager.get_default()
|
||||
style_manager.connect("notify::dark", self.set_details_view_opacity)
|
||||
style_manager.connect("notify::high-contrast", self.set_details_view_opacity)
|
||||
|
||||
# Allow for a custom number of rows for the library
|
||||
if shared.schema.get_uint("library-rows"):
|
||||
shared.schema.bind(
|
||||
"library-rows",
|
||||
self.library,
|
||||
"max-children-per-line",
|
||||
Gio.SettingsBindFlags.DEFAULT,
|
||||
)
|
||||
shared.schema.bind(
|
||||
"library-rows",
|
||||
self.hidden_library,
|
||||
"max-children-per-line",
|
||||
Gio.SettingsBindFlags.DEFAULT,
|
||||
)
|
||||
else:
|
||||
self.library.set_max_children_per_line(10)
|
||||
self.hidden_library.set_max_children_per_line(10)
|
||||
|
||||
def search_changed(self, _widget: Any, hidden: bool) -> None:
|
||||
# Refresh search filter on keystroke in search box
|
||||
(self.hidden_library if hidden else self.library).invalidate_filter()
|
||||
|
||||
def set_library_child(self) -> None:
|
||||
child, hidden_child = self.notice_empty, self.hidden_notice_empty
|
||||
|
||||
for game in shared.store:
|
||||
if game.removed or game.blacklisted:
|
||||
continue
|
||||
if game.hidden:
|
||||
if game.filtered and hidden_child:
|
||||
hidden_child = self.hidden_notice_no_results
|
||||
continue
|
||||
hidden_child = None
|
||||
else:
|
||||
if game.filtered and child:
|
||||
child = self.notice_no_results
|
||||
continue
|
||||
child = None
|
||||
|
||||
def remove_from_overlay(widget: Gtk.Widget) -> None:
|
||||
if isinstance(widget.get_parent(), Gtk.Overlay):
|
||||
widget.get_parent().remove_overlay(widget)
|
||||
|
||||
if child:
|
||||
self.library_overlay.add_overlay(child)
|
||||
else:
|
||||
remove_from_overlay(self.notice_empty)
|
||||
remove_from_overlay(self.notice_no_results)
|
||||
|
||||
if hidden_child:
|
||||
self.hidden_library_overlay.add_overlay(hidden_child)
|
||||
else:
|
||||
remove_from_overlay(self.hidden_notice_empty)
|
||||
remove_from_overlay(self.hidden_notice_no_results)
|
||||
|
||||
def filter_func(self, child: Gtk.Widget) -> bool:
|
||||
game = child.get_child()
|
||||
text = (
|
||||
(
|
||||
self.hidden_search_entry
|
||||
if self.navigation_view.get_visible_page() == self.hidden_library_page
|
||||
else self.search_entry
|
||||
)
|
||||
.get_text()
|
||||
.lower()
|
||||
)
|
||||
|
||||
filtered = text != "" and not (
|
||||
text in game.name.lower()
|
||||
or (text in game.developer.lower() if game.developer else False)
|
||||
)
|
||||
|
||||
if not filtered:
|
||||
if self.filter_state == "all":
|
||||
pass
|
||||
elif game.base_source != self.filter_state:
|
||||
filtered = True
|
||||
|
||||
game.filtered = filtered
|
||||
self.set_library_child()
|
||||
|
||||
return not filtered
|
||||
|
||||
def set_active_game(self, _widget: Any, _pspec: Any, game: Game) -> None:
|
||||
self.active_game = game
|
||||
|
||||
def show_details_page(self, game: Game) -> None:
|
||||
self.active_game = game
|
||||
|
||||
self.details_view_cover.set_opacity(int(not game.loading))
|
||||
self.details_view_spinner.set_visible(game.loading)
|
||||
|
||||
self.details_view_developer.set_label(game.developer or "")
|
||||
self.details_view_developer.set_visible(bool(game.developer))
|
||||
|
||||
icon, text = "view-conceal-symbolic", _("Hide")
|
||||
if game.hidden:
|
||||
icon, text = "view-reveal-symbolic", _("Unhide")
|
||||
|
||||
self.details_view_hide_button.set_icon_name(icon)
|
||||
self.details_view_hide_button.set_tooltip_text(text)
|
||||
|
||||
if self.details_view_game_cover:
|
||||
self.details_view_game_cover.pictures.remove(self.details_view_cover)
|
||||
|
||||
self.details_view_game_cover = game.game_cover
|
||||
self.details_view_game_cover.add_picture(self.details_view_cover)
|
||||
|
||||
self.details_view_blurred_cover.set_paintable(
|
||||
self.details_view_game_cover.get_blurred()
|
||||
)
|
||||
|
||||
self.details_view_title.set_label(game.name)
|
||||
self.details_page.set_title(game.name)
|
||||
|
||||
date = relative_date(game.added)
|
||||
self.details_view_added.set_label(
|
||||
# The variable is the date when the game was added
|
||||
_("Added: {}").format(date)
|
||||
)
|
||||
last_played_date = (
|
||||
relative_date(game.last_played) if game.last_played else _("Never")
|
||||
)
|
||||
self.details_view_last_played.set_label(
|
||||
# The variable is the date when the game was last played
|
||||
_("Last played: {}").format(last_played_date)
|
||||
)
|
||||
|
||||
if self.navigation_view.get_visible_page() != self.details_page:
|
||||
self.navigation_view.push(self.details_page)
|
||||
self.set_focus(self.details_view_play_button)
|
||||
|
||||
self.set_details_view_opacity()
|
||||
|
||||
def set_details_view_opacity(self, *_args: Any) -> None:
|
||||
if self.navigation_view.get_visible_page() != self.details_page:
|
||||
return
|
||||
|
||||
if (
|
||||
style_manager := Adw.StyleManager.get_default()
|
||||
).get_high_contrast() or not style_manager.get_system_supports_color_schemes():
|
||||
self.details_view_blurred_cover.set_opacity(0.3)
|
||||
return
|
||||
|
||||
self.details_view_blurred_cover.set_opacity(
|
||||
1 - self.details_view_game_cover.luminance[0] # type: ignore
|
||||
if style_manager.get_dark()
|
||||
else self.details_view_game_cover.luminance[1] # type: ignore
|
||||
)
|
||||
|
||||
def sort_func(self, child1: Gtk.Widget, child2: Gtk.Widget) -> int:
|
||||
var, order = "name", True
|
||||
|
||||
if self.sort_state in ("newest", "oldest"):
|
||||
var, order = "added", self.sort_state == "newest"
|
||||
elif self.sort_state == "last_played":
|
||||
var = "last_played"
|
||||
elif self.sort_state == "a-z":
|
||||
order = False
|
||||
|
||||
def get_value(index: int) -> str:
|
||||
return (
|
||||
str(getattr((child1.get_child(), child2.get_child())[index], var))
|
||||
.lower()
|
||||
.removeprefix("the ")
|
||||
)
|
||||
|
||||
if var != "name" and get_value(0) == get_value(1):
|
||||
var, order = "name", False
|
||||
|
||||
return ((get_value(0) > get_value(1)) ^ order) * 2 - 1
|
||||
|
||||
def set_show_hidden(self, navigation_view: Adw.NavigationView, *_args: Any) -> None:
|
||||
self.lookup_action("show_hidden").set_enabled(
|
||||
navigation_view.get_visible_page() == self.library_page
|
||||
)
|
||||
|
||||
def on_show_sidebar_action(self, *_args: Any) -> None:
|
||||
shared.state_schema.set_boolean(
|
||||
"show-sidebar", (value := not self.overlay_split_view.get_show_sidebar())
|
||||
)
|
||||
self.overlay_split_view.set_show_sidebar(value)
|
||||
|
||||
def on_go_to_parent_action(self, *_args: Any) -> None:
|
||||
if self.navigation_view.get_visible_page() == self.details_page:
|
||||
self.navigation_view.pop()
|
||||
|
||||
def on_go_home_action(self, *_args: Any) -> None:
|
||||
self.navigation_view.pop_to_page(self.library_page)
|
||||
|
||||
def on_show_hidden_action(self, *_args: Any) -> None:
|
||||
if self.navigation_view.get_visible_page() == self.hidden_library_page:
|
||||
return
|
||||
|
||||
self.navigation_view.push(self.hidden_library_page)
|
||||
|
||||
def on_sort_action(self, action: Gio.SimpleAction, state: GLib.Variant) -> None:
|
||||
action.set_state(state)
|
||||
self.sort_state = str(state).strip("'")
|
||||
self.library.invalidate_sort()
|
||||
|
||||
shared.state_schema.set_string("sort-mode", self.sort_state)
|
||||
|
||||
def on_toggle_search_action(self, *_args: Any) -> None:
|
||||
if self.navigation_view.get_visible_page() == self.library_page:
|
||||
search_bar = self.search_bar
|
||||
search_entry = self.search_entry
|
||||
elif self.navigation_view.get_visible_page() == self.hidden_library_page:
|
||||
search_bar = self.hidden_search_bar
|
||||
search_entry = self.hidden_search_entry
|
||||
else:
|
||||
return
|
||||
|
||||
search_bar.set_search_mode(not (search_mode := search_bar.get_search_mode()))
|
||||
|
||||
if not search_mode:
|
||||
self.set_focus(search_entry)
|
||||
|
||||
search_entry.set_text("")
|
||||
|
||||
def show_details_page_search(self, widget: Gtk.Widget) -> None:
|
||||
library = (
|
||||
self.hidden_library if widget == self.hidden_search_entry else self.library
|
||||
)
|
||||
index = 0
|
||||
|
||||
while True:
|
||||
if not (child := library.get_child_at_index(index)):
|
||||
break
|
||||
|
||||
if self.filter_func(child):
|
||||
self.show_details_page(child.get_child())
|
||||
break
|
||||
|
||||
index += 1
|
||||
|
||||
def on_undo_action(
|
||||
self, _widget: Any, game: Optional[Game] = None, undo: Optional[str] = None
|
||||
) -> None:
|
||||
if not game: # If the action was activated via Ctrl + Z
|
||||
if shared.importer and (
|
||||
shared.importer.imported_game_ids or shared.importer.removed_game_ids
|
||||
):
|
||||
shared.importer.undo_import()
|
||||
return
|
||||
|
||||
try:
|
||||
game = tuple(self.toasts.keys())[-1][0]
|
||||
undo = tuple(self.toasts.keys())[-1][1]
|
||||
except IndexError:
|
||||
return
|
||||
|
||||
if game:
|
||||
if undo == "hide":
|
||||
game.toggle_hidden(False)
|
||||
|
||||
elif undo == "remove":
|
||||
game.removed = False
|
||||
game.save()
|
||||
game.update()
|
||||
|
||||
self.toasts[(game, undo)].dismiss()
|
||||
self.toasts.pop((game, undo))
|
||||
|
||||
def on_open_menu_action(self, *_args: Any) -> None:
|
||||
if self.navigation_view.get_visible_page() == self.library_page:
|
||||
self.primary_menu_button.popup()
|
||||
elif self.navigation_view.get_visible_page() == self.hidden_library_page:
|
||||
self.hidden_primary_menu_button.popup()
|
||||
|
||||
def on_close_action(self, *_args: Any) -> None:
|
||||
self.close()
|
||||
@@ -1,14 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="@PREFIX@">
|
||||
<file preprocess="xml-stripblanks">@APP_ID@.metainfo.xml</file>
|
||||
<file preprocess="xml-stripblanks">gtk/window.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/game.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/preferences.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/details-window.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/details-dialog.ui</file>
|
||||
<file alias="style.css">gtk/style.css</file>
|
||||
<file alias="style-dark.css">gtk/style-dark.css</file>
|
||||
<file>library_placeholder.svg</file>
|
||||
<file>library_placeholder_small.svg</file>
|
||||
</gresource>
|
||||
<gresource prefix="@PREFIX@/icons/scalable/categories/">
|
||||
<file alias="bottles-source-symbolic.svg">icons/sources/bottles-source-symbolic.svg</file>
|
||||
<file alias="flatpak-source-symbolic.svg">icons/sources/flatpak-source-symbolic.svg</file>
|
||||
<file alias="heroic-source-symbolic.svg">icons/sources/heroic-source-symbolic.svg</file>
|
||||
<file alias="itch-source-symbolic.svg">icons/sources/itch-source-symbolic.svg</file>
|
||||
<file alias="legendary-source-symbolic.svg">icons/sources/legendary-source-symbolic.svg</file>
|
||||
<file alias="lutris-source-symbolic.svg">icons/sources/lutris-source-symbolic.svg</file>
|
||||
<file alias="retroarch-source-symbolic.svg">icons/sources/retroarch-source-symbolic.svg</file>
|
||||
<file alias="steam-source-symbolic.svg">icons/sources/steam-source-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $DetailsWindow : Adw.Window {
|
||||
default-width: 480; // Same as Nautilus' properties window
|
||||
default-height: -1;
|
||||
modal: true;
|
||||
|
||||
ShortcutController {
|
||||
Shortcut {
|
||||
trigger: "Escape";
|
||||
action: "action(window.close)";
|
||||
}
|
||||
}
|
||||
|
||||
Box {
|
||||
orientation: vertical;
|
||||
template $DetailsDialog: Adw.Dialog {
|
||||
content-width: 480;
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar HeaderBar {
|
||||
show-start-title-buttons: false;
|
||||
show-end-title-buttons: false;
|
||||
@@ -29,23 +19,20 @@ template $DetailsWindow : Adw.Window {
|
||||
[end]
|
||||
Button apply_button {
|
||||
styles [
|
||||
"suggested-action",
|
||||
"suggested-action"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesPage {
|
||||
vexpand: true;
|
||||
|
||||
Adw.PreferencesGroup cover_group {
|
||||
Adw.Clamp cover_clamp {
|
||||
maximum-size: 200;
|
||||
|
||||
Overlay {
|
||||
[overlay]
|
||||
Spinner spinner {
|
||||
margin-start: 72;
|
||||
margin-end: 72;
|
||||
Adw.Spinner spinner {
|
||||
visible: false;
|
||||
}
|
||||
|
||||
Overlay cover_overlay {
|
||||
@@ -63,7 +50,7 @@ template $DetailsWindow : Adw.Window {
|
||||
|
||||
styles [
|
||||
"circular",
|
||||
"osd",
|
||||
"osd"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -82,7 +69,7 @@ template $DetailsWindow : Adw.Window {
|
||||
|
||||
styles [
|
||||
"circular",
|
||||
"osd",
|
||||
"osd"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -92,7 +79,7 @@ template $DetailsWindow : Adw.Window {
|
||||
height-request: 300;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"card"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -130,8 +117,8 @@ template $DetailsWindow : Adw.Window {
|
||||
valign: center;
|
||||
icon-name: "help-about-symbolic";
|
||||
tooltip-text: _("More Info");
|
||||
popover:
|
||||
Popover exec_info_popover {
|
||||
|
||||
popover: Popover exec_info_popover {
|
||||
focusable: true;
|
||||
|
||||
Label exec_info_label {
|
||||
@@ -145,12 +132,10 @@ template $DetailsWindow : Adw.Window {
|
||||
margin-start: 6;
|
||||
margin-end: 6;
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $Game : Box {
|
||||
template $Game: Box {
|
||||
orientation: vertical;
|
||||
halign: center;
|
||||
valign: start;
|
||||
|
||||
Adw.Clamp {
|
||||
maximum-size: 200;
|
||||
unit: px;
|
||||
|
||||
Overlay {
|
||||
[overlay]
|
||||
@@ -63,9 +64,8 @@ template $Game : Box {
|
||||
|
||||
Overlay {
|
||||
[overlay]
|
||||
Spinner spinner {
|
||||
margin-start: 72;
|
||||
margin-end: 72;
|
||||
Adw.Spinner spinner {
|
||||
visible: false;
|
||||
}
|
||||
|
||||
Picture cover {
|
||||
@@ -98,38 +98,16 @@ template $Game : Box {
|
||||
|
||||
menu game_options {
|
||||
section {
|
||||
item {
|
||||
label: _("Edit");
|
||||
action: "app.edit_game";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Hide");
|
||||
action: "app.hide_game";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Remove");
|
||||
action: "app.remove_game";
|
||||
}
|
||||
item (_("Edit"), "app.edit_game")
|
||||
item (_("Hide"), "app.hide_game")
|
||||
item (_("Remove"), "app.remove_game")
|
||||
}
|
||||
}
|
||||
|
||||
menu hidden_game_options {
|
||||
section {
|
||||
item {
|
||||
label: _("Edit");
|
||||
action: "app.edit_game";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Unhide");
|
||||
action: "app.hide_game";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Remove");
|
||||
action: "app.remove_game";
|
||||
}
|
||||
item (_("Edit"), "app.edit_game")
|
||||
item (_("Unhide"), "app.hide_game")
|
||||
item (_("Remove"), "app.remove_game")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,23 +10,18 @@ ShortcutsWindow help_overlay {
|
||||
ShortcutsGroup {
|
||||
title: _("General");
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Quit");
|
||||
action-name: "app.quit";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Search");
|
||||
action-name: "win.toggle_search";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Show preferences");
|
||||
title: _("Preferences");
|
||||
action-name: "app.preferences";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Shortcuts");
|
||||
title: _("Keyboard Shortcuts");
|
||||
action-name: "win.show-help-overlay";
|
||||
}
|
||||
|
||||
@@ -36,7 +31,17 @@ ShortcutsWindow help_overlay {
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Open menu");
|
||||
title: _("Quit");
|
||||
action-name: "app.quit";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Toggle Sidebar");
|
||||
action-name: "win.show_sidebar";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Main Menu");
|
||||
action-name: "win.open_menu";
|
||||
}
|
||||
}
|
||||
@@ -45,22 +50,22 @@ ShortcutsWindow help_overlay {
|
||||
title: _("Games");
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Add new game");
|
||||
title: _("Add Game");
|
||||
action-name: "app.add_game";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Import games");
|
||||
title: _("Import");
|
||||
action-name: "app.import";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Show hidden games");
|
||||
title: _("Show Hidden Games");
|
||||
action-name: "win.show_hidden";
|
||||
}
|
||||
|
||||
ShortcutsShortcut {
|
||||
title: _("Remove game");
|
||||
title: _("Remove Game");
|
||||
action-name: "app.remove_game_details_view";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
default-height: 500;
|
||||
template $CartridgesPreferences: Adw.PreferencesDialog {
|
||||
search-enabled: true;
|
||||
|
||||
Adw.PreferencesPage general_page {
|
||||
name: "general";
|
||||
@@ -12,72 +12,46 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
Adw.PreferencesGroup behavior_group {
|
||||
title: _("Behavior");
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow exit_after_launch_switch {
|
||||
title: _("Exit After Launching Games");
|
||||
activatable-widget: exit_after_launch_switch;
|
||||
|
||||
Switch exit_after_launch_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow cover_launches_game_switch {
|
||||
title: _("Cover Image Launches Game");
|
||||
subtitle: _("Swaps the behavior of the cover image and the play button");
|
||||
activatable-widget: cover_launches_game_switch;
|
||||
|
||||
Switch cover_launches_game_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup images_group {
|
||||
title: _("Images");
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow high_quality_images_switch {
|
||||
title: _("High Quality Images");
|
||||
subtitle: _("Save game covers losslessly at the cost of storage");
|
||||
activatable-widget: high_quality_images_switch;
|
||||
|
||||
Switch high_quality_images_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup danger_zone_group {
|
||||
title: _("Danger Zone");
|
||||
separate-rows: true;
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.ButtonRow remove_all_games_button_row {
|
||||
title: _("Remove All Games");
|
||||
|
||||
Button remove_all_games_button {
|
||||
label: _("Remove");
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"destructive-action",
|
||||
"destructive-action"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow reset_action_row {
|
||||
Adw.ButtonRow reset_button_row {
|
||||
title: "Reset App";
|
||||
subtitle: "Completely resets and quits Cartridges";
|
||||
visible: false;
|
||||
|
||||
Button reset_button {
|
||||
label: "Reset";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"destructive-action",
|
||||
"destructive-action"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesPage import_page {
|
||||
name: "import";
|
||||
@@ -87,33 +61,43 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
Adw.PreferencesGroup import_behavior_group {
|
||||
title: _("Behavior");
|
||||
|
||||
Adw.ActionRow {
|
||||
title: _("Remove Uninstalled Games");
|
||||
activatable-widget: remove_missing_switch;
|
||||
|
||||
Switch remove_missing_switch {
|
||||
valign: center;
|
||||
Adw.SwitchRow auto_import_switch {
|
||||
title: _("Import Games Automatically");
|
||||
}
|
||||
|
||||
Adw.SwitchRow remove_missing_switch {
|
||||
title: _("Remove Uninstalled Games");
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup sources_group {
|
||||
title: _("Sources");
|
||||
separate-rows: true;
|
||||
|
||||
Adw.ExpanderRow steam_expander_row {
|
||||
title: _("Steam");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "steam-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow steam_data_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button steam_data_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,46 +105,34 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Lutris");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "lutris-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow lutris_data_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button lutris_data_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow lutris_cache_action_row {
|
||||
title: _("Cache Location");
|
||||
|
||||
Button lutris_cache_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
styles [
|
||||
"flat"
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow lutris_import_steam_switch {
|
||||
title: _("Import Steam Games");
|
||||
activatable-widget: lutris_import_steam_switch;
|
||||
|
||||
Switch lutris_import_steam_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow lutris_import_flatpak_switch {
|
||||
title: _("Import Flatpak Games");
|
||||
activatable-widget: lutris_import_flatpak_switch;
|
||||
|
||||
Switch lutris_import_flatpak_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,52 +140,42 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Heroic");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "heroic-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow heroic_config_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button heroic_config_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow heroic_import_epic_switch {
|
||||
title: _("Import Epic Games");
|
||||
activatable-widget: heroic_import_epic_switch;
|
||||
|
||||
Switch heroic_import_epic_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow heroic_import_gog_switch {
|
||||
title: _("Import GOG Games");
|
||||
activatable-widget: heroic_import_gog_switch;
|
||||
|
||||
Switch heroic_import_gog_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow heroic_import_amazon_switch {
|
||||
title: _("Import Amazon Games");
|
||||
activatable-widget: heroic_import_amazon_switch;
|
||||
|
||||
Switch heroic_import_amazon_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow heroic_import_sideload_switch {
|
||||
title: _("Import Sideloaded Games");
|
||||
activatable-widget: heroic_import_sideload_switch;
|
||||
|
||||
Switch heroic_import_sideload_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,16 +183,26 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Bottles");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "bottles-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow bottles_data_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button bottles_data_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,16 +210,26 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("itch");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "itch-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow itch_config_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button itch_config_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,16 +237,26 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Legendary");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "legendary-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow legendary_config_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button legendary_config_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,16 +264,26 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("RetroArch");
|
||||
show-enable-switch: true;
|
||||
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "retroarch-source-symbolic";
|
||||
}
|
||||
|
||||
Adw.ActionRow retroarch_config_action_row {
|
||||
title: _("Install Location");
|
||||
|
||||
Button retroarch_config_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,34 +291,58 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
title: _("Flatpak");
|
||||
show-enable-switch: true;
|
||||
|
||||
Adw.ActionRow flatpak_data_action_row {
|
||||
title: _("Install Location");
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "flatpak-source-symbolic";
|
||||
}
|
||||
|
||||
Button flatpak_data_file_chooser_button {
|
||||
Adw.ActionRow flatpak_system_data_action_row {
|
||||
// The location of the system-wide data directory
|
||||
title: _("System Location");
|
||||
|
||||
Button flatpak_system_data_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
|
||||
Adw.ActionRow flatpak_import_launchers_row {
|
||||
Adw.ActionRow flatpak_user_data_action_row {
|
||||
// The location of the user-specific data directory
|
||||
title: _("User Location");
|
||||
|
||||
Button flatpak_user_data_file_chooser_button {
|
||||
icon-name: "folder-symbolic";
|
||||
valign: center;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
styles [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
|
||||
Adw.SwitchRow flatpak_import_launchers_switch {
|
||||
title: _("Import Game Launchers");
|
||||
activatable-widget: flatpak_import_launchers_switch;
|
||||
|
||||
Switch flatpak_import_launchers_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow desktop_switch {
|
||||
title: _("Desktop Entries");
|
||||
activatable-widget: desktop_switch;
|
||||
|
||||
Switch desktop_switch {
|
||||
valign: center;
|
||||
[prefix]
|
||||
Image {
|
||||
icon-name: "user-desktop-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,32 +364,37 @@ template $PreferencesWindow : Adw.PreferencesWindow {
|
||||
Adw.PreferencesGroup sgdb_behavior_group {
|
||||
title: _("Behavior");
|
||||
|
||||
Adw.ActionRow sgdb_switch_row {
|
||||
Adw.SwitchRow sgdb_switch {
|
||||
title: _("Use SteamGridDB");
|
||||
subtitle: _("Download images when adding or importing games");
|
||||
activatable-widget: sgdb_switch;
|
||||
|
||||
Switch sgdb_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow sgdb_prefer_switch {
|
||||
title: _("Prefer Over Official Images");
|
||||
activatable-widget: sgdb_prefer_switch;
|
||||
|
||||
Switch sgdb_prefer_switch {
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
Adw.SwitchRow sgdb_animated_switch {
|
||||
title: _("Prefer Animated Images");
|
||||
activatable-widget: sgdb_animated_switch;
|
||||
}
|
||||
}
|
||||
|
||||
Switch sgdb_animated_switch {
|
||||
Adw.PreferencesGroup {
|
||||
Adw.ActionRow {
|
||||
title: _("Update Covers");
|
||||
subtitle: _("Fetch covers for games already in your library");
|
||||
sensitive: bind sgdb_switch.active;
|
||||
|
||||
Stack sgdb_stack {
|
||||
Button sgdb_fetch_button {
|
||||
label: _("Update");
|
||||
valign: center;
|
||||
}
|
||||
|
||||
Adw.Spinner sgdb_spinner {
|
||||
visible: false;
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@define-color accent_color @purple_1;
|
||||
@define-color accent_bg_color @purple_4;
|
||||
:root {
|
||||
--accent-color: var(--purple-1);
|
||||
--accent-bg-color: var(--purple-4);
|
||||
}
|
||||
|
||||
#details_view {
|
||||
background-color: black;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@define-color accent_color @purple_5;
|
||||
@define-color accent_bg_color @purple_3;
|
||||
:root {
|
||||
--accent-color: var(--purple-5);
|
||||
--accent-bg-color: var(--purple-3);
|
||||
}
|
||||
|
||||
#details_view {
|
||||
background-color: white;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Adw 1;
|
||||
Adw.StatusPage notice_no_results {
|
||||
icon-name: "system-search-symbolic";
|
||||
title: _("No Games Found");
|
||||
description: _("Try a different search.");
|
||||
description: _("Try a different search");
|
||||
vexpand: true;
|
||||
valign: center;
|
||||
}
|
||||
@@ -12,14 +12,14 @@ Adw.StatusPage notice_no_results {
|
||||
Adw.StatusPage hidden_notice_no_results {
|
||||
icon-name: "system-search-symbolic";
|
||||
title: _("No Games Found");
|
||||
description: _("Try a different search.");
|
||||
description: _("Try a different search");
|
||||
vexpand: true;
|
||||
valign: center;
|
||||
}
|
||||
|
||||
Adw.StatusPage notice_empty {
|
||||
title: _("No Games");
|
||||
description: _("Use the + button to add games.");
|
||||
description: _("Use the + button to add games");
|
||||
vexpand: true;
|
||||
valign: center;
|
||||
|
||||
@@ -38,49 +38,297 @@ Adw.StatusPage notice_empty {
|
||||
Adw.StatusPage hidden_notice_empty {
|
||||
icon-name: "view-conceal-symbolic";
|
||||
title: _("No Hidden Games");
|
||||
description: _("Games you hide will appear here.");
|
||||
description: _("Games you hide will appear here");
|
||||
vexpand: true;
|
||||
valign: center;
|
||||
}
|
||||
|
||||
template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
template $CartridgesWindow: Adw.ApplicationWindow {
|
||||
title: _("Cartridges");
|
||||
width-request: 360;
|
||||
height-request: 100;
|
||||
|
||||
Adw.Breakpoint {
|
||||
condition ("max-width: 564px")
|
||||
|
||||
setters {
|
||||
overlay_split_view.collapsed: true;
|
||||
details_view_box.orientation: vertical;
|
||||
details_view_box.margin-top: 12;
|
||||
details_view_box.margin-start: 12;
|
||||
details_view_box.margin-end: 12;
|
||||
details_view_details_box.margin-start: 0;
|
||||
details_view_details_box.margin-end: 0;
|
||||
details_view_title.margin-top: 30;
|
||||
details_view_title.halign: center;
|
||||
details_view_developer.halign: center;
|
||||
details_view_date_box.halign: center;
|
||||
details_view_toolbar.halign: center;
|
||||
details_view_toolbar.orientation: vertical;
|
||||
details_view_play_button.halign: center;
|
||||
details_view_toolbar_buttons.margin-start: 0;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ToastOverlay toast_overlay {
|
||||
Stack stack {
|
||||
visible-child: library_view;
|
||||
transition-type: over_left;
|
||||
Adw.NavigationView navigation_view {
|
||||
Adw.NavigationPage library_page {
|
||||
title: _("All Games");
|
||||
|
||||
Adw.OverlaySplitView overlay_split_view {
|
||||
sidebar-width-fraction: .2;
|
||||
|
||||
[sidebar]
|
||||
Adw.NavigationPage sidebar_navigation_page {
|
||||
title: _("Cartridges");
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar {
|
||||
[start]
|
||||
Button {
|
||||
icon-name: "sidebar-show-symbolic";
|
||||
action-name: "win.show_sidebar";
|
||||
tooltip-text: _("Toggle Sidebar");
|
||||
}
|
||||
}
|
||||
|
||||
ScrolledWindow {
|
||||
hscrollbar-policy: never;
|
||||
|
||||
ListBox sidebar {
|
||||
Box all_games_row_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 6;
|
||||
margin-end: 6;
|
||||
spacing: 12;
|
||||
|
||||
Image {
|
||||
icon-name: "view-grid-symbolic";
|
||||
}
|
||||
|
||||
Label {
|
||||
halign: start;
|
||||
label: _("All Games");
|
||||
wrap: true;
|
||||
wrap-mode: char;
|
||||
}
|
||||
|
||||
Label all_games_no_label {
|
||||
hexpand: true;
|
||||
halign: end;
|
||||
|
||||
styles [
|
||||
"dim-label"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Box added_row_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 6;
|
||||
spacing: 12;
|
||||
|
||||
Image {
|
||||
icon-name: "list-add-symbolic";
|
||||
}
|
||||
|
||||
Label {
|
||||
halign: start;
|
||||
label: _("Added");
|
||||
margin-end: 6;
|
||||
wrap: true;
|
||||
wrap-mode: char;
|
||||
}
|
||||
|
||||
Label added_games_no_label {
|
||||
hexpand: true;
|
||||
halign: end;
|
||||
margin-end: 6;
|
||||
|
||||
styles [
|
||||
"dim-label"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
ListBoxRow {
|
||||
selectable: false;
|
||||
activatable: false;
|
||||
|
||||
Label {
|
||||
label: _("Imported");
|
||||
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
halign: start;
|
||||
}
|
||||
}
|
||||
|
||||
styles [
|
||||
"navigation-sidebar"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ToolbarView library_view {
|
||||
[top]
|
||||
Adw.HeaderBar header_bar {
|
||||
[start]
|
||||
Button show_sidebar_button {
|
||||
icon-name: "sidebar-show-symbolic";
|
||||
action-name: "win.show_sidebar";
|
||||
tooltip-text: _("Toggle Sidebar");
|
||||
visible: bind overlay_split_view.show-sidebar inverted;
|
||||
}
|
||||
|
||||
[start]
|
||||
MenuButton {
|
||||
tooltip-text: _("Add Game");
|
||||
icon-name: "list-add-symbolic";
|
||||
menu-model: add_games;
|
||||
}
|
||||
|
||||
[end]
|
||||
MenuButton primary_menu_button {
|
||||
tooltip-text: _("Main Menu");
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
|
||||
[end]
|
||||
ToggleButton search_button {
|
||||
tooltip-text: _("Search");
|
||||
icon-name: "system-search-symbolic";
|
||||
action-name: "win.toggle_search";
|
||||
}
|
||||
}
|
||||
|
||||
[top]
|
||||
SearchBar search_bar {
|
||||
search-mode-enabled: bind search_button.active bidirectional;
|
||||
key-capture-widget: navigation_view;
|
||||
|
||||
Adw.Clamp {
|
||||
maximum-size: 500;
|
||||
tightening-threshold: 500;
|
||||
|
||||
SearchEntry search_entry {
|
||||
placeholder-text: _("Search");
|
||||
hexpand: true;
|
||||
|
||||
ShortcutController {
|
||||
Shortcut {
|
||||
trigger: "Escape";
|
||||
action: "action(win.toggle_search)";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay library_overlay {
|
||||
ScrolledWindow scrolledwindow {
|
||||
FlowBox library {
|
||||
homogeneous: true;
|
||||
halign: center;
|
||||
valign: start;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
margin-top: 15;
|
||||
margin-bottom: 15;
|
||||
margin-start: 15;
|
||||
margin-end: 15;
|
||||
selection-mode: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.NavigationPage hidden_library_page {
|
||||
title: _("Hidden Games");
|
||||
|
||||
Adw.ToolbarView hidden_library_view {
|
||||
[top]
|
||||
Adw.HeaderBar hidden_header_bar {
|
||||
[end]
|
||||
MenuButton hidden_primary_menu_button {
|
||||
tooltip-text: _("Main Menu");
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
|
||||
[end]
|
||||
ToggleButton hidden_search_button {
|
||||
tooltip-text: _("Search");
|
||||
icon-name: "system-search-symbolic";
|
||||
action-name: "win.toggle_search";
|
||||
}
|
||||
}
|
||||
|
||||
[top]
|
||||
SearchBar hidden_search_bar {
|
||||
search-mode-enabled: bind hidden_search_button.active bidirectional;
|
||||
key-capture-widget: hidden_library_view;
|
||||
|
||||
Adw.Clamp {
|
||||
maximum-size: 500;
|
||||
tightening-threshold: 500;
|
||||
|
||||
SearchEntry hidden_search_entry {
|
||||
placeholder-text: _("Search");
|
||||
hexpand: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay hidden_library_overlay {
|
||||
ScrolledWindow hidden_scrolledwindow {
|
||||
FlowBox hidden_library {
|
||||
homogeneous: true;
|
||||
halign: center;
|
||||
valign: start;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
margin-top: 15;
|
||||
margin-bottom: 15;
|
||||
margin-start: 15;
|
||||
margin-end: 15;
|
||||
selection-mode: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
styles [
|
||||
"background",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Adw.NavigationPage details_page {
|
||||
title: _("Game Details");
|
||||
|
||||
Overlay details_view {
|
||||
name: "details_view";
|
||||
|
||||
[overlay]
|
||||
Adw.ToolbarView details_view_toolbar_view {
|
||||
[top]
|
||||
Adw.HeaderBar {}
|
||||
|
||||
ScrolledWindow {
|
||||
Box details_view_box {
|
||||
orientation: vertical;
|
||||
|
||||
Adw.HeaderBar {
|
||||
[start]
|
||||
Button back_button {
|
||||
tooltip-text: _("Back");
|
||||
action-name: "win.go_back";
|
||||
icon-name: "go-previous-symbolic";
|
||||
}
|
||||
|
||||
[title]
|
||||
Adw.WindowTitle details_view_header_bar_title {
|
||||
title: _("Game Details");
|
||||
}
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
|
||||
Adw.Bin {
|
||||
hexpand: true;
|
||||
vexpand: true;
|
||||
|
||||
Box {
|
||||
halign: center;
|
||||
valign: center;
|
||||
margin-start: 24;
|
||||
@@ -93,9 +341,8 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
|
||||
Overlay {
|
||||
[overlay]
|
||||
Spinner details_view_spinner {
|
||||
margin-start: 72;
|
||||
margin-end: 72;
|
||||
Adw.Spinner details_view_spinner {
|
||||
visible: false;
|
||||
}
|
||||
|
||||
Picture details_view_cover {
|
||||
@@ -111,7 +358,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Box {
|
||||
Box details_view_details_box {
|
||||
orientation: vertical;
|
||||
margin-start: 48;
|
||||
vexpand: true;
|
||||
@@ -145,7 +392,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
]
|
||||
}
|
||||
|
||||
Box {
|
||||
Box details_view_date_box {
|
||||
orientation: horizontal;
|
||||
margin-top: 15;
|
||||
hexpand: true;
|
||||
@@ -155,6 +402,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
wrap: true;
|
||||
wrap-mode: word_char;
|
||||
natural-wrap-mode: word;
|
||||
justify: center;
|
||||
}
|
||||
|
||||
Label details_view_last_played {
|
||||
@@ -162,10 +410,11 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
wrap: true;
|
||||
wrap-mode: word_char;
|
||||
natural-wrap-mode: word;
|
||||
justify: center;
|
||||
}
|
||||
}
|
||||
|
||||
Box {
|
||||
Box details_view_toolbar {
|
||||
hexpand: true;
|
||||
vexpand: true;
|
||||
valign: center;
|
||||
@@ -183,7 +432,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
]
|
||||
}
|
||||
|
||||
Box {
|
||||
Box details_view_toolbar_buttons {
|
||||
halign: start;
|
||||
valign: center;
|
||||
margin-top: 24;
|
||||
@@ -245,141 +494,6 @@ template $CartridgesWindow : Adw.ApplicationWindow {
|
||||
keep-aspect-ratio: false;
|
||||
}
|
||||
}
|
||||
|
||||
Box library_view {
|
||||
orientation: vertical;
|
||||
|
||||
Adw.HeaderBar header_bar {
|
||||
[start]
|
||||
MenuButton {
|
||||
tooltip-text: _("Add Game");
|
||||
icon-name: "list-add-symbolic";
|
||||
menu-model: add_games;
|
||||
}
|
||||
|
||||
[end]
|
||||
MenuButton primary_menu_button {
|
||||
tooltip-text: _("Main Menu");
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
|
||||
[end]
|
||||
ToggleButton search_button {
|
||||
tooltip-text: _("Search");
|
||||
icon-name: "system-search-symbolic";
|
||||
action-name: "win.toggle_search";
|
||||
}
|
||||
}
|
||||
|
||||
SearchBar search_bar {
|
||||
search-mode-enabled: bind-property search_button.active bidirectional;
|
||||
key-capture-widget: library_view;
|
||||
|
||||
Adw.Clamp {
|
||||
maximum-size: 500;
|
||||
tightening-threshold: 500;
|
||||
|
||||
SearchEntry search_entry {
|
||||
placeholder-text: _("Search games");
|
||||
hexpand: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.Bin library_bin {
|
||||
ScrolledWindow scrolledwindow {
|
||||
hexpand: true;
|
||||
vexpand: true;
|
||||
|
||||
FlowBox library {
|
||||
homogeneous: true;
|
||||
halign: center;
|
||||
valign: start;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
margin-top: 15;
|
||||
margin-bottom: 15;
|
||||
margin-start: 15;
|
||||
margin-end: 15;
|
||||
selection-mode: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Box hidden_library_view {
|
||||
orientation: vertical;
|
||||
|
||||
Adw.HeaderBar hidden_header_bar {
|
||||
[start]
|
||||
Button hidden_back_button {
|
||||
tooltip-text: _("Back");
|
||||
action-name: "win.go_back";
|
||||
icon-name: "go-previous-symbolic";
|
||||
}
|
||||
|
||||
[title]
|
||||
Adw.WindowTitle {
|
||||
title: _("Hidden Games");
|
||||
}
|
||||
|
||||
[end]
|
||||
MenuButton hidden_primary_menu_button {
|
||||
tooltip-text: _("Main Menu");
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
|
||||
[end]
|
||||
ToggleButton hidden_search_button {
|
||||
tooltip-text: _("Search");
|
||||
icon-name: "system-search-symbolic";
|
||||
action-name: "win.toggle_search";
|
||||
}
|
||||
}
|
||||
|
||||
SearchBar hidden_search_bar {
|
||||
search-mode-enabled: bind-property hidden_search_button.active bidirectional;
|
||||
key-capture-widget: hidden_library_view;
|
||||
|
||||
Adw.Clamp {
|
||||
maximum-size: 500;
|
||||
tightening-threshold: 500;
|
||||
|
||||
SearchEntry hidden_search_entry {
|
||||
placeholder-text: _("Search hidden games");
|
||||
hexpand: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adw.Bin hidden_library_bin {
|
||||
ScrolledWindow hidden_scrolledwindow {
|
||||
hexpand: true;
|
||||
vexpand: true;
|
||||
|
||||
FlowBox hidden_library {
|
||||
homogeneous: true;
|
||||
halign: center;
|
||||
valign: start;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
margin-top: 15;
|
||||
margin-bottom: 15;
|
||||
margin-start: 15;
|
||||
margin-end: 15;
|
||||
selection-mode: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
styles [
|
||||
"background",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu primary_menu {
|
||||
@@ -426,66 +540,29 @@ menu primary_menu {
|
||||
}
|
||||
|
||||
section {
|
||||
item {
|
||||
label: _("Preferences");
|
||||
action: "app.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Keyboard Shortcuts");
|
||||
action: "win.show-help-overlay";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("About Cartridges");
|
||||
action: "app.about";
|
||||
}
|
||||
item (_("Preferences"), "app.preferences")
|
||||
item (_("Keyboard Shortcuts"), "win.show-help-overlay")
|
||||
item (_("About Cartridges"), "app.about")
|
||||
}
|
||||
}
|
||||
|
||||
menu add_games {
|
||||
section {
|
||||
item {
|
||||
label: _("Add Game");
|
||||
action: "app.add_game";
|
||||
}
|
||||
item (_("Add Game"), "app.add_game")
|
||||
}
|
||||
|
||||
section {
|
||||
item {
|
||||
label: _("Import");
|
||||
action: "app.import";
|
||||
}
|
||||
item (_("Import"), "app.import")
|
||||
}
|
||||
}
|
||||
|
||||
menu search {
|
||||
section {
|
||||
label: "Search on…";
|
||||
|
||||
item {
|
||||
label: "IGDB";
|
||||
action: "app.igdb_search";
|
||||
}
|
||||
|
||||
item {
|
||||
label: "SteamGridDB";
|
||||
action: "app.sgdb_search";
|
||||
}
|
||||
|
||||
item {
|
||||
label: "ProtonDB";
|
||||
action: "app.protondb_search";
|
||||
}
|
||||
|
||||
item {
|
||||
label: "Lutris";
|
||||
action: "app.lutris_search";
|
||||
}
|
||||
|
||||
item {
|
||||
label: "HowLongToBeat";
|
||||
action: "app.hltb_search";
|
||||
}
|
||||
item (_("IGDB"), "app.igdb_search")
|
||||
item (_("SteamGridDB"), "app.sgdb_search")
|
||||
item (_("ProtonDB"), "app.protondb_search")
|
||||
item (_("Lutris"), "app.lutris_search")
|
||||
item (_("HowLongToBeat"), "app.hltb_search")
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |
@@ -1,11 +1,11 @@
|
||||
scalable_dir = join_paths('hicolor', 'scalable', 'apps')
|
||||
install_data(
|
||||
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')
|
||||
install_data(
|
||||
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),
|
||||
)
|
||||
|
||||
1
data/icons/sources/bottles-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.847 0v.616c0 .371-.17.786-.405 1.239C1.812 2.95 1.163 4.02 1.01 5.288L1 16h2l.01-10.712c.153-1.267.802-2.337 1.432-3.433.235-.453.405-.868.405-1.24V0h-2Zm4 0v.616c0 .371-.17.786-.404 1.239C5.812 2.95 5.163 4.02 5.01 5.288L5 16h2.001l.01-10.712c.153-1.267.801-2.337 1.432-3.433.235-.453.405-.868.405-1.24V0h-2Zm4.001 0v.616c-.315 1.678-1.632 3.165-1.837 4.672L9.001 16h5.693l-.008-10.7c-.32-1.815-1.385-3.08-1.838-4.684V0h-2Z" fill="#000"/></svg>
|
||||
|
After Width: | Height: | Size: 532 B |
1
data/icons/sources/flatpak-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.805.02a.971.971 0 0 0-.36.148l-6 4A.998.998 0 0 0 1 5v6a1 1 0 0 0 .445.833l6 4c.337.223.774.223 1.11 0l6-4a.998.998 0 0 0 .446-.832V5a.998.998 0 0 0-.445-.832l-6-4a.994.994 0 0 0-.75-.149Zm.196 2.179V9l5-3.332v4.797l-5 3.337V9L3 5.668v-.133L8 2.2Z" fill="#000"/></svg>
|
||||
|
After Width: | Height: | Size: 355 B |
1
data/icons/sources/heroic-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="m7.872 16-3.817-3.083L2 2.79 7.872 0l5.871 2.789-2.055 10.128L7.872 16Zm0-4.257-.294-.293-.88-7.927 1.1-1.908 1.174 1.908-.807 7.927-.293.293Zm-.294.367-.147.367-1.761.294-.294-.66.294-.662 1.761.294.147.367Zm-.073.734-.22 1.541.587.294.587-.294-.22-1.541-.367-.22-.367.22Zm.807-.367-.147-.367.147-.367 1.761-.293.294.66-.294.66-1.761-.293Z" fill="#000"/></svg>
|
||||
|
After Width: | Height: | Size: 485 B |
1
data/icons/sources/itch-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.965 1.992C1.43 2.08 1 2.58 1 3.115V15.18c0 .534.43.894.965.806l12.066-1.979c.534-.088.964-.588.964-1.122V.82c0-.535-.43-.894-.964-.807L1.964 1.992Zm3.41 3.33c.555-.091.95.204 1.09.722l3.068-.503c.14-.564.532-.988 1.087-1.08.882-.144 1.851.602 2.154 1.659l.723 2.523c.302 1.056-.172 2.04-1.054 2.184-.774.127-1.615-.432-2.014-1.286l-4.863.798c-.399.984-1.24 1.82-2.014 1.946-.882.145-1.356-.683-1.054-1.838l.723-2.76c.303-1.157 1.272-2.22 2.154-2.365ZM7.282 6.58v.986l-.791.13L7.997 9.36 9.505 7.2l-.743.122v-.985l-1.48.243Z" fill="#000"/></svg>
|
||||
|
After Width: | Height: | Size: 631 B |
1
data/icons/sources/legendary-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 6.355V1a1 1 0 0 1 1-1h2.893a1 1 0 0 1 .708.293l.645.645a1 1 0 0 0 .707.293h4.094a1 1 0 0 0 .707-.293L11.4.293A1 1 0 0 1 12.107 0H15a1 1 0 0 1 1 1v5.355a1 1 0 0 1-.293.707l-.23.23a1 1 0 0 0 0 1.415l.23.23a1 1 0 0 1 .293.708V15a1 1 0 0 1-1 1h-2.893a1 1 0 0 1-.708-.293l-.645-.645a1 1 0 0 0-.707-.293H5.953a1 1 0 0 0-.707.293l-.645.645a1 1 0 0 1-.708.293H1a1 1 0 0 1-1-1V9.645a1 1 0 0 1 .293-.707l.23-.23a1 1 0 0 0 0-1.415l-.23-.23A1 1 0 0 1 0 6.354ZM8 5a1 1 0 0 0-2 0v5.5a1 1 0 0 0 1 1h3a1 1 0 1 0 0-2H8V5Z" fill="#000"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 757 B |
1
data/icons/sources/lutris-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 7.937C0 3.554 3.518 0 7.857 0c1.196 0 2.33.27 3.344.753.055-.118.181-.363.301-.371.158-.012.248.09.35.203l.001.002c.102.115.306.287.306.287s.929-.32 1.97.251c1.043.572 1.19.744 1.394 1.144.144.284.14.87.126 1.19a.248.248 0 0 0-.039-.004c-.17 0-.308.174-.308.387 0 .214.138.387.308.387a.256.256 0 0 0 .133-.039c.153.292.233.562.255.806-.05-.348-.544-.586-.544-.586s-.077.135-.243.215c-.025.012-.056.01-.091.006-.063-.007-.138-.014-.21.06-.239.484.345.888.617.877.265-.011.476-.276.475-.512.047.92-.74 1.461-1.495 1.374-.493-.058-.907-.249-1.383-.469a10.262 10.262 0 0 0-1.187-.483c-.951-.307-1.569-.47-2.322-.585-1.486-.227-2.557.12-3.061.424a5.84 5.84 0 0 0-.427.284c.772.15 1.236 1.329 1.25 1.65l.002.013v.007l.001.033c-.021.484-.247.845-.725.83a.823.823 0 0 1-.713-.426c-.014-.024-.028-.049-.044-.072a1.92 1.92 0 0 0-.965-.795c-.46.705-.715 1.548-.715 2.53 0 2.897 2.345 5.052 5.213 5.052.907 0 2.817-.309 4-1.28.226-.207.485-.438.725-.55-.862 2.161-3.479 3.488-6.299 3.403C3.534 15.996 0 12.321 0 7.937ZM13.415 4.02a.596.596 0 0 0 .593-.6.596.596 0 0 0-.593-.599.597.597 0 0 0-.594.6c0 .33.266.6.594.6Z" fill="#000"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
data/icons/sources/retroarch-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.56 4 5.6 5.28H3.52L3.04 7.2H1.76l.48-1.92H.96L0 9.12h2.56l-.32 1.28h2.24L2.8 12.32h1.88l1.56-1.92h3.52l1.56 1.92h1.88l-1.68-1.92h2.24l-.32-1.28H16l-.96-3.84h-1.28l.48 1.92h-1.28l-.48-1.92H10.4L11.44 4h-1.36L8.96 5.28H7.04L5.92 4H4.56Zm.16 2.56H6v1.28H4.72V6.56Zm5.283 0h1.28v1.28h-1.28V6.56Z" fill="#000"/></svg>
|
||||
|
After Width: | Height: | Size: 399 B |
1
data/icons/sources/steam-source-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.352 5.1a1.509 1.509 0 1 0 2.51 1.675A1.509 1.509 0 0 0 9.352 5.1Zm2.923-.277a2.009 2.009 0 1 1-3.34 2.231 2.009 2.009 0 0 1 3.34-2.23ZM5.01 12.131l-.983-.407a1.7 1.7 0 0 0 3.108-.103 1.696 1.696 0 0 0-1.213-2.29 1.699 1.699 0 0 0-.966.07l1.015.421a1.249 1.249 0 0 1-.96 2.307v.002ZM2.546 2.121A7.996 7.996 0 0 1 7.966 0l.003.013a7.988 7.988 0 0 1 7.159 4.432 7.996 7.996 0 0 1-4.277 11.018 7.99 7.99 0 0 1-8.274-1.558A7.989 7.989 0 0 1 .279 10.18l3.064 1.267A2.264 2.264 0 0 0 7.823 11v-.107l2.718-1.938h.063A3.016 3.016 0 1 0 7.589 5.94v.031l-1.906 2.76h-.126c-.454 0-.898.138-1.273.395L0 7.354A7.995 7.995 0 0 1 2.546 2.12Z" fill="#000"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 878 B |
@@ -1,20 +1,28 @@
|
||||
blueprints = custom_target('blueprints',
|
||||
blueprints = custom_target(
|
||||
'blueprints',
|
||||
input: files(
|
||||
'gtk/help-overlay.blp',
|
||||
'gtk/window.blp',
|
||||
'gtk/details-dialog.blp',
|
||||
'gtk/game.blp',
|
||||
'gtk/help-overlay.blp',
|
||||
'gtk/preferences.blp',
|
||||
'gtk/details-window.blp'
|
||||
'gtk/window.blp',
|
||||
),
|
||||
output: '.',
|
||||
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
|
||||
command: [
|
||||
find_program('blueprint-compiler'),
|
||||
'batch-compile',
|
||||
'@OUTPUT@',
|
||||
'@CURRENT_SOURCE_DIR@',
|
||||
'@INPUT@',
|
||||
],
|
||||
)
|
||||
|
||||
gnome.compile_resources('cartridges',
|
||||
gnome.compile_resources(
|
||||
'cartridges',
|
||||
configure_file(
|
||||
input: 'cartridges.gresource.xml.in',
|
||||
output: 'cartridges.gresource.xml',
|
||||
configuration: conf
|
||||
configuration: conf,
|
||||
),
|
||||
gresource_bundle: true,
|
||||
install: true,
|
||||
@@ -22,55 +30,86 @@ gnome.compile_resources('cartridges',
|
||||
dependencies: blueprints,
|
||||
)
|
||||
|
||||
desktop_file = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: 'hu.kramo.Cartridges.desktop.in',
|
||||
if host_machine.system() == 'windows'
|
||||
desktop_file = configure_file(
|
||||
input: 'page.kramo.Cartridges.desktop.in',
|
||||
output: app_id + '.desktop.in',
|
||||
configuration: conf
|
||||
configuration: conf,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('datadir'), 'applications'),
|
||||
)
|
||||
else
|
||||
desktop_file = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: 'page.kramo.Cartridges.desktop.in',
|
||||
output: app_id + '.desktop.in',
|
||||
configuration: conf,
|
||||
),
|
||||
output: app_id + '.desktop',
|
||||
type: 'desktop',
|
||||
po_dir: '../po',
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('datadir'), 'applications')
|
||||
)
|
||||
|
||||
desktop_utils = find_program('desktop-file-validate', required: false)
|
||||
if desktop_utils.found()
|
||||
test('Validate desktop file', desktop_utils, args: [desktop_file])
|
||||
install_dir: join_paths(get_option('datadir'), 'applications'),
|
||||
)
|
||||
endif
|
||||
|
||||
appstream_file = i18n.merge_file(
|
||||
if host_machine.system() != 'windows'
|
||||
desktop_utils = find_program('desktop-file-validate', required: false)
|
||||
if desktop_utils.found()
|
||||
test('Validate desktop file', desktop_utils, args: [desktop_file])
|
||||
endif
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
appstream_file = configure_file(
|
||||
input: 'page.kramo.Cartridges.metainfo.xml.in',
|
||||
output: app_id + '.metainfo.xml',
|
||||
configuration: conf,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('datadir'), 'metainfo'),
|
||||
)
|
||||
else
|
||||
appstream_file = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: 'hu.kramo.Cartridges.metainfo.xml.in',
|
||||
input: 'page.kramo.Cartridges.metainfo.xml.in',
|
||||
output: app_id + '.metainfo.xml.in',
|
||||
configuration: conf
|
||||
configuration: conf,
|
||||
),
|
||||
output: app_id + '.metainfo.xml',
|
||||
po_dir: '../po',
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('datadir'), 'metainfo')
|
||||
)
|
||||
install_dir: join_paths(get_option('datadir'), 'metainfo'),
|
||||
)
|
||||
endif
|
||||
|
||||
appstream_util = find_program('appstream-util', required: false)
|
||||
if appstream_util.found()
|
||||
test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
|
||||
if host_machine.system() != 'windows'
|
||||
appstreamcli = find_program('appstreamcli', required: false)
|
||||
if appstreamcli.found()
|
||||
test(
|
||||
'Validate appstream file',
|
||||
appstreamcli,
|
||||
args: ['validate', '--no-net', '--explain', appstream_file],
|
||||
workdir: meson.current_build_dir(),
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
install_data(
|
||||
configure_file(
|
||||
input: 'hu.kramo.Cartridges.gschema.xml.in',
|
||||
input: 'page.kramo.Cartridges.gschema.xml.in',
|
||||
output: app_id + '.gschema.xml',
|
||||
configuration: conf
|
||||
configuration: conf,
|
||||
),
|
||||
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
|
||||
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas'),
|
||||
)
|
||||
|
||||
compile_schemas = find_program('glib-compile-schemas', required: false)
|
||||
if compile_schemas.found()
|
||||
test('Validate schema file',
|
||||
test(
|
||||
'Validate schema file',
|
||||
compile_schemas,
|
||||
args: ['--strict', '--dry-run', meson.current_source_dir()])
|
||||
args: ['--strict', '--dry-run', meson.current_source_dir()],
|
||||
)
|
||||
endif
|
||||
|
||||
subdir('icons')
|
||||
|
||||
@@ -6,6 +6,6 @@ Exec=cartridges
|
||||
Icon=@APP_ID@
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GNOME;GTK;Game;
|
||||
Categories=GNOME;GTK;Game;PackageManager;
|
||||
Keywords=gaming;launcher;steam;lutris;heroic;bottles;itch;flatpak;legendary;retroarch;
|
||||
StartupNotify=true
|
||||
@@ -2,6 +2,9 @@
|
||||
<schemalist gettext-domain="cartridges">
|
||||
|
||||
<schema id="@APP_ID@" path="@PREFIX@/">
|
||||
<key name="auto-import" type="b">
|
||||
<default>false</default>
|
||||
</key>
|
||||
<key name="exit-after-launch" type="b">
|
||||
<default>false</default>
|
||||
</key>
|
||||
@@ -83,9 +86,12 @@
|
||||
<key name="flatpak" type="b">
|
||||
<default>true</default>
|
||||
</key>
|
||||
<key name="flatpak-location" type="s">
|
||||
<key name="flatpak-system-location" type="s">
|
||||
<default>"/var/lib/flatpak/"</default>
|
||||
</key>
|
||||
<key name="flatpak-user-location" type="s">
|
||||
<default>"~/.local/share/flatpak/"</default>
|
||||
</key>
|
||||
<key name="flatpak-import-launchers" type="b">
|
||||
<default>false</default>
|
||||
</key>
|
||||
@@ -108,10 +114,10 @@
|
||||
|
||||
<schema id="@APP_ID@.State" path="@PREFIX@/State/">
|
||||
<key name="width" type="i">
|
||||
<default>1110</default>
|
||||
<default>1170</default>
|
||||
</key>
|
||||
<key name="height" type="i">
|
||||
<default>820</default>
|
||||
<default>795</default>
|
||||
</key>
|
||||
<key name="is-maximized" type="b">
|
||||
<default>false</default>
|
||||
@@ -124,7 +130,10 @@
|
||||
<choice value="oldest" />
|
||||
<choice value="last_played" />
|
||||
</choices>
|
||||
<default>"a-z"</default>
|
||||
<default>"last_played"</default>
|
||||
</key>
|
||||
<key name="show-sidebar" type="b">
|
||||
<default>false</default>
|
||||
</key>
|
||||
<key name="steam-limiter-tokens-history" type="s">
|
||||
<default>"[]"</default>
|
||||
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>@APP_ID@</id>
|
||||
<replaces>
|
||||
<id>hu.kramo.Cartridges</id>
|
||||
</replaces>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0-or-later</project_license>
|
||||
<name>Cartridges</name>
|
||||
@@ -11,31 +14,38 @@
|
||||
<url type="homepage">https://github.com/kra-mo/cartridges</url>
|
||||
<url type="bugtracker">https://github.com/kra-mo/cartridges/issues</url>
|
||||
<url type="translate">https://hosted.weblate.org/engage/cartridges/</url>
|
||||
<url type="contact">https://www.kramo.hu/about/</url>
|
||||
<url type="contact">https://www.kramo.page/about/</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>
|
||||
<developer_name translatable="no">kramo</developer_name>
|
||||
<developer id="page.kramo">
|
||||
<name translate="no">kramo</name>
|
||||
</developer>
|
||||
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
|
||||
<translation type="gettext">cartridges</translation>
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#d5b0e7</color>
|
||||
<color type="primary" scheme_preference="dark">#501a5c</color>
|
||||
</branding>
|
||||
<supports>
|
||||
<control>pointing</control>
|
||||
<control>keyboard</control>
|
||||
<control>touch</control>
|
||||
</supports>
|
||||
<recommends>
|
||||
<display_length compare="gt">545</display_length>
|
||||
</recommends>
|
||||
<requires>
|
||||
<display_length compare="ge">360</display_length>
|
||||
</requires>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://raw.githubusercontent.com/kra-mo/cartridges/main/data/screenshots/1.png</image>
|
||||
<caption>Library</caption>
|
||||
<caption>Cartridges</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://raw.githubusercontent.com/kra-mo/cartridges/main/data/screenshots/2.png</image>
|
||||
<caption>Edit Game Details</caption>
|
||||
<caption>Game Details</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://raw.githubusercontent.com/kra-mo/cartridges/main/data/screenshots/3.png</image>
|
||||
<caption>Game Details</caption>
|
||||
<caption>Edit Game Details</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://raw.githubusercontent.com/kra-mo/cartridges/main/data/screenshots/4.png</image>
|
||||
@@ -44,8 +54,76 @@
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="2.11.1" date="2025-03-15">
|
||||
<description translate="no">
|
||||
<p>Updated the location of Steam covers, so they should correctly import again</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.11" date="2024-12-21">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Added the option to import games automatically</li>
|
||||
<li>Increased the number of games per row on wide screens</li>
|
||||
<li>Fixed an issue where animated covers would not play</li>
|
||||
<li>Fixed an issue where the import dialog would stay open</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.10" date="2024-09-18">
|
||||
<description translate="no">
|
||||
<p>Updated for GNOME 47</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.9" date="2024-07-10">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Cartridges is now available on macOS! You can download it from GitHub.</li>
|
||||
<li>Updated translations</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.8" date="2024-03-20">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>The app features new adaptive widgets taking advantage of developments in GNOME 46</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.7" date="2023-12-12">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Flatpaks installed for the user and system-wide ones can now be imported separately</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.6" date="2023-10-11">
|
||||
<description translate="no">
|
||||
<p>You can now search your Cartridges library from GNOME!</p>
|
||||
<p>To enable the functionality, go to "Search" in the Settings app and toggle "Cartridges" on.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.5" date="2023-10-06">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Added the ability to refetch covers from SteamGridDB</li>
|
||||
<li>Fixed an issue with fractional scaling</li>
|
||||
<li>Translations since 2.4</li>
|
||||
</ul>
|
||||
<p>The project now accepts donations. Thank you so much if you decide to donate! 💜</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.4" date="2023-09-21">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Cartridges now adapts to smaller screen sizes</li>
|
||||
<li>You can now filter games by import source</li>
|
||||
<li>Ported to Libadwaita 1.4</li>
|
||||
<li>Translations since 2.3</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.3" date="2023-08-29">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>New import source: desktop entries</li>
|
||||
<li>Added the ability to pick executables via the file picker</li>
|
||||
@@ -55,7 +133,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.2" date="2023-08-17">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>New import source: RetroArch</li>
|
||||
<li>Added the option to automatically remove uninstalled games on import</li>
|
||||
@@ -66,7 +144,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.1" date="2023-07-25">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Added support for Amazon Games in the Heroic importer</li>
|
||||
<li>Translations since 2.0</li>
|
||||
@@ -74,7 +152,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.0" date="2023-07-05">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<p>After months of work, Cartridges 2.0 is here:</p>
|
||||
<ul>
|
||||
<li>New import source: Legendary</li>
|
||||
@@ -88,7 +166,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.5" date="2023-05-23">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Cartridges is now part of GNOME Circle!</li>
|
||||
<li>Extra Steam libraries are now detected automatically</li>
|
||||
@@ -99,7 +177,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.4" date="2023-04-16">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Support for animated covers</li>
|
||||
<li>Redesigned details view</li>
|
||||
@@ -109,7 +187,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.3" date="2023-04-06">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Support for importing game covers from SteamGridDB!</li>
|
||||
<li>New import source: Lutris</li>
|
||||
@@ -121,7 +199,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.2" date="2023-03-30">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Refined the user experience for importing games</li>
|
||||
<li>Added option to remove all games</li>
|
||||
@@ -130,7 +208,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.1" date="2023-03-26">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<ul>
|
||||
<li>Added option to launch games by clicking the cover image</li>
|
||||
<li>Added option to save cover art losslessly</li>
|
||||
@@ -139,7 +217,7 @@
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.0" date="2023-03-25">
|
||||
<description translatable="no">
|
||||
<description translate="no">
|
||||
<p>First stable release</p>
|
||||
</description>
|
||||
</release>
|
||||
|
Before Width: | Height: | Size: 623 KiB After Width: | Height: | Size: 452 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 291 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 44 KiB |
@@ -35,7 +35,7 @@ Stored as a Unix time stamp.
|
||||
|
||||
The executable to run when launching a game.
|
||||
|
||||
If the source has a URL handler, using that is preferred. In that case, the value should be `"xdg-open url://example/url"` for Linux and `"start url://example/url"` for Windows.
|
||||
If the source has a URL handler, using that is preferred. In that case, the value should be `"xdg-open url://example/url"` for Linux, `"start url://example/url"` for Windows and `"open url://example/url"` for macOS.
|
||||
|
||||
Stored as either a string (preferred) or an argument vector to be passed to the shell through [subprocess.Popen](https://docs.python.org/3/library/subprocess.html#popen-constructor).
|
||||
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
{
|
||||
"id" : "hu.kramo.Cartridges.Devel",
|
||||
"runtime" : "org.gnome.Platform",
|
||||
"runtime-version" : "44",
|
||||
"sdk" : "org.gnome.Sdk",
|
||||
"command" : "cartridges",
|
||||
"finish-args" : [
|
||||
"--share=network",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--device=dri",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.freedesktop.Flatpak",
|
||||
"--filesystem=host",
|
||||
"--filesystem=~/.var/app/com.valvesoftware.Steam/data/Steam/:ro",
|
||||
"--filesystem=~/.var/app/net.lutris.Lutris/:ro",
|
||||
"--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/heroic/:ro",
|
||||
"--filesystem=~/.var/app/com.heroicgameslauncher.hgl/config/legendary/:ro",
|
||||
"--filesystem=~/.var/app/com.usebottles.bottles/data/bottles/:ro",
|
||||
"--filesystem=~/.var/app/io.itch.itch/config/itch/:ro",
|
||||
"--filesystem=~/.var/app/org.libretro.RetroArch/config/retroarch/:ro",
|
||||
"--filesystem=/var/lib/flatpak:ro"
|
||||
],
|
||||
"cleanup" : [
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/man",
|
||||
"/share/doc",
|
||||
"/share/gtk-doc",
|
||||
"/share/man",
|
||||
"/share/pkgconfig",
|
||||
"*.la",
|
||||
"*.a"
|
||||
],
|
||||
"modules" : [
|
||||
{
|
||||
"name": "python3-modules",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [],
|
||||
"modules": [
|
||||
{
|
||||
"name": "python3-pyyaml",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyyaml\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz",
|
||||
"sha256": "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "python3-requests",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl",
|
||||
"sha256": "4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/ff/d7/8d757f8bd45be079d76309248845a04f09619a7b17d6dfc8c9ff6433cac2/charset-normalizer-3.1.0.tar.gz",
|
||||
"sha256": "34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl",
|
||||
"sha256": "90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl",
|
||||
"sha256": "64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/7b/f5/890a0baca17a61c1f92f72b81d3c31523c99bec609e60c292ea55b387ae8/urllib3-1.26.15-py2.py3-none-any.whl",
|
||||
"sha256": "aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "python3-pillow",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pillow\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/00/d5/4903f310765e0ff2b8e91ffe55031ac6af77d982f0156061e20a4d1a8b2d/Pillow-9.5.0.tar.gz",
|
||||
"sha256": "bf548479d336726d7a0eceb6e767e179fbde37833ae42794602631a070d630f1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "blueprint-compiler",
|
||||
"buildsystem" : "meson",
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler",
|
||||
"tag" : "v0.8.1"
|
||||
}
|
||||
],
|
||||
"cleanup" : [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "cartridges",
|
||||
"builddir" : true,
|
||||
"buildsystem" : "meson",
|
||||
"config-opts": [
|
||||
"-Dprofile=development"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "dir",
|
||||
"path" : ".."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
46
meson.build
@@ -1,40 +1,60 @@
|
||||
project('cartridges',
|
||||
version: '2.3',
|
||||
project(
|
||||
'cartridges',
|
||||
version: '2.11.1',
|
||||
meson_version: '>= 0.59.0',
|
||||
default_options: [ 'warning_level=2', 'werror=false', ],
|
||||
default_options: [
|
||||
'warning_level=2',
|
||||
'werror=false',
|
||||
],
|
||||
)
|
||||
|
||||
i18n = import('i18n')
|
||||
dependency('gtk4', version: '>= 4.15.0')
|
||||
dependency('libadwaita-1', version: '>= 1.6.beta')
|
||||
|
||||
# Translations are broken on Windows for multiple reasons
|
||||
# gresources don't work and MSYS2 seems to have also broken the gettext package
|
||||
if host_machine.system() != 'windows'
|
||||
i18n = import('i18n')
|
||||
endif
|
||||
|
||||
gnome = import('gnome')
|
||||
python = import('python')
|
||||
|
||||
py_installation = python.find_installation('python3')
|
||||
|
||||
python_dir = join_paths(get_option('prefix'), py_installation.get_install_dir())
|
||||
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
|
||||
libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
|
||||
|
||||
profile = get_option('profile')
|
||||
if profile == 'development'
|
||||
app_id = 'hu.kramo.Cartridges.Devel'
|
||||
prefix = '/hu/kramo/Cartridges/Devel'
|
||||
app_id = 'page.kramo.Cartridges.Devel'
|
||||
prefix = '/page/kramo/Cartridges/Devel'
|
||||
elif profile == 'release'
|
||||
app_id = 'hu.kramo.Cartridges'
|
||||
prefix = '/hu/kramo/Cartridges'
|
||||
app_id = 'page.kramo.Cartridges'
|
||||
prefix = '/page/kramo/Cartridges'
|
||||
endif
|
||||
|
||||
conf = configuration_data()
|
||||
conf.set('PYTHON', python.find_installation('python3').full_path())
|
||||
conf.set('PYTHON_VERSION', python.find_installation('python3').language_version())
|
||||
conf.set('PYTHON', py_installation.full_path())
|
||||
conf.set('PYTHON_VERSION', py_installation.language_version())
|
||||
conf.set('APP_ID', app_id)
|
||||
conf.set('PREFIX', prefix)
|
||||
conf.set('VERSION', meson.project_version())
|
||||
conf.set('PROFILE', profile)
|
||||
conf.set('TIFF_COMPRESSION', get_option('tiff_compression'))
|
||||
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
|
||||
conf.set('pkgdatadir', pkgdatadir)
|
||||
conf.set('libexecdir', libexecdir)
|
||||
|
||||
subdir('data')
|
||||
subdir('src')
|
||||
subdir('po')
|
||||
subdir('cartridges')
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
subdir('windows')
|
||||
subdir('build-aux/windows')
|
||||
else
|
||||
subdir('search-provider')
|
||||
subdir('po')
|
||||
endif
|
||||
|
||||
gnome.post_install(
|
||||
|
||||
@@ -7,3 +7,12 @@ option(
|
||||
],
|
||||
value: 'release'
|
||||
)
|
||||
option(
|
||||
'tiff_compression',
|
||||
type: 'combo',
|
||||
choices: [
|
||||
'webp',
|
||||
'jpeg',
|
||||
],
|
||||
value: 'webp'
|
||||
)
|
||||
10
po/LINGUAS
@@ -20,3 +20,13 @@ sv
|
||||
tr
|
||||
el
|
||||
cs
|
||||
zh_Hans
|
||||
be
|
||||
hr
|
||||
ca
|
||||
ja
|
||||
hi
|
||||
en_GB
|
||||
ie
|
||||
te
|
||||
ia
|
||||
|
||||
41
po/POTFILES
@@ -1,21 +1,34 @@
|
||||
data/hu.kramo.Cartridges.desktop.in
|
||||
data/hu.kramo.Cartridges.gschema.xml.in
|
||||
data/hu.kramo.Cartridges.metainfo.xml.in
|
||||
data/page.kramo.Cartridges.desktop.in
|
||||
data/page.kramo.Cartridges.gschema.xml.in
|
||||
data/page.kramo.Cartridges.metainfo.xml.in
|
||||
|
||||
data/gtk/details-window.blp
|
||||
data/gtk/details-dialog.blp
|
||||
data/gtk/game.blp
|
||||
data/gtk/help-overlay.blp
|
||||
data/gtk/preferences.blp
|
||||
data/gtk/window.blp
|
||||
|
||||
src/main.py
|
||||
src/window.py
|
||||
src/details_window.py
|
||||
src/game.py
|
||||
src/preferences.py
|
||||
cartridges/main.py
|
||||
cartridges/window.py
|
||||
cartridges/details_dialog.py
|
||||
cartridges/game.py
|
||||
cartridges/preferences.py
|
||||
|
||||
src/utils/create_dialog.py
|
||||
src/importer/importer.py
|
||||
src/importer/sources/source.py
|
||||
src/importer/sources/location.py
|
||||
src/store/managers/sgdb_manager.py
|
||||
cartridges/utils/create_dialog.py
|
||||
cartridges/utils/relative_date.py
|
||||
|
||||
cartridges/importer/importer.py
|
||||
cartridges/importer/source.py
|
||||
cartridges/importer/location.py
|
||||
cartridges/importer/location.py
|
||||
cartridges/importer/bottles_source.py
|
||||
cartridges/importer/desktop_source.py
|
||||
cartridges/importer/flatpak_source.py
|
||||
cartridges/importer/heroic_source.py
|
||||
cartridges/importer/itch_source.py
|
||||
cartridges/importer/legendary_source.py
|
||||
cartridges/importer/lutris_source.py
|
||||
cartridges/importer/retroarch_source.py
|
||||
cartridges/importer/steam_source.py
|
||||
|
||||
cartridges/store/managers/sgdb_manager.py
|
||||
|
||||
561
po/ar.po
@@ -3,13 +3,16 @@
|
||||
# This file is distributed under the same license as the cartridges package.
|
||||
# Ali Aljishi <ahj696@hotmail.com>, 2023.
|
||||
# kramo <contact@kramo.hu>, 2023.
|
||||
# Ali-98 <ahj696@hotmail.com>, 2023.
|
||||
# Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>, 2024.
|
||||
# "Jadiir M. Aal Jaidaan" <ashrafquatre@gmail.com>, 2024.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: cartridges\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-08-27 14:03+0200\n"
|
||||
"PO-Revision-Date: 2023-08-29 10:45+0000\n"
|
||||
"Last-Translator: Ali Aljishi <ahj696@hotmail.com>\n"
|
||||
"POT-Creation-Date: 2024-11-05 14:01+0100\n"
|
||||
"PO-Revision-Date: 2024-11-27 20:00+0000\n"
|
||||
"Last-Translator: \"Jadiir M. Aal Jaidaan\" <ashrafquatre@gmail.com>\n"
|
||||
"Language-Team: Arabic <https://hosted.weblate.org/projects/cartridges/"
|
||||
"cartridges/ar/>\n"
|
||||
"Language: ar\n"
|
||||
@@ -18,30 +21,31 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
|
||||
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
|
||||
"X-Generator: Weblate 5.0.1-dev\n"
|
||||
"X-Generator: Weblate 5.9-dev\n"
|
||||
|
||||
#: data/hu.kramo.Cartridges.desktop.in:3
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:6 data/gtk/window.blp:47
|
||||
#: src/main.py:176
|
||||
#: data/page.kramo.Cartridges.desktop.in:3
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:9
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:40 data/gtk/window.blp:47
|
||||
#: data/gtk/window.blp:83
|
||||
msgid "Cartridges"
|
||||
msgstr "خراطيش"
|
||||
|
||||
#: data/hu.kramo.Cartridges.desktop.in:4
|
||||
#: data/page.kramo.Cartridges.desktop.in:4
|
||||
msgid "Game Launcher"
|
||||
msgstr "مشغِّل ألعاب"
|
||||
|
||||
#: data/hu.kramo.Cartridges.desktop.in:5
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:7
|
||||
#: data/page.kramo.Cartridges.desktop.in:5
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:10
|
||||
msgid "Launch all your games"
|
||||
msgstr "شغِّل كلَّ ألعابك"
|
||||
|
||||
#: data/hu.kramo.Cartridges.desktop.in:11
|
||||
#: data/page.kramo.Cartridges.desktop.in:11
|
||||
msgid ""
|
||||
"gaming;launcher;steam;lutris;heroic;bottles;itch;flatpak;legendary;retroarch;"
|
||||
msgstr ""
|
||||
"لعب;مشغل;ستيم;لوترس;هروك;قوارير;إتش;هيرويك;بوتلز;لجندري;فلاتباك;رتروآرتش;"
|
||||
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:9
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:12
|
||||
msgid ""
|
||||
"Cartridges is a simple game launcher for all of your games. It has support "
|
||||
"for importing games from Steam, Lutris, Heroic and more with no login "
|
||||
@@ -52,71 +56,66 @@ msgstr ""
|
||||
"وبرامج أخرى، وذلك دون تسجيل دخول. ولك ترتيب وإخفاء الألعاب فيه كيفما شئت، "
|
||||
"وكذلك تستطيع منه تنزيل غُلُف الألعاب من SteamGridDB."
|
||||
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:30
|
||||
msgid "Library"
|
||||
msgstr "المكتبة"
|
||||
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:34
|
||||
msgid "Edit Game Details"
|
||||
msgstr "حرِّر تفاصيل اللعبة"
|
||||
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:38 data/gtk/window.blp:71
|
||||
#: src/details_window.py:71
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:44 data/gtk/window.blp:320
|
||||
#: cartridges/details_dialog.py:77
|
||||
msgid "Game Details"
|
||||
msgstr "تفاصيل اللعبة"
|
||||
|
||||
#: data/hu.kramo.Cartridges.metainfo.xml.in:42 data/gtk/window.blp:430
|
||||
#: src/details_window.py:265 src/importer/importer.py:301
|
||||
#: src/importer/importer.py:352
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:48
|
||||
msgid "Edit Game Details"
|
||||
msgstr "حرِّر تفاصيل اللعبة"
|
||||
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:52 data/gtk/help-overlay.blp:19
|
||||
#: data/gtk/window.blp:543 cartridges/details_dialog.py:279
|
||||
#: cartridges/importer/importer.py:319 cartridges/importer/importer.py:369
|
||||
msgid "Preferences"
|
||||
msgstr "التفضيلات"
|
||||
|
||||
#: data/gtk/details-window.blp:25
|
||||
#: data/gtk/details-dialog.blp:15
|
||||
msgid "Cancel"
|
||||
msgstr "ألغِ"
|
||||
|
||||
#: data/gtk/details-window.blp:58
|
||||
#: data/gtk/details-dialog.blp:45
|
||||
msgid "New Cover"
|
||||
msgstr "غلاف جديد"
|
||||
|
||||
#: data/gtk/details-window.blp:77
|
||||
#: data/gtk/details-dialog.blp:64
|
||||
msgid "Delete Cover"
|
||||
msgstr "احذف الغلاف"
|
||||
|
||||
#: data/gtk/details-window.blp:105 data/gtk/game.blp:80
|
||||
#: data/gtk/details-dialog.blp:92 data/gtk/game.blp:80
|
||||
msgid "Title"
|
||||
msgstr "العنوان"
|
||||
|
||||
#: data/gtk/details-window.blp:109
|
||||
#: data/gtk/details-dialog.blp:96
|
||||
msgid "Developer (optional)"
|
||||
msgstr "المطوِّر (اختياري)"
|
||||
|
||||
#: data/gtk/details-window.blp:115
|
||||
#: data/gtk/details-dialog.blp:102
|
||||
msgid "Executable"
|
||||
msgstr "ملفُّ التنفيذ"
|
||||
|
||||
#: data/gtk/details-window.blp:121
|
||||
#: data/gtk/details-dialog.blp:108
|
||||
msgid "Select File"
|
||||
msgstr "اختر ملفًّا"
|
||||
|
||||
#: data/gtk/details-window.blp:132
|
||||
#: data/gtk/details-dialog.blp:119
|
||||
msgid "More Info"
|
||||
msgstr "معلومات أكثر"
|
||||
|
||||
#: data/gtk/game.blp:102 data/gtk/game.blp:121 data/gtk/window.blp:195
|
||||
#: data/gtk/game.blp:101 data/gtk/game.blp:109 data/gtk/window.blp:444
|
||||
msgid "Edit"
|
||||
msgstr "حرِّر"
|
||||
|
||||
#: data/gtk/game.blp:107 src/window.py:190
|
||||
#: data/gtk/game.blp:102 cartridges/window.py:359
|
||||
msgid "Hide"
|
||||
msgstr "أخفِ"
|
||||
|
||||
#: data/gtk/game.blp:112 data/gtk/game.blp:131 data/gtk/preferences.blp:56
|
||||
#: data/gtk/window.blp:215
|
||||
#: data/gtk/game.blp:103 data/gtk/game.blp:111 data/gtk/window.blp:464
|
||||
msgid "Remove"
|
||||
msgstr "أزل"
|
||||
|
||||
#: data/gtk/game.blp:126 src/window.py:192
|
||||
#: data/gtk/game.blp:110 cartridges/window.py:361
|
||||
msgid "Unhide"
|
||||
msgstr "اكشف"
|
||||
|
||||
@@ -124,54 +123,55 @@ msgstr "اكشف"
|
||||
msgid "General"
|
||||
msgstr "عام"
|
||||
|
||||
#: data/gtk/help-overlay.blp:14
|
||||
msgid "Quit"
|
||||
msgstr "أنهِ"
|
||||
|
||||
#: data/gtk/help-overlay.blp:19 data/gtk/window.blp:226 data/gtk/window.blp:269
|
||||
#: data/gtk/window.blp:336
|
||||
#: data/gtk/help-overlay.blp:14 data/gtk/window.blp:207 data/gtk/window.blp:223
|
||||
#: data/gtk/window.blp:274 data/gtk/window.blp:290 data/gtk/window.blp:475
|
||||
msgid "Search"
|
||||
msgstr "ابحث"
|
||||
|
||||
#: data/gtk/help-overlay.blp:24
|
||||
msgid "Show preferences"
|
||||
msgstr "أظهر التفضيلات"
|
||||
#: data/gtk/help-overlay.blp:24 data/gtk/window.blp:544
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr "اختصارات لوحة المفاتيح"
|
||||
|
||||
#: data/gtk/help-overlay.blp:29
|
||||
msgid "Shortcuts"
|
||||
msgstr "الاختصارات"
|
||||
|
||||
#: data/gtk/help-overlay.blp:34 src/game.py:105 src/preferences.py:124
|
||||
#: src/importer/importer.py:376
|
||||
#: data/gtk/help-overlay.blp:29 cartridges/game.py:103
|
||||
#: cartridges/preferences.py:137 cartridges/importer/importer.py:386
|
||||
msgid "Undo"
|
||||
msgstr "تراجع"
|
||||
|
||||
#: data/gtk/help-overlay.blp:39
|
||||
msgid "Open menu"
|
||||
msgstr "افتح القائمة"
|
||||
#: data/gtk/help-overlay.blp:34
|
||||
msgid "Quit"
|
||||
msgstr "أنهِ"
|
||||
|
||||
#: data/gtk/help-overlay.blp:45
|
||||
#: data/gtk/help-overlay.blp:39 data/gtk/window.blp:92 data/gtk/window.blp:187
|
||||
msgid "Toggle Sidebar"
|
||||
msgstr "أظهر شريط الجانب"
|
||||
|
||||
#: data/gtk/help-overlay.blp:44 data/gtk/window.blp:200 data/gtk/window.blp:267
|
||||
msgid "Main Menu"
|
||||
msgstr "القائمة الرئيسة"
|
||||
|
||||
#: data/gtk/help-overlay.blp:50
|
||||
msgid "Games"
|
||||
msgstr "الألعاب"
|
||||
|
||||
#: data/gtk/help-overlay.blp:48
|
||||
msgid "Add new game"
|
||||
msgstr "أضف لعبةً جديدةً"
|
||||
#: data/gtk/help-overlay.blp:53 data/gtk/window.blp:193 data/gtk/window.blp:551
|
||||
msgid "Add Game"
|
||||
msgstr "أضف لعبةً"
|
||||
|
||||
#: data/gtk/help-overlay.blp:53
|
||||
msgid "Import games"
|
||||
msgstr "استورد ألعابًا"
|
||||
|
||||
#: data/gtk/help-overlay.blp:58
|
||||
msgid "Show hidden games"
|
||||
msgstr "أظهر الألعاب المخفية"
|
||||
#: data/gtk/help-overlay.blp:58 data/gtk/preferences.blp:58
|
||||
#: data/gtk/window.blp:27 data/gtk/window.blp:555
|
||||
msgid "Import"
|
||||
msgstr "استورد"
|
||||
|
||||
#: data/gtk/help-overlay.blp:63
|
||||
msgid "Remove game"
|
||||
msgid "Show Hidden Games"
|
||||
msgstr "أظهر الألعاب المخفية"
|
||||
|
||||
#: data/gtk/help-overlay.blp:68
|
||||
msgid "Remove Game"
|
||||
msgstr "أزل اللعبة"
|
||||
|
||||
#: data/gtk/preferences.blp:13 data/gtk/preferences.blp:88
|
||||
#: data/gtk/preferences.blp:339
|
||||
#: data/gtk/preferences.blp:13 data/gtk/preferences.blp:62
|
||||
#: data/gtk/preferences.blp:365
|
||||
msgid "Behavior"
|
||||
msgstr "السلوك"
|
||||
|
||||
@@ -179,297 +179,321 @@ msgstr "السلوك"
|
||||
msgid "Exit After Launching Games"
|
||||
msgstr "اخرج بعد بدء الألعاب"
|
||||
|
||||
#: data/gtk/preferences.blp:25
|
||||
#: data/gtk/preferences.blp:20
|
||||
msgid "Cover Image Launches Game"
|
||||
msgstr "تبدأ صورة الغلاف اللعبة"
|
||||
|
||||
#: data/gtk/preferences.blp:26
|
||||
#: data/gtk/preferences.blp:21
|
||||
msgid "Swaps the behavior of the cover image and the play button"
|
||||
msgstr "يبدِّل سلوك صورة الغلاف وزرِّ «العب»"
|
||||
|
||||
#: data/gtk/preferences.blp:36 src/details_window.py:85
|
||||
#: data/gtk/preferences.blp:26 cartridges/details_dialog.py:91
|
||||
msgid "Images"
|
||||
msgstr "الصور"
|
||||
|
||||
#: data/gtk/preferences.blp:39
|
||||
#: data/gtk/preferences.blp:29
|
||||
msgid "High Quality Images"
|
||||
msgstr "صور ذات دقَّة عالية"
|
||||
|
||||
#: data/gtk/preferences.blp:40
|
||||
#: data/gtk/preferences.blp:30
|
||||
msgid "Save game covers losslessly at the cost of storage"
|
||||
msgstr "احفظ غُلُف الألعاب دون فقد على حساب مساحة التخزين"
|
||||
|
||||
#: data/gtk/preferences.blp:50
|
||||
#: data/gtk/preferences.blp:35
|
||||
msgid "Danger Zone"
|
||||
msgstr "منطقة خطر"
|
||||
|
||||
#: data/gtk/preferences.blp:53
|
||||
#: data/gtk/preferences.blp:39
|
||||
msgid "Remove All Games"
|
||||
msgstr "أزل كلَّ الألعاب"
|
||||
|
||||
#: data/gtk/preferences.blp:84 data/gtk/window.blp:27 data/gtk/window.blp:456
|
||||
msgid "Import"
|
||||
msgstr "استورد"
|
||||
#: data/gtk/preferences.blp:65
|
||||
msgid "Import Games Automatically"
|
||||
msgstr "استيراد الألعاب تلقائيًا"
|
||||
|
||||
#: data/gtk/preferences.blp:91
|
||||
#: data/gtk/preferences.blp:69
|
||||
msgid "Remove Uninstalled Games"
|
||||
msgstr "أزل الألعاب المحذوفة"
|
||||
|
||||
#: data/gtk/preferences.blp:101
|
||||
#: data/gtk/preferences.blp:74
|
||||
msgid "Sources"
|
||||
msgstr "المصادر"
|
||||
|
||||
#: data/gtk/preferences.blp:104
|
||||
#: data/gtk/preferences.blp:78 cartridges/importer/steam_source.py:114
|
||||
msgid "Steam"
|
||||
msgstr "ستيم"
|
||||
|
||||
#: data/gtk/preferences.blp:108 data/gtk/preferences.blp:125
|
||||
#: data/gtk/preferences.blp:172 data/gtk/preferences.blp:225
|
||||
#: data/gtk/preferences.blp:242 data/gtk/preferences.blp:259
|
||||
#: data/gtk/preferences.blp:276 data/gtk/preferences.blp:293
|
||||
#: data/gtk/preferences.blp:87 data/gtk/preferences.blp:114
|
||||
#: data/gtk/preferences.blp:149 data/gtk/preferences.blp:192
|
||||
#: data/gtk/preferences.blp:219 data/gtk/preferences.blp:246
|
||||
#: data/gtk/preferences.blp:273
|
||||
msgid "Install Location"
|
||||
msgstr "موضع التثبيت"
|
||||
|
||||
#: data/gtk/preferences.blp:121
|
||||
#: data/gtk/preferences.blp:105 data/gtk/window.blp:565
|
||||
#: cartridges/importer/lutris_source.py:107
|
||||
msgid "Lutris"
|
||||
msgstr "لوترس"
|
||||
|
||||
#: data/gtk/preferences.blp:137
|
||||
msgid "Cache Location"
|
||||
msgstr "موضع الذاكرة المؤقتة"
|
||||
|
||||
#: data/gtk/preferences.blp:149
|
||||
#: data/gtk/preferences.blp:131
|
||||
msgid "Import Steam Games"
|
||||
msgstr "استورد ألعابًا من ستيم"
|
||||
|
||||
#: data/gtk/preferences.blp:158
|
||||
#: data/gtk/preferences.blp:135
|
||||
msgid "Import Flatpak Games"
|
||||
msgstr "استورد ألعاب فلاتباك"
|
||||
|
||||
#: data/gtk/preferences.blp:168
|
||||
#: data/gtk/preferences.blp:140 cartridges/importer/heroic_source.py:355
|
||||
msgid "Heroic"
|
||||
msgstr "هِرُوِك"
|
||||
|
||||
#: data/gtk/preferences.blp:184
|
||||
#: data/gtk/preferences.blp:166
|
||||
msgid "Import Epic Games"
|
||||
msgstr "استورد ألعاب أَبِك"
|
||||
|
||||
#: data/gtk/preferences.blp:193
|
||||
#: data/gtk/preferences.blp:170
|
||||
msgid "Import GOG Games"
|
||||
msgstr "استورد ألعاب جيأوجي"
|
||||
|
||||
#: data/gtk/preferences.blp:202
|
||||
#: data/gtk/preferences.blp:174
|
||||
msgid "Import Amazon Games"
|
||||
msgstr "استورد ألعابًا من أمازون"
|
||||
|
||||
#: data/gtk/preferences.blp:211
|
||||
#: data/gtk/preferences.blp:178
|
||||
msgid "Import Sideloaded Games"
|
||||
msgstr "استورد ألعابًا مثبَّتةً بغير متجر"
|
||||
|
||||
#: data/gtk/preferences.blp:221
|
||||
#: data/gtk/preferences.blp:183 cartridges/importer/bottles_source.py:86
|
||||
msgid "Bottles"
|
||||
msgstr "قوارير"
|
||||
|
||||
#: data/gtk/preferences.blp:238
|
||||
#: data/gtk/preferences.blp:210 cartridges/importer/itch_source.py:81
|
||||
msgid "itch"
|
||||
msgstr "إتش"
|
||||
|
||||
#: data/gtk/preferences.blp:255
|
||||
#: data/gtk/preferences.blp:237 cartridges/importer/legendary_source.py:97
|
||||
msgid "Legendary"
|
||||
msgstr "لجندري"
|
||||
|
||||
#: data/gtk/preferences.blp:272
|
||||
#: data/gtk/preferences.blp:264 cartridges/importer/retroarch_source.py:142
|
||||
msgid "RetroArch"
|
||||
msgstr "رتروآرتش"
|
||||
|
||||
#: data/gtk/preferences.blp:289
|
||||
#: data/gtk/preferences.blp:291 cartridges/importer/flatpak_source.py:143
|
||||
msgid "Flatpak"
|
||||
msgstr "فلاتباك"
|
||||
|
||||
#: data/gtk/preferences.blp:305
|
||||
#. The location of the system-wide data directory
|
||||
#: data/gtk/preferences.blp:301
|
||||
msgid "System Location"
|
||||
msgstr "موضع النظام"
|
||||
|
||||
#. The location of the user-specific data directory
|
||||
#: data/gtk/preferences.blp:319
|
||||
msgid "User Location"
|
||||
msgstr "موضع المستخدم"
|
||||
|
||||
#: data/gtk/preferences.blp:336
|
||||
msgid "Import Game Launchers"
|
||||
msgstr "استورد مشغِّلات ألعاب"
|
||||
|
||||
#: data/gtk/preferences.blp:315
|
||||
#: data/gtk/preferences.blp:341 cartridges/importer/desktop_source.py:215
|
||||
msgid "Desktop Entries"
|
||||
msgstr "مدخلات سطح المكتب"
|
||||
|
||||
#: data/gtk/preferences.blp:327
|
||||
#: data/gtk/preferences.blp:353 data/gtk/window.blp:563
|
||||
msgid "SteamGridDB"
|
||||
msgstr "SteamGridDB"
|
||||
|
||||
#: data/gtk/preferences.blp:331
|
||||
#: data/gtk/preferences.blp:357
|
||||
msgid "Authentication"
|
||||
msgstr "الاستيثاق"
|
||||
|
||||
#: data/gtk/preferences.blp:334
|
||||
#: data/gtk/preferences.blp:360
|
||||
msgid "API Key"
|
||||
msgstr "مفتاح واجهة البرمجة"
|
||||
|
||||
#: data/gtk/preferences.blp:342
|
||||
#: data/gtk/preferences.blp:368
|
||||
msgid "Use SteamGridDB"
|
||||
msgstr "استخدم SteamGridDB"
|
||||
|
||||
#: data/gtk/preferences.blp:343
|
||||
#: data/gtk/preferences.blp:369
|
||||
msgid "Download images when adding or importing games"
|
||||
msgstr "نزِّل الصور حينما تنزِّل أو تستورد الألعاب"
|
||||
|
||||
#: data/gtk/preferences.blp:352
|
||||
#: data/gtk/preferences.blp:373
|
||||
msgid "Prefer Over Official Images"
|
||||
msgstr "فضِّلها على الصور الرسمية"
|
||||
|
||||
#: data/gtk/preferences.blp:361
|
||||
#: data/gtk/preferences.blp:377
|
||||
msgid "Prefer Animated Images"
|
||||
msgstr "فضِّل الصور المتحرِّكة"
|
||||
|
||||
#: data/gtk/preferences.blp:383
|
||||
msgid "Update Covers"
|
||||
msgstr "حدِّث الغُلُف"
|
||||
|
||||
#: data/gtk/preferences.blp:384
|
||||
msgid "Fetch covers for games already in your library"
|
||||
msgstr "اجلب غُلُفًا للألعاب التي في المكتبة"
|
||||
|
||||
#: data/gtk/preferences.blp:389
|
||||
msgid "Update"
|
||||
msgstr "حدِّث"
|
||||
|
||||
#: data/gtk/window.blp:6 data/gtk/window.blp:14
|
||||
msgid "No Games Found"
|
||||
msgstr "لم يُعثر على ألعاب"
|
||||
|
||||
#: data/gtk/window.blp:7 data/gtk/window.blp:15
|
||||
msgid "Try a different search."
|
||||
msgstr "جرِّب بحثًا آخر."
|
||||
msgid "Try a different search"
|
||||
msgstr "جرِّب بحثًا آخر"
|
||||
|
||||
#: data/gtk/window.blp:21
|
||||
msgid "No Games"
|
||||
msgstr "لا توجد ألعاب"
|
||||
|
||||
#: data/gtk/window.blp:22
|
||||
msgid "Use the + button to add games."
|
||||
msgstr "استخدم زرَّ + لتضيف ألعابًا."
|
||||
msgid "Use the + button to add games"
|
||||
msgstr "استخدم زرَّ + لتضيف ألعابًا"
|
||||
|
||||
#: data/gtk/window.blp:40
|
||||
msgid "No Hidden Games"
|
||||
msgstr "لا توجد ألعاب مخفية"
|
||||
|
||||
#: data/gtk/window.blp:41
|
||||
msgid "Games you hide will appear here."
|
||||
msgstr "هنا يظهر ما أخفيت من ألعاب."
|
||||
msgid "Games you hide will appear here"
|
||||
msgstr "هنا يظهر ما أخفيت من ألعاب"
|
||||
|
||||
#: data/gtk/window.blp:64 data/gtk/window.blp:317
|
||||
msgid "Back"
|
||||
msgstr "عد"
|
||||
#: data/gtk/window.blp:76 data/gtk/window.blp:113 cartridges/main.py:249
|
||||
msgid "All Games"
|
||||
msgstr "كلُّ الألعاب"
|
||||
|
||||
#: data/gtk/window.blp:121
|
||||
msgid "Game Title"
|
||||
msgstr "عنوان اللعبة"
|
||||
#: data/gtk/window.blp:140 cartridges/main.py:251
|
||||
msgid "Added"
|
||||
msgstr "أُضيفَت"
|
||||
|
||||
#: data/gtk/window.blp:176
|
||||
msgid "Play"
|
||||
msgstr "العب"
|
||||
#: data/gtk/window.blp:162
|
||||
msgid "Imported"
|
||||
msgstr "اُستوردَت"
|
||||
|
||||
#: data/gtk/window.blp:255 data/gtk/window.blp:449
|
||||
msgid "Add Game"
|
||||
msgstr "أضف لعبةً"
|
||||
|
||||
#: data/gtk/window.blp:262 data/gtk/window.blp:329
|
||||
msgid "Main Menu"
|
||||
msgstr "القائمة الرئيسة"
|
||||
|
||||
#: data/gtk/window.blp:284
|
||||
msgid "Search games"
|
||||
msgstr "ابحث عن ألعاب"
|
||||
|
||||
#: data/gtk/window.blp:324
|
||||
#: data/gtk/window.blp:260
|
||||
msgid "Hidden Games"
|
||||
msgstr "الألعاب المخفية"
|
||||
|
||||
#: data/gtk/window.blp:351
|
||||
msgid "Search hidden games"
|
||||
msgstr "ابحث في الألعاب المخفية"
|
||||
#: data/gtk/window.blp:368
|
||||
msgid "Game Title"
|
||||
msgstr "عنوان اللعبة"
|
||||
|
||||
#: data/gtk/window.blp:388
|
||||
#: data/gtk/window.blp:425
|
||||
msgid "Play"
|
||||
msgstr "العب"
|
||||
|
||||
#: data/gtk/window.blp:502
|
||||
msgid "Sort"
|
||||
msgstr "رتِّب"
|
||||
|
||||
#: data/gtk/window.blp:391
|
||||
#: data/gtk/window.blp:505
|
||||
msgid "A-Z"
|
||||
msgstr "أ-ي"
|
||||
|
||||
#: data/gtk/window.blp:397
|
||||
#: data/gtk/window.blp:511
|
||||
msgid "Z-A"
|
||||
msgstr "ي-أ"
|
||||
|
||||
#: data/gtk/window.blp:403
|
||||
#: data/gtk/window.blp:517
|
||||
msgid "Newest"
|
||||
msgstr "الأجدد"
|
||||
|
||||
#: data/gtk/window.blp:409
|
||||
#: data/gtk/window.blp:523
|
||||
msgid "Oldest"
|
||||
msgstr "الأقدم"
|
||||
|
||||
#: data/gtk/window.blp:415
|
||||
#: data/gtk/window.blp:529
|
||||
msgid "Last Played"
|
||||
msgstr "لُعبت آخر مرَّة"
|
||||
|
||||
#: data/gtk/window.blp:422
|
||||
#: data/gtk/window.blp:536
|
||||
msgid "Show Hidden"
|
||||
msgstr "أظهر ما أخفي"
|
||||
|
||||
#: data/gtk/window.blp:435
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr "اختصارات لوحة المفاتيح"
|
||||
|
||||
#: data/gtk/window.blp:440
|
||||
#: data/gtk/window.blp:545
|
||||
msgid "About Cartridges"
|
||||
msgstr "عن «خراطيش»"
|
||||
|
||||
#. Translators: Replace this with your name for it to show up in the about window
|
||||
#: src/main.py:195
|
||||
msgid "translator_credits"
|
||||
#: data/gtk/window.blp:562
|
||||
msgid "IGDB"
|
||||
msgstr "IGDB"
|
||||
|
||||
#: data/gtk/window.blp:564
|
||||
msgid "ProtonDB"
|
||||
msgstr "ProtonDB"
|
||||
|
||||
#: data/gtk/window.blp:566
|
||||
msgid "HowLongToBeat"
|
||||
msgstr "HowLongToBeat"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: cartridges/main.py:226 cartridges/game.py:125
|
||||
msgid "{} launched"
|
||||
msgstr "بُدئت {}"
|
||||
|
||||
#. Translators: Replace this with Your Name, Your Name <your.email@example.com>, or Your Name https://your-site.com for it to show up in the About dialog.
|
||||
#: cartridges/main.py:291
|
||||
msgid "translator-credits"
|
||||
msgstr "Ali Aljishi <ahj696@hotmail.com>"
|
||||
|
||||
#. The variable is the date when the game was added
|
||||
#: src/window.py:213
|
||||
#: cartridges/window.py:382
|
||||
msgid "Added: {}"
|
||||
msgstr "أضيفت في: {}"
|
||||
|
||||
#: src/window.py:216
|
||||
#: cartridges/window.py:385
|
||||
msgid "Never"
|
||||
msgstr "أبدًا"
|
||||
|
||||
#. The variable is the date when the game was last played
|
||||
#: src/window.py:220
|
||||
#: cartridges/window.py:389
|
||||
msgid "Last played: {}"
|
||||
msgstr "لُعبت آخر مرَّة في: {}"
|
||||
|
||||
#: src/details_window.py:76
|
||||
#: cartridges/details_dialog.py:82
|
||||
msgid "Apply"
|
||||
msgstr "طبِّق"
|
||||
|
||||
#: src/details_window.py:82
|
||||
#: cartridges/details_dialog.py:88
|
||||
msgid "Add New Game"
|
||||
msgstr "أضف لعبةً جديدةً"
|
||||
|
||||
#: src/details_window.py:83
|
||||
#: cartridges/details_dialog.py:89
|
||||
msgid "Add"
|
||||
msgstr "أضف"
|
||||
|
||||
#: src/details_window.py:93
|
||||
#: cartridges/details_dialog.py:102
|
||||
msgid "Executables"
|
||||
msgstr "ملفات التنفيذ"
|
||||
|
||||
#. Translate this string as you would translate "file"
|
||||
#: src/details_window.py:108
|
||||
#: cartridges/details_dialog.py:117
|
||||
msgid "file.txt"
|
||||
msgstr "ملف.txt"
|
||||
|
||||
#. As in software
|
||||
#: src/details_window.py:110
|
||||
#: cartridges/details_dialog.py:119
|
||||
msgid "program"
|
||||
msgstr "البرنامج"
|
||||
|
||||
#. Translate this string as you would translate "path to {}"
|
||||
#: src/details_window.py:115 src/details_window.py:117
|
||||
#: cartridges/details_dialog.py:124 cartridges/details_dialog.py:126
|
||||
msgid "C:\\path\\to\\{}"
|
||||
msgstr "C:\\المسار\\إلى\\{}"
|
||||
|
||||
#. Translate this string as you would translate "path to {}"
|
||||
#: src/details_window.py:121 src/details_window.py:123
|
||||
#: cartridges/details_dialog.py:130 cartridges/details_dialog.py:132
|
||||
msgid "/path/to/{}"
|
||||
msgstr "/المسار/إلى/{}"
|
||||
|
||||
#: src/details_window.py:128
|
||||
#: cartridges/details_dialog.py:137
|
||||
msgid ""
|
||||
"To launch the executable \"{}\", use the command:\n"
|
||||
"\n"
|
||||
@@ -491,125 +515,225 @@ msgstr ""
|
||||
"\n"
|
||||
"ولا تنسَ إحاطة المسار بعلامتي تنصيص مزدوجتين حالما تضمَّن مسافات!"
|
||||
|
||||
#: src/details_window.py:171 src/details_window.py:177
|
||||
#: cartridges/details_dialog.py:179 cartridges/details_dialog.py:185
|
||||
msgid "Couldn't Add Game"
|
||||
msgstr "تعذَّرت إضافة اللعبة"
|
||||
|
||||
#: src/details_window.py:171 src/details_window.py:207
|
||||
#: cartridges/details_dialog.py:179 cartridges/details_dialog.py:221
|
||||
msgid "Game title cannot be empty."
|
||||
msgstr "لا يجوز كون عنوان اللعبة فارغًا."
|
||||
|
||||
#: src/details_window.py:177 src/details_window.py:215
|
||||
#: cartridges/details_dialog.py:185 cartridges/details_dialog.py:229
|
||||
msgid "Executable cannot be empty."
|
||||
msgstr "لا يجوز كون ملفِّ التنفيذ فارغًا."
|
||||
|
||||
#: src/details_window.py:206 src/details_window.py:214
|
||||
#: cartridges/details_dialog.py:220 cartridges/details_dialog.py:228
|
||||
msgid "Couldn't Apply Preferences"
|
||||
msgstr "تعذَّر تطبيق التفضيلات"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: src/game.py:141
|
||||
msgid "{} launched"
|
||||
msgstr "بُدئت {}"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: src/game.py:155
|
||||
#: cartridges/game.py:139
|
||||
msgid "{} hidden"
|
||||
msgstr "أٌخفيت {}"
|
||||
|
||||
#: src/game.py:155
|
||||
#: cartridges/game.py:139
|
||||
msgid "{} unhidden"
|
||||
msgstr "أٌظهرت {}"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#. The variable is the number of games removed
|
||||
#: src/game.py:172 src/importer/importer.py:373
|
||||
#: cartridges/game.py:153
|
||||
msgid "{} removed"
|
||||
msgstr "أزيلت {}"
|
||||
|
||||
#: src/preferences.py:123
|
||||
#: cartridges/preferences.py:136
|
||||
msgid "All games removed"
|
||||
msgstr "أُزيلت كلُّ الألعاب"
|
||||
|
||||
#: src/preferences.py:172
|
||||
#: cartridges/preferences.py:188
|
||||
msgid ""
|
||||
"An API key is required to use SteamGridDB. You can generate one {}here{}."
|
||||
msgstr ""
|
||||
"تحتاج مفتاح واجهة برمجة حال ما أردت استخدام SteamGridDB، {}هنا تولِّده{}."
|
||||
|
||||
#: src/preferences.py:293
|
||||
#: cartridges/preferences.py:203
|
||||
msgid "Downloading covers…"
|
||||
msgstr "تُنزَّل الغُلُف…"
|
||||
|
||||
#: cartridges/preferences.py:222
|
||||
msgid "Covers updated"
|
||||
msgstr "حُدِّثت الغُلُف"
|
||||
|
||||
#: cartridges/preferences.py:370
|
||||
msgid "Installation Not Found"
|
||||
msgstr "لم يُعثر على التثبيت"
|
||||
|
||||
#: src/preferences.py:294
|
||||
msgid "Select a valid directory."
|
||||
msgstr "حدِّد مجلَّدًا صالحًا."
|
||||
#: cartridges/preferences.py:371
|
||||
msgid "Select a valid directory"
|
||||
msgstr "حدِّد مجلَّدًا صالحًا"
|
||||
|
||||
#: src/preferences.py:330 src/importer/importer.py:299
|
||||
#: cartridges/preferences.py:407 cartridges/importer/importer.py:317
|
||||
msgid "Warning"
|
||||
msgstr "تحذير"
|
||||
|
||||
#: src/preferences.py:364
|
||||
#: cartridges/preferences.py:441
|
||||
msgid "Invalid Directory"
|
||||
msgstr "مجلَّد غير صالح"
|
||||
|
||||
#: src/preferences.py:370
|
||||
#: cartridges/preferences.py:447
|
||||
msgid "Set Location"
|
||||
msgstr "عيِّن الموضع"
|
||||
|
||||
#: src/utils/create_dialog.py:33 src/importer/importer.py:300
|
||||
#: cartridges/utils/create_dialog.py:33 cartridges/importer/importer.py:318
|
||||
msgid "Dismiss"
|
||||
msgstr "تجاهل"
|
||||
|
||||
#: src/importer/importer.py:137
|
||||
#: cartridges/utils/relative_date.py:30
|
||||
msgid "Today"
|
||||
msgstr "اليوم"
|
||||
|
||||
#: cartridges/utils/relative_date.py:32
|
||||
msgid "Yesterday"
|
||||
msgstr "أمس"
|
||||
|
||||
#: cartridges/utils/relative_date.py:36
|
||||
#, fuzzy
|
||||
msgid "Last Week"
|
||||
msgstr "لُعبت آخر مرَّة"
|
||||
|
||||
#: cartridges/utils/relative_date.py:38
|
||||
msgid "This Month"
|
||||
msgstr "هذا الشهر"
|
||||
|
||||
#: cartridges/utils/relative_date.py:40
|
||||
msgid "Last Month"
|
||||
msgstr "الشهر الماضي"
|
||||
|
||||
#: cartridges/utils/relative_date.py:44
|
||||
msgid "Last Year"
|
||||
msgstr "العام الماضي"
|
||||
|
||||
#: cartridges/importer/importer.py:144
|
||||
msgid "Importing Games…"
|
||||
msgstr "تُستورد الألعاب…"
|
||||
|
||||
#: src/importer/importer.py:320
|
||||
#: cartridges/importer/importer.py:337
|
||||
msgid "The following errors occured during import:"
|
||||
msgstr "طرأ هذا الخطأ أثناء الاستيراد:"
|
||||
|
||||
#: src/importer/importer.py:349
|
||||
#: cartridges/importer/importer.py:366
|
||||
msgid "No new games found"
|
||||
msgstr "لم يُعثر على ألعاب جديدة"
|
||||
|
||||
#: src/importer/importer.py:361
|
||||
msgid "1 game imported"
|
||||
msgstr "اُستوردت لعبة واحدة"
|
||||
#. The variable is the number of games.
|
||||
#: cartridges/importer/importer.py:379
|
||||
#, fuzzy
|
||||
msgid "{} game imported"
|
||||
msgid_plural "{} games imported"
|
||||
msgstr[0] "اُستوردت {} لعبة"
|
||||
msgstr[1] "اُستوردت {} لعبة"
|
||||
msgstr[2] "اُستوردت {} لعبة"
|
||||
msgstr[3] "اُستوردت {} لعبة"
|
||||
msgstr[4] "اُستوردت {} لعبة"
|
||||
msgstr[5] "اُستوردت {} لعبة"
|
||||
|
||||
#. The variable is the number of games
|
||||
#: src/importer/importer.py:365
|
||||
msgid "{} games imported"
|
||||
msgstr "اُستوردت {} لعبة"
|
||||
|
||||
#. A single game removed
|
||||
#: src/importer/importer.py:369
|
||||
msgid "1 removed"
|
||||
msgstr "أزيل ١"
|
||||
#. The variable is the number of games. This text comes after "{0} games imported".
|
||||
#: cartridges/importer/importer.py:383
|
||||
#, fuzzy
|
||||
msgid ", {} removed"
|
||||
msgid_plural ", {} removed"
|
||||
msgstr[0] "أزيلت {}"
|
||||
msgstr[1] "أزيلت {}"
|
||||
msgstr[2] "أزيلت {}"
|
||||
msgstr[3] "أزيلت {}"
|
||||
msgstr[4] "أزيلت {}"
|
||||
msgstr[5] "أزيلت {}"
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: src/importer/sources/location.py:33
|
||||
#: cartridges/importer/location.py:34
|
||||
msgid "Select the {} cache directory."
|
||||
msgstr "حدِّد مجلَّد ذاكرة {} المؤقتة."
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: src/importer/sources/location.py:35
|
||||
#: cartridges/importer/location.py:36
|
||||
msgid "Select the {} configuration directory."
|
||||
msgstr "حدِّد مجلَّد ضبط {}."
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: src/importer/sources/location.py:37
|
||||
#: cartridges/importer/location.py:38
|
||||
msgid "Select the {} data directory."
|
||||
msgstr "حدِّد مجلَّد بيانات {}."
|
||||
|
||||
#: src/store/managers/sgdb_manager.py:46
|
||||
#: cartridges/importer/retroarch_source.py:129
|
||||
msgid "No RetroArch Core Selected"
|
||||
msgstr "لم تختر نواة رتروآرتش"
|
||||
|
||||
#. The variable is a newline separated list of playlists
|
||||
#: cartridges/importer/retroarch_source.py:131
|
||||
msgid "The following playlists have no default core:"
|
||||
msgstr "ليس للقوائم التالية نواة مبدئية:"
|
||||
|
||||
#: cartridges/importer/retroarch_source.py:133
|
||||
msgid "Games with no core selected were not imported"
|
||||
msgstr "لم نستورد الألعاب التي لم تختر لها أنويةً"
|
||||
|
||||
#: cartridges/store/managers/sgdb_manager.py:46
|
||||
msgid "Couldn't Authenticate SteamGridDB"
|
||||
msgstr "تعذَّر استيثاق SteamGridDB"
|
||||
|
||||
#: src/store/managers/sgdb_manager.py:47
|
||||
#: cartridges/store/managers/sgdb_manager.py:47
|
||||
msgid "Verify your API key in preferences"
|
||||
msgstr "أكِّد مفتاح واجهة البرمجة في التفضيلات"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "1 game imported"
|
||||
#~ msgid_plural "{} games imported"
|
||||
#~ msgstr[0] "اُستوردت لعبة واحدة"
|
||||
#~ msgstr[1] "اُستوردت {} لعبة"
|
||||
#~ msgstr[2] "اُستوردت {} لعبة"
|
||||
#~ msgstr[3] "اُستوردت {} لعبة"
|
||||
#~ msgstr[4] "اُستوردت {} لعبة"
|
||||
#~ msgstr[5] "اُستوردت {} لعبة"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "1 removed"
|
||||
#~ msgid_plural "{} removed"
|
||||
#~ msgstr[0] "أزيل ١"
|
||||
#~ msgstr[1] "أزيل {}"
|
||||
#~ msgstr[2] "أزيل {}"
|
||||
#~ msgstr[3] "أزيل {}"
|
||||
#~ msgstr[4] "أزيل {}"
|
||||
#~ msgstr[5] "أزيل {}"
|
||||
|
||||
#~ msgid "Cache Location"
|
||||
#~ msgstr "موضع الذاكرة المؤقتة"
|
||||
|
||||
#~ msgid "Library"
|
||||
#~ msgstr "المكتبة"
|
||||
|
||||
#~ msgid "Show preferences"
|
||||
#~ msgstr "أظهر التفضيلات"
|
||||
|
||||
#~ msgid "Shortcuts"
|
||||
#~ msgstr "الاختصارات"
|
||||
|
||||
#~ msgid "Open menu"
|
||||
#~ msgstr "افتح القائمة"
|
||||
|
||||
#~ msgid "Add new game"
|
||||
#~ msgstr "أضف لعبةً جديدةً"
|
||||
|
||||
#~ msgid "Import games"
|
||||
#~ msgstr "استورد ألعابًا"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "عد"
|
||||
|
||||
#~ msgid "Search games"
|
||||
#~ msgstr "ابحث عن ألعاب"
|
||||
|
||||
#~ msgid "Search hidden games"
|
||||
#~ msgstr "ابحث في الألعاب المخفية"
|
||||
|
||||
#~ msgid "The title of the game"
|
||||
#~ msgstr "عنوان اللعبة"
|
||||
|
||||
@@ -644,21 +768,12 @@ msgstr "أكِّد مفتاح واجهة البرمجة في التفضيلات"
|
||||
#~ msgid "Bottles Install Location"
|
||||
#~ msgstr "موضع تثبيت قوارير"
|
||||
|
||||
#~ msgid "Today"
|
||||
#~ msgstr "اليوم"
|
||||
|
||||
#~ msgid "Yesterday"
|
||||
#~ msgstr "أمس"
|
||||
|
||||
#~ msgid "Cache Not Found"
|
||||
#~ msgstr "لم يُعثر على الذاكرة المؤقَّتة"
|
||||
|
||||
#~ msgid "Select the Lutris cache directory."
|
||||
#~ msgstr "حدِّد مجلَّد ذاكرة لوترس المؤقَّتة."
|
||||
|
||||
#~ msgid "Importing Covers…"
|
||||
#~ msgstr "تُستورد الغُلُف…"
|
||||
|
||||
#~ msgid "Directory to use when importing games"
|
||||
#~ msgstr "المجلَّد المستخدم عند استيراد الألعاب"
|
||||
|
||||
|
||||
699
po/be.po
Normal file
@@ -0,0 +1,699 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR kramo
|
||||
# This file is distributed under the same license as the Cartridges package.
|
||||
# Yahor <k1llo2810@gmail.com>, 2023.
|
||||
# Yahor <g_egor98@tut.by>, 2023.
|
||||
# Yahor <k1llo2810@protonmail.com>, 2023.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Cartridges\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-11-05 14:01+0100\n"
|
||||
"PO-Revision-Date: 2023-12-13 09:28+0000\n"
|
||||
"Last-Translator: Yahor <k1llo2810@protonmail.com>\n"
|
||||
"Language-Team: Belarusian <https://hosted.weblate.org/projects/cartridges/"
|
||||
"cartridges/be/>\n"
|
||||
"Language: be\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
|
||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 5.3-rc\n"
|
||||
|
||||
#: data/page.kramo.Cartridges.desktop.in:3
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:9
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:40 data/gtk/window.blp:47
|
||||
#: data/gtk/window.blp:83
|
||||
msgid "Cartridges"
|
||||
msgstr "Картрыджы"
|
||||
|
||||
#: data/page.kramo.Cartridges.desktop.in:4
|
||||
msgid "Game Launcher"
|
||||
msgstr "Праграма запуску гульняў"
|
||||
|
||||
#: data/page.kramo.Cartridges.desktop.in:5
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:10
|
||||
msgid "Launch all your games"
|
||||
msgstr "Запускайце ўсе свае гульні"
|
||||
|
||||
#: data/page.kramo.Cartridges.desktop.in:11
|
||||
msgid ""
|
||||
"gaming;launcher;steam;lutris;heroic;bottles;itch;flatpak;legendary;retroarch;"
|
||||
msgstr ""
|
||||
"гульні;праграма запуску;steam;lutris;heroic;bottles;itch;flatpak;legendary;"
|
||||
"retroarch;"
|
||||
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:12
|
||||
msgid ""
|
||||
"Cartridges is a simple game launcher for all of your games. It has support "
|
||||
"for importing games from Steam, Lutris, Heroic and more with no login "
|
||||
"necessary. You can sort and hide games or download cover art from "
|
||||
"SteamGridDB."
|
||||
msgstr ""
|
||||
"Картрыджы - гэта простая праграма для запуску ўсіх вашых гульняў. Яна "
|
||||
"падтрымлівае імпарт гульняў з Steam, Lutris, Heroic і іншых без неабходнасці "
|
||||
"ўваходу ў сістэму. Вы можаце сартаваць і хаваць гульні або спампоўваць "
|
||||
"вокладку з SteamGridDB."
|
||||
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:44 data/gtk/window.blp:320
|
||||
#: cartridges/details_dialog.py:77
|
||||
msgid "Game Details"
|
||||
msgstr "Падрабязнасці аб гульні"
|
||||
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:48
|
||||
msgid "Edit Game Details"
|
||||
msgstr "Рэдагаваць падрабязнасці аб гульні"
|
||||
|
||||
#: data/page.kramo.Cartridges.metainfo.xml.in:52 data/gtk/help-overlay.blp:19
|
||||
#: data/gtk/window.blp:543 cartridges/details_dialog.py:279
|
||||
#: cartridges/importer/importer.py:319 cartridges/importer/importer.py:369
|
||||
msgid "Preferences"
|
||||
msgstr "Параметры"
|
||||
|
||||
#: data/gtk/details-dialog.blp:15
|
||||
msgid "Cancel"
|
||||
msgstr "Скасаваць"
|
||||
|
||||
#: data/gtk/details-dialog.blp:45
|
||||
msgid "New Cover"
|
||||
msgstr "Новая вокладка"
|
||||
|
||||
#: data/gtk/details-dialog.blp:64
|
||||
msgid "Delete Cover"
|
||||
msgstr "Выдалиць вокладку"
|
||||
|
||||
#: data/gtk/details-dialog.blp:92 data/gtk/game.blp:80
|
||||
msgid "Title"
|
||||
msgstr "Назва"
|
||||
|
||||
#: data/gtk/details-dialog.blp:96
|
||||
msgid "Developer (optional)"
|
||||
msgstr "Распрацоўшчык (неабавязкова)"
|
||||
|
||||
#: data/gtk/details-dialog.blp:102
|
||||
msgid "Executable"
|
||||
msgstr "Выконваны"
|
||||
|
||||
#: data/gtk/details-dialog.blp:108
|
||||
msgid "Select File"
|
||||
msgstr "Выбраць файл"
|
||||
|
||||
#: data/gtk/details-dialog.blp:119
|
||||
msgid "More Info"
|
||||
msgstr "Больш інфармацыі"
|
||||
|
||||
#: data/gtk/game.blp:101 data/gtk/game.blp:109 data/gtk/window.blp:444
|
||||
msgid "Edit"
|
||||
msgstr "Рэдагаваць"
|
||||
|
||||
#: data/gtk/game.blp:102 cartridges/window.py:359
|
||||
msgid "Hide"
|
||||
msgstr "Схаваць"
|
||||
|
||||
#: data/gtk/game.blp:103 data/gtk/game.blp:111 data/gtk/window.blp:464
|
||||
msgid "Remove"
|
||||
msgstr "Выдаліць"
|
||||
|
||||
#: data/gtk/game.blp:110 cartridges/window.py:361
|
||||
msgid "Unhide"
|
||||
msgstr "Паказаць"
|
||||
|
||||
#: data/gtk/help-overlay.blp:11 data/gtk/preferences.blp:9
|
||||
msgid "General"
|
||||
msgstr "Агульнае"
|
||||
|
||||
#: data/gtk/help-overlay.blp:14 data/gtk/window.blp:207 data/gtk/window.blp:223
|
||||
#: data/gtk/window.blp:274 data/gtk/window.blp:290 data/gtk/window.blp:475
|
||||
msgid "Search"
|
||||
msgstr "Пошук"
|
||||
|
||||
#: data/gtk/help-overlay.blp:24 data/gtk/window.blp:544
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr "Спалучэнні клавіш"
|
||||
|
||||
#: data/gtk/help-overlay.blp:29 cartridges/game.py:103
|
||||
#: cartridges/preferences.py:137 cartridges/importer/importer.py:386
|
||||
msgid "Undo"
|
||||
msgstr "Адмяніць"
|
||||
|
||||
#: data/gtk/help-overlay.blp:34
|
||||
msgid "Quit"
|
||||
msgstr "Выйсці"
|
||||
|
||||
#: data/gtk/help-overlay.blp:39 data/gtk/window.blp:92 data/gtk/window.blp:187
|
||||
msgid "Toggle Sidebar"
|
||||
msgstr "Пераключыць бакавую панэль"
|
||||
|
||||
#: data/gtk/help-overlay.blp:44 data/gtk/window.blp:200 data/gtk/window.blp:267
|
||||
msgid "Main Menu"
|
||||
msgstr "Галоўнае меню"
|
||||
|
||||
#: data/gtk/help-overlay.blp:50
|
||||
msgid "Games"
|
||||
msgstr "Гульні"
|
||||
|
||||
#: data/gtk/help-overlay.blp:53 data/gtk/window.blp:193 data/gtk/window.blp:551
|
||||
msgid "Add Game"
|
||||
msgstr "Дадаць гульню"
|
||||
|
||||
#: data/gtk/help-overlay.blp:58 data/gtk/preferences.blp:58
|
||||
#: data/gtk/window.blp:27 data/gtk/window.blp:555
|
||||
msgid "Import"
|
||||
msgstr "Імпарт"
|
||||
|
||||
#: data/gtk/help-overlay.blp:63
|
||||
msgid "Show Hidden Games"
|
||||
msgstr "Паказаць схаваныя гульні"
|
||||
|
||||
#: data/gtk/help-overlay.blp:68
|
||||
msgid "Remove Game"
|
||||
msgstr "Выдаліць гульню"
|
||||
|
||||
#: data/gtk/preferences.blp:13 data/gtk/preferences.blp:62
|
||||
#: data/gtk/preferences.blp:365
|
||||
msgid "Behavior"
|
||||
msgstr "Паводзіны"
|
||||
|
||||
#: data/gtk/preferences.blp:16
|
||||
msgid "Exit After Launching Games"
|
||||
msgstr "Выхад пасля запуску гульняў"
|
||||
|
||||
#: data/gtk/preferences.blp:20
|
||||
msgid "Cover Image Launches Game"
|
||||
msgstr "Выява вокладкі запускае гульню"
|
||||
|
||||
#: data/gtk/preferences.blp:21
|
||||
msgid "Swaps the behavior of the cover image and the play button"
|
||||
msgstr "Мяняе паводзіны вокладкі і кнопкі запуску"
|
||||
|
||||
#: data/gtk/preferences.blp:26 cartridges/details_dialog.py:91
|
||||
msgid "Images"
|
||||
msgstr "Відарысы"
|
||||
|
||||
#: data/gtk/preferences.blp:29
|
||||
msgid "High Quality Images"
|
||||
msgstr "Відарысы высокай якасці"
|
||||
|
||||
#: data/gtk/preferences.blp:30
|
||||
msgid "Save game covers losslessly at the cost of storage"
|
||||
msgstr "Захаванне вокладак гульняў без страт за кошт сховішча"
|
||||
|
||||
#: data/gtk/preferences.blp:35
|
||||
msgid "Danger Zone"
|
||||
msgstr "Небяспечная зона"
|
||||
|
||||
#: data/gtk/preferences.blp:39
|
||||
msgid "Remove All Games"
|
||||
msgstr "Выдаліць усе гульні"
|
||||
|
||||
#: data/gtk/preferences.blp:65
|
||||
msgid "Import Games Automatically"
|
||||
msgstr ""
|
||||
|
||||
#: data/gtk/preferences.blp:69
|
||||
msgid "Remove Uninstalled Games"
|
||||
msgstr "Выдаляць дэінсталяваныя гульні"
|
||||
|
||||
#: data/gtk/preferences.blp:74
|
||||
msgid "Sources"
|
||||
msgstr "Крыніцы"
|
||||
|
||||
#: data/gtk/preferences.blp:78 cartridges/importer/steam_source.py:114
|
||||
msgid "Steam"
|
||||
msgstr "Steam"
|
||||
|
||||
#: data/gtk/preferences.blp:87 data/gtk/preferences.blp:114
|
||||
#: data/gtk/preferences.blp:149 data/gtk/preferences.blp:192
|
||||
#: data/gtk/preferences.blp:219 data/gtk/preferences.blp:246
|
||||
#: data/gtk/preferences.blp:273
|
||||
msgid "Install Location"
|
||||
msgstr "Месца ўсталёўкі"
|
||||
|
||||
#: data/gtk/preferences.blp:105 data/gtk/window.blp:565
|
||||
#: cartridges/importer/lutris_source.py:107
|
||||
msgid "Lutris"
|
||||
msgstr "Lutris"
|
||||
|
||||
#: data/gtk/preferences.blp:131
|
||||
msgid "Import Steam Games"
|
||||
msgstr "Імпарт гульняў Steam"
|
||||
|
||||
#: data/gtk/preferences.blp:135
|
||||
msgid "Import Flatpak Games"
|
||||
msgstr "Імпарт гульняў Flatpak"
|
||||
|
||||
#: data/gtk/preferences.blp:140 cartridges/importer/heroic_source.py:355
|
||||
msgid "Heroic"
|
||||
msgstr "Heroic"
|
||||
|
||||
#: data/gtk/preferences.blp:166
|
||||
msgid "Import Epic Games"
|
||||
msgstr "Імпарт Epic Games"
|
||||
|
||||
#: data/gtk/preferences.blp:170
|
||||
msgid "Import GOG Games"
|
||||
msgstr "Імпарт гульняў GOG"
|
||||
|
||||
#: data/gtk/preferences.blp:174
|
||||
msgid "Import Amazon Games"
|
||||
msgstr "Імпарт гульняў Amazon"
|
||||
|
||||
#: data/gtk/preferences.blp:178
|
||||
msgid "Import Sideloaded Games"
|
||||
msgstr "Імпарт іншых гульняў"
|
||||
|
||||
#: data/gtk/preferences.blp:183 cartridges/importer/bottles_source.py:86
|
||||
msgid "Bottles"
|
||||
msgstr "Bottles"
|
||||
|
||||
#: data/gtk/preferences.blp:210 cartridges/importer/itch_source.py:81
|
||||
msgid "itch"
|
||||
msgstr "itch"
|
||||
|
||||
#: data/gtk/preferences.blp:237 cartridges/importer/legendary_source.py:97
|
||||
msgid "Legendary"
|
||||
msgstr "Legendary"
|
||||
|
||||
#: data/gtk/preferences.blp:264 cartridges/importer/retroarch_source.py:142
|
||||
msgid "RetroArch"
|
||||
msgstr "RetroArch"
|
||||
|
||||
#: data/gtk/preferences.blp:291 cartridges/importer/flatpak_source.py:143
|
||||
msgid "Flatpak"
|
||||
msgstr "Flatpak"
|
||||
|
||||
#. The location of the system-wide data directory
|
||||
#: data/gtk/preferences.blp:301
|
||||
msgid "System Location"
|
||||
msgstr "Сістэмнае размяшчэнне"
|
||||
|
||||
#. The location of the user-specific data directory
|
||||
#: data/gtk/preferences.blp:319
|
||||
msgid "User Location"
|
||||
msgstr "Карыстальніцкае размяшчэнне"
|
||||
|
||||
#: data/gtk/preferences.blp:336
|
||||
msgid "Import Game Launchers"
|
||||
msgstr "Імпарт сродкаў запуску гульняў"
|
||||
|
||||
#: data/gtk/preferences.blp:341 cartridges/importer/desktop_source.py:215
|
||||
msgid "Desktop Entries"
|
||||
msgstr "Запісы працоўнага стала"
|
||||
|
||||
#: data/gtk/preferences.blp:353 data/gtk/window.blp:563
|
||||
msgid "SteamGridDB"
|
||||
msgstr "SteamGridDB"
|
||||
|
||||
#: data/gtk/preferences.blp:357
|
||||
msgid "Authentication"
|
||||
msgstr "Аўтэнтыфікацыя"
|
||||
|
||||
#: data/gtk/preferences.blp:360
|
||||
msgid "API Key"
|
||||
msgstr "Ключ API"
|
||||
|
||||
#: data/gtk/preferences.blp:368
|
||||
msgid "Use SteamGridDB"
|
||||
msgstr "Выкарыстоўвайць SteamGridDB"
|
||||
|
||||
#: data/gtk/preferences.blp:369
|
||||
msgid "Download images when adding or importing games"
|
||||
msgstr "Спампоўка відарысаў пры даданні ці імпарце гульняў"
|
||||
|
||||
#: data/gtk/preferences.blp:373
|
||||
msgid "Prefer Over Official Images"
|
||||
msgstr "Аддавайце перавагу афіцыйным відарысам"
|
||||
|
||||
#: data/gtk/preferences.blp:377
|
||||
msgid "Prefer Animated Images"
|
||||
msgstr "Аддавайце перавагу аніміраваным відарысам"
|
||||
|
||||
#: data/gtk/preferences.blp:383
|
||||
msgid "Update Covers"
|
||||
msgstr "Абнавіць вокладкі"
|
||||
|
||||
#: data/gtk/preferences.blp:384
|
||||
msgid "Fetch covers for games already in your library"
|
||||
msgstr "Атрымаць вокладкі для гульняў, якія ўжо ёсць у вашай бібліятэцы"
|
||||
|
||||
#: data/gtk/preferences.blp:389
|
||||
msgid "Update"
|
||||
msgstr "Абнавіць"
|
||||
|
||||
#: data/gtk/window.blp:6 data/gtk/window.blp:14
|
||||
msgid "No Games Found"
|
||||
msgstr "Гульні не знойдзены"
|
||||
|
||||
#: data/gtk/window.blp:7 data/gtk/window.blp:15
|
||||
msgid "Try a different search"
|
||||
msgstr "Паспрабуйце іншы пошук"
|
||||
|
||||
#: data/gtk/window.blp:21
|
||||
msgid "No Games"
|
||||
msgstr "Няма гульняў"
|
||||
|
||||
#: data/gtk/window.blp:22
|
||||
msgid "Use the + button to add games"
|
||||
msgstr "Выкарыстоўвайце кнопку +, каб дадаць гульні"
|
||||
|
||||
#: data/gtk/window.blp:40
|
||||
msgid "No Hidden Games"
|
||||
msgstr "Няма схаваных гульняў"
|
||||
|
||||
#: data/gtk/window.blp:41
|
||||
msgid "Games you hide will appear here"
|
||||
msgstr "Гульні, якія вы схаваеце, з'явяцца тут"
|
||||
|
||||
#: data/gtk/window.blp:76 data/gtk/window.blp:113 cartridges/main.py:249
|
||||
msgid "All Games"
|
||||
msgstr "Усе гульні"
|
||||
|
||||
#: data/gtk/window.blp:140 cartridges/main.py:251
|
||||
msgid "Added"
|
||||
msgstr "Дададзена"
|
||||
|
||||
#: data/gtk/window.blp:162
|
||||
msgid "Imported"
|
||||
msgstr "Імпартавана"
|
||||
|
||||
#: data/gtk/window.blp:260
|
||||
msgid "Hidden Games"
|
||||
msgstr "Схаваныя гульні"
|
||||
|
||||
#: data/gtk/window.blp:368
|
||||
msgid "Game Title"
|
||||
msgstr "Назва гульні"
|
||||
|
||||
#: data/gtk/window.blp:425
|
||||
msgid "Play"
|
||||
msgstr "Гуляць"
|
||||
|
||||
#: data/gtk/window.blp:502
|
||||
msgid "Sort"
|
||||
msgstr "Сартаваць"
|
||||
|
||||
#: data/gtk/window.blp:505
|
||||
msgid "A-Z"
|
||||
msgstr "А-Я"
|
||||
|
||||
#: data/gtk/window.blp:511
|
||||
msgid "Z-A"
|
||||
msgstr "Я-А"
|
||||
|
||||
#: data/gtk/window.blp:517
|
||||
msgid "Newest"
|
||||
msgstr "Найноўшыя"
|
||||
|
||||
#: data/gtk/window.blp:523
|
||||
msgid "Oldest"
|
||||
msgstr "Старэйшыя"
|
||||
|
||||
#: data/gtk/window.blp:529
|
||||
msgid "Last Played"
|
||||
msgstr "Апошняя гульня"
|
||||
|
||||
#: data/gtk/window.blp:536
|
||||
msgid "Show Hidden"
|
||||
msgstr "Паказаць схаваныя"
|
||||
|
||||
#: data/gtk/window.blp:545
|
||||
msgid "About Cartridges"
|
||||
msgstr "Аб картрыджах"
|
||||
|
||||
#: data/gtk/window.blp:562
|
||||
msgid "IGDB"
|
||||
msgstr "IGDB"
|
||||
|
||||
#: data/gtk/window.blp:564
|
||||
msgid "ProtonDB"
|
||||
msgstr "ProtonDB"
|
||||
|
||||
#: data/gtk/window.blp:566
|
||||
msgid "HowLongToBeat"
|
||||
msgstr "HowLongToBeat"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: cartridges/main.py:226 cartridges/game.py:125
|
||||
msgid "{} launched"
|
||||
msgstr "{} запушчана"
|
||||
|
||||
#. Translators: Replace this with Your Name, Your Name <your.email@example.com>, or Your Name https://your-site.com for it to show up in the About dialog.
|
||||
#: cartridges/main.py:291
|
||||
msgid "translator-credits"
|
||||
msgstr "Yahor Haurylenka https://github.com/k1llo"
|
||||
|
||||
#. The variable is the date when the game was added
|
||||
#: cartridges/window.py:382
|
||||
msgid "Added: {}"
|
||||
msgstr "Дададзена: {}"
|
||||
|
||||
#: cartridges/window.py:385
|
||||
msgid "Never"
|
||||
msgstr "Ніколі"
|
||||
|
||||
#. The variable is the date when the game was last played
|
||||
#: cartridges/window.py:389
|
||||
msgid "Last played: {}"
|
||||
msgstr "Гулялі апошні раз: {}"
|
||||
|
||||
#: cartridges/details_dialog.py:82
|
||||
msgid "Apply"
|
||||
msgstr "Ужыць"
|
||||
|
||||
#: cartridges/details_dialog.py:88
|
||||
msgid "Add New Game"
|
||||
msgstr "Дадаць новую гульню"
|
||||
|
||||
#: cartridges/details_dialog.py:89
|
||||
msgid "Add"
|
||||
msgstr "Дадаць"
|
||||
|
||||
#: cartridges/details_dialog.py:102
|
||||
msgid "Executables"
|
||||
msgstr "Выконваныя"
|
||||
|
||||
#. Translate this string as you would translate "file"
|
||||
#: cartridges/details_dialog.py:117
|
||||
msgid "file.txt"
|
||||
msgstr "file.txt"
|
||||
|
||||
#. As in software
|
||||
#: cartridges/details_dialog.py:119
|
||||
msgid "program"
|
||||
msgstr "праграма"
|
||||
|
||||
#. Translate this string as you would translate "path to {}"
|
||||
#: cartridges/details_dialog.py:124 cartridges/details_dialog.py:126
|
||||
msgid "C:\\path\\to\\{}"
|
||||
msgstr "C:\\шлях\\да\\{}"
|
||||
|
||||
#. Translate this string as you would translate "path to {}"
|
||||
#: cartridges/details_dialog.py:130 cartridges/details_dialog.py:132
|
||||
msgid "/path/to/{}"
|
||||
msgstr "/шлях/да/{}"
|
||||
|
||||
#: cartridges/details_dialog.py:137
|
||||
msgid ""
|
||||
"To launch the executable \"{}\", use the command:\n"
|
||||
"\n"
|
||||
"<tt>\"{}\"</tt>\n"
|
||||
"\n"
|
||||
"To open the file \"{}\" with the default application, use:\n"
|
||||
"\n"
|
||||
"<tt>{} \"{}\"</tt>\n"
|
||||
"\n"
|
||||
"If the path contains spaces, make sure to wrap it in double quotes!"
|
||||
msgstr ""
|
||||
"Каб запусціць выкананы файл \"{}\", выканайце каманду:\n"
|
||||
"\n"
|
||||
"<tt>\"{}\"</tt>\n"
|
||||
"\n"
|
||||
"Каб адкрыць файл \"{}\" з дапамогай праграмы па змаўчанні, выкарыстоўвайце:\n"
|
||||
"\n"
|
||||
"<tt>{} \"{}\"</tt>\n"
|
||||
"\n"
|
||||
"Калі шлях змяшчае прабелы, абавязкова заключыце яго ў падвойныя двукоссі!"
|
||||
|
||||
#: cartridges/details_dialog.py:179 cartridges/details_dialog.py:185
|
||||
msgid "Couldn't Add Game"
|
||||
msgstr "Не ўдалося дадаць гульню"
|
||||
|
||||
#: cartridges/details_dialog.py:179 cartridges/details_dialog.py:221
|
||||
msgid "Game title cannot be empty."
|
||||
msgstr "Назва гульні не можа быць пустой."
|
||||
|
||||
#: cartridges/details_dialog.py:185 cartridges/details_dialog.py:229
|
||||
msgid "Executable cannot be empty."
|
||||
msgstr "Выканальны файл не можа быць пустым."
|
||||
|
||||
#: cartridges/details_dialog.py:220 cartridges/details_dialog.py:228
|
||||
msgid "Couldn't Apply Preferences"
|
||||
msgstr "Не ўдалося прымяніць параметры"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: cartridges/game.py:139
|
||||
msgid "{} hidden"
|
||||
msgstr "{} схаваная"
|
||||
|
||||
#: cartridges/game.py:139
|
||||
msgid "{} unhidden"
|
||||
msgstr "{} непрыхавана"
|
||||
|
||||
#. The variable is the title of the game
|
||||
#: cartridges/game.py:153
|
||||
#, fuzzy
|
||||
msgid "{} removed"
|
||||
msgstr "{} выдалена"
|
||||
|
||||
#: cartridges/preferences.py:136
|
||||
msgid "All games removed"
|
||||
msgstr "Усе гульні выдалены"
|
||||
|
||||
#: cartridges/preferences.py:188
|
||||
msgid ""
|
||||
"An API key is required to use SteamGridDB. You can generate one {}here{}."
|
||||
msgstr ""
|
||||
"Для выкарыстання SteamGridDB патрабуецца ключ API. Вы можаце стварыць яго {}"
|
||||
"тут{}."
|
||||
|
||||
#: cartridges/preferences.py:203
|
||||
msgid "Downloading covers…"
|
||||
msgstr "Спампоўка вокладак…"
|
||||
|
||||
#: cartridges/preferences.py:222
|
||||
msgid "Covers updated"
|
||||
msgstr "Вокладкі абноўлены"
|
||||
|
||||
#: cartridges/preferences.py:370
|
||||
msgid "Installation Not Found"
|
||||
msgstr "Усталяванне не знойдзена"
|
||||
|
||||
#: cartridges/preferences.py:371
|
||||
msgid "Select a valid directory"
|
||||
msgstr "Выберыце сапраўдны каталог"
|
||||
|
||||
#: cartridges/preferences.py:407 cartridges/importer/importer.py:317
|
||||
msgid "Warning"
|
||||
msgstr "Увага"
|
||||
|
||||
#: cartridges/preferences.py:441
|
||||
msgid "Invalid Directory"
|
||||
msgstr "Няправільны каталог"
|
||||
|
||||
#: cartridges/preferences.py:447
|
||||
msgid "Set Location"
|
||||
msgstr "Задаць размяшчэнне"
|
||||
|
||||
#: cartridges/utils/create_dialog.py:33 cartridges/importer/importer.py:318
|
||||
msgid "Dismiss"
|
||||
msgstr "Адхіліць"
|
||||
|
||||
#: cartridges/utils/relative_date.py:30
|
||||
msgid "Today"
|
||||
msgstr ""
|
||||
|
||||
#: cartridges/utils/relative_date.py:32
|
||||
msgid "Yesterday"
|
||||
msgstr ""
|
||||
|
||||
#: cartridges/utils/relative_date.py:36
|
||||
#, fuzzy
|
||||
msgid "Last Week"
|
||||
msgstr "Апошняя гульня"
|
||||
|
||||
#: cartridges/utils/relative_date.py:38
|
||||
msgid "This Month"
|
||||
msgstr ""
|
||||
|
||||
#: cartridges/utils/relative_date.py:40
|
||||
msgid "Last Month"
|
||||
msgstr ""
|
||||
|
||||
#: cartridges/utils/relative_date.py:44
|
||||
#, fuzzy
|
||||
msgid "Last Year"
|
||||
msgstr "Апошняя гульня"
|
||||
|
||||
#: cartridges/importer/importer.py:144
|
||||
msgid "Importing Games…"
|
||||
msgstr "Імпарт гульняў…"
|
||||
|
||||
#: cartridges/importer/importer.py:337
|
||||
msgid "The following errors occured during import:"
|
||||
msgstr "Падчас імпарту адбыліся наступныя памылкі:"
|
||||
|
||||
#: cartridges/importer/importer.py:366
|
||||
msgid "No new games found"
|
||||
msgstr "Новыя гульні не знойдзены"
|
||||
|
||||
#. The variable is the number of games.
|
||||
#: cartridges/importer/importer.py:379
|
||||
#, fuzzy
|
||||
msgid "{} game imported"
|
||||
msgid_plural "{} games imported"
|
||||
msgstr[0] "{} гульняў імпартавана"
|
||||
msgstr[1] "{} гульняў імпартавана"
|
||||
msgstr[2] "{} гульняў імпартавана"
|
||||
|
||||
#. The variable is the number of games. This text comes after "{0} games imported".
|
||||
#: cartridges/importer/importer.py:383
|
||||
#, fuzzy
|
||||
msgid ", {} removed"
|
||||
msgid_plural ", {} removed"
|
||||
msgstr[0] "{} выдалена"
|
||||
msgstr[1] "{} выдалена"
|
||||
msgstr[2] "{} выдалена"
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: cartridges/importer/location.py:34
|
||||
msgid "Select the {} cache directory."
|
||||
msgstr "Выберыце каталог кэша {}."
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: cartridges/importer/location.py:36
|
||||
msgid "Select the {} configuration directory."
|
||||
msgstr "Выберыце каталог канфігурацыі {}."
|
||||
|
||||
#. The variable is the name of the source
|
||||
#: cartridges/importer/location.py:38
|
||||
msgid "Select the {} data directory."
|
||||
msgstr "Выберыце каталог даных {}."
|
||||
|
||||
#: cartridges/importer/retroarch_source.py:129
|
||||
msgid "No RetroArch Core Selected"
|
||||
msgstr "Ядро RetroArch не выбрана"
|
||||
|
||||
#. The variable is a newline separated list of playlists
|
||||
#: cartridges/importer/retroarch_source.py:131
|
||||
msgid "The following playlists have no default core:"
|
||||
msgstr "Наступныя плэйлісты не маюць ядра па змаўчанні:"
|
||||
|
||||
#: cartridges/importer/retroarch_source.py:133
|
||||
msgid "Games with no core selected were not imported"
|
||||
msgstr "Гульні без выбранага ядра не былі імпартаваныя"
|
||||
|
||||
#: cartridges/store/managers/sgdb_manager.py:46
|
||||
msgid "Couldn't Authenticate SteamGridDB"
|
||||
msgstr "Немагчыма аўтэнтыфікаваць SteamGridDB"
|
||||
|
||||
#: cartridges/store/managers/sgdb_manager.py:47
|
||||
msgid "Verify your API key in preferences"
|
||||
msgstr "Праверце свой ключ API ў наладах"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "1 game imported"
|
||||
#~ msgid_plural "{} games imported"
|
||||
#~ msgstr[0] "Імпартавана 1 гульня"
|
||||
#~ msgstr[1] "Імпартавана {} гульня"
|
||||
#~ msgstr[2] "Імпартавана {} гульня"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "1 removed"
|
||||
#~ msgid_plural "{} removed"
|
||||
#~ msgstr[0] "1 выдалена"
|
||||
#~ msgstr[1] "{} выдалена"
|
||||
#~ msgstr[2] "{} выдалена"
|
||||
|
||||
#~ msgid "Cache Location"
|
||||
#~ msgstr "Размяшчэнне кэша"
|
||||