Compare commits
91
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afa9519efc
|
||
|
|
13e89d8b2b
|
||
|
|
30c3bfb3b1
|
||
|
|
8e12ec713f
|
||
|
|
e809f031ce
|
||
|
|
1b42c672bb
|
||
|
|
07b53f3160
|
||
|
|
40d80f0ce8
|
||
|
|
0b8536b163
|
||
|
|
31f6d84537
|
||
|
|
5c86b3d943
|
||
|
|
ec2ffee64d
|
||
|
|
60e9a2866a
|
||
|
|
94269455ec
|
||
|
|
f5c07cf3ea
|
||
|
|
509d4272ab
|
||
|
|
ff560fb43a
|
||
|
|
ed78af49d2
|
||
|
|
5c5a154a0d
|
||
|
|
ae011adfdf
|
||
|
|
b0d97e0e0b
|
||
|
|
8a303bf9ed
|
||
|
|
a14563dd78
|
||
|
|
abb511c173 | ||
|
|
ef0626a069
|
||
|
|
40f06caa16
|
||
|
|
bfd4bf4065
|
||
|
|
92ecc008f3
|
||
|
|
0c78e9c689
|
||
|
|
4840d512b5 | ||
|
|
c22992b803
|
||
|
|
57f955d827 | ||
|
|
f9694e576b | ||
|
|
a74c5631ec | ||
|
|
55361797c3
|
||
|
|
f3999e9bf1
|
||
|
|
35366bbf12
|
||
|
|
bab6d6b84e
|
||
|
|
061ee7fedf
|
||
|
|
8707c93835
|
||
|
|
53a44c5708
|
||
|
|
154cf43bf8
|
||
|
|
a70bf97774
|
||
|
|
a06f76a2e9
|
||
|
|
649aec7229
|
||
|
|
0da0d55537
|
||
|
|
c2f611c73e | ||
|
|
c4f9f05363 | ||
|
|
56c8a9781b
|
||
|
|
9d72466402
|
||
|
|
4df207fa3b
|
||
|
|
bd6dc490b1 | ||
|
|
383d17f523 | ||
|
|
9b889a8d2e | ||
|
|
64c9f4d196 | ||
|
|
0de9e46485
|
||
|
|
bdc14d1d86
|
||
|
|
1fc8d62a85
|
||
|
|
0e3a0be146 | ||
|
|
6e2f7452bd | ||
|
|
37168f8892 | ||
|
|
141f98d81f | ||
|
|
7031051dc4
|
||
|
|
769ad421a2
|
||
|
|
2316efe3d6
|
||
|
|
09b790fc26
|
||
|
|
a48b9050d2
|
||
|
|
b602880907
|
||
|
|
05a5b136e9
|
||
|
|
bde4ba9602
|
||
|
|
2634370ee3 | ||
|
|
9cea141f9c | ||
|
|
3d417c1a83
|
||
|
|
27003d4967
|
||
|
|
c75755bb64
|
||
|
|
67652ea258
|
||
|
|
3735c7514c
|
||
|
|
803c98b6ff
|
||
|
|
9214018c03
|
||
|
|
d2597fa8d6
|
||
|
|
25e20c3ea1
|
||
|
|
f1a5db4f34
|
||
|
|
096d86cb7b
|
||
|
|
7b7553a1fe
|
||
|
|
7c30418d61
|
||
|
|
fa30835e97
|
||
|
|
0bdab8fd40 | ||
|
|
43f4d0a665 | ||
|
|
779a5eca65 | ||
|
|
1a30a105d0
|
||
|
|
45fe72d393
|
No files matched your search
@@ -32,10 +32,10 @@ jobs:
|
||||
options: --privileged --device /dev/fuse
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Sy --noconfirm archlinux-keyring
|
||||
pacman -Syu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm xorg-server-xvfb zsync patchelf
|
||||
uses: https://git.linux-gaming.ru/actions/anylinux-setup-action@7278cbb7c3692fce7241d427614ef7984192f138 # v3
|
||||
|
||||
- name: Install CI dependencies
|
||||
run: pacman -S --noconfirm --needed nodejs npm
|
||||
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
name: Check code
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:84cd9ef000b3cff245ec028e87965b84724f4bf1cc63fc2741ba927b88515ed6
|
||||
image: archlinux:base-devel@sha256:4894f5a268c696fad671966f383175a13faf433c9d9c88cdd4e32eaa2d18838b
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
|
||||
- name: Set up Python
|
||||
uses: https://git.linux-gaming.ru/actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
|
||||
@@ -80,14 +80,14 @@ jobs:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.appimage == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:84cd9ef000b3cff245ec028e87965b84724f4bf1cc63fc2741ba927b88515ed6
|
||||
image: archlinux:base-devel@sha256:4894f5a268c696fad671966f383175a13faf433c9d9c88cdd4e32eaa2d18838b
|
||||
options: --privileged --device /dev/fuse
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Sy --noconfirm archlinux-keyring
|
||||
pacman -Syu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm xorg-server-xvfb zsync patchelf
|
||||
uses: https://git.linux-gaming.ru/actions/anylinux-setup-action@7ff2bdc2fe97f9a4c6a4007f5f42fb4941f49fee # v4
|
||||
|
||||
- name: Install CI dependencies
|
||||
run: pacman -S --noconfirm --needed nodejs npm
|
||||
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
if: github.event_name == 'pull_request'
|
||||
@@ -185,7 +185,7 @@ jobs:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.arch == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:84cd9ef000b3cff245ec028e87965b84724f4bf1cc63fc2741ba927b88515ed6
|
||||
image: archlinux:base-devel@sha256:4894f5a268c696fad671966f383175a13faf433c9d9c88cdd4e32eaa2d18838b
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
@@ -251,7 +251,7 @@ jobs:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.debian == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: debian:trixie-20260824@sha256:f324c7ff54321e8d9c588493a20244965938ce0aa50bbd1022d38010e9ffc4b1
|
||||
image: debian:trixie-20260918@sha256:9cc080028c43b27d2074d63a5f9caf7166d731494965616c1a6d2827a004585c
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: https://git.linux-gaming.ru/actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.10
|
||||
3.11
|
||||
@@ -1,7 +1,7 @@
|
||||
# PortProtonQt — AI Agent Guidelines
|
||||
|
||||
**Project:** PortProtonQt — GUI for PortProton, Steam, Epic Games Store
|
||||
**Language:** Python 3.10+
|
||||
**Project:** PortProtonQt — Game library manager and launcher for Linux
|
||||
**Language:** Python 3.11+
|
||||
**Platform:** Linux (POSIX)
|
||||
**License:** GPL-3.0
|
||||
**Build:** Meson + uv
|
||||
@@ -302,6 +302,9 @@ Do not delete or disable caching or downloaders to satisfy this rule. Caching is
|
||||
- No heavy operations in paintEvent
|
||||
- Use methods instead of lambda for complex logic
|
||||
- Use QThread for long tasks
|
||||
- Retain every background worker that can outlive its caller in an owner field or collection until it finishes
|
||||
- Register window-owned workers and retained worker collections in the application shutdown path; cancel when supported and wait before interpreter exit
|
||||
- Add or update shutdown regression tests when adding or changing a background worker, including executor-backed workers
|
||||
|
||||
---
|
||||
|
||||
@@ -329,7 +332,7 @@ Do not assume conventions. Never invent behavior.
|
||||
|
||||
```bash
|
||||
# Setup
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync
|
||||
source .venv/bin/activate
|
||||
pre-commit install --install-hooks
|
||||
@@ -412,9 +415,11 @@ tests/
|
||||
├── test_base_config.py # BaseConfig read/write, caching, versioning
|
||||
├── test_cli.py # normalize_launch_path, URL/resolution parsing
|
||||
├── test_debug_env_utils.py # Debug environment helpers, runtime variables
|
||||
├── test_easyterm.py # Terminal final output, exit status, keyboard and gamepad closing
|
||||
├── test_input_manager.py # Gamepad input navigation and focus regressions
|
||||
├── test_sound_manager.py # UI sound playback, widget events, gamepad connection, theme sound files
|
||||
├── test_main_window.py # Main window data processing and callback regressions
|
||||
├── test_store_games.py # GOG and EGS library, launch, install, and stop regressions
|
||||
├── test_portproton_config.py # exec_line parsing, launcher tail, extensions
|
||||
├── test_portproton_api.py # PPDB API helpers, autoinstall localization fallback
|
||||
├── test_autoinstall_status.py # Autoinstall installed-status matching regressions
|
||||
@@ -492,6 +497,7 @@ pre-commit run pytest
|
||||
- [ ] Prefer dedicated functions for subprocess calls when practical within task scope
|
||||
- [ ] No shared mutable global state (except logger and explicit cache/session infrastructure)
|
||||
- [ ] No blocking calls introduced in the UI thread
|
||||
- [ ] Background workers have explicit ownership and shutdown cleanup with regression coverage
|
||||
- [ ] **No hardcoded styles or constants (use theme constants)**
|
||||
- [ ] **New constants added to theme files only**
|
||||
|
||||
|
||||
+36
-1
@@ -7,15 +7,30 @@
|
||||
|
||||
### Added
|
||||
|
||||
- Добавлены выбор и установка DLC при установке игр GOG
|
||||
- При установке GOG в папку с уже имеющейся игрой добавлены автоматический импорт, проверка файлов и загрузка недостающих или повреждённых файлов
|
||||
- Добавлена возможность приостанавливать и возобновлять запущенную игру через системный трей
|
||||
- Добавлена настройка отключения проверки i586-зависимостей в ALT Linux
|
||||
- Добавлена настройка принудительного применения английского языка
|
||||
- Добавлено редактирование названия и обложки игр GOG по ID
|
||||
- Добавлена интеграция Epic Games Store с авторизацией, библиотекой, установкой, импортом, восстановлением и удалением игр
|
||||
- Добавлена поддержка сборок Proton CachyOS WineLand
|
||||
- Добавлена кнопка возврата на рабочий стол в системной вкладке при указании команды в `PORTPROTONQT_RETURN_TO_DESKTOP_SCRIPT`
|
||||
- Добавлены режимы библиотеки `horizontal` и `horizontal_top` с циклической навигацией и плиткой открытия полной сетки в топ-режиме
|
||||
- В панель библиотеки добавлен выбор типа сетки
|
||||
- В виджет с исчезающей полосой прокрутки добавлена поддержка горизонтальной ориентации
|
||||
- Добавлен режим библиотеки `vertical` с табличным отображением названия, последнего запуска, проведённого времени и источника игры
|
||||
- При открытии карточки с отсутствующим исполняемым файлом добавлен выбор: удалить карточку или указать другой файл
|
||||
- Добавлен отдельный раздел настройки шрифтов MangoHud с масштабом, размером и выбором шрифта
|
||||
- Добавлен графический редактор глобальных настроек игр из `user.conf`
|
||||
|
||||
### Changed
|
||||
|
||||
- После завершения загрузки показывается системное уведомление, а строка результата открывает карточку игры мышью или кнопкой A геймпада
|
||||
- Улучшено определение вылетов игр: учитывается код завершения команды Wine/Proton и время работы игровых процессов, включая дочерний движок, без учёта времени завершения скрипта запуска
|
||||
- Каталоги пользовательских данных игр переведены на единый формат `источник-ID`
|
||||
- Данные приложения организованы в `$XDG_DATA_HOME/PortProtonQt` (по умолчанию `~/.local/share/PortProtonQt`): кеш перенесён из `.cache` в `cache`, данные лаунчеров — в `launcher`, загружаемые бинарники — в `bin`, чтобы временный кеш AnyLinux не вызывал повторную загрузку при каждом запуске AppImage
|
||||
- Минимальная поддерживаемая версия Python повышена с 3.10 до 3.11
|
||||
- Поиск в библиотеке теперь находит совпадения в любой части названия и показывает одноимённые игры из разных источников
|
||||
- Тема теперь применяется без перезапуска приложения
|
||||
- Добавлена сборка Fedora 45
|
||||
@@ -24,27 +39,47 @@
|
||||
- Обновлён перевод на Немецкий `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/de/`
|
||||
- Обновлён перевод на Португальский (Бразилия) `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/pt_BR/`
|
||||
- Обновлён перевод на Русский `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/ru/`
|
||||
- Обновлён перевод на Испанский `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/es/`
|
||||
- В AppImage добавлен Bash для предотвращения конфликтов Vulkan со Steam Runtime при использовании системного GameMode
|
||||
- Удалена ассоциация PortProtonQt с исполняемыми файлами Linux
|
||||
- MIME-тип образов MDS заменён на используемый libMirage `application/x-mds`
|
||||
- Порог определения быстрого вылета Windows-программы увеличен с 5 до 7 секунд
|
||||
- Открытие карточек и тихий запуск унифицированы
|
||||
- `minazuki` добавлен в список конфликтующих с GameMode процессов
|
||||
- Встроенный терминал после ошибки остаётся открытым и закрывается клавишей Enter или кнопкой A геймпада
|
||||
- В список советов при вылете добавлено отключение Optiscaler
|
||||
|
||||
### Fixed
|
||||
|
||||
- Исправлены создание и восстановление `.desktop`-файлов с переносами строк в названии игры
|
||||
- Исправлено появление дубля карточки при добавлении игры
|
||||
- Исправлено отсутствие новых `.exe` в поиске библиотеки до обновления сетки
|
||||
- Исправлено обновление названия на детальной странице после редактирования ярлыка без повторного открытия страницы
|
||||
- Исправлено отображение дополнений и наборов GOG как отдельных игр в библиотеке
|
||||
- Исправлено отсутствие установленных демоверсий, модов, приложений и бета-версий Steam в библиотеке
|
||||
- Исправлена синтаксическая ошибка в `functions_helper`, препятствовавшая запуску PortProton с Bash 5.1
|
||||
- Исправлено управление интерфейсом при одновременном подключении нескольких геймпадов
|
||||
- Исправлена коллизия пользовательских данных автоустановок с одинаковыми именами исходных исполняемых файлов
|
||||
- Исправлен поиск скриптов и локалей через `XDG_DATA_DIRS` в NixOS
|
||||
- Исправлена проверка и установка недостающих i586-зависимостей в ALT Linux перед запуском игр
|
||||
- Исправлено игнорирование проверки 32-битных пакетов при запуске игр GOG
|
||||
- Исправлено отсутствие иконки у окна встроенного терминала
|
||||
- Исправлена потеря финального вывода при ошибке встроенного терминала
|
||||
- Исправлено открытие карточек GOG через URI при старте приложения
|
||||
- Исправлен сброс состояния кнопки записи лога при переключении детальной страницы в компактный режим
|
||||
- Исправлено отображение значка PortProtonQt в системном трее при медленной инициализации приложения
|
||||
- Исправлено отсутствие вкладок Wi-Fi и Bluetooth при запуске до инициализации системных адаптеров
|
||||
- Исправлена ошибка, из-за которой не работал поиск по настройкам при отсутствии доступных параметров MangoHud или Gamescope
|
||||
- Фильтр установленных игр теперь переключается без повторной загрузки библиотеки
|
||||
- Некорректные изображения в кэше Steam теперь пропускаются при поиске обложек
|
||||
- Исправлено открытие `.ppdb` на разделах с битом исполнения у всех файлов
|
||||
- Исправлено создание резервной копии префикса с `libarchive-c 5.1`
|
||||
- Исправлено завершение приложения при активных фоновых операциях
|
||||
|
||||
### Contributors
|
||||
- @rogerio-mattos
|
||||
- @Rubin13
|
||||
- @adem4ik
|
||||
- @gallegonovato
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -15,439 +15,3 @@ 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/>.
|
||||
|
||||
We make use of various projects, some of which require their license to be preserved. Here's their respective licenses:
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
===============
|
||||
= icoextract: =
|
||||
===============
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-2016 Fadhil Mandaga
|
||||
Copyright (c) 2019-2025 James Lu <james@overdrivenetworks.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
===============
|
||||
= portproton: =
|
||||
===============
|
||||
MIT License
|
||||
|
||||
|
||||
Copyright (c) 2025 Mikhail Tergoev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
===============================
|
||||
= HowLongToBeat-Python-API : =
|
||||
===============================
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 JaeguKim
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
===============================
|
||||
= mdf2iso : =
|
||||
===============================
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 2 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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
|
||||
=====================================================================
|
||||
|
||||
===========================
|
||||
= Kenney Interface Sounds =
|
||||
===========================
|
||||
|
||||
Interface Sounds (1.0)
|
||||
|
||||
Created/distributed by Kenney (www.kenney.nl)
|
||||
|
||||
License: Creative Commons Zero, CC0
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
This content is free to use in personal, educational and commercial projects.
|
||||
|
||||
Support us by crediting Kenney or www.kenney.nl (this is not mandatory)
|
||||
@@ -5,14 +5,14 @@
|
||||
<div align="center">
|
||||
<img src="build-aux/share/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg" width="64">
|
||||
<h1 align="center">PortProtonQt</h1>
|
||||
<a href="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt/releases"><img src="https://img.shields.io/badge/Downloads-10488-green?style=flat-square" alt="Total Downloads"></a>
|
||||
<a href="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt/releases"><img src="https://img.shields.io/badge/Downloads-12.8k-green?style=flat-square" alt="Total Downloads"></a>
|
||||
<p align="center">A modern and convenient interface for managing and launching games from PortProton, Steam, Epic Games Store, and GOG. It brings libraries together in one place and simplifies launching Windows games on Linux.</p>
|
||||
</div>
|
||||
|
||||
### Installation (devel)
|
||||
|
||||
```sh
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync
|
||||
source .venv/bin/activate # For bash/zsh
|
||||
# or
|
||||
@@ -29,7 +29,7 @@ Launch using the `portprotonqt` command or via the shortcut in your application
|
||||
|
||||
### Development
|
||||
|
||||
To automatically prepare the environment (install Python 3.10, dependencies, pre-commit hooks, and generate translations), run the following script:
|
||||
To automatically prepare the environment (install Python 3.11, dependencies, pre-commit hooks, and generate translations), run the following script:
|
||||
|
||||
```sh
|
||||
./dev-scripts/prepare_env.sh
|
||||
@@ -65,13 +65,16 @@ PortProtonQt uses code and dependencies from the following projects:
|
||||
|
||||
- [Icoextract](https://github.com/jlu5/icoextract) — icon extraction library, [MIT](https://github.com/jlu5/icoextract/blob/master/LICENSE) license.
|
||||
- [HowLongToBeat Python API](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI) — library for interacting with HowLongToBeat, [MIT](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI/blob/master/LICENSE.md) license.
|
||||
- [iat](https://sourceforge.net/projects/iat.berlios) — library for converting mdf and nrg to iso, GPLv3 license.
|
||||
- [Iso9660 Analyzer Tool (IAT)](https://sourceforge.net/projects/iat.berlios/) — library for converting mdf and nrg to iso, GPLv2 license.
|
||||
- [heroic-gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl) — GOG downloading module, [GPLv3](https://github.com/Heroic-Games-Launcher/heroic-gogdl/blob/main/LICENSE) license.
|
||||
- [Legendary](https://github.com/Heroic-Games-Launcher/legendary) — Epic Games launcher alternative, [GPLv3](https://github.com/Heroic-Games-Launcher/legendary/blob/master/LICENSE) license.
|
||||
- [pyte](https://github.com/selectel/pyte) — ANSI escape code parser, [LGPLv3](https://github.com/selectel/pyte?tab=LGPL-3.0-1-ov-file) license.
|
||||
- [gjs-osk](https://github.com/Vishram1123/gjs-osk) — base for virtual keyboard layout data, GPLv3 license.
|
||||
- [omikuji](https://github.com/omikuji-launcher/omikuji) — inspiration and source material for the procedural detail page backgrounds, [GPLv3](https://github.com/omikuji-launcher/omikuji/blob/master/LICENSE) license.
|
||||
- [Bottles](https://github.com/bottlesdevs/Bottles) — source of the compatibility analysis rules, GPL-3.0-only license.
|
||||
|
||||
See the [LICENSE](LICENSE) file for the full text of the licenses.
|
||||
PortProtonQt is licensed under the terms in [LICENSE](LICENSE). See
|
||||
[THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) for third-party licenses.
|
||||
|
||||
> [!WARNING]
|
||||
> **Be careful!** If you are using a theme not from the official repository or a trusted source, make sure its `styles.py` file does not contain malicious or unwanted code. Since `styles.py` is a regular Python file, it can contain any instructions. Always check the contents of third-party themes before use.
|
||||
+8
-5
@@ -5,14 +5,14 @@
|
||||
<div align="center">
|
||||
<img src="build-aux/share/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg" width="64">
|
||||
<h1 align="center">PortProtonQt</h1>
|
||||
<a href="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt/releases"><img src="https://img.shields.io/badge/%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B8-10488-green?style=flat-square" alt="Всего загрузок"></a>
|
||||
<a href="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt/releases"><img src="https://img.shields.io/badge/%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B8-12.8k-green?style=flat-square" alt="Всего загрузок"></a>
|
||||
<p align="center">Современный и удобный интерфейс для управления и запуска игр из PortProton, Steam, Epic Games Store и GOG. Объединяет библиотеки в одном месте и упрощает запуск Windows-игр на Linux.</p>
|
||||
</div>
|
||||
|
||||
### Установка (devel)
|
||||
|
||||
```sh
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync
|
||||
source .venv/bin/activate # For bash/zsh
|
||||
# or
|
||||
@@ -29,7 +29,7 @@ source .venv/bin/activate.fish # For fish
|
||||
|
||||
### Разработка
|
||||
|
||||
Для автоматической подготовки окружения (установка Python 3.10, зависимостей, pre-commit хуков и генерация переводов) выполните скрипт:
|
||||
Для автоматической подготовки окружения (установка Python 3.11, зависимостей, pre-commit хуков и генерация переводов) выполните скрипт:
|
||||
|
||||
```sh
|
||||
./dev-scripts/prepare_env.sh
|
||||
@@ -65,13 +65,16 @@ PortProtonQt использует код и зависимости от след
|
||||
|
||||
- [Icoextract](https://github.com/jlu5/icoextract) — библиотека для извлечения иконок, лицензия [MIT](https://github.com/jlu5/icoextract/blob/master/LICENSE).
|
||||
- [HowLongToBeat Python API](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI) — библиотека для взаимодействия с HowLongToBeat, лицензия [MIT](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI/blob/master/LICENSE.md).
|
||||
- [iat](https://sourceforge.net/projects/iat.berlios) — библиотека для конвертации mdf и nrg в iso, лицензия GPLv3
|
||||
- [Iso9660 Analyzer Tool (IAT)](https://sourceforge.net/projects/iat.berlios/) — библиотека для конвертации mdf и nrg в iso, лицензия GPLv2
|
||||
- [heroic-gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl) — модуль загрузки игр GOG, лицензия [GPLv3](https://github.com/Heroic-Games-Launcher/heroic-gogdl/blob/main/LICENSE).
|
||||
- [Legendary](https://github.com/Heroic-Games-Launcher/legendary) — альтернатива Epic Games Launcher, лицензия [GPLv3](https://github.com/Heroic-Games-Launcher/legendary/blob/master/LICENSE).
|
||||
- [pyte](https://github.com/selectel/pyte) — разбор ANSI escape-кодов, лицензия [LGPLv3](https://github.com/selectel/pyte?tab=LGPL-3.0-1-ov-file)
|
||||
- [gjs-osk](https://github.com/Vishram1123/gjs-osk) — основа данных раскладок виртуальной клавиатуры, лицензия GPLv3.
|
||||
- [omikuji](https://github.com/omikuji-launcher/omikuji) — источник вдохновения и материалов для процедурных фонов детальной страницы, лицензия [GPLv3](https://github.com/omikuji-launcher/omikuji/blob/master/LICENSE).
|
||||
- [Bottles](https://github.com/bottlesdevs/Bottles) — источник правил анализа совместимости, лицензия GPL-3.0-only.
|
||||
|
||||
Полный текст лицензий см. в файле [LICENSE](LICENSE).
|
||||
Условия лицензии PortProtonQt приведены в файле [LICENSE](LICENSE). Лицензии
|
||||
сторонних проектов приведены в файле [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES).
|
||||
|
||||
> [!WARNING]
|
||||
> **Будьте осторожны!** Если вы берёте тему не из официального репозитория или надёжного источника, убедитесь, что в её файле `styles.py` нет вредоносного или нежелательного кода. Поскольку `styles.py` — это обычный Python-файл, он может содержать любые инструкции. Всегда проверяйте содержимое чужих тем перед использованием.
|
||||
+1278
File diff suppressed because it is too large.
Load diff
@@ -52,7 +52,6 @@ while [ $# -gt 0 ]; do
|
||||
done
|
||||
|
||||
ARCH="$(uname -m)"
|
||||
EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh"
|
||||
|
||||
if [ "$LOCAL_MODE" = true ]; then
|
||||
echo "Using local PKGBUILD-git from repository..."
|
||||
@@ -104,9 +103,7 @@ makepkg -si --noconfirm
|
||||
|
||||
echo "Installing debloated packages..."
|
||||
echo "---------------------------------------------------------------"
|
||||
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
|
||||
chmod +x ./get-debloated-pkgs.sh
|
||||
./get-debloated-pkgs.sh --add-common --prefer-nano
|
||||
get-debloated-pkgs --add-common --prefer-nano
|
||||
|
||||
if [ "$LOCAL_MODE" = true ]; then
|
||||
# For git version, we use portprotonqt-git
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
set -eu
|
||||
|
||||
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
|
||||
ARCH="$(uname -m)"
|
||||
VERSION="$(cat ~/version)"
|
||||
export ARCH VERSION
|
||||
@@ -20,16 +19,12 @@ export OPTIMIZE_LAUNCH=1
|
||||
# Adjust comp settings to bypass oom-killer
|
||||
export DWARFS_COMP="zstd:level=15 -S22 -B5"
|
||||
|
||||
# DEPLOY ALL LIBS
|
||||
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
|
||||
chmod +x ./quick-sharun
|
||||
|
||||
# Add udev rules
|
||||
mkdir -p ./AppDir/etc/udev/rules.d
|
||||
cp /usr/lib/udev/rules.d/60-portprotonqt.rules ./AppDir/etc/udev/rules.d
|
||||
|
||||
# Add PortProton scripts
|
||||
# Copy manual because im to lazzy for wait ./quick-sharun strace 208 .ppdb
|
||||
# Copy manually to avoid tracing 208 .ppdb files with quick-sharun
|
||||
mkdir -p ./AppDir/share
|
||||
cp -r /usr/share/portproton ./AppDir/share
|
||||
|
||||
@@ -43,7 +38,7 @@ GAMEPAD_LIBRARY=$(find /usr/lib -type f \
|
||||
-path '*/site-packages/portprotonqt/libportprotonqt_gamepad.so' \
|
||||
-print -quit)
|
||||
test -n "$GAMEPAD_LIBRARY"
|
||||
./quick-sharun \
|
||||
quick-sharun \
|
||||
/usr/bin/portprotonqt* \
|
||||
/usr/bin/bash \
|
||||
/usr/bin/update-desktop-database \
|
||||
@@ -103,4 +98,4 @@ done
|
||||
rm -rf "$PYSIDE_DIR"/QtAsyncio
|
||||
|
||||
# Turn AppDir into AppImage
|
||||
./quick-sharun --make-appimage
|
||||
quick-sharun --make-appimage
|
||||
Binary file not shown.
@@ -16,4 +16,10 @@
|
||||
<sub-class-of type="text/plain"/>
|
||||
<glob pattern="*.ppdb" weight="100"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/x-portproton-user-conf">
|
||||
<comment>PortProton user configuration</comment>
|
||||
<comment xml:lang="ru">Пользовательская конфигурация PortProton</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<glob pattern="user.conf" weight="100"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -23,6 +23,29 @@ python_module () {
|
||||
python3 -m portprotonqt.scripts_utils.$python3_module "$@"
|
||||
}
|
||||
|
||||
pw_alt_i586_dependencies () {
|
||||
local action="${1:-check}" installed list package
|
||||
installed="$(rpm -qa --qf '%{NAME}\n')" || return 2
|
||||
list=""
|
||||
|
||||
for package in glibc-nss glibc-gconv-modules libnm libvulkan1 libfreetype \
|
||||
$(grep '^libnss-' <<< "$installed" | grep -v '^libnss-fallback$') \
|
||||
$(grep '^xorg-dri-' <<< "$installed"); do
|
||||
if grep -Fqx "$package" <<< "$installed" \
|
||||
&& ! grep -Fqx "i586-$package" <<< "$installed" ; then
|
||||
list+=" i586-$package"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$action" == "check" ]] ; then
|
||||
[[ -z "$list" ]]
|
||||
return $?
|
||||
fi
|
||||
|
||||
[[ -z "$list" ]] && return 0
|
||||
apt-get update && apt-get install -y $list
|
||||
}
|
||||
|
||||
python_term () {
|
||||
print_info "Running: easyterm $@"
|
||||
python_module easyterm -e "$@"
|
||||
@@ -533,21 +556,6 @@ try_download () {
|
||||
return 0
|
||||
}
|
||||
|
||||
prepare_epic_wrapper () {
|
||||
local expected_hash="1feb21e21e19cbb34e881791c8f2557769f59231e46850915d49a6d0c1ce4583"
|
||||
export PW_EPIC_WRAPPER_EXE="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}/epic/EpicGamesLauncher.exe"
|
||||
if [[ ! -f "$PW_EPIC_WRAPPER_EXE" ]] ; then
|
||||
create_new_dir "$(dirname "$PW_EPIC_WRAPPER_EXE")"
|
||||
try_download \
|
||||
"https://github.com/BananaWorks07/heroic-epic-integration/releases/download/v${PW_EPIC_WRAPPER_VER}/EpicGamesLauncher.exe" \
|
||||
"$PW_EPIC_WRAPPER_EXE" no_mirror || return 1
|
||||
fi
|
||||
if [[ "$(sha256sum "$PW_EPIC_WRAPPER_EXE" | awk '{print $1}')" != "$expected_hash" ]] ; then
|
||||
try_remove_file "$PW_EPIC_WRAPPER_EXE"
|
||||
fatal "Epic launcher wrapper checksum verification failed"
|
||||
fi
|
||||
}
|
||||
|
||||
var_winedlloverride_update () {
|
||||
export WINEDLLOVERRIDES="${1}${WINEDLLOVERRIDES:+;$WINEDLLOVERRIDES}"
|
||||
}
|
||||
@@ -1079,6 +1087,7 @@ EOF
|
||||
-e '/export PW_SOUND_DRIVER_USE=/d' \
|
||||
"$USER_CONF"
|
||||
fi
|
||||
chmod 644 "${USER_CONF}"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source "$USER_CONF"
|
||||
@@ -2189,8 +2198,8 @@ manage_user_conf_value () {
|
||||
local var_name="$2"
|
||||
local var_value="$3"
|
||||
|
||||
if [[ -z "${action}" ]] || [[ -z "${var_name}" ]]; then
|
||||
print_error "Action and variable name must be provided"
|
||||
if [[ -z "${action}" ]]; then
|
||||
print_error "Action must be provided"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -2201,6 +2210,11 @@ manage_user_conf_value () {
|
||||
|
||||
case "$action" in
|
||||
get)
|
||||
if [[ -z "${var_name}" ]]; then
|
||||
grep -E '^export [A-Za-z_][A-Za-z0-9_]*=' "${USER_CONF}" 2>/dev/null \
|
||||
| sed -E 's/^export //' || true
|
||||
return 0
|
||||
fi
|
||||
if grep -q "^export ${var_name}=" "${USER_CONF}" ; then
|
||||
# Extract the value, handling both quoted and unquoted values
|
||||
local value=$(grep "^export ${var_name}=" "${USER_CONF}" | sed -E 's/^export [^=]+=("?)(.*)\1$/\2/')
|
||||
@@ -2212,6 +2226,10 @@ manage_user_conf_value () {
|
||||
fi
|
||||
;;
|
||||
set)
|
||||
if [[ -z "${var_name}" ]]; then
|
||||
print_error "Variable name must be provided"
|
||||
return 1
|
||||
fi
|
||||
if [[ -z "${var_value}" ]]; then
|
||||
print_error "Variable value must be provided for set action"
|
||||
return 1
|
||||
@@ -2222,6 +2240,10 @@ manage_user_conf_value () {
|
||||
return 0
|
||||
;;
|
||||
delete)
|
||||
if [[ -z "${var_name}" ]]; then
|
||||
print_error "Variable name must be provided"
|
||||
return 1
|
||||
fi
|
||||
if grep -q "^export ${var_name}=" "${USER_CONF}" ; then
|
||||
sed -i "/^export ${var_name}=/d" "${USER_CONF}"
|
||||
print_info "Removed ${var_name} from USER.conf"
|
||||
@@ -2933,6 +2955,9 @@ start_portproton () {
|
||||
|
||||
if [[ "${PW_USE_NVAPI_AND_DLSS}" == "1" ]] ; then
|
||||
export DXVK_ENABLE_NVAPI="1"
|
||||
if [[ -f "${WINEDIR}/share/dxvk-nvapi-vkreflex-layer/implicit_layer.d/VkLayer_DXVK_NVAPI_reflex.json" ]] ; then
|
||||
PW_VKREFLEX=1
|
||||
fi
|
||||
if echo "$LSPCI_VGA" | grep -i -q 'nvidia' ; then
|
||||
FIND_NVNGX="$(dirname $(find /usr/* -type f -name "nvngx.dll" 2>/dev/null | head -n 1 | awk '{print $1}'))"
|
||||
if [[ -n "$FIND_NVNGX" ]] ; then
|
||||
@@ -2944,6 +2969,7 @@ start_portproton () {
|
||||
fi
|
||||
else
|
||||
export DXVK_ENABLE_NVAPI="0"
|
||||
unset PW_VKREFLEX DXVK_NVAPI_VKREFLEX
|
||||
fi
|
||||
|
||||
if [[ "${PW_HEAP_DELAY_FREE}" == 1 ]]
|
||||
@@ -3221,7 +3247,7 @@ start_portproton () {
|
||||
# DGVOODOO2 enable:
|
||||
if [[ "${PW_DGVOODOO2}" == "1" ]] \
|
||||
&& [[ "${PW_USE_SPECIALK}" != "1" ]] \
|
||||
&& [[ "${PW_USE_D7VK}" != "1" ]] \
|
||||
&& [[ "${PW_USE_D7VK}" != "1" ]]
|
||||
then
|
||||
if [[ ! -f "${PW_VULKAN_DIR}/dgvoodoo2-${DGV2_VER}/dgVoodoo.conf" ]] ; then
|
||||
print_info "Download and install DGVOODOO2 v.${DGV2_VER}"
|
||||
@@ -3791,6 +3817,7 @@ start_portproton () {
|
||||
}
|
||||
|
||||
pw_run () {
|
||||
local pw_game_exit_code
|
||||
if [[ "$PW_USE_TERMINAL" == 1 ]] \
|
||||
&& [[ "${PRESSURE_VESSEL_TERMINAL:-}" != "tty" ]]
|
||||
then
|
||||
@@ -3857,6 +3884,7 @@ pw_run () {
|
||||
${PW_GAMEMODERUN_SLR} \
|
||||
${PW_ADD_VAR_SLR} \
|
||||
"${WINELOADER}" "$@" ${proxy_launch_parameters} &>>"${PW_LOG_FILE}"
|
||||
pw_game_exit_code=$?
|
||||
else
|
||||
if [[ "$PW_USE_TERMINAL" == 1 ]] ; then
|
||||
pw_init_runtime
|
||||
@@ -3877,6 +3905,7 @@ pw_run () {
|
||||
${PW_GAMEMODERUN_SLR} \
|
||||
${PW_ADD_VAR_SLR} \
|
||||
"${WINELOADER}" "$@" ${proxy_launch_parameters} &>>"${PW_LOG_FILE}"
|
||||
pw_game_exit_code=$?
|
||||
print_info "Update prefix log:"
|
||||
[[ -f "${PW_TMPFS_PATH}/update_pfx_log" ]] && cat "${PW_TMPFS_PATH}/update_pfx_log"
|
||||
echo
|
||||
@@ -3906,6 +3935,7 @@ pw_run () {
|
||||
${PW_INHIBIT_SLR} \
|
||||
${PW_TASKSET_SLR} \
|
||||
"${WINELOADER}" "$@" ${proxy_launch_parameters} &>>"${PW_LOG_FILE}"
|
||||
pw_game_exit_code=$?
|
||||
wait_wineserver
|
||||
else
|
||||
print_info "Update prefix log:"
|
||||
@@ -3926,9 +3956,12 @@ pw_run () {
|
||||
${PW_INHIBIT_SLR} \
|
||||
${PW_TASKSET_SLR} \
|
||||
"${WINELOADER}" "$@" ${proxy_launch_parameters}
|
||||
pw_game_exit_code=$?
|
||||
wait_wineserver
|
||||
fi
|
||||
fi
|
||||
printf 'PORTPROTONQT_GAME_EXIT_CODE=%s\n' "$pw_game_exit_code"
|
||||
return "$pw_game_exit_code"
|
||||
}
|
||||
export -f pw_run
|
||||
|
||||
@@ -4016,6 +4049,10 @@ steamplay_launch () {
|
||||
else
|
||||
export PW_VK_LAYER_PATH="${PW_PLUGINS_PATH}/portable/share/vulkan/implicit_layer.d"
|
||||
fi
|
||||
if [[ "${PW_VKREFLEX}" == "1" ]] ; then
|
||||
export DXVK_NVAPI_VKREFLEX="1"
|
||||
export PW_VK_LAYER_PATH="${PW_VK_LAYER_PATH:+${PW_VK_LAYER_PATH}:}${WINEDIR}/share/dxvk-nvapi-vkreflex-layer/implicit_layer.d"
|
||||
fi
|
||||
|
||||
pw_mangohud_check
|
||||
pw_vkbasalt_check
|
||||
@@ -4094,6 +4131,7 @@ steamplay_launch () {
|
||||
${PW_GAMEMODERUN_SLR} \
|
||||
${PW_TASKSET_SLR} \
|
||||
"${proton_runner}" waitforexitandrun "${PW_EXE_FILE}" "$@"
|
||||
printf 'PORTPROTONQT_GAME_EXIT_CODE=%s\n' "$?"
|
||||
if [[ $PW_LOG != 1 ]] && [[ -n $START_PW_TIME_IN_GAME ]] ; then
|
||||
debug_timer --end -s "PW_TIME_IN_GAME"
|
||||
PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 ))
|
||||
@@ -4170,12 +4208,7 @@ EOF
|
||||
else
|
||||
case "${PW_EXE_FILE,,}" in
|
||||
*.exe)
|
||||
if [[ -n "${PW_EPIC_WRAPPER_EXE:-}" ]] ; then
|
||||
pw_run "${PW_VD_TMP[@]}" "${PW_EPIC_WRAPPER_EXE}" \
|
||||
"${PW_EXE_FILE}" "$@"
|
||||
else
|
||||
pw_run "${PW_VD_TMP[@]}" ${WINE_WIN_START} "${PW_EXE_FILE}"
|
||||
fi
|
||||
pw_run "${PW_VD_TMP[@]}" ${WINE_WIN_START} "${PW_EXE_FILE}"
|
||||
;;
|
||||
*.bat|*.cmd)
|
||||
PW_USE_TERMINAL=1
|
||||
|
||||
@@ -6,6 +6,19 @@ export url_git="https://git.linux-gaming.ru/CastroFidel/PortWINE"
|
||||
########################################################################
|
||||
$PW_DEBUG
|
||||
|
||||
if [[ "$(realpath "$0")" == "/usr/share/portproton/scripts/start.sh" ]] ; then
|
||||
PORT_SCRIPTS_PATH="/usr/share/portproton/scripts/"
|
||||
else
|
||||
PORT_SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
|
||||
fi
|
||||
|
||||
if [[ "${1:-}" == "cli" ]] \
|
||||
&& [[ "${2:-}" == "--alt-i586-dependencies" ]] ; then
|
||||
source "$PORT_SCRIPTS_PATH/functions_helper"
|
||||
pw_alt_i586_dependencies "${3:-}"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [[ $(id -u) = 0 ]] \
|
||||
&& [[ ! -e "/userdata/system/batocera.conf" ]]
|
||||
then
|
||||
@@ -13,12 +26,6 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(realpath "$0")" == "/usr/share/portproton/scripts/start.sh" ]] ; then
|
||||
PORT_SCRIPTS_PATH="/usr/share/portproton/scripts/"
|
||||
else
|
||||
PORT_SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
|
||||
fi
|
||||
|
||||
PORT_CONF_PATH="$(dirname "$PORT_SCRIPTS_PATH")/conf"
|
||||
|
||||
if [[ -z "$PORT_DATA_PATH" ]] ; then
|
||||
@@ -73,9 +80,6 @@ fi
|
||||
|
||||
export PW_START_PID="$$"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source "${PORT_SCRIPTS_PATH}/var"
|
||||
|
||||
read -r -a pw_full_command_line <<< "$0 $*"
|
||||
export pw_full_command_line
|
||||
export orig_IFS="$IFS"
|
||||
@@ -122,9 +126,6 @@ elif [[ "$1" =~ ^--(debug|launch|edit-db)$ && "${2,,}" =~ \.(exe|bat|cmd|msi|reg
|
||||
elif [[ -f "$OLDPWD/$2" ]] ; then
|
||||
PW_EXE_FILE="$(realpath -s "$OLDPWD/$2")"
|
||||
fi
|
||||
elif [[ "$1" == "--epic-wrapper" && "${2,,}" =~ \.exe$ ]] ; then
|
||||
prepare_epic_wrapper || fatal "Failed to prepare Epic launcher wrapper"
|
||||
PW_EXE_FILE="$(realpath -s "$2")"
|
||||
fi
|
||||
export PW_EXE_FILE
|
||||
|
||||
@@ -170,6 +171,9 @@ export PW_VULKAN_DIR="${PORT_WINE_TMP_PATH}/VULKAN"
|
||||
create_new_dir "${PW_VULKAN_DIR}"
|
||||
|
||||
cd "${PORT_SCRIPTS_PATH}" || fatal "Scripts directory not found: ${PORT_SCRIPTS_PATH}"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source "${PORT_SCRIPTS_PATH}/var"
|
||||
# HACK: Avoid inheriting a system scripts cwd in pressure-vessel.
|
||||
cd "${XDG_DATA_HOME:-$HOME}" || fatal "Data directory not found: ${XDG_DATA_HOME:-$HOME}"
|
||||
|
||||
@@ -269,7 +273,7 @@ case "$1" in
|
||||
--launch Launches the application immediately, requires the path to the .exe file
|
||||
--edit-db After the variable, the path to the .exe file is required and then the variables.
|
||||
(List their variables and values for example PW_MANGOHUD=1 PW_VKBASALT=0, etc.)
|
||||
--get-user-conf Get a value from user.conf file, requires variable name
|
||||
--get-user-conf Get one or all values from user.conf file
|
||||
--set-user-conf Set a value in user.conf file, requires variable name and value
|
||||
--del-user-conf Delete a value from user.conf file, requires variable name
|
||||
--list-db List all available database variables
|
||||
@@ -579,10 +583,6 @@ Usage examples:
|
||||
portwine_launch
|
||||
stop_portproton
|
||||
;;
|
||||
--epic-wrapper)
|
||||
portwine_launch "${@:3}"
|
||||
stop_portproton
|
||||
;;
|
||||
--stop)
|
||||
start_path="$(realpath "$0")"
|
||||
pgrep -f -- "${start_path}.*--autoinstall" | while read -r autoinstall_pid ; do
|
||||
|
||||
@@ -16,7 +16,6 @@ export VKD3D_SAREK_VER="sarek-2.6.0"
|
||||
export PW_LSFG_VK_VER="2.0.0-dev25-p11"
|
||||
export PW_OPTISCALER_VER="v03-0.9.0-pre8"
|
||||
export PW_SPECIALK_VER="SK_26_5_15"
|
||||
export PW_EPIC_WRAPPER_VER="0.4"
|
||||
export PW_GALLIUM_NINE_VER="0.10"
|
||||
export DOTPFX_VER="48v9"
|
||||
export DEFPFX_VER="v1"
|
||||
|
||||
+141
-35
@@ -3,28 +3,119 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define AXIS_ACTIVATION_THRESHOLD 16000
|
||||
|
||||
typedef struct {
|
||||
SDL_Gamepad *gamepad;
|
||||
SDL_JoystickID instance_id;
|
||||
int sdl_type;
|
||||
bool buttons[SDL_GAMEPAD_BUTTON_COUNT];
|
||||
bool axes_active[SDL_GAMEPAD_AXIS_COUNT];
|
||||
} GamepadEntry;
|
||||
|
||||
typedef struct {
|
||||
GamepadEntry *entries;
|
||||
int count;
|
||||
SDL_JoystickID active_instance_id;
|
||||
} PortProtonGamepad;
|
||||
|
||||
static PortProtonGamepad *open_gamepad(SDL_JoystickID instance_id)
|
||||
static bool has_gamepad(const PortProtonGamepad *gamepads,
|
||||
SDL_JoystickID instance_id)
|
||||
{
|
||||
for (int index = 0; index < gamepads->count; index++) {
|
||||
if (gamepads->entries[index].instance_id == instance_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool add_gamepad(PortProtonGamepad *gamepads,
|
||||
SDL_JoystickID instance_id)
|
||||
{
|
||||
SDL_Gamepad *gamepad = SDL_OpenGamepad(instance_id);
|
||||
if (gamepad == NULL) {
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
PortProtonGamepad *result = malloc(sizeof(*result));
|
||||
if (result == NULL) {
|
||||
GamepadEntry *entries = realloc(
|
||||
gamepads->entries, sizeof(*entries) * (gamepads->count + 1));
|
||||
if (entries == NULL) {
|
||||
SDL_CloseGamepad(gamepad);
|
||||
SDL_SetError("Failed to allocate gamepad handle");
|
||||
return SDL_SetError("Failed to allocate gamepad handle");
|
||||
}
|
||||
gamepads->entries = entries;
|
||||
GamepadEntry entry = {0};
|
||||
entry.gamepad = gamepad;
|
||||
entry.instance_id = instance_id;
|
||||
entry.sdl_type = SDL_GetGamepadTypeForID(instance_id);
|
||||
entries[gamepads->count] = entry;
|
||||
gamepads->count++;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void remove_disconnected(PortProtonGamepad *gamepads)
|
||||
{
|
||||
int active_count = 0;
|
||||
for (int index = 0; index < gamepads->count; index++) {
|
||||
GamepadEntry entry = gamepads->entries[index];
|
||||
if (SDL_GamepadConnected(entry.gamepad)) {
|
||||
gamepads->entries[active_count++] = entry;
|
||||
} else {
|
||||
if (gamepads->active_instance_id == entry.instance_id) {
|
||||
gamepads->active_instance_id = 0;
|
||||
}
|
||||
SDL_CloseGamepad(entry.gamepad);
|
||||
}
|
||||
}
|
||||
gamepads->count = active_count;
|
||||
}
|
||||
|
||||
static void update_gamepads(PortProtonGamepad *gamepads)
|
||||
{
|
||||
SDL_PumpEvents();
|
||||
SDL_UpdateGamepads();
|
||||
remove_disconnected(gamepads);
|
||||
int count = 0;
|
||||
SDL_JoystickID *instance_ids = SDL_GetGamepads(&count);
|
||||
if (instance_ids == NULL) {
|
||||
return;
|
||||
}
|
||||
for (int index = 0; index < count; index++) {
|
||||
if (!has_gamepad(gamepads, instance_ids[index])) {
|
||||
add_gamepad(gamepads, instance_ids[index]);
|
||||
}
|
||||
}
|
||||
SDL_free(instance_ids);
|
||||
}
|
||||
|
||||
static bool update_entry_activity(GamepadEntry *entry)
|
||||
{
|
||||
bool activated = false;
|
||||
for (int button = 0; button < SDL_GAMEPAD_BUTTON_COUNT; button++) {
|
||||
bool pressed = SDL_GetGamepadButton(entry->gamepad, button);
|
||||
activated |= pressed && !entry->buttons[button];
|
||||
entry->buttons[button] = pressed;
|
||||
}
|
||||
for (int axis = 0; axis < SDL_GAMEPAD_AXIS_COUNT; axis++) {
|
||||
int value = SDL_GetGamepadAxis(entry->gamepad, axis);
|
||||
bool active = abs(value) >= AXIS_ACTIVATION_THRESHOLD;
|
||||
activated |= active && !entry->axes_active[axis];
|
||||
entry->axes_active[axis] = active;
|
||||
}
|
||||
return activated;
|
||||
}
|
||||
|
||||
static const GamepadEntry *get_active_gamepad(const PortProtonGamepad *gamepads)
|
||||
{
|
||||
if (gamepads == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
result->gamepad = gamepad;
|
||||
result->instance_id = instance_id;
|
||||
result->sdl_type = SDL_GetGamepadTypeForID(instance_id);
|
||||
return result;
|
||||
for (int index = 0; index < gamepads->count; index++) {
|
||||
if (gamepads->entries[index].instance_id == gamepads->active_instance_id) {
|
||||
return &gamepads->entries[index];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PortProtonGamepad *portproton_gamepad_find(void)
|
||||
@@ -33,23 +124,17 @@ PortProtonGamepad *portproton_gamepad_find(void)
|
||||
if (!SDL_InitSubSystem(SDL_INIT_GAMEPAD)) {
|
||||
return NULL;
|
||||
}
|
||||
SDL_PumpEvents();
|
||||
SDL_UpdateGamepads();
|
||||
int count = 0;
|
||||
SDL_JoystickID *gamepads = SDL_GetGamepads(&count);
|
||||
if (gamepads == NULL) {
|
||||
PortProtonGamepad *result = calloc(1, sizeof(*result));
|
||||
if (result == NULL) {
|
||||
SDL_SetError("Failed to allocate gamepad collection");
|
||||
return NULL;
|
||||
}
|
||||
if (count == 0) {
|
||||
SDL_free(gamepads);
|
||||
update_gamepads(result);
|
||||
if (result->count == 0) {
|
||||
free(result);
|
||||
SDL_ClearError();
|
||||
return NULL;
|
||||
}
|
||||
PortProtonGamepad *result = NULL;
|
||||
for (int index = 0; index < count && result == NULL; index++) {
|
||||
result = open_gamepad(gamepads[index]);
|
||||
}
|
||||
SDL_free(gamepads);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -64,56 +149,77 @@ void portproton_gamepad_close(PortProtonGamepad *gamepad)
|
||||
if (gamepad == NULL) {
|
||||
return;
|
||||
}
|
||||
if (gamepad->gamepad != NULL) {
|
||||
SDL_CloseGamepad(gamepad->gamepad);
|
||||
for (int index = 0; index < gamepad->count; index++) {
|
||||
SDL_CloseGamepad(gamepad->entries[index].gamepad);
|
||||
}
|
||||
free(gamepad->entries);
|
||||
free(gamepad);
|
||||
}
|
||||
|
||||
bool portproton_gamepad_connected(const PortProtonGamepad *gamepad)
|
||||
{
|
||||
return gamepad != NULL && gamepad->gamepad != NULL &&
|
||||
SDL_GamepadConnected(gamepad->gamepad);
|
||||
return gamepad != NULL && gamepad->count > 0;
|
||||
}
|
||||
|
||||
void portproton_gamepad_update(void)
|
||||
void portproton_gamepad_update(PortProtonGamepad *gamepad)
|
||||
{
|
||||
SDL_UpdateGamepads();
|
||||
if (gamepad != NULL) {
|
||||
update_gamepads(gamepad);
|
||||
for (int index = 0; index < gamepad->count; index++) {
|
||||
if (update_entry_activity(&gamepad->entries[index])) {
|
||||
gamepad->active_instance_id = gamepad->entries[index].instance_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int portproton_gamepad_get_button(const PortProtonGamepad *gamepad, int button)
|
||||
{
|
||||
if (gamepad == NULL || gamepad->gamepad == NULL) {
|
||||
const GamepadEntry *active = get_active_gamepad(gamepad);
|
||||
if (active == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_GetGamepadButton(gamepad->gamepad, button);
|
||||
return SDL_GetGamepadButton(active->gamepad, button);
|
||||
}
|
||||
|
||||
int16_t portproton_gamepad_get_axis(const PortProtonGamepad *gamepad, int axis)
|
||||
{
|
||||
if (gamepad == NULL || gamepad->gamepad == NULL) {
|
||||
const GamepadEntry *active = get_active_gamepad(gamepad);
|
||||
if (active == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_GetGamepadAxis(gamepad->gamepad, axis);
|
||||
return SDL_GetGamepadAxis(active->gamepad, axis);
|
||||
}
|
||||
|
||||
uint32_t portproton_gamepad_get_active_instance_id(
|
||||
const PortProtonGamepad *gamepad)
|
||||
{
|
||||
return gamepad != NULL ? gamepad->active_instance_id : 0;
|
||||
}
|
||||
|
||||
const char *portproton_gamepad_get_name(const PortProtonGamepad *gamepad)
|
||||
{
|
||||
if (gamepad == NULL || gamepad->gamepad == NULL) {
|
||||
if (gamepad == NULL || gamepad->count == 0) {
|
||||
return "";
|
||||
}
|
||||
const char *name = SDL_GetGamepadName(gamepad->gamepad);
|
||||
const char *name = SDL_GetGamepadName(gamepad->entries[0].gamepad);
|
||||
return name != NULL ? name : "";
|
||||
}
|
||||
|
||||
uint32_t portproton_gamepad_get_instance_id(const PortProtonGamepad *gamepad)
|
||||
{
|
||||
return gamepad != NULL ? gamepad->instance_id : 0;
|
||||
return gamepad != NULL && gamepad->count > 0
|
||||
? gamepad->entries[0].instance_id : 0;
|
||||
}
|
||||
|
||||
int portproton_gamepad_get_type(const PortProtonGamepad *gamepad)
|
||||
{
|
||||
return gamepad != NULL ? gamepad->sdl_type : 0;
|
||||
const GamepadEntry *active = get_active_gamepad(gamepad);
|
||||
if (active != NULL) {
|
||||
return active->sdl_type;
|
||||
}
|
||||
return gamepad != NULL && gamepad->count > 0
|
||||
? gamepad->entries[0].sdl_type : 0;
|
||||
}
|
||||
|
||||
void portproton_gamepad_shutdown(void)
|
||||
|
||||
@@ -19,6 +19,18 @@ for file in "$@"; do
|
||||
echo "$file: bash -n syntax check failed"
|
||||
status=1
|
||||
fi
|
||||
|
||||
# Bash 5.1 requires a separator before then after a conditional command.
|
||||
if ! awk '
|
||||
/\]\][ \t]+then([ \t;]|$)/ || (continued && /^[ \t]*then([ \t;]|$)/) {
|
||||
printf "%s:%d: Bash 5.1 requires a newline or semicolon before then\n", FILENAME, NR
|
||||
failed = 1
|
||||
}
|
||||
{ continued = /\]\][ \t]*\\$/ }
|
||||
END { exit failed }
|
||||
' "$file"; then
|
||||
status=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit "$status"
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
GITHUB_REPOS=("Boria138/PortProtonQt" "linux-gaming-ru/PortProtonQt")
|
||||
GITHUB_REPOS=("linux-gaming-ru/PortProtonQt")
|
||||
GITEA_REPO="Linux-Gaming/PortProtonQt"
|
||||
GITEA_URL="https://git.linux-gaming.ru"
|
||||
|
||||
jq_format='def format_downloads: if . < 1000 then tostring else ((. / 100 | round) / 10 | tostring) + "k" end;'
|
||||
|
||||
jq_total='[.[].assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not) | .download_count] | add // 0'
|
||||
|
||||
echo "=== PortProtonQt Download Stats ==="
|
||||
@@ -12,49 +14,52 @@ echo
|
||||
|
||||
echo "--- GitHub (${GITHUB_REPOS[*]}) ---"
|
||||
GH_RAW=$(for repo in "${GITHUB_REPOS[@]}"; do
|
||||
curl -sf "https://api.github.com/repos/${repo}/releases?per_page=100"
|
||||
curl -sfL "https://api.github.com/repos/${repo}/releases?per_page=100"
|
||||
done | jq -s 'add')
|
||||
GH_COUNT=$(echo "$GH_RAW" | jq "$jq_total")
|
||||
GH_RELEASES=$(echo "$GH_RAW" | jq 'length')
|
||||
echo "Releases: $GH_RELEASES"
|
||||
echo "Total downloads: $GH_COUNT"
|
||||
GH_DISPLAY=$(jq -nr --argjson count "$GH_COUNT" "$jq_format"'$count | format_downloads')
|
||||
echo "Total downloads: $GH_DISPLAY"
|
||||
echo
|
||||
echo "Per release:"
|
||||
echo "$GH_RAW" | jq -r '.[] | "\n \(.tag_name) (\(.published_at)):" as $header | $header, (.assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not) | " \(.name): \(.download_count)")'
|
||||
echo "$GH_RAW" | jq -r "$jq_format"'.[] | "\n \(.tag_name) (\(.published_at)):" as $header | $header, (.assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not) | " \(.name): \(.download_count | format_downloads)")'
|
||||
echo
|
||||
|
||||
echo "--- Gitea (${GITEA_REPO}) ---"
|
||||
GIT_RAW=$(curl -sf "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases?limit=50")
|
||||
GIT_RAW=$(curl -sfL "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases?limit=50")
|
||||
GIT_COUNT=$(echo "$GIT_RAW" | jq "$jq_total")
|
||||
GIT_RELEASES=$(echo "$GIT_RAW" | jq 'length')
|
||||
echo "Releases: $GIT_RELEASES"
|
||||
echo "Total downloads: $GIT_COUNT"
|
||||
GIT_DISPLAY=$(jq -nr --argjson count "$GIT_COUNT" "$jq_format"'$count | format_downloads')
|
||||
echo "Total downloads: $GIT_DISPLAY"
|
||||
echo
|
||||
echo "Per release:"
|
||||
echo "$GIT_RAW" | jq -r '.[] | "\n \(.tag_name) (\(.created_at)):" as $header | $header, (.assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not) | " \(.name): \(.download_count)")'
|
||||
echo "$GIT_RAW" | jq -r "$jq_format"'.[] | "\n \(.tag_name) (\(.created_at)):" as $header | $header, (.assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not) | " \(.name): \(.download_count | format_downloads)")'
|
||||
echo
|
||||
|
||||
TOTAL=$((GH_COUNT + GIT_COUNT))
|
||||
BADGE_TOTAL=$(jq -nr --argjson total "$TOTAL" "$jq_format"'$total | format_downloads')
|
||||
echo "========================"
|
||||
echo "GitHub total: $GH_COUNT"
|
||||
echo "Gitea total: $GIT_COUNT"
|
||||
echo "Grand total: $TOTAL"
|
||||
echo "GitHub total: $GH_DISPLAY"
|
||||
echo "Gitea total: $GIT_DISPLAY"
|
||||
echo "Grand total: $BADGE_TOTAL"
|
||||
echo
|
||||
echo "--- Top downloads (by file) ---"
|
||||
jq_filter_top='[.[].assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not)] | group_by(.name) | map({name: .[0].name, total: (map(.download_count) | add)}) | sort_by(-.total) | .[:15] | .[] | " \(.total)\t\(.name)"'
|
||||
jq_filter_top='[.[].assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not)] | group_by(.name) | map({name: .[0].name, total: (map(.download_count) | add)}) | sort_by(-.total) | .[:15] | .[] | " \(.total | format_downloads)\t\(.name)"'
|
||||
echo "GitHub:"
|
||||
echo "$GH_RAW" | jq -r "$jq_filter_top"
|
||||
echo "$GH_RAW" | jq -r "$jq_format $jq_filter_top"
|
||||
echo
|
||||
echo "Gitea:"
|
||||
echo "$GIT_RAW" | jq -r "$jq_filter_top"
|
||||
echo "$GIT_RAW" | jq -r "$jq_format $jq_filter_top"
|
||||
echo
|
||||
echo "--- Top downloads (by type) ---"
|
||||
jq_type='[.[].assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not)] | map({type: (.name | split(".") | last | if test("^AppImage$") then "AppImage" elif test("^deb$") then "deb" elif test("^rpm$") then "rpm" elif test("^zst$") then "pkg.tar.zst" else "other" end), downloads: .download_count}) | group_by(.type) | map({type: .[0].type, total: (map(.downloads) | add)}) | sort_by(-.total) | .[] | " \(.type): \(.total)"'
|
||||
jq_type='[.[].assets[] | select(.name | test("\\.(zsync|sha256)$|steam-compat") | not)] | map({type: (.name | split(".") | last | if test("^AppImage$") then "AppImage" elif test("^deb$") then "deb" elif test("^rpm$") then "rpm" elif test("^zst$") then "pkg.tar.zst" else "other" end), downloads: .download_count}) | group_by(.type) | map({type: .[0].type, total: (map(.downloads) | add)}) | sort_by(-.total) | .[] | " \(.type): \(.total | format_downloads)"'
|
||||
echo "GitHub:"
|
||||
echo "$GH_RAW" | jq -r "$jq_type"
|
||||
echo "$GH_RAW" | jq -r "$jq_format $jq_type"
|
||||
echo
|
||||
echo "Gitea:"
|
||||
echo "$GIT_RAW" | jq -r "$jq_type"
|
||||
echo "$GIT_RAW" | jq -r "$jq_format $jq_type"
|
||||
|
||||
if [[ "${CI:-}" != "true" ]]; then
|
||||
echo
|
||||
@@ -62,9 +67,9 @@ if [[ "${CI:-}" != "true" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sed -i "s|-[0-9]*-green?style=flat-square|-$TOTAL-green?style=flat-square|g" README.md README.ru.md
|
||||
sed -i -E "s|-[0-9]+(\.[0-9]+)?k?-green\?style=flat-square|-$BADGE_TOTAL-green?style=flat-square|g" README.md README.ru.md
|
||||
echo
|
||||
echo "Badge updated: $TOTAL"
|
||||
echo "Badge updated: $BADGE_TOTAL"
|
||||
|
||||
git diff --quiet README.md README.ru.md && { echo "No changes to commit"; exit 0; }
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ if ! command -v uv &> /dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Check if Python 3.10 is already installed via uv
|
||||
# We look for cpython-3.10 and ensure it doesn't say "<download available>"
|
||||
if uv python list | grep "cpython-3.10" | grep -qv "<download available>"; then
|
||||
echo "✅ Python 3.10 is already available."
|
||||
# 2. Check if Python 3.11 is already installed via uv
|
||||
# We look for cpython-3.11 and ensure it doesn't say "<download available>"
|
||||
if uv python list | grep "cpython-3.11" | grep -qv "<download available>"; then
|
||||
echo "✅ Python 3.11 is already available."
|
||||
else
|
||||
echo "🐍 Installing Python 3.10..."
|
||||
uv python install 3.10
|
||||
echo "🐍 Installing Python 3.11..."
|
||||
uv python install 3.11
|
||||
fi
|
||||
|
||||
# 3. Sync dependencies
|
||||
|
||||
@@ -44,7 +44,7 @@ Translations submitted online are periodically reviewed and merged into the main
|
||||
1. Run:
|
||||
|
||||
```bash
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync --all-extras --dev
|
||||
source .venv/bin/activate
|
||||
python dev-scripts/l10n.py --create-new <locale_code>
|
||||
@@ -64,7 +64,7 @@ python dev-scripts/l10n.py
|
||||
If you’ve added new strings to the code:
|
||||
|
||||
```bash
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync --all-extras --dev
|
||||
source .venv/bin/activate
|
||||
python dev-scripts/l10n.py --update-all
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
1. Выполните:
|
||||
|
||||
```bash
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync --all-extras --dev
|
||||
source .venv/bin/activate
|
||||
python dev-scripts/l10n.py --create-new <код_локали>
|
||||
@@ -64,7 +64,7 @@ python dev-scripts/l10n.py
|
||||
Если вы добавили новые строки в код:
|
||||
|
||||
```bash
|
||||
uv python install 3.10
|
||||
uv python install 3.11
|
||||
uv sync --all-extras --dev
|
||||
source .venv/bin/activate
|
||||
python dev-scripts/l10n.py --update-all
|
||||
|
||||
@@ -291,6 +291,7 @@ GAME_CARD_GRID = {
|
||||
}
|
||||
|
||||
GAME_CARD_HORIZONTAL = {
|
||||
"card_orientation": "vertical",
|
||||
"card_animation_type": "scale",
|
||||
"extra_margin": 20,
|
||||
"spacing": 5,
|
||||
@@ -302,6 +303,9 @@ GAME_CARD_HORIZONTAL = {
|
||||
}
|
||||
```
|
||||
|
||||
Set `card_orientation` to `"vertical"` to reuse the grid card proportions in
|
||||
the horizontal strip. Omit it to keep the horizontal block proportions.
|
||||
|
||||
Values are logical pixels. `cover_radius` applies to static and animated covers;
|
||||
`border_radius` applies to the painted focus and hover border. Grid cover width
|
||||
continues to follow the library card-size setting.
|
||||
@@ -312,7 +316,8 @@ widths, pulse settings, gradient angles and colors, fill/stripe/glow colors and
|
||||
opacity, scale values, animation durations, and easing curves. For example,
|
||||
`horizontal_top` can define its own `scale` type, scale values, duration, and
|
||||
easing while the complete grid uses separately configured `gradient` values.
|
||||
Keys omitted from a layout continue to use `GAME_CARD_ANIMATION` as fallback.
|
||||
Keys omitted from a layout continue to use `GAME_CARD_ANIMATION` as fallback;
|
||||
`card_animation_type` defaults to `gradient`.
|
||||
|
||||
```python
|
||||
GAME_CARD_HORIZONTAL = {
|
||||
|
||||
@@ -291,6 +291,7 @@ GAME_CARD_GRID = {
|
||||
}
|
||||
|
||||
GAME_CARD_HORIZONTAL = {
|
||||
"card_orientation": "vertical",
|
||||
"card_animation_type": "scale",
|
||||
"extra_margin": 20,
|
||||
"spacing": 5,
|
||||
@@ -302,6 +303,10 @@ GAME_CARD_HORIZONTAL = {
|
||||
}
|
||||
```
|
||||
|
||||
Укажите `card_orientation = "vertical"`, чтобы использовать в горизонтальной
|
||||
ленте вертикальные пропорции карточек из сетки. Без параметра сохраняются
|
||||
пропорции горизонтальных блоков.
|
||||
|
||||
Значения задаются в логических пикселях. `cover_radius` применяется к
|
||||
статическим и анимированным обложкам, а `border_radius` — к отрисовываемой
|
||||
обводке при фокусе и наведении. Ширина обложки в сеточном режиме по-прежнему
|
||||
@@ -313,7 +318,8 @@ GAME_CARD_HORIZONTAL = {
|
||||
fill/stripe/glow, масштаб, длительности и easing-кривые. Например,
|
||||
`horizontal_top` может задавать собственные тип `scale`, значения масштаба,
|
||||
длительность и easing, а полная сетка — отдельные параметры `gradient`.
|
||||
Отсутствующие в режиме параметры берутся из `GAME_CARD_ANIMATION`.
|
||||
Отсутствующие в режиме параметры берутся из `GAME_CARD_ANIMATION`, а
|
||||
`card_animation_type` по умолчанию использует `gradient`.
|
||||
|
||||
```python
|
||||
GAME_CARD_HORIZONTAL = {
|
||||
|
||||
@@ -25,10 +25,7 @@ class GameCardAnimations:
|
||||
|
||||
def _animation_type(self) -> str:
|
||||
layout_config = getattr(self.game_card, "card_layout_cfg", {})
|
||||
return layout_config.get(
|
||||
"card_animation_type",
|
||||
self.theme.GAME_CARD_ANIMATION.get("card_animation_type", "gradient"),
|
||||
)
|
||||
return layout_config.get("card_animation_type", "gradient")
|
||||
|
||||
def _config_value(self, key: str) -> Any:
|
||||
layout_config = getattr(self.game_card, "card_layout_cfg", {})
|
||||
|
||||
@@ -509,6 +509,8 @@ def main():
|
||||
window = MainWindow(app_name=__app_name__, version=version, launch_exe=launch_path, resolution=window_resolution, show_system_tab=args.ppqtos)
|
||||
window.silent_launch_mode = silent_game_request
|
||||
if silent_game_request:
|
||||
window._initialize_tray(__app_name__)
|
||||
assert window.tray_manager is not None
|
||||
if exe_path:
|
||||
window.tray_manager.tray_icon.hide()
|
||||
else:
|
||||
@@ -863,6 +865,10 @@ def main():
|
||||
|
||||
if start_sh:
|
||||
worker = InitialCommandWorker(start_sh)
|
||||
window.initialCommandWorker = worker
|
||||
worker.finished.connect(
|
||||
lambda: setattr(window, "initialCommandWorker", None)
|
||||
)
|
||||
worker.start()
|
||||
else:
|
||||
logger.warning("PortProton start command not available, skipping initial command")
|
||||
|
||||
@@ -183,6 +183,7 @@ def integrate_appimage() -> Path:
|
||||
resolved_icon = icon_source.resolve()
|
||||
icon = icon_dir / f"{APP_ID}.svg"
|
||||
_copy_appimage(source, destination)
|
||||
# Remove after the legacy AppImage migration period.
|
||||
legacy_appimage = Path.home() / "Applications/PortProtonQt.AppImage"
|
||||
if legacy_appimage.resolve() != destination.resolve():
|
||||
portproton_location = get_portproton_location()
|
||||
|
||||
@@ -14,7 +14,8 @@ import requests
|
||||
from PySide6.QtCore import QThread, Signal
|
||||
|
||||
from portprotonqt.downloader import get_requests_session
|
||||
from portprotonqt.config import CACHE_DIR, ui_config
|
||||
from portprotonqt.config import ui_config
|
||||
from portprotonqt.config.base import XDG_DATA_HOME
|
||||
from portprotonqt.logger import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -59,7 +60,7 @@ def _get_appimage_arch() -> str:
|
||||
|
||||
|
||||
def _cached_tool_path() -> Path:
|
||||
return CACHE_DIR / "bin" / "appimageupdatetool"
|
||||
return XDG_DATA_HOME / "PortProtonQt" / "bin" / "appimageupdatetool"
|
||||
|
||||
|
||||
def _get_appimageupdatetool_url() -> str:
|
||||
|
||||
@@ -14,6 +14,7 @@ from typing import Any
|
||||
|
||||
import orjson
|
||||
import pefile
|
||||
import psutil
|
||||
|
||||
from portprotonqt.debug_utils import (
|
||||
get_portproton_env,
|
||||
@@ -98,16 +99,46 @@ class CompatibilityLaunch:
|
||||
duration: float
|
||||
|
||||
|
||||
def is_suspected_crash(duration: float, stopped_by_user: bool, executable: str) -> bool:
|
||||
"""Return whether an executable closed too soon after launch."""
|
||||
def is_suspected_crash(
|
||||
duration: float, stopped_by_user: bool, executable: str, exit_code: int | None = None
|
||||
) -> bool:
|
||||
"""Prefer Wine's command status; use short runtime only when it is unknown."""
|
||||
always_report = os.getenv(COMPATIBILITY_ALWAYS_REPORT_ENV) == "1"
|
||||
return (
|
||||
(always_report or (not stopped_by_user and duration < CRASH_THRESHOLD_SECONDS))
|
||||
(always_report or (not stopped_by_user and (
|
||||
exit_code != 0 if exit_code is not None else duration < CRASH_THRESHOLD_SECONDS
|
||||
)))
|
||||
and executable.lower().endswith((".exe", ".msi"))
|
||||
and os.path.isfile(executable)
|
||||
)
|
||||
|
||||
|
||||
def get_running_game_processes(executable: str, started: float) -> dict[tuple[int, float], str]:
|
||||
"""Find new Windows processes in the game's directory, including engine children."""
|
||||
directory = os.path.dirname(os.path.abspath(executable)).lower() + "/"
|
||||
running = {}
|
||||
for process in psutil.process_iter(attrs=["pid", "name", "cmdline", "cwd", "create_time", "status"]):
|
||||
info = process.info
|
||||
created = info.get("create_time")
|
||||
if created is None or created < started or info.get("status") == psutil.STATUS_ZOMBIE:
|
||||
continue
|
||||
arguments = info.get("cmdline") or []
|
||||
command = (arguments[0] if arguments else info.get("name") or "").replace("\\", "/")
|
||||
if not command.lower().endswith((".exe", ".msi")):
|
||||
continue
|
||||
if command.lower().startswith("z:/"):
|
||||
command = command[2:]
|
||||
if not command.startswith("/"):
|
||||
cwd = info.get("cwd")
|
||||
if not cwd:
|
||||
continue
|
||||
command = os.path.join(cwd, os.path.basename(command) if ":" in command else command)
|
||||
command = os.path.normpath(command)
|
||||
if command.lower().startswith(directory):
|
||||
running[(info["pid"], created)] = command
|
||||
return running
|
||||
|
||||
|
||||
def _read_imports(pe: pefile.PE) -> set[str]:
|
||||
imports = set()
|
||||
for directory_name in ("DIRECTORY_ENTRY_IMPORT", "DIRECTORY_ENTRY_DELAY_IMPORT"):
|
||||
@@ -288,9 +319,12 @@ def _analyze_pe(executable: str) -> tuple[str, dict[str, list[str]]]:
|
||||
try:
|
||||
optional_header = getattr(pe, "OPTIONAL_HEADER", None)
|
||||
data_directories = getattr(optional_header, "DATA_DIRECTORY", [])
|
||||
clr = data_directories[
|
||||
pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR"]
|
||||
descriptor_index = pefile.DIRECTORY_ENTRY[
|
||||
"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR"
|
||||
]
|
||||
if not isinstance(descriptor_index, int):
|
||||
raise IndexError
|
||||
clr = data_directories[descriptor_index]
|
||||
if clr.VirtualAddress and ".NET Framework" not in findings.setdefault("Runtimes", []):
|
||||
findings["Runtimes"].append(".NET Framework")
|
||||
except (AttributeError, IndexError):
|
||||
@@ -420,6 +454,8 @@ def _compatibility_suggestions(
|
||||
)
|
||||
if uses_directx_8_11 and environment.get("PW_VULKAN_USE") == "0":
|
||||
suggestions.append("Switch from WineD3D to DXVK for DirectX 8-11.")
|
||||
if environment.get("PW_USE_OPTISCALER") == "1":
|
||||
suggestions.append("Temporarily disable OptiScaler in the game settings and retry to check for a conflict.")
|
||||
if _uses_integrated_gpu(environment):
|
||||
suggestions.append("Use the discrete GPU.")
|
||||
runtimes = findings.get("Runtimes", [])
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Base configuration class for PortProtonQt."""
|
||||
import os
|
||||
import configparser
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.config.validators import validate_string, validate_int, validate_bool, ValidationError
|
||||
@@ -24,7 +25,27 @@ THEMES_DIRS = [
|
||||
]
|
||||
|
||||
# Cache paths
|
||||
CACHE_DIR = Path(os.getenv("XDG_CACHE_HOME", Path.home() / ".cache")) / "PortProtonQt"
|
||||
CACHE_DIR = XDG_DATA_HOME / "PortProtonQt" / "cache"
|
||||
LEGACY_CACHE_DIR = Path(os.getenv("XDG_CACHE_HOME", Path.home() / ".cache")) / "PortProtonQt"
|
||||
|
||||
|
||||
# Remove after the legacy cache migration period.
|
||||
def _migrate_legacy_cache() -> None:
|
||||
"""Move the legacy XDG cache into persistent application data."""
|
||||
if not LEGACY_CACHE_DIR.is_dir():
|
||||
return
|
||||
try:
|
||||
if not CACHE_DIR.exists():
|
||||
CACHE_DIR.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.move(str(LEGACY_CACHE_DIR), str(CACHE_DIR))
|
||||
return
|
||||
shutil.copytree(LEGACY_CACHE_DIR, CACHE_DIR, dirs_exist_ok=True)
|
||||
shutil.rmtree(LEGACY_CACHE_DIR)
|
||||
except OSError as error:
|
||||
logger.warning("Failed to migrate legacy cache directory: %s", error)
|
||||
|
||||
|
||||
_migrate_legacy_cache()
|
||||
|
||||
# Module-level cache storage
|
||||
_config_cache: dict[str, configparser.ConfigParser] = {}
|
||||
|
||||
@@ -164,13 +164,19 @@ def get_portproton_scripts_path() -> str | None:
|
||||
if appimage_path:
|
||||
appimage_root = Path(sys.executable).resolve().parent.parent
|
||||
prefixes.append(("AppImage executable", appimage_root))
|
||||
if os.getenv("FLATPAK_ID"):
|
||||
prefixes.append(("Flatpak package", Path("/app")))
|
||||
prefixes.append(("system package", Path("/usr")))
|
||||
xdg_scripts_dirs = [
|
||||
("XDG data", Path(data_dir) / "portproton" / "scripts")
|
||||
for data_dir in os.getenv(
|
||||
"XDG_DATA_DIRS", "/usr/local/share:/usr/share"
|
||||
).split(os.pathsep)
|
||||
if data_dir
|
||||
]
|
||||
|
||||
scripts_dirs = (
|
||||
("repository", Path.cwd() / "build-aux" / "share" / "portproton" / "scripts"),
|
||||
*[(source, prefix / "share" / "portproton" / "scripts") for source, prefix in prefixes],
|
||||
*xdg_scripts_dirs,
|
||||
)
|
||||
for source, scripts_dir in scripts_dirs:
|
||||
if (scripts_dir / "start.sh").is_file():
|
||||
@@ -283,6 +289,7 @@ def _get_desktop_paths(desktop_dir: str | None) -> tuple[str, ...]:
|
||||
return (os.path.join(os.path.expanduser("~"), "Desktop"),)
|
||||
|
||||
|
||||
# Remove after the legacy shortcut migration period.
|
||||
def migrate_legacy_shortcut(
|
||||
portproton_path: str,
|
||||
desktop_dir: str | None = None,
|
||||
@@ -448,7 +455,42 @@ def migrate_legacy_shortcut(
|
||||
def parse_desktop_entry(file_path: str) -> configparser.SectionProxy | None:
|
||||
"""Read and parse a .desktop file using configparser."""
|
||||
cp = configparser.ConfigParser(interpolation=None)
|
||||
cp.read(file_path, encoding="utf-8")
|
||||
content = ""
|
||||
try:
|
||||
content = Path(file_path).read_text(encoding="utf-8")
|
||||
cp.read_string(content, source=file_path)
|
||||
except configparser.ParsingError:
|
||||
lines = []
|
||||
for line in content.splitlines():
|
||||
stripped = line.strip()
|
||||
if stripped and "=" not in line and not stripped.startswith(("[", "#", ";")):
|
||||
if not lines or "=" not in lines[-1]:
|
||||
return None
|
||||
lines[-1] = f"{lines[-1]} {stripped}"
|
||||
continue
|
||||
lines.append(line)
|
||||
repaired_content = "\n".join(lines) + ("\n" if content.endswith("\n") else "")
|
||||
try:
|
||||
cp.read_string(repaired_content, source=file_path)
|
||||
except configparser.Error as error:
|
||||
logger.warning("Failed to parse desktop file %s: %s", file_path, error)
|
||||
return None
|
||||
desktop_path = Path(file_path)
|
||||
temp_path = desktop_path.with_name(f".{desktop_path.name}.tmp")
|
||||
try:
|
||||
temp_path.write_text(repaired_content, encoding="utf-8")
|
||||
os.chmod(temp_path, desktop_path.stat().st_mode)
|
||||
os.replace(temp_path, desktop_path)
|
||||
logger.warning("Repaired malformed desktop file %s", file_path)
|
||||
except OSError as error:
|
||||
logger.warning("Failed to save repaired desktop file %s: %s", file_path, error)
|
||||
try:
|
||||
temp_path.unlink(missing_ok=True)
|
||||
except OSError as cleanup_error:
|
||||
logger.debug("Failed to remove temporary file %s: %s", temp_path, cleanup_error)
|
||||
except (configparser.Error, OSError, UnicodeError) as error:
|
||||
logger.warning("Failed to parse desktop file %s: %s", file_path, error)
|
||||
return None
|
||||
if "Desktop Entry" not in cp:
|
||||
return None
|
||||
return cp["Desktop Entry"]
|
||||
@@ -556,6 +598,7 @@ def create_desktop_file(
|
||||
|
||||
if not game_name:
|
||||
game_name = os.path.splitext(os.path.basename(exe_path))[0]
|
||||
game_name = " ".join(game_name.splitlines()).strip()
|
||||
base_path = os.path.join(portproton_path, "data")
|
||||
icon_name = _sanitize_icon_name(game_name)
|
||||
has_icon_source = bool(icon_source and os.path.isfile(icon_source))
|
||||
|
||||
@@ -383,6 +383,27 @@ class UIConfig(BaseConfig):
|
||||
validate_string(mode, "badge_view_mode", min_len=1, max_len=20)
|
||||
self._save_value("badge_view_mode", mode, "str")
|
||||
|
||||
def get_library_layout_mode(self, theme_mode: str = "grid") -> str:
|
||||
"""Get the selected library layout or the theme default."""
|
||||
modes = {"grid", "list", "vertical", "horizontal", "horizontal_top"}
|
||||
mode = self._get_str("library_layout_mode", "theme")
|
||||
return mode if mode in modes else theme_mode.lower()
|
||||
|
||||
def set_library_layout_mode(self, mode: str) -> None:
|
||||
"""Set the library layout mode."""
|
||||
validate_string(mode, "library_layout_mode", min_len=1, max_len=20)
|
||||
self._save_value("library_layout_mode", mode, "str")
|
||||
|
||||
def get_horizontal_card_orientation(self, theme_mode: str) -> str:
|
||||
"""Get the horizontal card orientation or the theme default."""
|
||||
mode = self._get_str("horizontal_card_orientation", "theme")
|
||||
return mode if mode in {"horizontal", "vertical"} else theme_mode
|
||||
|
||||
def set_horizontal_card_orientation(self, mode: str) -> None:
|
||||
"""Set the horizontal card orientation."""
|
||||
validate_string(mode, "horizontal_card_orientation", min_len=1, max_len=20)
|
||||
self._save_value("horizontal_card_orientation", mode, "str")
|
||||
|
||||
def get_economy_mode(self) -> bool:
|
||||
"""Get economy mode setting."""
|
||||
return self._get_download_bool("economy_mode", False)
|
||||
@@ -489,6 +510,15 @@ class UIConfig(BaseConfig):
|
||||
validate_bool(enabled, "crash_reports_enabled")
|
||||
self._save_value("crash_reports_enabled", enabled, "bool")
|
||||
|
||||
def get_disable_alt_i586_dependency_check(self) -> bool:
|
||||
"""Get ALT i586 dependency check setting."""
|
||||
return self._get_bool("disable_alt_i586_dependency_check", False)
|
||||
|
||||
def set_disable_alt_i586_dependency_check(self, enabled: bool) -> None:
|
||||
"""Set ALT i586 dependency check setting."""
|
||||
validate_bool(enabled, "disable_alt_i586_dependency_check")
|
||||
self._save_value("disable_alt_i586_dependency_check", enabled, "bool")
|
||||
|
||||
|
||||
def load_theme_metainfo(theme_name: str) -> dict:
|
||||
"""Load theme metadata from metainfo.ini."""
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
import glob
|
||||
import shutil
|
||||
import tempfile
|
||||
from typing import TYPE_CHECKING
|
||||
from PySide6.QtWidgets import QMessageBox, QDialog, QMenu, QLineEdit, QApplication, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QFrame
|
||||
from PySide6.QtCore import QUrl, QPoint, QObject, Signal, Qt, QStandardPaths, QTimer, QSize, QProcess
|
||||
from PySide6.QtGui import QDesktopServices, QIcon, QKeySequence
|
||||
@@ -34,6 +35,9 @@ from portprotonqt.image_utils import COVER_IMAGE_EXTENSIONS
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from portprotonqt.game_card import GameCard
|
||||
|
||||
class ContextMenuSignals(QObject):
|
||||
"""Signals for thread-safe UI updates from worker threads."""
|
||||
show_warning_dialog = Signal(str, str)
|
||||
@@ -544,6 +548,14 @@ class ContextMenuManager:
|
||||
import_action.triggered.connect(
|
||||
lambda: self.parent._import_gog_game(game)
|
||||
)
|
||||
edit_action = menu.addAction(self._get_safe_icon("edit"), _("Edit Shortcut"))
|
||||
edit_action.triggered.connect(
|
||||
lambda: self._edit_id_shortcut(
|
||||
game_card.name,
|
||||
game_card.cover_path,
|
||||
("gog", str(game_card.appid)),
|
||||
)
|
||||
)
|
||||
|
||||
if game_card.game_source == "egs":
|
||||
app_id = str(game_card.appid)
|
||||
@@ -607,6 +619,12 @@ class ContextMenuManager:
|
||||
import_action.triggered.connect(
|
||||
lambda: self.parent._import_egs_game(app_id)
|
||||
)
|
||||
edit_action = menu.addAction(self._get_safe_icon("edit"), _("Edit Shortcut"))
|
||||
edit_action.triggered.connect(
|
||||
lambda: self._edit_id_shortcut(
|
||||
game_card.name, game_card.cover_path, ("egs", app_id)
|
||||
)
|
||||
)
|
||||
|
||||
if game_card.game_source == "steam":
|
||||
desktop_dir = QStandardPaths.writableLocation(
|
||||
@@ -1007,7 +1025,7 @@ class ContextMenuManager:
|
||||
if not resolved_exec_line:
|
||||
return
|
||||
shortcut_paths = self._get_installed_shortcut_paths(game_name)
|
||||
exe_path = self._parse_exe_path(resolved_exec_line, game_name)
|
||||
exe_path = extract_exec_target_path(resolved_exec_line)
|
||||
if not self._remove_file(
|
||||
desktop_path,
|
||||
_("Failed to delete .desktop file: {error}"),
|
||||
@@ -1284,29 +1302,34 @@ class ContextMenuManager:
|
||||
):
|
||||
self._update_desktop_database()
|
||||
|
||||
def _edit_steam_shortcut(self, game_name: str, appid: int | str, cover_path: str) -> None:
|
||||
appid_str = str(appid).strip()
|
||||
if not appid_str.isdigit():
|
||||
logger.warning("Invalid Steam appid for shortcut editing: %s", appid)
|
||||
def _edit_id_shortcut(self, game_name: str, cover_path: str,
|
||||
store: tuple[str, str]) -> None:
|
||||
source, app_id = store
|
||||
app_id = str(app_id).strip()
|
||||
invalid_path = app_id in {".", ".."} or os.path.basename(app_id) != app_id
|
||||
if not app_id or invalid_path or (source == "steam" and not app_id.isdigit()):
|
||||
logger.warning("Invalid %s game ID for shortcut editing: %s", source, app_id)
|
||||
return
|
||||
dialog = AddGameDialog(parent=self.parent, theme=self.theme, edit_mode=True,
|
||||
game_name=game_name, cover_path=cover_path, steam_appid=appid_str)
|
||||
game_name=game_name, cover_path=cover_path, steam_appid=app_id)
|
||||
if dialog.exec() != QDialog.DialogCode.Accepted:
|
||||
return
|
||||
new_name = dialog.nameEdit.text().strip()
|
||||
if not new_name:
|
||||
return
|
||||
selected_cover = dialog.coverEdit.text().strip()
|
||||
if not os.path.isfile(selected_cover) and dialog.last_cover_path and os.path.isfile(dialog.last_cover_path):
|
||||
if (not os.path.isfile(selected_cover) and dialog.last_cover_path
|
||||
and os.path.isfile(dialog.last_cover_path)):
|
||||
selected_cover = dialog.last_cover_path
|
||||
xdg_data_home = os.getenv(
|
||||
"XDG_DATA_HOME", os.path.join(os.path.expanduser("~"), ".local", "share")
|
||||
)
|
||||
game_dir = os.path.join(xdg_data_home, "PortProtonQt", "custom_data", appid_str)
|
||||
default_data_home = os.path.join(os.path.expanduser("~"), ".local", "share")
|
||||
xdg_data_home = os.getenv("XDG_DATA_HOME", default_data_home)
|
||||
game_dir = os.path.join(xdg_data_home, "PortProtonQt", "custom_data",
|
||||
f"{source}-{app_id}")
|
||||
try:
|
||||
os.makedirs(game_dir, exist_ok=True)
|
||||
clean_name = new_name.replace("\r", " ").replace("\n", " ").strip()
|
||||
with open(os.path.join(game_dir, "metadata.txt"), "w", encoding="utf-8") as metadata_file:
|
||||
metadata_path = os.path.join(game_dir, "metadata.txt")
|
||||
with open(metadata_path, "w", encoding="utf-8") as metadata_file:
|
||||
metadata_file.write(f"name={clean_name}\n")
|
||||
if selected_cover and os.path.isfile(selected_cover):
|
||||
extension = os.path.splitext(selected_cover)[1].lower()
|
||||
@@ -1318,22 +1341,90 @@ class ContextMenuManager:
|
||||
shutil.copyfile(selected_cover, target_cover)
|
||||
cover_path = target_cover
|
||||
except OSError as e:
|
||||
self.signals.show_warning_dialog.emit(
|
||||
_("Error"), _("Failed to save custom data: {error}").format(error=str(e))
|
||||
)
|
||||
message = _("Failed to save custom data: {error}").format(error=str(e))
|
||||
self.signals.show_warning_dialog.emit(_("Error"), message)
|
||||
return
|
||||
for game in self.game_library_manager.games:
|
||||
if str(game[3]) != appid_str or game[12] != "steam":
|
||||
if str(game[3]) != app_id or game[12] != source:
|
||||
continue
|
||||
updated_game = list(game)
|
||||
updated_game[0] = new_name
|
||||
updated_game[2] = cover_path
|
||||
self.game_library_manager.replace_game_incremental(
|
||||
game[0], game[5], tuple(updated_game)
|
||||
)
|
||||
self.game_library_manager.replace_game_incremental(game[0], game[5], tuple(updated_game))
|
||||
QTimer.singleShot(0, self.game_library_manager.load_visible_images)
|
||||
return
|
||||
|
||||
def handle_missing_executable(self, game_card: "GameCard") -> None:
|
||||
"""Offer removal or shortcut repair when the launch file is missing."""
|
||||
msg_box = QMessageBox(self.parent)
|
||||
msg_box.setIcon(QMessageBox.Icon.Question)
|
||||
msg_box.setWindowTitle(_("Executable not found"))
|
||||
msg_box.setText(_("Executable not found: {0}").format(game_card.missing_executable_path))
|
||||
delete_button = msg_box.addButton(_("Delete from PortProton"), QMessageBox.ButtonRole.DestructiveRole)
|
||||
edit_button = msg_box.addButton(_("Select another executable"), QMessageBox.ButtonRole.ActionRole)
|
||||
msg_box.addButton(QMessageBox.StandardButton.Cancel)
|
||||
for button in msg_box.buttons():
|
||||
button.ensurePolished()
|
||||
button.setMinimumWidth(button.sizeHint().width())
|
||||
msg_box.exec()
|
||||
if msg_box.clickedButton() == delete_button:
|
||||
self.delete_game(game_card.name, game_card.exec_line)
|
||||
elif msg_box.clickedButton() == edit_button:
|
||||
self.edit_game_shortcut(game_card.name, game_card.exec_line, game_card.cover_path)
|
||||
|
||||
def _relocate_shortcut_data(self, old_exe: str, new_exe: str) -> list[tuple[str, str]]:
|
||||
"""Move path-specific data, refusing to overwrite another game's data."""
|
||||
if os.path.abspath(old_exe) == os.path.abspath(new_exe):
|
||||
return []
|
||||
data_home = os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share"))
|
||||
custom_root = os.path.join(data_home, "PortProtonQt", "custom_data")
|
||||
old_folder = resolve_custom_data_dir(custom_root, old_exe)
|
||||
new_folder = os.path.join(custom_root, get_custom_data_dir_name(new_exe))
|
||||
paths = [(old_folder, new_folder), (old_exe + ".ppdb", new_exe + ".ppdb")]
|
||||
moves = [(source, target) for source, target in paths if os.path.exists(source)]
|
||||
for _source, target in moves:
|
||||
if os.path.lexists(target):
|
||||
raise FileExistsError(_("File already exists: {file_name}").format(file_name=target))
|
||||
completed = []
|
||||
try:
|
||||
for source, target in moves:
|
||||
shutil.move(source, target)
|
||||
completed.append((source, target))
|
||||
except OSError:
|
||||
for source, target in reversed(completed):
|
||||
shutil.move(target, source)
|
||||
raise
|
||||
return completed
|
||||
|
||||
def _relocate_shortcut_statistics(self, old_exe: str, new_exe: str) -> None:
|
||||
"""Keep playtime and last launch associated with a repaired shortcut."""
|
||||
from portprotonqt.time_utils import get_last_launch_path, get_statistics_path
|
||||
|
||||
old_name = os.path.splitext(os.path.basename(old_exe))[0]
|
||||
new_name = os.path.splitext(os.path.basename(new_exe))[0]
|
||||
last_launch_path = get_last_launch_path()
|
||||
records = (
|
||||
(get_statistics_path(), os.path.normpath(old_exe).replace(" ", "#@_@#"), new_exe.replace(" ", "#@_@#")),
|
||||
(last_launch_path, old_name, new_name),
|
||||
)
|
||||
for path, old_key, new_key in records:
|
||||
if not os.path.isfile(path):
|
||||
continue
|
||||
try:
|
||||
with open(path, encoding="utf-8") as stream:
|
||||
lines = stream.readlines()
|
||||
updated = []
|
||||
for line in lines:
|
||||
parts = line.rsplit(maxsplit=1) if path == last_launch_path else line.split(maxsplit=1)
|
||||
if len(parts) == 2 and parts[0] == old_key:
|
||||
line = f"{new_key} {parts[1].rstrip()}\n"
|
||||
updated.append(line)
|
||||
if updated != lines:
|
||||
with open(path, "w", encoding="utf-8") as stream:
|
||||
stream.writelines(updated)
|
||||
except OSError as error:
|
||||
logger.warning("Failed to relocate statistics for %s: %s", old_exe, error)
|
||||
|
||||
def edit_game_shortcut(self, game_name, exec_line, cover_path, appid=None):
|
||||
"""
|
||||
Opens a dialog allowing the user to edit a game shortcut in edit mode to modify an existing .desktop file.
|
||||
@@ -1344,7 +1435,7 @@ class ContextMenuManager:
|
||||
cover_path: The path to the game's cover image.
|
||||
"""
|
||||
if appid is not None:
|
||||
self._edit_steam_shortcut(game_name, appid, cover_path)
|
||||
self._edit_id_shortcut(game_name, cover_path, ("steam", str(appid)))
|
||||
return
|
||||
if not self._check_portproton():
|
||||
return
|
||||
@@ -1352,7 +1443,7 @@ class ContextMenuManager:
|
||||
if not exec_line:
|
||||
return
|
||||
old_exec_line = exec_line
|
||||
exe_path = self._parse_exe_path(exec_line, game_name)
|
||||
exe_path = extract_exec_target_path(exec_line)
|
||||
if not exe_path:
|
||||
return
|
||||
dialog = AddGameDialog(
|
||||
@@ -1383,6 +1474,27 @@ class ContextMenuManager:
|
||||
return
|
||||
|
||||
old_path = self._get_desktop_path(game_name)
|
||||
moved_paths = []
|
||||
try:
|
||||
moved_paths = self._relocate_shortcut_data(exe_path, new_exe_path)
|
||||
with open(new_desktop_path, "w", encoding="utf-8") as f:
|
||||
f.write(desktop_entry)
|
||||
os.chmod(new_desktop_path, 0o755)
|
||||
except OSError as e:
|
||||
for source, target in reversed(moved_paths):
|
||||
shutil.move(target, source)
|
||||
self.signals.show_warning_dialog.emit(
|
||||
_("Error"),
|
||||
_("Failed to save .desktop file: {error}").format(error=str(e))
|
||||
)
|
||||
return
|
||||
for source, target in moved_paths:
|
||||
if new_cover_path.startswith(source + os.sep):
|
||||
new_cover_path = target + new_cover_path[len(source):]
|
||||
if dialog.last_cover_path and dialog.last_cover_path.startswith(source + os.sep):
|
||||
dialog.last_cover_path = target + dialog.last_cover_path[len(source):]
|
||||
if exe_path != new_exe_path:
|
||||
self._relocate_shortcut_statistics(exe_path, new_exe_path)
|
||||
if game_name != new_name and os.path.exists(old_path):
|
||||
self._remove_file(
|
||||
old_path,
|
||||
@@ -1390,17 +1502,6 @@ class ContextMenuManager:
|
||||
_("Removed old .desktop file for '{game_name}'"),
|
||||
game_name
|
||||
)
|
||||
|
||||
try:
|
||||
with open(new_desktop_path, "w", encoding="utf-8") as f:
|
||||
f.write(desktop_entry)
|
||||
os.chmod(new_desktop_path, 0o755)
|
||||
except OSError as e:
|
||||
self.signals.show_warning_dialog.emit(
|
||||
_("Error"),
|
||||
_("Failed to save .desktop file: {error}").format(error=str(e))
|
||||
)
|
||||
return
|
||||
saved_entry = parse_desktop_entry(new_desktop_path)
|
||||
updated_exec_line = new_exe_path
|
||||
if saved_entry:
|
||||
@@ -1461,8 +1562,8 @@ class ContextMenuManager:
|
||||
old_menu_path = self._get_menu_shortcut_path(game_name)
|
||||
new_menu_path = self._get_menu_shortcut_path(new_name)
|
||||
desktop_dir = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.DesktopLocation)
|
||||
old_desktop_path = os.path.join(desktop_dir, f"{game_name}.desktop")
|
||||
new_desktop_path_target = os.path.join(desktop_dir, f"{new_name}.desktop")
|
||||
old_desktop_path = self._get_shortcut_path(game_name, desktop_dir)
|
||||
new_desktop_path_target = self._get_shortcut_path(new_name, desktop_dir)
|
||||
|
||||
if game_name != new_name:
|
||||
if os.path.exists(old_menu_path):
|
||||
@@ -1473,19 +1574,22 @@ class ContextMenuManager:
|
||||
self.remove_from_steam(game_name, new_exe_path, "portproton")
|
||||
|
||||
if dialog.add_to_menu_checkbox.isChecked():
|
||||
if not os.path.exists(new_menu_path):
|
||||
if exe_path != new_exe_path or not os.path.exists(new_menu_path):
|
||||
self.add_to_menu(new_name, updated_exec_line)
|
||||
elif os.path.exists(new_menu_path):
|
||||
self.remove_from_menu(new_name)
|
||||
|
||||
if dialog.add_to_desktop_checkbox.isChecked():
|
||||
if not os.path.exists(new_desktop_path_target):
|
||||
if exe_path != new_exe_path or not os.path.exists(new_desktop_path_target):
|
||||
self.add_to_desktop(new_name, updated_exec_line)
|
||||
elif os.path.exists(new_desktop_path_target):
|
||||
self.remove_from_desktop(new_name)
|
||||
|
||||
is_in_steam = is_game_in_steam(new_name)
|
||||
if dialog.add_to_steam_checkbox.isChecked():
|
||||
if is_in_steam and exe_path != new_exe_path:
|
||||
self.remove_from_steam(new_name, old_exec_line, "portproton")
|
||||
is_in_steam = False
|
||||
if not is_in_steam:
|
||||
self.add_to_steam(new_name, updated_exec_line, new_cover_path)
|
||||
elif is_in_steam:
|
||||
@@ -1569,7 +1673,7 @@ class ContextMenuManager:
|
||||
exec_line = self._get_exec_line(game_name, exec_line)
|
||||
if not exec_line:
|
||||
return
|
||||
exe_path = self._parse_exe_path(exec_line, game_name)
|
||||
exe_path = extract_exec_target_path(exec_line)
|
||||
if not exe_path:
|
||||
return
|
||||
logger.debug("Removing game '%s' from Steam", game_name)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
from PySide6.QtWidgets import QLabel, QPushButton, QStyle, QStyleOptionButton, QWidget, QLayout, QLayoutItem, QScrollArea, QGraphicsOpacityEffect, QComboBox
|
||||
from PySide6.QtCore import Qt, Signal, QRect, QRectF, QSize, Property, QPropertyAnimation, QEasingCurve, QTimer, QEvent
|
||||
from PySide6.QtGui import QFont, QFontMetrics, QIcon, QPainter, QPalette, QColor
|
||||
from PySide6.QtGui import QFont, QFontMetrics, QIcon, QPainter, QPalette, QColor, QWheelEvent
|
||||
from PySide6.QtSvg import QSvgRenderer
|
||||
from portprotonqt.theme_manager import ThemeManager
|
||||
from portprotonqt.config import ui_config
|
||||
@@ -547,7 +547,8 @@ class AutoSizeButton(QPushButton):
|
||||
self.current_theme_name = selected_theme
|
||||
self.theme = self.theme_manager.apply_theme(selected_theme)
|
||||
|
||||
if padding is None:
|
||||
self._uses_theme_padding = padding is None
|
||||
if self._uses_theme_padding:
|
||||
padding = getattr(self.theme, 'autoSizeButtonPadding', 20)
|
||||
|
||||
self._pad_top, self._pad_bottom, self._pad_left, self._pad_right = self._normalize_padding(padding)
|
||||
@@ -574,6 +575,18 @@ class AutoSizeButton(QPushButton):
|
||||
|
||||
self.adjustFontSize()
|
||||
|
||||
def refresh_theme(self, theme: object) -> None:
|
||||
"""Refresh sizing values supplied by the active theme."""
|
||||
self.theme = theme
|
||||
if not self._uses_theme_padding:
|
||||
return
|
||||
padding = getattr(theme, "autoSizeButtonPadding", 20)
|
||||
self._pad_top, self._pad_bottom, self._pad_left, self._pad_right = (
|
||||
self._normalize_padding(padding)
|
||||
)
|
||||
self.adjustFontSize()
|
||||
self.updateGeometry()
|
||||
|
||||
def _extract_icon_name(self, icon_path):
|
||||
if isinstance(icon_path, str):
|
||||
base = os.path.basename(icon_path)
|
||||
@@ -845,18 +858,30 @@ class AutoHideScrollArea(QScrollArea):
|
||||
self.setStyleSheet(self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
|
||||
self._v_scrollbar = self.verticalScrollBar()
|
||||
self._h_scrollbar = self.horizontalScrollBar()
|
||||
self._v_scrollbar.installEventFilter(self)
|
||||
self._h_scrollbar.installEventFilter(self)
|
||||
|
||||
self._opacity_effect = QGraphicsOpacityEffect(self._v_scrollbar)
|
||||
self._opacity_effect.setOpacity(0.0)
|
||||
self._v_scrollbar.setGraphicsEffect(self._opacity_effect)
|
||||
|
||||
self._h_opacity_effect = QGraphicsOpacityEffect(self._h_scrollbar)
|
||||
self._h_opacity_effect.setOpacity(0.0)
|
||||
self._h_scrollbar.setGraphicsEffect(self._h_opacity_effect)
|
||||
|
||||
self._fade_animation = QPropertyAnimation(self._opacity_effect, b"opacity")
|
||||
self._fade_animation.setDuration(self.fade_duration_ms)
|
||||
self._fade_animation.setEasingCurve(QEasingCurve.Type.InOutCubic)
|
||||
|
||||
self._h_fade_animation = QPropertyAnimation(self._h_opacity_effect, b"opacity")
|
||||
self._h_fade_animation.setDuration(self.fade_duration_ms)
|
||||
self._h_fade_animation.setEasingCurve(QEasingCurve.Type.InOutCubic)
|
||||
|
||||
self._is_visible = False
|
||||
self._scroll_needed = False
|
||||
self._h_is_visible = False
|
||||
self._h_scroll_needed = False
|
||||
|
||||
self._apply_visible_style()
|
||||
|
||||
@@ -864,7 +889,12 @@ class AutoHideScrollArea(QScrollArea):
|
||||
self._hide_timer.setSingleShot(True)
|
||||
self._hide_timer.timeout.connect(self._start_fade_out)
|
||||
|
||||
self._h_hide_timer = QTimer(self)
|
||||
self._h_hide_timer.setSingleShot(True)
|
||||
self._h_hide_timer.timeout.connect(self._start_horizontal_fade_out)
|
||||
|
||||
self._v_scrollbar.valueChanged.connect(self._on_scroll)
|
||||
self._h_scrollbar.valueChanged.connect(self._on_horizontal_scroll)
|
||||
|
||||
self.viewport().installEventFilter(self)
|
||||
initial_widget = self.widget()
|
||||
@@ -875,6 +905,25 @@ class AutoHideScrollArea(QScrollArea):
|
||||
|
||||
def _apply_visible_style(self) -> None:
|
||||
self._v_scrollbar.setStyleSheet(self.theme.SCROLL_STYLE)
|
||||
self._h_scrollbar.setStyleSheet(self.theme.SCROLL_STYLE)
|
||||
|
||||
def _start_horizontal_fade_in(self) -> None:
|
||||
if not self._h_scroll_needed:
|
||||
return
|
||||
self._h_fade_animation.stop()
|
||||
self._h_fade_animation.setStartValue(self._h_opacity_effect.opacity())
|
||||
self._h_fade_animation.setEndValue(1.0)
|
||||
self._h_fade_animation.start()
|
||||
self._h_is_visible = True
|
||||
|
||||
def _start_horizontal_fade_out(self) -> None:
|
||||
if not self._h_scroll_needed:
|
||||
return
|
||||
self._h_fade_animation.stop()
|
||||
self._h_fade_animation.setStartValue(self._h_opacity_effect.opacity())
|
||||
self._h_fade_animation.setEndValue(0.0)
|
||||
self._h_fade_animation.start()
|
||||
self._h_is_visible = False
|
||||
|
||||
def _start_fade_in(self) -> None:
|
||||
if not self._scroll_needed:
|
||||
@@ -899,17 +948,28 @@ class AutoHideScrollArea(QScrollArea):
|
||||
self._opacity_effect.setOpacity(opacity)
|
||||
self._is_visible = opacity == 1.0
|
||||
|
||||
def _set_horizontal_opacity_immediately(self, opacity: float) -> None:
|
||||
self._h_fade_animation.stop()
|
||||
self._h_opacity_effect.setOpacity(opacity)
|
||||
self._h_is_visible = opacity == 1.0
|
||||
|
||||
def _update_scroll_needed(self) -> None:
|
||||
widget = self.widget()
|
||||
if widget is None:
|
||||
self._scroll_needed = False
|
||||
self._h_scroll_needed = False
|
||||
self._set_opacity_immediately(0.0)
|
||||
self._set_horizontal_opacity_immediately(0.0)
|
||||
self._hide_timer.stop()
|
||||
self._h_hide_timer.stop()
|
||||
return
|
||||
|
||||
content_height = widget.sizeHint().height()
|
||||
content_width = widget.sizeHint().width()
|
||||
viewport_height = self.viewport().height()
|
||||
viewport_width = self.viewport().width()
|
||||
self._scroll_needed = content_height > viewport_height
|
||||
self._h_scroll_needed = content_width > viewport_width
|
||||
|
||||
if not self._scroll_needed:
|
||||
self._set_opacity_immediately(0.0)
|
||||
@@ -918,23 +978,46 @@ class AutoHideScrollArea(QScrollArea):
|
||||
if not self._is_visible:
|
||||
self._set_opacity_immediately(0.0)
|
||||
|
||||
if not self._h_scroll_needed:
|
||||
self._set_horizontal_opacity_immediately(0.0)
|
||||
self._h_hide_timer.stop()
|
||||
elif not self._h_is_visible:
|
||||
self._set_horizontal_opacity_immediately(0.0)
|
||||
|
||||
def _on_scroll(self, value: int) -> None:
|
||||
if not self._scroll_needed:
|
||||
return
|
||||
self._start_fade_in()
|
||||
self._hide_timer.start(self.hide_delay_ms)
|
||||
|
||||
def _on_horizontal_scroll(self, value: int) -> None:
|
||||
if not self._h_scroll_needed:
|
||||
return
|
||||
self._start_horizontal_fade_in()
|
||||
self._h_hide_timer.start(self.hide_delay_ms)
|
||||
|
||||
def enterEvent(self, event):
|
||||
if self._scroll_needed:
|
||||
self._start_fade_in()
|
||||
self._hide_timer.start(self.hide_delay_ms)
|
||||
if self._h_scroll_needed:
|
||||
self._start_horizontal_fade_in()
|
||||
self._h_hide_timer.start(self.hide_delay_ms)
|
||||
|
||||
def leaveEvent(self, event):
|
||||
if self._scroll_needed and self._is_visible:
|
||||
self._hide_timer.start(self.hide_delay_ms)
|
||||
if self._h_scroll_needed and self._h_is_visible:
|
||||
self._h_hide_timer.start(self.hide_delay_ms)
|
||||
|
||||
def wheelEvent(self, event: QWheelEvent) -> None:
|
||||
if self._v_scrollbar.maximum() == 0 and self._h_scrollbar.maximum() > 0:
|
||||
self._h_scrollbar.event(event)
|
||||
return
|
||||
super().wheelEvent(event)
|
||||
|
||||
def eventFilter(self, obj, event):
|
||||
if not hasattr(self, "_v_scrollbar"):
|
||||
if not hasattr(self, "_v_scrollbar") or not hasattr(self, "_h_scrollbar"):
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
if event.type() == QEvent.Type.Resize:
|
||||
@@ -947,6 +1030,14 @@ class AutoHideScrollArea(QScrollArea):
|
||||
elif event.type() == QEvent.Type.Leave:
|
||||
if self._scroll_needed and self._is_visible:
|
||||
self._hide_timer.start(self.hide_delay_ms)
|
||||
elif obj == self._h_scrollbar:
|
||||
if event.type() == QEvent.Type.Enter:
|
||||
if self._h_scroll_needed:
|
||||
self._start_horizontal_fade_in()
|
||||
self._h_hide_timer.start(self.hide_delay_ms)
|
||||
elif event.type() == QEvent.Type.Leave:
|
||||
if self._h_scroll_needed and self._h_is_visible:
|
||||
self._h_hide_timer.start(self.hide_delay_ms)
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
def setWidget(self, widget: QWidget | None) -> None:
|
||||
|
||||
@@ -613,16 +613,23 @@ class DetailPageManager:
|
||||
)
|
||||
buttons_layout.addWidget(play_button)
|
||||
|
||||
if str(game_source).lower() == "steam" and appid:
|
||||
if source in {"steam", "gog", "egs"} and appid:
|
||||
edit_button = self._make_action_button(
|
||||
_("Edit Shortcut"),
|
||||
self.main_window.theme_manager.get_icon("edit", as_path=True),
|
||||
)
|
||||
edit_button.clicked.connect(
|
||||
lambda: self.main_window.context_menu_manager.edit_game_shortcut(
|
||||
game_name, exec_line, cover_path, appid
|
||||
if source == "steam":
|
||||
edit_button.clicked.connect(
|
||||
lambda: self.main_window.context_menu_manager.edit_game_shortcut(
|
||||
game_name, exec_line, cover_path, appid
|
||||
)
|
||||
)
|
||||
else:
|
||||
edit_button.clicked.connect(
|
||||
lambda: self.main_window.context_menu_manager._edit_id_shortcut(
|
||||
game_name, cover_path, (source, str(appid))
|
||||
)
|
||||
)
|
||||
)
|
||||
buttons_layout.addWidget(edit_button)
|
||||
elif self._has_game_shortcut(game_name):
|
||||
edit_button = self._make_action_button(
|
||||
@@ -1441,6 +1448,8 @@ class DetailPageManager:
|
||||
resolved_exe_path = self.main_window.resolve_launch_file_path(exe_path)
|
||||
if resolved_exe_path is None:
|
||||
return
|
||||
if not self.main_window._check_alt_i586_dependencies_before_launch():
|
||||
return
|
||||
|
||||
start_command = get_portproton_start_command()
|
||||
if not start_command:
|
||||
|
||||
@@ -418,14 +418,13 @@ class ProtonManager(DraggableDialog):
|
||||
|
||||
def filter_entries_by_cpu_level(self, entries, source_name):
|
||||
is_arm = platform.machine().lower().startswith(('arm', 'aarch64'))
|
||||
if not is_arm:
|
||||
entries = [
|
||||
entry for entry in entries
|
||||
if 'aarch64' not in entry.get('name', '').lower()
|
||||
and '-arm' not in entry.get('name', '').lower()
|
||||
and 'aarch64' not in entry.get('url', '').lower()
|
||||
and '-arm' not in entry.get('url', '').lower()
|
||||
]
|
||||
filtered_entries = []
|
||||
for entry in entries:
|
||||
entry_info = f"{entry.get('name', '')} {entry.get('url', '')}".lower()
|
||||
entry_is_arm = 'aarch64' in entry_info or '-arm' in entry_info
|
||||
if entry_is_arm == is_arm:
|
||||
filtered_entries.append(entry)
|
||||
entries = filtered_entries
|
||||
if source_name.lower() != 'proton_cachyos':
|
||||
return entries
|
||||
if self.cpu_level >= 4:
|
||||
|
||||
@@ -45,6 +45,7 @@ from portprotonqt.dialogs.settings_vkbasalt import VKBASALT_ENV_KEYS, VkBasaltSe
|
||||
from portprotonqt.localization import _, format_setting_name_for_display
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.preloader import Preloader
|
||||
from portprotonqt.qt_utils import get_screen_info, get_system_dpi_for_wine
|
||||
from portprotonqt.settings_manager import (
|
||||
ADVANCED_SETTING_KEYS,
|
||||
get_available_prefix_options,
|
||||
@@ -65,8 +66,11 @@ TOGGLE_BOOL_KEYS = {
|
||||
'PW_VKBASALT',
|
||||
'PW_VKBASALT_USER_CONF',
|
||||
}
|
||||
|
||||
|
||||
DEFAULT_WINE_SETTING_KEYS = {
|
||||
'PW_WINE_USE': 'PW_DEFAULT_WINE_USE',
|
||||
'PW_PREFIX_NAME': 'PW_DEFAULT_PREFIX_NAME',
|
||||
'PW_VULKAN_USE': 'PW_DEFAULT_VULKAN_USE',
|
||||
}
|
||||
def _normalize_prefix_directories(prefixes_dir):
|
||||
if not os.path.isdir(prefixes_dir):
|
||||
return
|
||||
@@ -135,13 +139,15 @@ class ExeSettingsDialog(
|
||||
):
|
||||
"""Dialog for configuring executable-specific settings."""
|
||||
|
||||
def __init__(self, parent=None, theme=None, exe_path=None, appid=None, game_source=None):
|
||||
def __init__(self, parent=None, theme=None, exe_path=None, appid=None, game_source=None,
|
||||
user_conf=False):
|
||||
super().__init__(parent)
|
||||
self.theme = theme if theme else theme_manager.apply_theme(ui_config.get_theme())
|
||||
self.exe_path = exe_path
|
||||
self.appid = appid
|
||||
self.game_source = str(game_source).lower() if game_source else ""
|
||||
if not self.exe_path and not self.appid:
|
||||
self.user_conf = user_conf
|
||||
if not self.user_conf and not self.exe_path and not self.appid:
|
||||
return
|
||||
self.portproton_path = get_portproton_location()
|
||||
if self.portproton_path is None:
|
||||
@@ -154,12 +160,21 @@ class ExeSettingsDialog(
|
||||
|
||||
self.dist_options = []
|
||||
self.lg_dist_aliases = {}
|
||||
self.plugins_ver = ""
|
||||
self.prefix_options = []
|
||||
if self.portproton_path:
|
||||
scripts_path = get_portproton_scripts_path()
|
||||
if scripts_path:
|
||||
var_path = os.path.join(scripts_path, "var")
|
||||
self.lg_dist_aliases = read_lg_dist_versions_from_var(var_path)
|
||||
try:
|
||||
with open(var_path, encoding="utf-8") as var_file:
|
||||
for line in var_file:
|
||||
if line.startswith('export PW_PLUGINS_VER='):
|
||||
self.plugins_ver = line.split('=', 1)[1].strip().strip('"\'')
|
||||
break
|
||||
except OSError as exc:
|
||||
logger.warning("Failed to read PW_PLUGINS_VER: %s", exc)
|
||||
system_wine_label = "" if self.game_source == "steam" else _('System WINE')
|
||||
self.dist_options = get_available_wine_options(
|
||||
self.portproton_path, system_wine_label, self.game_source == "steam"
|
||||
@@ -185,7 +200,7 @@ class ExeSettingsDialog(
|
||||
self.logical_core_options = []
|
||||
self._gamepad_tooltip_map = {}
|
||||
|
||||
self.setWindowTitle(_("Exe Settings"))
|
||||
self.setWindowTitle(_("Global Game Settings") if self.user_conf else _("Exe Settings"))
|
||||
self.setModal(True)
|
||||
self.resize(1100, 720)
|
||||
self.setStyleSheet(self.theme.MAIN_WINDOW_STYLE + self.theme.MESSAGE_BOX_STYLE)
|
||||
@@ -194,6 +209,16 @@ class ExeSettingsDialog(
|
||||
self.toggle_settings = get_toggle_settings()
|
||||
|
||||
self.setup_ui()
|
||||
if self.user_conf:
|
||||
self.open_ppdb_button.clicked.disconnect()
|
||||
self.open_ppdb_button.setText(_("Edit user.conf"))
|
||||
self.open_ppdb_button.clicked.connect(self.open_user_conf)
|
||||
self.clear_ppdb_button.clicked.disconnect()
|
||||
self.clear_ppdb_button.setText(_("Clear All"))
|
||||
self.clear_ppdb_button.clicked.connect(self.clear_user_conf)
|
||||
self.settings_table.horizontalHeader().setSectionResizeMode(
|
||||
1, QHeaderView.ResizeMode.ResizeToContents
|
||||
)
|
||||
app = QApplication.instance()
|
||||
if isinstance(app, QApplication):
|
||||
app.focusChanged.connect(self._on_focus_changed)
|
||||
@@ -472,7 +497,10 @@ class ExeSettingsDialog(
|
||||
|
||||
process = QProcess(self)
|
||||
process.finished.connect(self.on_show_ppdb_finished)
|
||||
args = self._get_process_args(["cli", "--show-ppdb", f"{self.exe_path}"])
|
||||
command = ["cli", "--get-user-conf"] if self.user_conf else [
|
||||
"cli", "--show-ppdb", f"{self.exe_path}"
|
||||
]
|
||||
args = self._get_process_args(command)
|
||||
process.start(args[0], args[1:])
|
||||
|
||||
def on_show_ppdb_finished(self, exit_code, exit_status):
|
||||
@@ -484,6 +512,13 @@ class ExeSettingsDialog(
|
||||
self.logical_core_options = []
|
||||
self.locale_options = []
|
||||
|
||||
if self.user_conf and (
|
||||
exit_code != 0 or exit_status != QProcess.ExitStatus.NormalExit
|
||||
):
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to load global game settings."))
|
||||
self.reject()
|
||||
return
|
||||
|
||||
if exit_code == 0 and exit_status == QProcess.ExitStatus.NormalExit:
|
||||
output = bytes(process.readAllStandardOutput().data()).decode('utf-8', 'ignore')
|
||||
for line in output.splitlines():
|
||||
@@ -504,6 +539,7 @@ class ExeSettingsDialog(
|
||||
if (
|
||||
key in self.toggle_settings
|
||||
or key in ADVANCED_SETTING_KEYS
|
||||
or key in DEFAULT_WINE_SETTING_KEYS.values()
|
||||
or key in MANGOHUD_ENV_KEYS
|
||||
or key in GAMESCOPE_ENV_KEYS
|
||||
or key in VKBASALT_ENV_KEYS
|
||||
@@ -515,6 +551,8 @@ class ExeSettingsDialog(
|
||||
self.current_settings[key] = val
|
||||
except ValueError:
|
||||
continue
|
||||
if self.user_conf and self.plugins_ver:
|
||||
self.current_settings['PW_PLUGINS_VER'] = self.plugins_ver
|
||||
|
||||
if self.game_source == "steam":
|
||||
self.blocked_keys.update({
|
||||
@@ -539,17 +577,18 @@ class ExeSettingsDialog(
|
||||
self.current_settings[key] = ''
|
||||
for key in VKBASALT_ENV_KEYS:
|
||||
self.current_settings[key] = ''
|
||||
else:
|
||||
elif not self.user_conf:
|
||||
self.current_settings.setdefault('PW_MANGOHUD', '0')
|
||||
self.current_settings.setdefault('PW_VKBASALT', '0')
|
||||
|
||||
for key in self.blocked_keys:
|
||||
self.current_settings[key] = '0'
|
||||
|
||||
current_wine_version = self.current_settings.get('PW_WINE_USE')
|
||||
wine_key = 'PW_DEFAULT_WINE_USE' if self.user_conf else 'PW_WINE_USE'
|
||||
current_wine_version = self.current_settings.get(wine_key)
|
||||
if current_wine_version in self.lg_dist_aliases:
|
||||
self.current_settings['PW_WINE_USE'] = self.lg_dist_aliases[current_wine_version]
|
||||
current_wine_version = self.current_settings['PW_WINE_USE']
|
||||
self.current_settings[wine_key] = self.lg_dist_aliases[current_wine_version]
|
||||
current_wine_version = self.current_settings[wine_key]
|
||||
if (
|
||||
current_wine_version
|
||||
and current_wine_version not in self.dist_options
|
||||
@@ -560,7 +599,7 @@ class ExeSettingsDialog(
|
||||
|
||||
self.original_values = self.current_settings.copy()
|
||||
for key in set(self.toggle_settings.keys()):
|
||||
self.original_values.setdefault(key, '0')
|
||||
self.original_values.setdefault(key, '' if self.user_conf else '0')
|
||||
|
||||
self.populate_table()
|
||||
self.populate_advanced()
|
||||
@@ -588,6 +627,14 @@ class ExeSettingsDialog(
|
||||
if not QDesktopServices.openUrl(QUrl.fromLocalFile(db_path)):
|
||||
QMessageBox.critical(self, _("Error"), _("Failed to open PPDB file:\n") + db_path)
|
||||
|
||||
def open_user_conf(self) -> None:
|
||||
user_conf = os.path.join(cast(str, self.portproton_path), "data", "user.conf")
|
||||
if not os.path.exists(user_conf):
|
||||
QMessageBox.critical(self, _("Error"), _("Failed to open file:\n") + user_conf)
|
||||
return
|
||||
if not QDesktopServices.openUrl(QUrl.fromLocalFile(user_conf)):
|
||||
QMessageBox.critical(self, _("Error"), _("Failed to open file:\n") + user_conf)
|
||||
|
||||
def clear_ppdb_file(self):
|
||||
"""Remove the PPDB file and reload settings."""
|
||||
if not self.exe_path:
|
||||
@@ -620,6 +667,40 @@ class ExeSettingsDialog(
|
||||
|
||||
self.load_current_settings()
|
||||
|
||||
def clear_user_conf(self) -> None:
|
||||
msg_box = QMessageBox(self)
|
||||
msg_box.setIcon(QMessageBox.Icon.Question)
|
||||
msg_box.setWindowTitle(_("Confirm Clear"))
|
||||
msg_box.setText(_("Are you sure you want to clear settings? This action cannot be undone."))
|
||||
msg_box.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
|
||||
msg_box.setDefaultButton(QMessageBox.StandardButton.No)
|
||||
msg_box.setButtonText(QMessageBox.StandardButton.Yes, _("Yes"))
|
||||
msg_box.setButtonText(QMessageBox.StandardButton.No, _("No"))
|
||||
if msg_box.exec() != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
|
||||
user_conf = os.path.join(cast(str, self.portproton_path), "data", "user.conf")
|
||||
try:
|
||||
os.remove(user_conf)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except OSError as exc:
|
||||
logger.warning("Failed to remove user.conf: %s", exc)
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to apply changes. Check logs."))
|
||||
return
|
||||
screen_resolution, screen_primary = get_screen_info()
|
||||
self.user_conf_changes = [
|
||||
screen_resolution,
|
||||
screen_primary,
|
||||
f"PW_WINE_DPI_VALUE={get_system_dpi_for_wine()}",
|
||||
]
|
||||
self.user_conf_changes = [
|
||||
change for change in self.user_conf_changes if change.split('=', 1)[1]
|
||||
]
|
||||
self.close_after_user_conf_changes = False
|
||||
self.apply_button.setEnabled(False)
|
||||
self._apply_next_user_conf_change()
|
||||
|
||||
def populate_table(self):
|
||||
"""Populate the table with settings."""
|
||||
self.settings_table.setRowCount(0)
|
||||
@@ -640,27 +721,46 @@ class ExeSettingsDialog(
|
||||
name_item.setData(Qt.ItemDataRole.UserRole, toggle)
|
||||
name_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
|
||||
current_val = self.current_settings.get(toggle, '0')
|
||||
current_val = self.current_settings.get(toggle, '') if self.user_conf else (
|
||||
self.current_settings.get(toggle, '0')
|
||||
)
|
||||
is_blocked = toggle in self.blocked_keys
|
||||
checkbox_widget = QCheckBox()
|
||||
checkbox_widget.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
checkbox_widget.setChecked(current_val == '1' and not is_blocked)
|
||||
checkbox_widget.setEnabled(not is_blocked)
|
||||
checkbox_widget.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
checkbox_widget.installEventFilter(self)
|
||||
checkbox_container = QWidget()
|
||||
checkbox_container.setStyleSheet(self.theme.CHECKBOX_STYLE + self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
checkbox_layout = QHBoxLayout(checkbox_container)
|
||||
checkbox_layout.setContentsMargins(0, 0, 0, 0)
|
||||
checkbox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
checkbox_layout.addWidget(checkbox_widget)
|
||||
checkbox_container.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
checkbox_item = QTableWidgetItem()
|
||||
checkbox_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
if self.user_conf:
|
||||
value_widget = CustomComboBox(theme=self.theme)
|
||||
value_widget.setObjectName("settingsTableCombo")
|
||||
value_widget.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
value_widget.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
value_widget.addItem(_("Default"), "")
|
||||
value_widget.addItem(_("Yes"), "1")
|
||||
value_widget.addItem(_("No"), "0")
|
||||
value_widget.setCurrentIndex(max(0, value_widget.findData(current_val)))
|
||||
else:
|
||||
value_widget = QCheckBox()
|
||||
value_widget.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
value_widget.setChecked(current_val == '1' and not is_blocked)
|
||||
value_widget.setEnabled(not is_blocked)
|
||||
value_widget.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
value_widget.installEventFilter(self)
|
||||
if is_blocked:
|
||||
name_item.setForeground(QColor(self.theme.color_disabled_text))
|
||||
self.settings_table.setItem(row, 1, checkbox_item)
|
||||
self.settings_table.setCellWidget(row, 1, checkbox_container)
|
||||
if self.user_conf:
|
||||
self.settings_table.setCellWidget(row, 1, value_widget)
|
||||
else:
|
||||
checkbox_container = QWidget()
|
||||
checkbox_container.setStyleSheet(self.theme.CHECKBOX_STYLE + self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
checkbox_layout = QHBoxLayout(checkbox_container)
|
||||
checkbox_layout.setContentsMargins(0, 0, 0, 0)
|
||||
checkbox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
checkbox_layout.addWidget(value_widget)
|
||||
checkbox_container.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
checkbox_item = QTableWidgetItem()
|
||||
checkbox_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
self.settings_table.setItem(row, 1, checkbox_item)
|
||||
self.settings_table.setCellWidget(row, 1, checkbox_container)
|
||||
|
||||
desc_item = QTableWidgetItem(description)
|
||||
desc_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
@@ -670,7 +770,7 @@ class ExeSettingsDialog(
|
||||
self.settings_table.setItem(row, 2, desc_item)
|
||||
|
||||
self.settings_table.setItem(row, 0, name_item)
|
||||
self.value_widgets[(row, 1)] = checkbox_widget
|
||||
self.value_widgets[(row, 1)] = value_widget
|
||||
|
||||
self.settings_table.resizeRowsToContents()
|
||||
if self.settings_table.rowCount() > 0:
|
||||
@@ -702,6 +802,11 @@ class ExeSettingsDialog(
|
||||
dist_options=self.dist_options,
|
||||
prefix_options=self.prefix_options
|
||||
)
|
||||
if self.user_conf:
|
||||
for setting in advanced_settings:
|
||||
setting['key'] = DEFAULT_WINE_SETTING_KEYS.get(setting['key'], setting['key'])
|
||||
if setting['type'] == 'combo':
|
||||
setting['options'] = [_('Default')] + setting['options']
|
||||
self.advanced_settings_by_key = {
|
||||
setting['key']: setting for setting in advanced_settings
|
||||
}
|
||||
@@ -726,7 +831,7 @@ class ExeSettingsDialog(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
combo.addItems(setting['options'])
|
||||
if setting['key'] == 'PW_PREFIX_NAME':
|
||||
if setting['key'] in ('PW_PREFIX_NAME', 'PW_DEFAULT_PREFIX_NAME'):
|
||||
combo.setEditable(True)
|
||||
combo.setInsertPolicy(QComboBox.InsertPolicy.NoInsert)
|
||||
prefix_line_edit = combo.lineEdit()
|
||||
@@ -735,17 +840,21 @@ class ExeSettingsDialog(
|
||||
combo.highlighted.connect(
|
||||
lambda row, c=combo: self._on_combo_highlighted(row, c),
|
||||
)
|
||||
elif setting['key'] == 'PW_WINE_USE':
|
||||
elif setting['key'] in ('PW_WINE_USE', 'PW_DEFAULT_WINE_USE'):
|
||||
combo.highlighted.connect(
|
||||
lambda row, c=combo: self._on_combo_highlighted(row, c),
|
||||
)
|
||||
|
||||
current_raw = current.get(setting['key'], setting['default'])
|
||||
if setting['key'] == 'PW_WINE_CPU_TOPOLOGY':
|
||||
current_raw = current.get(setting['key'], '') if self.user_conf else (
|
||||
current.get(setting['key'], setting['default'])
|
||||
)
|
||||
if self.user_conf and not current_raw:
|
||||
current_val = _('Default')
|
||||
elif setting['key'] == 'PW_WINE_CPU_TOPOLOGY':
|
||||
current_val = disabled_text if current_raw == 'disabled' else (
|
||||
current_raw.split(':')[0] if isinstance(current_raw, str) and ':' in current_raw else current_raw
|
||||
)
|
||||
elif setting['key'] == 'PW_WINE_USE':
|
||||
elif setting['key'] in ('PW_WINE_USE', 'PW_DEFAULT_WINE_USE'):
|
||||
current_val = _('System WINE') if current_raw == 'USE_SYSTEM_WINE' else current_raw
|
||||
else:
|
||||
current_val = disabled_text if current_raw == 'disabled' else current_raw
|
||||
@@ -781,6 +890,9 @@ class ExeSettingsDialog(
|
||||
else:
|
||||
self.original_display_values[setting['key']] = current_val_text
|
||||
|
||||
if self.user_conf and not current_raw:
|
||||
self.original_display_values[setting['key']] = ''
|
||||
|
||||
if '_value_map' in setting:
|
||||
reverse_map = {v: k for k, v in setting['_value_map'].items()}
|
||||
self.value_mapping[setting['key']] = {
|
||||
@@ -790,7 +902,9 @@ class ExeSettingsDialog(
|
||||
|
||||
elif setting['type'] == 'text':
|
||||
line_edit = QLineEdit()
|
||||
current_val = current.get(setting['key'], setting['default'])
|
||||
current_val = current.get(setting['key'], '') if self.user_conf else (
|
||||
current.get(setting['key'], setting['default'])
|
||||
)
|
||||
line_edit.setText(current_val)
|
||||
if not current_val and not setting['default']:
|
||||
line_edit.setPlaceholderText(_("Default value"))
|
||||
@@ -996,6 +1110,10 @@ class ExeSettingsDialog(
|
||||
source_widget = self._find_toggle_widget(key)
|
||||
checkbox = QCheckBox()
|
||||
checkbox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
if isinstance(source_widget, QComboBox):
|
||||
self.favorites_table.removeCellWidget(row, 1)
|
||||
self._add_favorite_combo(row, source_widget)
|
||||
return
|
||||
checkbox.setChecked(source_widget.isChecked() if source_widget else False)
|
||||
checkbox.setEnabled(source_widget.isEnabled() if source_widget else False)
|
||||
checkbox.stateChanged.connect(
|
||||
@@ -1039,7 +1157,7 @@ class ExeSettingsDialog(
|
||||
self.favorites_table.setItem(row, 0, name_item)
|
||||
self.favorites_table.setItem(row, 2, desc_item)
|
||||
|
||||
def _find_toggle_widget(self, key: str) -> QCheckBox | None:
|
||||
def _find_toggle_widget(self, key: str) -> QCheckBox | QComboBox | None:
|
||||
for (row, _column), widget in self.value_widgets.items():
|
||||
item = self.settings_table.item(row, 0)
|
||||
if item and item.data(Qt.ItemDataRole.UserRole) == key:
|
||||
@@ -1047,8 +1165,8 @@ class ExeSettingsDialog(
|
||||
return None
|
||||
|
||||
def _sync_checkbox(self, source_widget: QCheckBox | None, checkbox: QCheckBox) -> None:
|
||||
if source_widget is not None and source_widget.isChecked() != checkbox.isChecked():
|
||||
source_widget.setChecked(checkbox.isChecked())
|
||||
if source_widget is not None and source_widget.checkState() != checkbox.checkState():
|
||||
source_widget.setCheckState(checkbox.checkState())
|
||||
|
||||
def _add_favorite_combo(self, row: int, source_widget: QComboBox) -> None:
|
||||
combo = CustomComboBox(theme=self.theme)
|
||||
@@ -1226,10 +1344,12 @@ class ExeSettingsDialog(
|
||||
continue
|
||||
|
||||
widget = self.value_widgets.get((row, 1))
|
||||
if not isinstance(widget, QCheckBox):
|
||||
if isinstance(widget, QComboBox) and self.user_conf:
|
||||
new_val = str(widget.currentData() or '')
|
||||
elif isinstance(widget, QCheckBox):
|
||||
new_val = '1' if widget.isChecked() else '0'
|
||||
else:
|
||||
continue
|
||||
|
||||
new_val = '1' if widget.isChecked() else '0'
|
||||
if new_val != orig_val:
|
||||
changes.append(f"{key}={new_val}")
|
||||
# Track if PW_MANGOHUD is being enabled
|
||||
@@ -1240,9 +1360,11 @@ class ExeSettingsDialog(
|
||||
orig_val = self.original_display_values.get(key, '')
|
||||
if isinstance(widget, QComboBox):
|
||||
new_val = widget.currentText()
|
||||
if self.user_conf and new_val == _('Default'):
|
||||
new_val = ''
|
||||
if key in ('PW_PREFIX_NAME', 'PW_VULKAN_USE') and self.game_source == "steam":
|
||||
continue
|
||||
if key == 'PW_PREFIX_NAME':
|
||||
if key in ('PW_PREFIX_NAME', 'PW_DEFAULT_PREFIX_NAME'):
|
||||
new_val = re.sub(r"[ \t]", "_", new_val.strip()).upper()
|
||||
|
||||
if key in self.value_mapping and 'forward' in self.value_mapping[key]:
|
||||
@@ -1253,7 +1375,7 @@ class ExeSettingsDialog(
|
||||
else:
|
||||
has_changed = (new_val != orig_val)
|
||||
|
||||
if key == 'PW_WINE_USE' and new_val == _('System WINE'):
|
||||
if key in ('PW_WINE_USE', 'PW_DEFAULT_WINE_USE') and new_val == _('System WINE'):
|
||||
new_val = 'USE_SYSTEM_WINE'
|
||||
|
||||
if new_val.lower() == _('disabled').lower():
|
||||
@@ -1275,9 +1397,32 @@ class ExeSettingsDialog(
|
||||
gamescope_changes = []
|
||||
if self.gamescope_available:
|
||||
gamescope_changes = self._collect_gamescope_changes()
|
||||
changes.extend(mangohud_changes)
|
||||
changes.extend(self._collect_vkbasalt_changes())
|
||||
changes.extend(gamescope_changes)
|
||||
vkbasalt_changes = self._collect_vkbasalt_changes()
|
||||
if self.user_conf:
|
||||
if self.current_settings.get('PW_MANGOHUD') != '1':
|
||||
mangohud_changes = [
|
||||
change for change in mangohud_changes
|
||||
if change.startswith(('PW_MANGOHUD=', 'PW_MANGOHUD_USER_CONF='))
|
||||
]
|
||||
if self.current_settings.get('PW_VKBASALT') != '1':
|
||||
vkbasalt_changes = [
|
||||
change for change in vkbasalt_changes
|
||||
if change.startswith(('PW_VKBASALT=', 'PW_VKBASALT_USER_CONF='))
|
||||
]
|
||||
if self.current_settings.get('PW_GAMESCOPE') != '1':
|
||||
gamescope_changes = [
|
||||
change for change in gamescope_changes
|
||||
if change.startswith('PW_GAMESCOPE=')
|
||||
]
|
||||
specialized_changes = mangohud_changes + vkbasalt_changes + gamescope_changes
|
||||
if self.user_conf:
|
||||
defaults = ('', '0', '0.00', 'Home')
|
||||
specialized_changes = [
|
||||
change for change in specialized_changes
|
||||
if change.split('=', 1)[0] in self.original_values
|
||||
or change.split('=', 1)[1] not in defaults
|
||||
]
|
||||
changes.extend(specialized_changes)
|
||||
|
||||
# Check if PW_GAMESCOPE toggle changes are already in the list
|
||||
has_gamescope_toggle = any(change.startswith("PW_GAMESCOPE=") for change in gamescope_changes)
|
||||
@@ -1298,6 +1443,13 @@ class ExeSettingsDialog(
|
||||
if not changes:
|
||||
return
|
||||
|
||||
if self.user_conf:
|
||||
self.user_conf_changes = changes
|
||||
self.close_after_user_conf_changes = True
|
||||
self.apply_button.setEnabled(False)
|
||||
self._apply_next_user_conf_change()
|
||||
return
|
||||
|
||||
process = QProcess(self)
|
||||
process.finished.connect(self.on_edit_db_finished)
|
||||
process_args = ["cli", "--edit-db", self.exe_path] + changes
|
||||
@@ -1305,6 +1457,36 @@ class ExeSettingsDialog(
|
||||
process.start(args[0], args[1:])
|
||||
self.apply_button.setEnabled(False)
|
||||
|
||||
def _apply_next_user_conf_change(self) -> None:
|
||||
if not self.user_conf_changes:
|
||||
self.apply_button.setEnabled(True)
|
||||
if self.close_after_user_conf_changes:
|
||||
self.close()
|
||||
else:
|
||||
self.load_current_settings()
|
||||
return
|
||||
|
||||
key, value = self.user_conf_changes.pop(0).split('=', 1)
|
||||
action = "--set-user-conf" if value else "--delete-user-conf"
|
||||
command = ["cli", action, key]
|
||||
if value:
|
||||
command.append(value)
|
||||
self.user_conf_process = QProcess(self)
|
||||
self.user_conf_process.finished.connect(self._on_user_conf_change_finished)
|
||||
args = self._get_process_args(command)
|
||||
self.user_conf_process.start(args[0], args[1:])
|
||||
|
||||
def _on_user_conf_change_finished(self, exit_code, exit_status) -> None:
|
||||
if exit_code != 0 or exit_status != QProcess.ExitStatus.NormalExit:
|
||||
error_output = bytes(self.user_conf_process.readAllStandardError().data()).decode(
|
||||
'utf-8', 'ignore'
|
||||
)
|
||||
self.apply_button.setEnabled(True)
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to apply changes. Check logs."))
|
||||
logger.error("Failed to update user.conf: %s", error_output)
|
||||
return
|
||||
self._apply_next_user_conf_change()
|
||||
|
||||
def on_edit_db_finished(self, exit_code, exit_status):
|
||||
"""Handle --edit-db output."""
|
||||
process = cast(QProcess, self.sender())
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import configparser
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from typing import Any, cast
|
||||
|
||||
@@ -151,8 +152,14 @@ MANGOHUD_VALUE_SPECS = [
|
||||
'options': [f'{i / 10:.1f}' for i in range(11)]},
|
||||
{'key': 'round_corners', 'label': _("Round corners (px)"), 'type': 'combo',
|
||||
'options': [str(i) for i in range(16)]},
|
||||
{'key': 'font_scale', 'label': _("Font scale"), 'type': 'combo',
|
||||
'options': ['', '0.5', '0.75', '1.0', '1.25', '1.5', '2.0']},
|
||||
{'key': 'font_size', 'label': _("Font size"), 'type': 'line'},
|
||||
{'key': 'font_file', 'label': _("Font"), 'type': 'combo', 'options': []},
|
||||
]
|
||||
|
||||
MANGOHUD_FONT_KEYS = {'font_scale', 'font_size', 'font_file'}
|
||||
|
||||
MANGOHUD_VALUE_OPTION_TRANSLATIONS = {
|
||||
'position': {
|
||||
'top-left': _("Top-left"),
|
||||
@@ -391,6 +398,7 @@ class MangoHudSettingsMixin:
|
||||
self.mangohud_presets_group = None
|
||||
self.mangohud_toggle_group = None
|
||||
self.mangohud_values_group = None
|
||||
self.mangohud_fonts_group = None
|
||||
self.mangohud_fps_group = None
|
||||
self.mangohud_extra_group = None
|
||||
self.mangohud_action_buttons = []
|
||||
@@ -412,6 +420,7 @@ class MangoHudSettingsMixin:
|
||||
self._add_mangohud_presets_group(layout)
|
||||
self._add_mangohud_toggle_group(layout)
|
||||
self._add_mangohud_values_group(layout)
|
||||
self._add_mangohud_fonts_group(layout)
|
||||
self._add_mangohud_fps_group(layout)
|
||||
self._add_mangohud_extra_group(layout)
|
||||
layout.addStretch()
|
||||
@@ -433,6 +442,8 @@ class MangoHudSettingsMixin:
|
||||
gpu_count = sum(1 for _text, value in self.mangohud_gpu_options if value.isdigit())
|
||||
|
||||
for spec in MANGOHUD_VALUE_SPECS:
|
||||
if spec['key'] in MANGOHUD_FONT_KEYS:
|
||||
continue
|
||||
if spec['key'] == 'fps_limit_method':
|
||||
continue
|
||||
if spec['key'] == 'gpu_list' and gpu_count < 2:
|
||||
@@ -441,8 +452,32 @@ class MangoHudSettingsMixin:
|
||||
|
||||
parent_layout.addWidget(group)
|
||||
|
||||
def _add_mangohud_fonts_group(self, parent_layout):
|
||||
"""Add MangoHud font controls."""
|
||||
group = QGroupBox(_("Fonts"))
|
||||
group.setStyleSheet(self.theme.QGROUP_BOX_STYLE)
|
||||
form = QFormLayout(group)
|
||||
form.setVerticalSpacing(self.theme.exeSettingsGroupBoxElementVerticalSpacing)
|
||||
form.setHorizontalSpacing(self.theme.exeSettingsGroupBoxElementHorizontalSpacing)
|
||||
form.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
|
||||
self.mangohud_fonts_group = group
|
||||
|
||||
for spec in MANGOHUD_VALUE_SPECS:
|
||||
if spec['key'] in MANGOHUD_FONT_KEYS:
|
||||
form.addRow(spec['label'], self._create_mangohud_value_widget(spec))
|
||||
|
||||
parent_layout.addWidget(group)
|
||||
|
||||
def _create_mangohud_value_widget(self, spec):
|
||||
"""Create a MangoHud value widget."""
|
||||
if spec['type'] == 'line':
|
||||
widget = QLineEdit()
|
||||
widget.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
widget.installEventFilter(cast(QWidget, self))
|
||||
widget.setStyleSheet(self.theme.ADDGAME_INPUT_STYLE)
|
||||
self.mangohud_widgets[spec['key']] = widget
|
||||
return widget
|
||||
|
||||
widget = CustomComboBox(theme=self.theme)
|
||||
widget.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
@@ -458,6 +493,10 @@ class MangoHudSettingsMixin:
|
||||
gpu_options = self.mangohud_gpu_options or self._get_mangohud_gpu_options()
|
||||
for text, value in gpu_options:
|
||||
widget.addItem(text, value)
|
||||
elif spec['key'] == 'font_file':
|
||||
widget.addItem(placeholder_text, '')
|
||||
for text, value in self._get_mangohud_font_options():
|
||||
widget.addItem(text, value)
|
||||
else:
|
||||
value_translations = MANGOHUD_VALUE_OPTION_TRANSLATIONS.get(spec['key'], {})
|
||||
for option in options:
|
||||
@@ -475,6 +514,30 @@ class MangoHudSettingsMixin:
|
||||
self.mangohud_widgets[spec['key']] = widget
|
||||
return widget
|
||||
|
||||
def _get_mangohud_font_options(self) -> list[tuple[str, str]]:
|
||||
"""Get installed font names and files from fontconfig."""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
['fc-list', '--format=%{family[0]} %{style[0]}\t%{file}\n'],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
timeout=3,
|
||||
)
|
||||
except (OSError, subprocess.TimeoutExpired) as exc:
|
||||
logger.warning("Failed to list system fonts: %s", exc)
|
||||
return []
|
||||
if result.returncode != 0:
|
||||
logger.warning("fc-list failed with exit code %s", result.returncode)
|
||||
return []
|
||||
|
||||
fonts = set()
|
||||
for line in result.stdout.splitlines():
|
||||
name, separator, path = line.partition('\t')
|
||||
if separator and path.lower().endswith(('.ttf', '.otf')):
|
||||
fonts.add((name.strip(), path.strip()))
|
||||
return sorted(fonts, key=lambda font: font[0].lower())
|
||||
|
||||
def _add_mangohud_presets_group(self, parent_layout):
|
||||
"""Add preset buttons for common MangoHud layouts."""
|
||||
presets_group = QGroupBox(_("Presets"))
|
||||
@@ -866,6 +929,8 @@ class MangoHudSettingsMixin:
|
||||
self.mangohud_presets_group.setVisible(config_visible)
|
||||
if self.mangohud_values_group is not None:
|
||||
self.mangohud_values_group.setVisible(config_visible)
|
||||
if self.mangohud_fonts_group is not None:
|
||||
self.mangohud_fonts_group.setVisible(config_visible)
|
||||
if self.mangohud_fps_group is not None:
|
||||
self.mangohud_fps_group.setVisible(config_visible)
|
||||
if self.mangohud_extra_group is not None:
|
||||
@@ -1065,6 +1130,9 @@ class MangoHudSettingsMixin:
|
||||
if widget is None:
|
||||
return
|
||||
text = value if isinstance(value, str) else ''
|
||||
if isinstance(widget, QLineEdit):
|
||||
widget.setText(text)
|
||||
return
|
||||
index = widget.findData(text)
|
||||
if text and index < 0:
|
||||
widget.addItem(text, text)
|
||||
@@ -1179,10 +1247,13 @@ class MangoHudSettingsMixin:
|
||||
if widget is None:
|
||||
return ''
|
||||
|
||||
current_data = widget.currentData()
|
||||
value = '' if current_data is None else str(current_data).strip()
|
||||
if not value and current_data is None:
|
||||
value = widget.currentText().strip()
|
||||
if isinstance(widget, QLineEdit):
|
||||
value = widget.text().strip()
|
||||
else:
|
||||
current_data = widget.currentData()
|
||||
value = '' if current_data is None else str(current_data).strip()
|
||||
if not value and current_data is None:
|
||||
value = widget.currentText().strip()
|
||||
if not value:
|
||||
return ''
|
||||
parsed_original, _raw_tokens = self._parse_mangohud_config(
|
||||
|
||||
+25
-5
@@ -38,17 +38,32 @@ class EGSAPI:
|
||||
|
||||
def __init__(self) -> None:
|
||||
data_home = Path(os.getenv("XDG_DATA_HOME", Path.home() / ".local/share"))
|
||||
self.data_dir = data_home / "PortProtonQt" / "egs"
|
||||
self.data_dir = data_home / "PortProtonQt" / "launcher" / "egs"
|
||||
self.bin_dir = data_home / "PortProtonQt" / "bin"
|
||||
# Remove after the legacy launcher storage migration period.
|
||||
legacy_dir = data_home / "PortProtonQt" / "egs"
|
||||
if legacy_dir.exists() and not self.data_dir.exists():
|
||||
self.data_dir.parent.mkdir(parents=True, exist_ok=True)
|
||||
legacy_dir.rename(self.data_dir)
|
||||
legacy_bin = self.data_dir / "bin"
|
||||
if legacy_bin.is_dir():
|
||||
self.bin_dir.mkdir(parents=True, exist_ok=True)
|
||||
for legacy_binary in legacy_bin.iterdir():
|
||||
target = self.bin_dir / legacy_binary.name
|
||||
if not target.exists():
|
||||
legacy_binary.rename(target)
|
||||
if not any(legacy_bin.iterdir()):
|
||||
legacy_bin.rmdir()
|
||||
self.config_dir = self.data_dir / "legendary"
|
||||
self.user_path = self.config_dir / "user.json"
|
||||
self.library_path = self.data_dir / "library.json"
|
||||
self.sizes_path = self.data_dir / "sizes.json"
|
||||
self.version_path = self.data_dir / "bin/legendary.version"
|
||||
self.version_path = self.bin_dir / "legendary.version"
|
||||
self.games_dir = Path.home() / "Games"
|
||||
|
||||
def get_legendary_path(self) -> str | None:
|
||||
"""Return an available Legendary executable."""
|
||||
bundled = self.data_dir / "bin/legendary"
|
||||
bundled = self.bin_dir / "legendary"
|
||||
if bundled.is_file() and os.access(bundled, os.X_OK):
|
||||
return str(bundled)
|
||||
return shutil.which("legendary")
|
||||
@@ -63,7 +78,7 @@ class EGSAPI:
|
||||
|
||||
def update_legendary(self) -> str:
|
||||
"""Update the bundled Legendary binary when a newer release exists."""
|
||||
bundled = self.data_dir / "bin/legendary"
|
||||
bundled = self.bin_dir / "legendary"
|
||||
if bundled.is_file() and os.access(bundled, os.X_OK):
|
||||
try:
|
||||
last_check = self.version_path.stat().st_mtime
|
||||
@@ -109,7 +124,7 @@ class EGSAPI:
|
||||
return ""
|
||||
|
||||
def _download_legendary(self, asset: dict, release_tag: str) -> str:
|
||||
target = self.data_dir / "bin/legendary"
|
||||
target = self.bin_dir / "legendary"
|
||||
temporary = target.with_suffix(".part")
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
digest = hashlib.sha256()
|
||||
@@ -218,6 +233,8 @@ class EGSAPI:
|
||||
games = []
|
||||
for game in raw_games:
|
||||
metadata = game.get("metadata", {})
|
||||
if metadata.get("mainGameItem"):
|
||||
continue
|
||||
release_info = metadata.get("releaseInfo", [])
|
||||
mobile_only = bool(release_info) and all(
|
||||
info.get("platform")
|
||||
@@ -444,6 +461,9 @@ class EGSAPI:
|
||||
"description": str(metadata.get("description", "")),
|
||||
"cover": cover,
|
||||
"namespace": str(metadata.get("namespace", "")),
|
||||
"folder_name": str(metadata.get("customAttributes", {}).get(
|
||||
"FolderName", {}
|
||||
).get("value") or game.get("app_name") or game.get("appName") or ""),
|
||||
"description_locale": "",
|
||||
"description_preference": "",
|
||||
"description_cache_version": 0,
|
||||
|
||||
@@ -397,7 +397,8 @@ class GameCard(AnimatedCard):
|
||||
config_name = "GAME_CARD_HORIZONTAL"
|
||||
else:
|
||||
config_name = "GAME_CARD_GRID"
|
||||
self.card_layout_cfg = getattr(self.theme, config_name, {})
|
||||
self.card_layout_cfg = self._get_layout_config(self.theme, config_name)
|
||||
self.card_geometry_cfg = self._get_card_geometry_config(self.theme)
|
||||
default_margin = 8 if self.list_layout else 20
|
||||
self.base_extra_margin = self.card_layout_cfg.get("extra_margin", default_margin)
|
||||
card_style_name = (
|
||||
@@ -551,6 +552,8 @@ class GameCard(AnimatedCard):
|
||||
self.nameLabel.setContentsMargins(0, 0, 10, 0)
|
||||
else:
|
||||
self.nameLabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
if self.horizontal_layout:
|
||||
self.nameLabel.setWordWrap(True)
|
||||
name_style = (
|
||||
self.theme.GAME_CARD_VERTICAL_NAME_STYLE
|
||||
if self.vertical_layout
|
||||
@@ -608,7 +611,8 @@ class GameCard(AnimatedCard):
|
||||
config_name = "GAME_CARD_HORIZONTAL"
|
||||
else:
|
||||
config_name = "GAME_CARD_GRID"
|
||||
self.card_layout_cfg = getattr(theme, config_name, {})
|
||||
self.card_layout_cfg = self._get_layout_config(theme, config_name)
|
||||
self.card_geometry_cfg = self._get_card_geometry_config(theme)
|
||||
default_margin = 8 if self.list_layout else 20
|
||||
self.base_extra_margin = self.card_layout_cfg.get("extra_margin", default_margin)
|
||||
spacing = self.card_layout_cfg.get("spacing", 12 if self.list_layout else 5)
|
||||
@@ -665,6 +669,43 @@ class GameCard(AnimatedCard):
|
||||
else:
|
||||
self.update()
|
||||
|
||||
def _get_card_geometry_config(self, theme: Any) -> dict:
|
||||
theme_orientation = self.card_layout_cfg.get(
|
||||
"card_orientation", "horizontal"
|
||||
)
|
||||
if (
|
||||
self.horizontal_layout
|
||||
and ui_config.get_horizontal_card_orientation(theme_orientation)
|
||||
== "vertical"
|
||||
):
|
||||
return getattr(theme, "GAME_CARD_GRID", {})
|
||||
return self.card_layout_cfg
|
||||
|
||||
@staticmethod
|
||||
def _get_layout_config(theme: Any, config_name: str) -> dict:
|
||||
config = getattr(theme, config_name, {})
|
||||
get_override = getattr(theme, "get_theme_override", None)
|
||||
if not callable(get_override) or get_override(config_name) is not None:
|
||||
return config
|
||||
config = dict(config)
|
||||
for name in (
|
||||
"GAME_CARD_GRID", "GAME_CARD_HORIZONTAL",
|
||||
"GAME_CARD_LIST", "GAME_CARD_VERTICAL",
|
||||
):
|
||||
override = get_override(name)
|
||||
if isinstance(override, dict) and "card_animation_type" in override:
|
||||
config["card_animation_type"] = override["card_animation_type"]
|
||||
break
|
||||
else:
|
||||
animation = getattr(theme, "GAME_CARD_ANIMATION", {})
|
||||
config["card_animation_type"] = animation.get(
|
||||
"card_animation_type", "gradient"
|
||||
)
|
||||
radius = str(getattr(theme, "border_radius_card", "")).removesuffix("px")
|
||||
if radius.isdigit():
|
||||
config.update(cover_radius=int(radius), border_radius=int(radius))
|
||||
return config
|
||||
|
||||
def on_cover_loaded(self, pixmap):
|
||||
self.animated_cover_path = ""
|
||||
self.base_pixmap = pixmap
|
||||
@@ -677,7 +718,7 @@ class GameCard(AnimatedCard):
|
||||
height = cover_size
|
||||
else:
|
||||
width = self.base_card_width
|
||||
layout_config = getattr(self, "card_layout_cfg", {})
|
||||
layout_config = getattr(self, "card_geometry_cfg", {})
|
||||
height = int(self.base_card_width * layout_config.get("cover_aspect_ratio", 1.5))
|
||||
if self._set_animated_cover(cover_path, width, height):
|
||||
return
|
||||
@@ -885,11 +926,11 @@ class GameCard(AnimatedCard):
|
||||
small_card_mode = self.base_card_width < self.theme.COMPACT_CARD["width_threshold"]
|
||||
height_ratio = (
|
||||
self.theme.COMPACT_CARD["height_ratio"]
|
||||
if small_card_mode else self.card_layout_cfg.get("card_height_ratio", 1.8)
|
||||
if small_card_mode else self.card_geometry_cfg.get("card_height_ratio", 1.8)
|
||||
)
|
||||
scaled_height = int(self.base_card_width * height_ratio * self._scale)
|
||||
self.setFixedSize(scaled_width + scaled_extra, scaled_height + scaled_extra)
|
||||
cover_ratio = self.card_layout_cfg.get("cover_aspect_ratio", 1.5)
|
||||
cover_ratio = self.card_geometry_cfg.get("cover_aspect_ratio", 1.5)
|
||||
cover_height = int(scaled_width * cover_ratio)
|
||||
self.coverWidget.setFixedSize(scaled_width, cover_height)
|
||||
self.coverLabel.setFixedSize(scaled_width, cover_height)
|
||||
@@ -1207,6 +1248,9 @@ class GameCard(AnimatedCard):
|
||||
super().showEvent(event)
|
||||
|
||||
def click(self) -> None:
|
||||
if self._get_missing_executable_path() and self.context_menu_manager:
|
||||
self.context_menu_manager.handle_missing_executable(self)
|
||||
return
|
||||
game_data = {
|
||||
"name": self.name,
|
||||
"description": self.description,
|
||||
|
||||
@@ -26,7 +26,9 @@ class FullLibraryTile(AnimatedCard):
|
||||
self.name = ""
|
||||
self.animation_base_size = theme.fullLibraryTileSize
|
||||
self.tile_pixmap = QPixmap()
|
||||
self.setup_card_animations(theme, theme.GAME_CARD_HORIZONTAL)
|
||||
self.setup_card_animations(
|
||||
theme, GameCard._get_layout_config(theme, "GAME_CARD_HORIZONTAL")
|
||||
)
|
||||
self.update_scale()
|
||||
|
||||
def set_tile_pixmap(self, pixmap: QPixmap) -> None:
|
||||
@@ -72,7 +74,8 @@ class GameLibraryManager:
|
||||
self.game_card_cache = {}
|
||||
self.pending_images = {}
|
||||
self.card_width = ui_config.get_card_width()
|
||||
self.layout_mode = str(getattr(theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
theme_mode = str(getattr(theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
self.layout_mode = ui_config.get_library_layout_mode(theme_mode)
|
||||
self.gamesListWidget: QWidget | None = None
|
||||
self.gamesListLayout: FlowLayout | QHBoxLayout | QVBoxLayout | None = None
|
||||
self.gamesScrollArea: QScrollArea | None = None
|
||||
@@ -105,17 +108,17 @@ class GameLibraryManager:
|
||||
self.gamesLibraryWidget.setProperty("theme_style_name", "LIBRARY_WIDGET_STYLE")
|
||||
self.gamesLibraryWidget.setStyleSheet(self.theme.LIBRARY_WIDGET_STYLE)
|
||||
library_background = getattr(self.theme, "LIBRARY_BACKGROUND", None)
|
||||
stack_layout = QGridLayout(self.gamesLibraryWidget)
|
||||
if isinstance(library_background, dict):
|
||||
stack_layout = QGridLayout(self.gamesLibraryWidget)
|
||||
stack_layout.setContentsMargins(*library_background["margins"])
|
||||
self.libraryBackgroundLabel = QLabel()
|
||||
stack_layout.addWidget(self.libraryBackgroundLabel, 0, 0)
|
||||
content_widget = QWidget()
|
||||
content_widget.setStyleSheet(self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
layout = QVBoxLayout(content_widget)
|
||||
stack_layout.addWidget(content_widget, 0, 0)
|
||||
else:
|
||||
layout = QVBoxLayout(self.gamesLibraryWidget)
|
||||
stack_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.libraryBackgroundLabel = QLabel()
|
||||
stack_layout.addWidget(self.libraryBackgroundLabel, 0, 0)
|
||||
content_widget = QWidget()
|
||||
content_widget.setStyleSheet(self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
layout = QVBoxLayout(content_widget)
|
||||
stack_layout.addWidget(content_widget, 0, 0)
|
||||
self.libraryContentLayout = layout
|
||||
layout.setSpacing(15)
|
||||
|
||||
@@ -139,15 +142,18 @@ class GameLibraryManager:
|
||||
self.gamesListWidget.setProperty("theme_style_name", "LIST_WIDGET_STYLE")
|
||||
self.gamesListWidget.setStyleSheet(self.theme.LIST_WIDGET_STYLE)
|
||||
if self.layout_mode in {"horizontal", "horizontal_top"}:
|
||||
layout_config = self.theme.GAME_CARD_HORIZONTAL
|
||||
layout_config = getattr(self.theme, "GAME_CARD_HORIZONTAL", {})
|
||||
self.gamesListLayout = QHBoxLayout(self.gamesListWidget)
|
||||
self.gamesListLayout.setContentsMargins(*layout_config["layout_margins"])
|
||||
self.gamesListLayout.setSpacing(layout_config["layout_spacing"])
|
||||
scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||
self.gamesListLayout.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||
self.gamesListLayout.setContentsMargins(
|
||||
*layout_config.get("layout_margins", (0, 0, 0, 0))
|
||||
)
|
||||
self.gamesListLayout.setSpacing(layout_config.get("layout_spacing", 0))
|
||||
scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||
elif self.layout_mode == "vertical":
|
||||
layout_config = self.theme.GAME_CARD_VERTICAL
|
||||
self.gamesListLayout = QVBoxLayout(self.gamesListWidget)
|
||||
self.gamesListLayout.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
self.gamesListLayout.setContentsMargins(
|
||||
*layout_config.get("layout_margins", (0, 0, 0, 0))
|
||||
)
|
||||
@@ -223,13 +229,17 @@ class GameLibraryManager:
|
||||
self.fullLibraryTile = None
|
||||
old_layout = self.gamesListLayout
|
||||
if layout_mode in {"horizontal", "horizontal_top"}:
|
||||
layout_config = self.theme.GAME_CARD_HORIZONTAL
|
||||
layout_config = getattr(self.theme, "GAME_CARD_HORIZONTAL", {})
|
||||
self.gamesListLayout = QHBoxLayout()
|
||||
self.gamesListLayout.setContentsMargins(*layout_config["layout_margins"])
|
||||
self.gamesListLayout.setSpacing(layout_config["layout_spacing"])
|
||||
self.gamesListLayout.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||
self.gamesListLayout.setContentsMargins(
|
||||
*layout_config.get("layout_margins", (0, 0, 0, 0))
|
||||
)
|
||||
self.gamesListLayout.setSpacing(layout_config.get("layout_spacing", 0))
|
||||
elif layout_mode == "vertical":
|
||||
layout_config = self.theme.GAME_CARD_VERTICAL
|
||||
self.gamesListLayout = QVBoxLayout()
|
||||
self.gamesListLayout.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
self.gamesListLayout.setContentsMargins(
|
||||
*layout_config.get("layout_margins", (0, 0, 0, 0))
|
||||
)
|
||||
@@ -245,11 +255,10 @@ class GameLibraryManager:
|
||||
if horizontal
|
||||
else Qt.ScrollBarPolicy.ScrollBarAsNeeded
|
||||
)
|
||||
self.gamesScrollArea.setHorizontalScrollBarPolicy(
|
||||
Qt.ScrollBarPolicy.ScrollBarAlwaysOff
|
||||
)
|
||||
self.gamesScrollArea.setVerticalScrollBarPolicy(vertical_policy)
|
||||
theme_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
theme_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
self.full_library_open = theme_mode == "horizontal_top" and layout_mode == "grid"
|
||||
if self.full_library_open and self.libraryBackgroundLabel is not None:
|
||||
remove_cover_background(self.libraryBackgroundLabel)
|
||||
@@ -382,10 +391,17 @@ class GameLibraryManager:
|
||||
"""Render the configured library background from the active cover."""
|
||||
if self.full_library_open or self.libraryBackgroundLabel is None:
|
||||
return
|
||||
self.render_library_background(self.libraryBackgroundLabel, card)
|
||||
|
||||
def render_library_background(self, label: QLabel, card: GameCard) -> None:
|
||||
"""Render the configured library background on a target label."""
|
||||
pixmap = card.coverLabel.pixmap()
|
||||
if pixmap is None or pixmap.isNull():
|
||||
return
|
||||
library_config = self.theme.LIBRARY_BACKGROUND
|
||||
library_config = getattr(self.theme, "LIBRARY_BACKGROUND", None)
|
||||
if not isinstance(library_config, dict):
|
||||
remove_cover_background(label)
|
||||
return
|
||||
backgrounds = dict(getattr(self.theme, "DETAIL_PAGE_BACKGROUNDS", {}))
|
||||
backgrounds.update(library_config.get("backgrounds", {}))
|
||||
background_theme = SimpleNamespace(
|
||||
@@ -393,7 +409,7 @@ class GameLibraryManager:
|
||||
DETAIL_PAGE_BACKGROUNDS=backgrounds,
|
||||
)
|
||||
setup_cover_background(
|
||||
self.libraryBackgroundLabel, pixmap, self.main_window, background_theme
|
||||
label, pixmap, self.main_window, background_theme
|
||||
)
|
||||
|
||||
def _collapse_library_filter_controls(self) -> None:
|
||||
@@ -458,7 +474,9 @@ class GameLibraryManager:
|
||||
"""Schedules a game grid update with debouncing."""
|
||||
if focus_first_card is not None:
|
||||
self._focus_first_card_after_update = focus_first_card
|
||||
theme_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
theme_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
if not self.full_library_open:
|
||||
self.layout_mode = theme_mode
|
||||
if self.sizeSlider is not None:
|
||||
@@ -983,6 +1001,7 @@ class GameLibraryManager:
|
||||
"""Add a single game without full reload."""
|
||||
self.games.append(game_data)
|
||||
self.filtered_games.append(game_data) # Assume no filter active; adjust if needed
|
||||
self._build_search_indices(self.games)
|
||||
self.dirty = True
|
||||
self.update_game_grid()
|
||||
self._update_missing_exe_button()
|
||||
@@ -1009,6 +1028,17 @@ class GameLibraryManager:
|
||||
self.update_game_grid()
|
||||
self._update_missing_exe_button()
|
||||
|
||||
detail_manager = getattr(self.main_window, "detail_page_manager", None)
|
||||
source = getattr(detail_manager, "_current_detail_source", None)
|
||||
if detail_manager and source and source[0] == "game" and detail_manager._detail_page_active:
|
||||
detail_data = source[1]
|
||||
if (detail_data.get("name"), detail_data.get("exec_line")) == old_key:
|
||||
detail_data.update(
|
||||
name=game_data[0], description=game_data[1],
|
||||
cover_path=game_data[2], exec_line=game_data[5],
|
||||
)
|
||||
detail_manager._reopen_current_detail_page()
|
||||
|
||||
def remove_game_incremental(self, game_name: str, exec_line: str):
|
||||
"""Remove a single game without full reload."""
|
||||
key = (game_name, exec_line)
|
||||
|
||||
+72
-6
@@ -7,6 +7,7 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import zlib
|
||||
from collections.abc import Callable
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from pathlib import Path
|
||||
@@ -31,6 +32,9 @@ GOG_USER_TIMEOUT = 15
|
||||
GOG_METADATA_WORKERS = 4
|
||||
GOG_SETUP_MARKER_VERSION = 1
|
||||
GOG_SETUP_TIMEOUT = 600
|
||||
GOG_REPAIR_METADATA_TIMEOUT = 30
|
||||
GOG_COMPRESSED_MANIFEST_VERSION = 2
|
||||
GOG_BUILDS_API_VERSION = 2
|
||||
GOG_PRODUCT_LOCALES = {
|
||||
"bg": "bg-BG", "cs": "cs-CZ", "da": "da-DK", "de": "de-DE",
|
||||
"el": "el-GR", "en": "en-US", "es": "es-ES", "fi": "fi-FI",
|
||||
@@ -47,11 +51,26 @@ class GOGAPI:
|
||||
|
||||
def __init__(self) -> None:
|
||||
data_home = Path(os.getenv("XDG_DATA_HOME", Path.home() / ".local/share"))
|
||||
self.data_dir = data_home / "PortProtonQt" / "gog"
|
||||
self.data_dir = data_home / "PortProtonQt" / "launcher" / "gog"
|
||||
self.bin_dir = data_home / "PortProtonQt" / "bin"
|
||||
# Remove after the legacy launcher storage migration period.
|
||||
legacy_dir = data_home / "PortProtonQt" / "gog"
|
||||
if legacy_dir.exists() and not self.data_dir.exists():
|
||||
self.data_dir.parent.mkdir(parents=True, exist_ok=True)
|
||||
legacy_dir.rename(self.data_dir)
|
||||
legacy_bin = self.data_dir / "bin"
|
||||
if legacy_bin.is_dir():
|
||||
self.bin_dir.mkdir(parents=True, exist_ok=True)
|
||||
for legacy_binary in legacy_bin.iterdir():
|
||||
target = self.bin_dir / legacy_binary.name
|
||||
if not target.exists():
|
||||
legacy_binary.rename(target)
|
||||
if not any(legacy_bin.iterdir()):
|
||||
legacy_bin.rmdir()
|
||||
self.auth_path = self.data_dir / "auth.json"
|
||||
self.account_path = self.data_dir / "account.json"
|
||||
self.config_dir = self.data_dir / "gogdl"
|
||||
self.gogdl_version_path = self.data_dir / "bin/gogdl.version"
|
||||
self.gogdl_version_path = self.bin_dir / "gogdl.version"
|
||||
self.library_path = self.data_dir / "library.json"
|
||||
self.installed_path = self.data_dir / "installed.json"
|
||||
self.sizes_path = self.data_dir / "sizes.json"
|
||||
@@ -59,7 +78,7 @@ class GOGAPI:
|
||||
|
||||
def get_gogdl_path(self) -> str | None:
|
||||
"""Return an available gogdl executable."""
|
||||
bundled = self.data_dir / "bin/gogdl"
|
||||
bundled = self.bin_dir / "gogdl"
|
||||
if bundled.is_file() and os.access(bundled, os.X_OK):
|
||||
return str(bundled)
|
||||
return shutil.which("gogdl")
|
||||
@@ -84,7 +103,7 @@ class GOGAPI:
|
||||
|
||||
def update_gogdl(self) -> str:
|
||||
"""Update the bundled gogdl binary to the latest official release."""
|
||||
bundled = self.data_dir / "bin/gogdl"
|
||||
bundled = self.bin_dir / "gogdl"
|
||||
if bundled.is_file() and os.access(bundled, os.X_OK):
|
||||
try:
|
||||
last_check = self.gogdl_version_path.stat().st_mtime
|
||||
@@ -134,7 +153,7 @@ class GOGAPI:
|
||||
return path
|
||||
|
||||
def _download_gogdl_asset(self, asset: dict) -> str:
|
||||
target = self.data_dir / "bin/gogdl"
|
||||
target = self.bin_dir / "gogdl"
|
||||
temporary = target.with_suffix(".part")
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
digest = hashlib.sha256()
|
||||
@@ -375,6 +394,53 @@ class GOGAPI:
|
||||
logger.warning("Failed to inspect GOG installation path %s: %s", parent, error)
|
||||
return None
|
||||
|
||||
def prepare_repair_manifest(self, app_id: str, install_path: Path) -> None:
|
||||
"""Restore gogdl metadata before verifying an imported Windows game."""
|
||||
manifest_path = self.config_dir / "heroic_gogdl" / "manifests" / app_id
|
||||
if manifest_path.is_file():
|
||||
return
|
||||
info = self._load_json(install_path / f"goggame-{app_id}.info", {})
|
||||
build_info = self._load_json(install_path / f"goggame-{app_id}.id", {})
|
||||
build_id = build_info.get("buildId") or info.get("buildId")
|
||||
credentials = self.get_credentials()
|
||||
response = requests.get(
|
||||
f"https://content-system.gog.com/products/{app_id}/os/windows/builds",
|
||||
params={"generation": GOG_COMPRESSED_MANIFEST_VERSION, "_version": GOG_BUILDS_API_VERSION},
|
||||
headers={"Authorization": f"Bearer {credentials.get('access_token', '')}"},
|
||||
timeout=GOG_REPAIR_METADATA_TIMEOUT,
|
||||
)
|
||||
response.raise_for_status()
|
||||
builds = response.json().get("items", [])
|
||||
build = next((item for item in builds if (
|
||||
str(item.get("build_id")) == str(build_id) if build_id
|
||||
else not item.get("branch")
|
||||
)), None)
|
||||
if build is None and build_id:
|
||||
build = next((item for item in builds if not item.get("branch") and item.get("urls")), None)
|
||||
if build:
|
||||
logger.warning(
|
||||
"GOG build %s for %s is unavailable; verifying against build %s",
|
||||
build_id, app_id, build.get("build_id"),
|
||||
)
|
||||
if not build or not build.get("urls"):
|
||||
raise OSError(f"GOG build not found for installed game {app_id}")
|
||||
response = requests.get(build["urls"][0]["url"], timeout=GOG_REPAIR_METADATA_TIMEOUT)
|
||||
response.raise_for_status()
|
||||
data = response.content
|
||||
if build.get("generation") == GOG_COMPRESSED_MANIFEST_VERSION:
|
||||
data = zlib.decompress(data)
|
||||
manifest = orjson.loads(data)
|
||||
manifest["HGLPlatform"] = "windows"
|
||||
manifest["HGLInstallLanguage"] = (
|
||||
info.get("language") or next(iter(info.get("languages", [])), "en-US")
|
||||
)
|
||||
manifest["HGLdlcs"] = [
|
||||
{"id": path.stem.removeprefix("goggame-")}
|
||||
for path in install_path.glob("goggame-*.info")
|
||||
if path.stem != f"goggame-{app_id}"
|
||||
]
|
||||
self._save_json(manifest_path, manifest)
|
||||
|
||||
def get_launch_target(self, app_id: str) -> str | None:
|
||||
"""Return the primary executable from gogdl installation metadata."""
|
||||
primary, install_path = self._get_primary_task(app_id)
|
||||
@@ -615,7 +681,7 @@ class GOGAPI:
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
game = data.get("game", {})
|
||||
if not game.get("visible_in_library", True):
|
||||
if data.get("type") not in {"game", "mod"} or not game.get("visible_in_library", True):
|
||||
return {}
|
||||
steam_release = next(
|
||||
(
|
||||
|
||||
@@ -7,6 +7,7 @@ import struct
|
||||
import io
|
||||
import pefile
|
||||
from PIL import Image
|
||||
from portprotonqt.config.base import CACHE_DIR
|
||||
from portprotonqt.logger import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -48,14 +49,9 @@ def _resolve_batch_icon_target(inputfile: str) -> str | None:
|
||||
|
||||
def get_exe_icon_cache_path(exe_path: str) -> str:
|
||||
"""Return the shared cache path for an executable icon."""
|
||||
cache_home = os.getenv(
|
||||
"XDG_CACHE_HOME",
|
||||
os.path.join(os.path.expanduser("~"), ".cache"),
|
||||
)
|
||||
icon_name = re.sub(r"[^A-Za-z0-9._-]", "_", os.path.basename(exe_path))
|
||||
return os.path.join(
|
||||
cache_home,
|
||||
"PortProtonQt",
|
||||
CACHE_DIR,
|
||||
"images",
|
||||
"exe_icons",
|
||||
f"{icon_name}.png",
|
||||
|
||||
@@ -8,7 +8,7 @@ from PySide6.QtCore import (
|
||||
from PySide6.QtWidgets import QGraphicsItem, QToolButton, QFrame, QLabel, QGraphicsScene, QHBoxLayout, QWidget, QGraphicsView, QVBoxLayout, QSizePolicy
|
||||
from PySide6.QtWidgets import QSpacerItem, QGraphicsPixmapItem, QDialog, QApplication
|
||||
from PIL import Image, ImageQt, ImageSequence
|
||||
from portprotonqt.config import ui_config
|
||||
from portprotonqt.config import CACHE_DIR, ui_config
|
||||
from portprotonqt.theme_manager import ThemeManager, load_theme
|
||||
from portprotonqt.downloader import Downloader
|
||||
from portprotonqt.icon_extractor import generate_thumbnail
|
||||
@@ -367,8 +367,7 @@ def _get_ppdb_autoinstall_image_name(cover: str) -> str:
|
||||
|
||||
|
||||
def clear_ppdb_autoinstall_image_cache(cover_urls: list[str]) -> None:
|
||||
xdg_cache_home = os.getenv("XDG_CACHE_HOME", os.path.join(os.path.expanduser("~"), ".cache"))
|
||||
image_folder = os.path.join(xdg_cache_home, "PortProtonQt", "images")
|
||||
image_folder = str(CACHE_DIR / "images")
|
||||
for cover in cover_urls:
|
||||
filename = _get_ppdb_autoinstall_image_name(cover)
|
||||
if not filename:
|
||||
@@ -457,8 +456,7 @@ def load_pixmap_async(
|
||||
pixmap.load(icon_path)
|
||||
return pixmap
|
||||
|
||||
xdg_cache_home = os.getenv("XDG_CACHE_HOME", os.path.join(os.path.expanduser("~"), ".cache"))
|
||||
image_folder = os.path.join(xdg_cache_home, "PortProtonQt", "images")
|
||||
image_folder = str(CACHE_DIR / "images")
|
||||
os.makedirs(image_folder, exist_ok=True)
|
||||
|
||||
if cover and cover.startswith("https://steamcdn-a.akamaihd.net/steam/apps/"):
|
||||
|
||||
@@ -60,6 +60,7 @@ class MainWindowProtocol(Protocol):
|
||||
current_exec_line: str | None
|
||||
current_add_game_dialog: AddGameDialog | None
|
||||
game_library_manager: Any # GameLibraryManager - using Any to avoid circular import
|
||||
theme: Any
|
||||
auto_size_slider: QSlider | None
|
||||
|
||||
class MouseEmulationThread(QThread):
|
||||
@@ -289,7 +290,7 @@ class InputManager(
|
||||
card for card in container.findChildren(AnimatedCard)
|
||||
if card.isVisible() and card.isEnabled()
|
||||
]
|
||||
if self._navigate_horizontal_library(game_cards, code, value):
|
||||
if self._navigate_horizontal_library(game_cards, tab_index, code, value):
|
||||
return
|
||||
focused = QApplication.focusWidget()
|
||||
if game_cards and focused not in game_cards:
|
||||
@@ -302,14 +303,21 @@ class InputManager(
|
||||
self._parent.tabButtons[tab_index].setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
|
||||
def _navigate_horizontal_library(
|
||||
self, cards: list[QWidget], code: int, value: int
|
||||
self, cards: list[QWidget], tab_index: int, code: int, value: int
|
||||
) -> bool:
|
||||
manager = getattr(self._parent, "game_library_manager", None)
|
||||
if getattr(manager, "layout_mode", "grid") not in {
|
||||
if tab_index == 1:
|
||||
mode = str(
|
||||
getattr(self._parent.theme, "LIBRARY_LAYOUT_MODE", "grid")
|
||||
).lower()
|
||||
layout = getattr(self._parent, "autoInstallContainerLayout", None)
|
||||
else:
|
||||
manager = getattr(self._parent, "game_library_manager", None)
|
||||
mode = getattr(manager, "layout_mode", "grid")
|
||||
layout = getattr(manager, "gamesListLayout", None)
|
||||
if mode not in {
|
||||
"horizontal", "horizontal_top"
|
||||
}:
|
||||
return False
|
||||
layout = getattr(manager, "gamesListLayout", None)
|
||||
if code != PAD_DPAD_X or value == 0 or layout is None:
|
||||
return False
|
||||
ordered_cards = []
|
||||
|
||||
@@ -82,6 +82,9 @@ class ButtonInputMixin(InputMixin):
|
||||
if self._handle_system_table_button(focused, button_code):
|
||||
return
|
||||
|
||||
if self._handle_table_button(focused, button_code):
|
||||
return
|
||||
|
||||
if self._handle_system_quick_button(button_code):
|
||||
return
|
||||
|
||||
@@ -89,6 +92,14 @@ class ButtonInputMixin(InputMixin):
|
||||
except Exception as e:
|
||||
logger.error(f"Error in handle_button_slot: {e}", exc_info=True)
|
||||
|
||||
def _handle_table_button(self, focused: QWidget | None, button_code: int) -> bool:
|
||||
if not isinstance(focused, QTableWidget) or button_code not in BUTTONS['confirm']:
|
||||
return False
|
||||
if not self.handle_table_confirm(focused):
|
||||
return False
|
||||
SoundManager().play("click")
|
||||
return True
|
||||
|
||||
def _open_focused_context_menu(self, focused: QWidget | None, button_code: int) -> bool:
|
||||
if button_code not in BUTTONS['context_menu'] or focused is None:
|
||||
return False
|
||||
|
||||
@@ -257,6 +257,10 @@ class DialogInputModesMixin(InputMixin):
|
||||
if isinstance(cell_widget, QCheckBox) and cell_widget.isEnabled():
|
||||
cell_widget.setChecked(not cell_widget.isChecked())
|
||||
return True
|
||||
if isinstance(cell_widget, QComboBox) and cell_widget.isEnabled():
|
||||
cell_widget.showPopup()
|
||||
cell_widget.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return True
|
||||
if cell_widget is not None:
|
||||
checkbox = cell_widget.findChild(QCheckBox)
|
||||
if checkbox and checkbox.isEnabled():
|
||||
@@ -265,7 +269,8 @@ class DialogInputModesMixin(InputMixin):
|
||||
|
||||
# Check if the cell contains a checkbox
|
||||
item = table.item(current_row, current_col)
|
||||
if item and (item.flags() & Qt.ItemFlag.ItemIsUserCheckable):
|
||||
if (item and item.data(Qt.ItemDataRole.CheckStateRole) is not None
|
||||
and item.flags() & Qt.ItemFlag.ItemIsUserCheckable):
|
||||
# Toggle the checkbox state
|
||||
new_state = Qt.CheckState.Checked if item.checkState() == Qt.CheckState.Unchecked else Qt.CheckState.Unchecked
|
||||
item.setCheckState(new_state)
|
||||
|
||||
@@ -450,6 +450,7 @@ class KeyboardInputMixin(InputMixin):
|
||||
"gamesDisplayCombo",
|
||||
"onlyInstalledCheckBox",
|
||||
"gamesBadgeViewCombo",
|
||||
"gamesLayoutCombo",
|
||||
):
|
||||
widget = getattr(self._parent, attr_name, None)
|
||||
if isinstance(widget, QWidget) and widget.isVisible() and widget.isEnabled():
|
||||
|
||||
@@ -175,7 +175,7 @@ class GamepadRuntimeMixin(InputMixin):
|
||||
keyboard.update_keyboard()
|
||||
|
||||
def find_gamepad(self) -> SDLGamepad | None:
|
||||
"""Find the first SDL3 gamepad with a standardized mapping."""
|
||||
"""Open the SDL3 handle that combines all connected gamepads."""
|
||||
try:
|
||||
gamepad = find_gamepad()
|
||||
self._last_gamepad_error = None
|
||||
@@ -353,10 +353,18 @@ class GamepadRuntimeMixin(InputMixin):
|
||||
self._last_gamepad_check_time = current_time
|
||||
return
|
||||
try:
|
||||
active_gamepad.update()
|
||||
active_changed = active_gamepad.update()
|
||||
if not active_gamepad.connected():
|
||||
self.gamepad_hotplug.emit('remove')
|
||||
return
|
||||
if active_changed:
|
||||
self._reset_input_state()
|
||||
self.gamepad_type = self._get_effective_gamepad_type(active_gamepad)
|
||||
self._refresh_gamepad_ui()
|
||||
logger.info(
|
||||
"Active gamepad changed to SDL instance %s",
|
||||
active_gamepad.active_instance_id,
|
||||
)
|
||||
self._poll_button_events(active_gamepad, current_time)
|
||||
self._handle_pending_menu_fullscreen(current_time)
|
||||
self._poll_hat_events(active_gamepad, current_time)
|
||||
|
||||
@@ -327,12 +327,16 @@ class SettingsInputMixin(InputMixin):
|
||||
self._move_mangohud_vertical(focused, normalized_value, sections)
|
||||
return
|
||||
|
||||
# 2. Combo Box Navigation (within Advanced Table)
|
||||
# 2. Combo Box Navigation (within Advanced and Main Tables)
|
||||
table = self._get_current_settings_table()
|
||||
if not table or table.rowCount() == 0:
|
||||
return
|
||||
|
||||
if self.settings_dialog and table == self.settings_dialog.advanced_table and table.currentRow() >= 0:
|
||||
combo_tables = (
|
||||
self.settings_dialog.advanced_table,
|
||||
self.settings_dialog.settings_table,
|
||||
)
|
||||
if self.settings_dialog and table in combo_tables and table.currentRow() >= 0:
|
||||
cell_widget = table.cellWidget(table.currentRow(), 1)
|
||||
if isinstance(cell_widget, QComboBox) and cell_widget.view().isVisible():
|
||||
if code == PAD_DPAD_Y and value != 0:
|
||||
@@ -433,6 +437,9 @@ class SettingsInputMixin(InputMixin):
|
||||
|
||||
if table == self.settings_dialog.settings_table:
|
||||
cell_widget = table.cellWidget(row, 1)
|
||||
if isinstance(cell_widget, QComboBox) and cell_widget.isEnabled():
|
||||
cell_widget.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
if cell_widget is not None:
|
||||
checkbox = cell_widget.findChild(QCheckBox)
|
||||
if checkbox and checkbox.isEnabled():
|
||||
|
||||
@@ -169,6 +169,9 @@ msgstr ""
|
||||
msgid "Import"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr ""
|
||||
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
@@ -181,9 +184,6 @@ msgstr ""
|
||||
msgid "Open Game Folder"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr ""
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr ""
|
||||
|
||||
@@ -249,12 +249,26 @@ msgstr ""
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Executable not found"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Select another executable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr ""
|
||||
@@ -263,10 +277,6 @@ msgstr ""
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr ""
|
||||
@@ -343,15 +353,24 @@ msgstr ""
|
||||
msgid "Denied"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr ""
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr ""
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library"
|
||||
msgstr ""
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr ""
|
||||
|
||||
@@ -415,10 +434,6 @@ msgstr ""
|
||||
msgid "Unknown Application"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr ""
|
||||
@@ -443,6 +458,10 @@ msgstr ""
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
msgid "Select Epic game folder"
|
||||
msgstr ""
|
||||
|
||||
@@ -747,6 +766,9 @@ msgstr ""
|
||||
msgid "sec."
|
||||
msgstr ""
|
||||
|
||||
msgid "Pause Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Exit"
|
||||
msgstr ""
|
||||
|
||||
@@ -759,6 +781,12 @@ msgstr ""
|
||||
msgid "Recent Games"
|
||||
msgstr ""
|
||||
|
||||
msgid "Resume Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to pause game"
|
||||
msgstr ""
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr ""
|
||||
|
||||
@@ -781,12 +809,6 @@ msgstr ""
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr ""
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr ""
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr ""
|
||||
|
||||
@@ -811,15 +833,15 @@ msgstr ""
|
||||
msgid "Create Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr ""
|
||||
|
||||
@@ -1116,9 +1138,15 @@ msgstr ""
|
||||
msgid "System WINE"
|
||||
msgstr ""
|
||||
|
||||
msgid "Global Game Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr ""
|
||||
|
||||
@@ -1143,6 +1171,9 @@ msgstr ""
|
||||
msgid "Clear PPDB"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr ""
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr ""
|
||||
|
||||
@@ -1152,6 +1183,9 @@ msgstr ""
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Information"
|
||||
msgstr ""
|
||||
|
||||
@@ -1164,6 +1198,12 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1173,9 +1213,6 @@ msgstr ""
|
||||
msgid "Default value"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr ""
|
||||
|
||||
@@ -1369,9 +1406,6 @@ msgstr ""
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr ""
|
||||
|
||||
@@ -1448,6 +1482,15 @@ msgstr ""
|
||||
msgid "Round corners (px)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font scale"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font size"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font"
|
||||
msgstr ""
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr ""
|
||||
|
||||
@@ -1757,6 +1800,9 @@ msgstr ""
|
||||
msgid "Layout and limiter"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Presets"
|
||||
msgstr ""
|
||||
|
||||
@@ -1842,9 +1888,6 @@ msgstr ""
|
||||
msgid "Libraries"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr ""
|
||||
|
||||
@@ -1960,9 +2003,6 @@ msgstr ""
|
||||
msgid "Disk: "
|
||||
msgstr ""
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr ""
|
||||
|
||||
msgid "Started at"
|
||||
msgstr ""
|
||||
|
||||
@@ -2053,10 +2093,6 @@ msgstr ""
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
msgid "Starting"
|
||||
msgstr ""
|
||||
|
||||
@@ -2120,6 +2156,33 @@ msgstr ""
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Theme"
|
||||
msgstr ""
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
msgid "List"
|
||||
msgstr ""
|
||||
|
||||
msgid "Table"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Grid Type:"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2183,6 +2246,9 @@ msgstr ""
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr ""
|
||||
|
||||
@@ -2438,9 +2504,6 @@ msgstr ""
|
||||
msgid "Prefix:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr ""
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: PortProtonQt 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: support@linux-gaming.ru\n"
|
||||
"POT-Creation-Date: 2026-06-18 23:41+0500\n"
|
||||
"PO-Revision-Date: 2026-09-02 20:25+0000\n"
|
||||
"PO-Revision-Date: 2026-09-11 12:20+0000\n"
|
||||
"Last-Translator: Rubin13 <rubin13@noreply.codeberg.org>\n"
|
||||
"Language-Team: German <https://translate.codeberg.org/projects/portprotonqt/"
|
||||
"portprotonqt/de/>\n"
|
||||
@@ -174,6 +174,9 @@ msgstr "Löschen"
|
||||
msgid "Import"
|
||||
msgstr "Import"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Verknüpfung bearbeiten"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "Aktualisierung"
|
||||
|
||||
@@ -186,9 +189,6 @@ msgstr "EOS-Overlay aktivieren"
|
||||
msgid "Open Game Folder"
|
||||
msgstr "Spielordner öffnen"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Verknüpfung bearbeiten"
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr "Von Steam entfernen"
|
||||
|
||||
@@ -258,12 +258,27 @@ msgstr "Desktop"
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr "Fehler beim Speichern der Benutzerdaten: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found"
|
||||
msgstr "Ausführbare Datei nicht gefunden"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Ausführbare Datei nicht gefunden: {0}"
|
||||
|
||||
msgid "Select another executable"
|
||||
msgstr "Wähle eine andere ausführbare Datei aus"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr "Spielname und Ausführungspfad werden benötigt"
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr "Fehler beim Generieren der .desktop-Datei"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Speichern der .desktop-Datei fehlgeschlagen: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr "Die alte .desktop-Datei konnte nicht gelöscht werden: {error}"
|
||||
@@ -272,10 +287,6 @@ msgstr "Die alte .desktop-Datei konnte nicht gelöscht werden: {error}"
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr "Die alte .desktop-Datei für '{game_name}' wurde entfernt"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Speichern der .desktop-Datei fehlgeschlagen: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr "Fehler beim Kopieren des Titelbildes: {error}"
|
||||
@@ -356,15 +367,24 @@ msgstr "Kaputt"
|
||||
msgid "Denied"
|
||||
msgstr "Abgelehnt"
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Spieltitel"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "LETZTER START"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "SPIELZEIT"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Sammlung"
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr "Unbekanntes Spiel"
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr "Wine wird heruntergeladen…"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Sammlung"
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr "Automatische Installation"
|
||||
|
||||
@@ -425,10 +445,6 @@ msgstr "Niemals"
|
||||
msgid "Unknown Application"
|
||||
msgstr "Unbekannte Anwendung"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Ausführbare Datei nicht gefunden: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr "Datei nicht gefunden: {0}"
|
||||
@@ -454,6 +470,10 @@ msgstr "Abhängigkeiten installieren"
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr "Notwendige 32-Bit-Software fehlen. Jetzt installieren?"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "'{0}' und alle Dateien im Installationsordner löschen?"
|
||||
|
||||
msgid "Select Epic game folder"
|
||||
msgstr "Epic-Spieleordner auswählen"
|
||||
|
||||
@@ -817,6 +837,9 @@ msgstr "Min."
|
||||
msgid "sec."
|
||||
msgstr "Sek."
|
||||
|
||||
msgid "Pause Game"
|
||||
msgstr "Spiel anhalten"
|
||||
|
||||
msgid "Exit"
|
||||
msgstr "Exit"
|
||||
|
||||
@@ -829,6 +852,12 @@ msgstr "Favoriten"
|
||||
msgid "Recent Games"
|
||||
msgstr "Aktuelle Spiele"
|
||||
|
||||
msgid "Resume Game"
|
||||
msgstr "Spiel fortsetzen"
|
||||
|
||||
msgid "Failed to pause game"
|
||||
msgstr "Spiel konnte nicht pausiert werden"
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr "Keine aktuellen Spiele"
|
||||
|
||||
@@ -852,12 +881,6 @@ msgstr "Herunterladen"
|
||||
msgid "Size"
|
||||
msgstr "Größe"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "LETZTER START"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "SPIELZEIT"
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr "HAUPTSPIEL"
|
||||
|
||||
@@ -882,15 +905,15 @@ msgstr "Einstellungen"
|
||||
msgid "Create Log"
|
||||
msgstr "Protokoll erstellen"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Protokollierung beenden"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "Ansicht öffnen"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "Neuinstallation"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Protokollierung beenden"
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr "Protokollierung konnte nicht gestartet werden"
|
||||
|
||||
@@ -1195,9 +1218,16 @@ msgstr "Der Download oder das Entpacken wurde abgebrochen."
|
||||
msgid "System WINE"
|
||||
msgstr "System WINE"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Global Game Settings"
|
||||
msgstr "Einstellungen speichern"
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr "Einstellungen für die exe-Datei"
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr "Einstellungen suchen…"
|
||||
|
||||
@@ -1222,6 +1252,10 @@ msgstr "PPDB bearbeiten"
|
||||
msgid "Clear PPDB"
|
||||
msgstr "PPDB zurücksetzen"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr "Laden der Themes fehlgeschlagen"
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr "Der Pfad zur ausführbaren Datei ist nicht verfügbar."
|
||||
|
||||
@@ -1231,6 +1265,10 @@ msgstr "PPDB-Datei ist nicht vorhanden unter: "
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr "Fehler beim Öffnen der PPDB-Datei:\n"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr "Fehler beim Öffnen der PPDB-Datei:\n"
|
||||
|
||||
msgid "Information"
|
||||
msgstr "Information"
|
||||
|
||||
@@ -1245,6 +1283,12 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "Fehler beim Entfernen der PPDB-Datei:\n"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Anwenden der Änderungen fehlgeschlagen. Überprüfe die Protokolle."
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Standard"
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "deaktiviert"
|
||||
|
||||
@@ -1254,9 +1298,6 @@ msgstr "Prefix-Name eingeben"
|
||||
msgid "Default value"
|
||||
msgstr "Standardwert"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Anwenden der Änderungen fehlgeschlagen. Überprüfe die Protokolle."
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr "Rahmenloses Fenster"
|
||||
|
||||
@@ -1460,9 +1501,6 @@ msgstr "Voreingestellte Einstellungen"
|
||||
msgid "Enable {0}"
|
||||
msgstr "Einschalten {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Standard"
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr "FSR-Upscaling"
|
||||
|
||||
@@ -1541,6 +1579,18 @@ msgstr "Hintergrund-Deckkraft"
|
||||
msgid "Round corners (px)"
|
||||
msgstr "Abgerundete Ecken (px)"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font scale"
|
||||
msgstr "Schriftarten"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font size"
|
||||
msgstr "Schriftarten"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font"
|
||||
msgstr "Schriftarten"
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr "Oben links"
|
||||
|
||||
@@ -1850,6 +1900,9 @@ msgstr "VRAM-Nutzung"
|
||||
msgid "Layout and limiter"
|
||||
msgstr "Layout und Limiter"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Schriftarten"
|
||||
|
||||
msgid "Presets"
|
||||
msgstr "Voreinstellungen"
|
||||
|
||||
@@ -1939,9 +1992,6 @@ msgstr "Auswahl"
|
||||
msgid "Libraries"
|
||||
msgstr "Bibliotheken"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Schriftarten"
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr "Winetricks wurde nicht gefunden. Bitte versuche es erneut."
|
||||
|
||||
@@ -2057,9 +2107,6 @@ msgstr "Warten…"
|
||||
msgid "Disk: "
|
||||
msgstr "Datenträger: "
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Spieltitel"
|
||||
|
||||
msgid "Started at"
|
||||
msgstr "Begonnen"
|
||||
|
||||
@@ -2150,10 +2197,6 @@ msgstr "GOG-Spielordner auswählen"
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr "Der ausgewählte Ordner ist nicht dieses GOG-Spiel"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "'{0}' und alle Dateien im Installationsordner löschen?"
|
||||
|
||||
msgid "Starting"
|
||||
msgstr "Starten"
|
||||
|
||||
@@ -2217,6 +2260,40 @@ msgstr "Versteckt"
|
||||
msgid "Badge View Type:"
|
||||
msgstr "Anzeigetyp von Titelbildern:"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Theme"
|
||||
msgstr "Themen"
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "List"
|
||||
msgstr "Hell"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Table"
|
||||
msgstr "Stable"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr "Horizontales HUD-Layout"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Cards"
|
||||
msgstr "Horizontales HUD-Layout"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr "Horizontales HUD-Layout"
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Grid Type:"
|
||||
msgstr "Gamepad-Typ:"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2282,6 +2359,9 @@ msgstr "Benutzeroberflächen-Sounds aktivieren"
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr "Kompatibilitätsbericht nach Spielabsturz anzeigen"
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr "Runtime-Download deaktivieren"
|
||||
|
||||
@@ -2540,9 +2620,6 @@ msgstr "Das Theme konnte nicht gelöscht werden."
|
||||
msgid "Prefix:"
|
||||
msgstr "Prefix:"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "Standardmäßig verwenden"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Wine-Konfiguration"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"Report-Msgid-Bugs-To: support@linux-gaming.ru\n"
|
||||
"POT-Creation-Date: 2026-03-22 13:50+0500\n"
|
||||
"PO-Revision-Date: 2026-08-11 19:26+0000\n"
|
||||
"PO-Revision-Date: 2026-09-10 15:44+0000\n"
|
||||
"Last-Translator: gallegonovato <gallegonovato@noreply.codeberg.org>\n"
|
||||
"Language-Team: Spanish <https://translate.codeberg.org/projects/portprotonqt/"
|
||||
"portprotonqt/es/>\n"
|
||||
@@ -176,6 +176,9 @@ msgstr "Borrar"
|
||||
msgid "Import"
|
||||
msgstr "Importar"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Editar acceso directo"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "Actualizar"
|
||||
|
||||
@@ -188,9 +191,6 @@ msgstr ""
|
||||
msgid "Open Game Folder"
|
||||
msgstr "Abrir la carpeta del juego"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Editar acceso directo"
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr "Eliminar de Steam"
|
||||
|
||||
@@ -258,6 +258,18 @@ msgstr "Escritorio"
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr "No se han podido guardar los datos personalizados: {error}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Executable not found"
|
||||
msgstr "No se ha encontrado el archivo ejecutable: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "No se ha encontrado el archivo ejecutable: {0}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Select another executable"
|
||||
msgstr "Ruta al ejecutable:"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr ""
|
||||
"Es necesario indicar el nombre del juego y la ruta del archivo ejecutable"
|
||||
@@ -265,6 +277,10 @@ msgstr ""
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr "No se han podido generar los datos del archivo .desktop"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "No se ha podido guardar el archivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr "No se ha podido eliminar el archivo .desktop antiguo: {error}"
|
||||
@@ -273,10 +289,6 @@ msgstr "No se ha podido eliminar el archivo .desktop antiguo: {error}"
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr "Se ha eliminado el antiguo archivo .desktop de «{game_name}»"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "No se ha podido guardar el archivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr "No se ha podido copiar la imagen de portada: {error}"
|
||||
@@ -357,15 +369,24 @@ msgstr "Falló"
|
||||
msgid "Denied"
|
||||
msgstr "Denegado"
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Título del juego"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ÚLTIMO LANZAMIENTO"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "TIEMPO EMPLEADO"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Biblioteca"
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr "Juego desconocido"
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr "Descargando Wine…"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Biblioteca"
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr "Instalación automática"
|
||||
|
||||
@@ -426,10 +447,6 @@ msgstr "Nunca"
|
||||
msgid "Unknown Application"
|
||||
msgstr "Aplicación desconocida"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "No se ha encontrado el archivo ejecutable: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr "Archivo no encontrado: {0}"
|
||||
@@ -456,6 +473,10 @@ msgstr "Instalar las dependencias"
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr "Faltan algunas dependencias de 32 bits. ¿Las instalas ahora?"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Select Epic game folder"
|
||||
msgstr "Borrar la carpeta"
|
||||
@@ -836,6 +857,9 @@ msgstr "min"
|
||||
msgid "sec."
|
||||
msgstr "s"
|
||||
|
||||
msgid "Pause Game"
|
||||
msgstr "Pausar el juego"
|
||||
|
||||
msgid "Exit"
|
||||
msgstr "Salir"
|
||||
|
||||
@@ -848,6 +872,12 @@ msgstr "Favoritos"
|
||||
msgid "Recent Games"
|
||||
msgstr "Juegos recientes"
|
||||
|
||||
msgid "Resume Game"
|
||||
msgstr "Reanudar el juego"
|
||||
|
||||
msgid "Failed to pause game"
|
||||
msgstr "Error al pausar el juego"
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr "Sin juegos recientes"
|
||||
|
||||
@@ -870,12 +900,6 @@ msgstr "Descargar"
|
||||
msgid "Size"
|
||||
msgstr "Tamaño"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ÚLTIMO LANZAMIENTO"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "TIEMPO EMPLEADO"
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr "HISTORIA PRINCIPAL"
|
||||
|
||||
@@ -900,15 +924,15 @@ msgstr "Ajustes"
|
||||
msgid "Create Log"
|
||||
msgstr "Crear registro"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Detener el registro"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "Carta abierta"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "Reinstalar"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Detener el registro"
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr "No se pudo iniciar la sesión de depuración"
|
||||
|
||||
@@ -1209,9 +1233,16 @@ msgstr ""
|
||||
msgid "System WINE"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Global Game Settings"
|
||||
msgstr "Ajustes de Wine"
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr "Buscar ajustes…"
|
||||
|
||||
@@ -1236,6 +1267,10 @@ msgstr ""
|
||||
msgid "Clear PPDB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr "Error al cargar los temas"
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr ""
|
||||
|
||||
@@ -1245,6 +1280,10 @@ msgstr ""
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr "No se ha podido abrir la carpeta: {error}"
|
||||
|
||||
msgid "Information"
|
||||
msgstr ""
|
||||
|
||||
@@ -1262,6 +1301,12 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "No se ha podido eliminar el archivo PPDB:\n"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1271,9 +1316,6 @@ msgstr ""
|
||||
msgid "Default value"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr ""
|
||||
|
||||
@@ -1466,9 +1508,6 @@ msgstr ""
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr ""
|
||||
|
||||
@@ -1545,6 +1584,17 @@ msgstr ""
|
||||
msgid "Round corners (px)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font scale"
|
||||
msgstr "Local"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font size"
|
||||
msgstr "Tamaño"
|
||||
|
||||
msgid "Font"
|
||||
msgstr ""
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr ""
|
||||
|
||||
@@ -1854,6 +1904,9 @@ msgstr ""
|
||||
msgid "Layout and limiter"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Presets"
|
||||
msgstr ""
|
||||
|
||||
@@ -1939,9 +1992,6 @@ msgstr ""
|
||||
msgid "Libraries"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr ""
|
||||
|
||||
@@ -2057,9 +2107,6 @@ msgstr "Esperando…"
|
||||
msgid "Disk: "
|
||||
msgstr "Disco: "
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Título del juego"
|
||||
|
||||
msgid "Started at"
|
||||
msgstr "Comenzó en"
|
||||
|
||||
@@ -2153,10 +2200,6 @@ msgstr "Borrar la carpeta"
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Starting"
|
||||
msgstr "Iniciar"
|
||||
@@ -2223,6 +2266,35 @@ msgstr ""
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Theme"
|
||||
msgstr "Temas"
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
msgid "List"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Table"
|
||||
msgstr "Estable"
|
||||
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Grid Type:"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2288,6 +2360,9 @@ msgstr ""
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr ""
|
||||
|
||||
@@ -2546,9 +2621,6 @@ msgstr "Error al cargar los temas"
|
||||
msgid "Prefix:"
|
||||
msgstr "Prefijo:"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "Usar por defecto"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Configuración de Wine"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PortProtonQt 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2026-09-01 17:22+0500\n"
|
||||
"POT-Creation-Date: 2026-09-26 12:00+0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -165,6 +165,9 @@ msgstr ""
|
||||
msgid "Import"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr ""
|
||||
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
@@ -177,9 +180,6 @@ msgstr ""
|
||||
msgid "Open Game Folder"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr ""
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr ""
|
||||
|
||||
@@ -245,12 +245,26 @@ msgstr ""
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Executable not found"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Select another executable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr ""
|
||||
@@ -259,10 +273,6 @@ msgstr ""
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr ""
|
||||
@@ -339,15 +349,24 @@ msgstr ""
|
||||
msgid "Denied"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr ""
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr ""
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library"
|
||||
msgstr ""
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr ""
|
||||
|
||||
@@ -411,10 +430,6 @@ msgstr ""
|
||||
msgid "Unknown Application"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr ""
|
||||
@@ -439,6 +454,10 @@ msgstr ""
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
msgid "Select Epic game folder"
|
||||
msgstr ""
|
||||
|
||||
@@ -743,6 +762,9 @@ msgstr ""
|
||||
msgid "sec."
|
||||
msgstr ""
|
||||
|
||||
msgid "Pause Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Exit"
|
||||
msgstr ""
|
||||
|
||||
@@ -755,6 +777,12 @@ msgstr ""
|
||||
msgid "Recent Games"
|
||||
msgstr ""
|
||||
|
||||
msgid "Resume Game"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to pause game"
|
||||
msgstr ""
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr ""
|
||||
|
||||
@@ -777,12 +805,6 @@ msgstr ""
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr ""
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr ""
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr ""
|
||||
|
||||
@@ -807,15 +829,15 @@ msgstr ""
|
||||
msgid "Create Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr ""
|
||||
|
||||
@@ -1112,9 +1134,15 @@ msgstr ""
|
||||
msgid "System WINE"
|
||||
msgstr ""
|
||||
|
||||
msgid "Global Game Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr ""
|
||||
|
||||
@@ -1139,6 +1167,9 @@ msgstr ""
|
||||
msgid "Clear PPDB"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr ""
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr ""
|
||||
|
||||
@@ -1148,6 +1179,9 @@ msgstr ""
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Information"
|
||||
msgstr ""
|
||||
|
||||
@@ -1160,6 +1194,12 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1169,9 +1209,6 @@ msgstr ""
|
||||
msgid "Default value"
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr ""
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr ""
|
||||
|
||||
@@ -1365,9 +1402,6 @@ msgstr ""
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr ""
|
||||
|
||||
@@ -1444,6 +1478,15 @@ msgstr ""
|
||||
msgid "Round corners (px)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font scale"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font size"
|
||||
msgstr ""
|
||||
|
||||
msgid "Font"
|
||||
msgstr ""
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr ""
|
||||
|
||||
@@ -1753,6 +1796,9 @@ msgstr ""
|
||||
msgid "Layout and limiter"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Presets"
|
||||
msgstr ""
|
||||
|
||||
@@ -1838,9 +1884,6 @@ msgstr ""
|
||||
msgid "Libraries"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr ""
|
||||
|
||||
@@ -1956,9 +1999,6 @@ msgstr ""
|
||||
msgid "Disk: "
|
||||
msgstr ""
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr ""
|
||||
|
||||
msgid "Started at"
|
||||
msgstr ""
|
||||
|
||||
@@ -2049,10 +2089,6 @@ msgstr ""
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
msgid "Starting"
|
||||
msgstr ""
|
||||
|
||||
@@ -2116,6 +2152,33 @@ msgstr ""
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Theme"
|
||||
msgstr ""
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
msgid "List"
|
||||
msgstr ""
|
||||
|
||||
msgid "Table"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
msgid "Grid Type:"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2179,6 +2242,9 @@ msgstr ""
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr ""
|
||||
|
||||
@@ -2435,9 +2501,6 @@ msgstr ""
|
||||
msgid "Prefix:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr ""
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: PortProtonQt 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: support@linux-gaming.ru\n"
|
||||
"POT-Creation-Date: 2026-06-04 10:32+0500\n"
|
||||
"PO-Revision-Date: 2026-08-28 22:26+0000\n"
|
||||
"PO-Revision-Date: 2026-09-09 00:26+0000\n"
|
||||
"Last-Translator: rogerio-mattos <rogerio-mattos@noreply.codeberg.org>\n"
|
||||
"Language-Team: Portuguese (Brazil) <https://translate.codeberg.org/projects/"
|
||||
"portprotonqt/portprotonqt/pt_BR/>\n"
|
||||
@@ -174,23 +174,21 @@ msgstr "Excluir"
|
||||
msgid "Import"
|
||||
msgstr "Importar"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Editar Atalho"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "Atualizar"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Disable EOS Overlay"
|
||||
msgstr "Ativar overlay mangoapp"
|
||||
msgstr "Desativar sobreposição do EOS"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Enable EOS Overlay"
|
||||
msgstr "Ativar overlay mangoapp"
|
||||
msgstr "Ativar sobreposição do EOS"
|
||||
|
||||
msgid "Open Game Folder"
|
||||
msgstr "Abrir Pasta do Jogo"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Editar Atalho"
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr "Remover da Steam"
|
||||
|
||||
@@ -260,12 +258,28 @@ msgstr "Área de Trabalho"
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr "Falha ao salvar os dados personalizados: {error}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Executable not found"
|
||||
msgstr "Executável não encontrado: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Executável não encontrado: {0}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Select another executable"
|
||||
msgstr "Excluir atalhos sem executável"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr "O nome do jogo e o caminho do executável são obrigatórios"
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr "Falha ao gerar os dados do arquivo .desktop"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Falha ao salvar o arquivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr "Falha ao excluir o arquivo .desktop antigo: {error}"
|
||||
@@ -274,10 +288,6 @@ msgstr "Falha ao excluir o arquivo .desktop antigo: {error}"
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr "Arquivo .desktop antigo de '{game_name}' removido"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Falha ao salvar o arquivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr "Falha ao copiar a imagem de capa: {error}"
|
||||
@@ -358,15 +368,24 @@ msgstr "Quebrado"
|
||||
msgid "Denied"
|
||||
msgstr "Negado"
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Título do jogo"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ÚLTIMO LANÇAMENTO"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "TEMPO JOGADO"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Biblioteca"
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr "Jogo Desconhecido"
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr "Baixando Wine…"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Biblioteca"
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr "Instalação Automática"
|
||||
|
||||
@@ -427,10 +446,6 @@ msgstr "Nunca"
|
||||
msgid "Unknown Application"
|
||||
msgstr "Aplicativo Desconhecido"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Executável não encontrado: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr "Arquivo não encontrado: {0}"
|
||||
@@ -455,17 +470,18 @@ msgstr "Instalar dependências"
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr "As dependências de 32 bits estão faltando. Instalá-las agora?"
|
||||
|
||||
#, fuzzy
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "Excluir '{0}' e todos os arquivos da sua pasta de instalação?"
|
||||
|
||||
msgid "Select Epic game folder"
|
||||
msgstr "Selecionar pasta do jogo da GOG"
|
||||
msgstr "elecionar pasta do jogo da Epic"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Another Epic operation is running"
|
||||
msgstr "Outra operação da GOG já está em execução"
|
||||
msgstr "Outra operação da Epic está em andamento"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Wine prefix not found"
|
||||
msgstr "Prefixo não encontrado"
|
||||
msgstr "Prefixo do Wine não encontrado"
|
||||
|
||||
msgid "Game not found."
|
||||
msgstr "Jogo não encontrado."
|
||||
@@ -824,6 +840,10 @@ msgstr "min."
|
||||
msgid "sec."
|
||||
msgstr "s."
|
||||
|
||||
#, fuzzy
|
||||
msgid "Pause Game"
|
||||
msgstr "Iniciar Jogo"
|
||||
|
||||
msgid "Exit"
|
||||
msgstr "Sair"
|
||||
|
||||
@@ -836,6 +856,14 @@ msgstr "Favoritos"
|
||||
msgid "Recent Games"
|
||||
msgstr "Jogos Recentes"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Resume Game"
|
||||
msgstr "Jogos Recentes"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to pause game"
|
||||
msgstr "Falha ao parar o jogo"
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr "Nenhum jogo recente"
|
||||
|
||||
@@ -858,12 +886,6 @@ msgstr "Baixar"
|
||||
msgid "Size"
|
||||
msgstr "Tamanho"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ÚLTIMO LANÇAMENTO"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "TEMPO JOGADO"
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr "HISTÓRIA PRINCIPAL"
|
||||
|
||||
@@ -888,15 +910,15 @@ msgstr "Configurações"
|
||||
msgid "Create Log"
|
||||
msgstr "Criar log"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Encerrar log"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "Abrir cartão"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "Reinstale"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Encerrar log"
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr "Falha ao iniciar a sessão de depuração"
|
||||
|
||||
@@ -1200,9 +1222,16 @@ msgstr "O download ou a extração foi cancelado."
|
||||
msgid "System WINE"
|
||||
msgstr "WINE do Sistema"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Global Game Settings"
|
||||
msgstr "Salvar Configurações"
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr "Configurações do Exe"
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr "Pesquisar configurações…"
|
||||
|
||||
@@ -1227,6 +1256,10 @@ msgstr "Editar PPDB"
|
||||
msgid "Clear PPDB"
|
||||
msgstr "Limpar PPDB"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr "Falha ao carregar temas"
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr "O caminho do executável não está disponível."
|
||||
|
||||
@@ -1236,6 +1269,10 @@ msgstr "O arquivo PPDB não existe em: "
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr "Falha ao abrir o arquivo PPDB:\n"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr "Falha ao abrir o arquivo PPDB:\n"
|
||||
|
||||
msgid "Information"
|
||||
msgstr "Informação"
|
||||
|
||||
@@ -1250,6 +1287,12 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "Falha ao remover o arquivo PPDB:\n"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Falha ao aplicar as alterações. Verifique os logs."
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Padrão"
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "desativado"
|
||||
|
||||
@@ -1259,9 +1302,6 @@ msgstr "Digite o nome do prefixo"
|
||||
msgid "Default value"
|
||||
msgstr "Valor padrão"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Falha ao aplicar as alterações. Verifique os logs."
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr "Janela sem bordas"
|
||||
|
||||
@@ -1465,9 +1505,6 @@ msgstr "Predefinições rápidas"
|
||||
msgid "Enable {0}"
|
||||
msgstr "Ativar {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Padrão"
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr "FSR upscaling"
|
||||
|
||||
@@ -1544,6 +1581,18 @@ msgstr "Opacidade do fundo"
|
||||
msgid "Round corners (px)"
|
||||
msgstr "Cantos arredondados (px)"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font scale"
|
||||
msgstr "Fontes"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font size"
|
||||
msgstr "Fontes"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font"
|
||||
msgstr "Fontes"
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr "Superior esquerdo"
|
||||
|
||||
@@ -1853,6 +1902,9 @@ msgstr "Uso de VRAM"
|
||||
msgid "Layout and limiter"
|
||||
msgstr "Layout e limitador"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Fontes"
|
||||
|
||||
msgid "Presets"
|
||||
msgstr "Predefinições"
|
||||
|
||||
@@ -1942,9 +1994,6 @@ msgstr "Definir"
|
||||
msgid "Libraries"
|
||||
msgstr "Bibliotecas"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Fontes"
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr "Winetricks não encontrado. Tente novamente."
|
||||
|
||||
@@ -2060,9 +2109,6 @@ msgstr "Aguardando…"
|
||||
msgid "Disk: "
|
||||
msgstr "Disco: "
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Título do jogo"
|
||||
|
||||
msgid "Started at"
|
||||
msgstr "Iniciado em"
|
||||
|
||||
@@ -2108,43 +2154,38 @@ msgstr "Atualizando biblioteca da GOG… {0}/{1}"
|
||||
msgid "Failed to refresh GOG library: {0}"
|
||||
msgstr "Falha ao atualizar a biblioteca da GOG: {0}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to log out of Epic account"
|
||||
msgstr "Falha ao sair da conta GOG"
|
||||
msgstr "Falha ao sair da conta da Epic"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Copy the authorization code to clipboard"
|
||||
msgstr "Copiar o link para a área de transferência"
|
||||
msgstr "Copiar o código de autorização para a área de transferência"
|
||||
|
||||
msgid "Epic authorization…"
|
||||
msgstr ""
|
||||
msgstr "Autorização da Epic…"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
#, python-brace-format
|
||||
msgid "Epic login failed: {0}"
|
||||
msgstr "Falha no login da GOG: {0}"
|
||||
msgstr "Falha no login da Epic: {0}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Epic account connected"
|
||||
msgstr "Conta GOG conectada"
|
||||
msgstr "Conta da Epic conectada"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Epic account not connected"
|
||||
msgstr "Conta GOG não conectada"
|
||||
msgstr "Conta Epic não conectada"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
#, python-brace-format
|
||||
msgid "Refreshing Epic library… {0}/{1}"
|
||||
msgstr "Atualizando biblioteca da GOG… {0}/{1}"
|
||||
msgstr "Atualizando biblioteca da Epic… {0}/{1}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
#, python-brace-format
|
||||
msgid "Failed to refresh Epic library: {0}"
|
||||
msgstr "Falha ao atualizar a biblioteca da GOG: {0}"
|
||||
msgstr "Falha ao atualizar a biblioteca da Epic: {0}"
|
||||
|
||||
msgid "Select installation folder"
|
||||
msgstr "Selecionar pasta de instalação"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Another download is running"
|
||||
msgstr "Baixando agora"
|
||||
msgstr "Outro download está em andamento"
|
||||
|
||||
msgid "Another GOG operation is already running"
|
||||
msgstr "Outra operação da GOG já está em execução"
|
||||
@@ -2158,10 +2199,6 @@ msgstr "Selecionar pasta do jogo da GOG"
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr "A pasta selecionada não corresponde a este jogo da GOG"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "Excluir '{0}' e todos os arquivos da sua pasta de instalação?"
|
||||
|
||||
msgid "Starting"
|
||||
msgstr "Iniciando"
|
||||
|
||||
@@ -2225,6 +2262,40 @@ msgstr "Oculto"
|
||||
msgid "Badge View Type:"
|
||||
msgstr "Modo de Exibição do Selo:"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Theme"
|
||||
msgstr "Temas"
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "List"
|
||||
msgstr "Claro"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Table"
|
||||
msgstr "Estável"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr "Layout horizontal do HUD"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Cards"
|
||||
msgstr "Layout horizontal do HUD"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr "Layout horizontal do HUD"
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Grid Type:"
|
||||
msgstr "Tipo de Controle:"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2282,7 +2353,7 @@ msgid "Hide Control Hints"
|
||||
msgstr "Ocultar dicas de controle"
|
||||
|
||||
msgid "Force English language"
|
||||
msgstr ""
|
||||
msgstr "Forçar idioma inglês"
|
||||
|
||||
msgid "Enable UI Sounds"
|
||||
msgstr "Ativar sons da interface"
|
||||
@@ -2290,6 +2361,9 @@ msgstr "Ativar sons da interface"
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr "Mostrar relatório de compatibilidade após a falha do jogo"
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr "Desativar download de runtime"
|
||||
|
||||
@@ -2451,9 +2525,8 @@ msgstr "Dispositivos de reprodução"
|
||||
msgid "Output"
|
||||
msgstr "Saída"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Return to desktop"
|
||||
msgstr "Adicionar à Área de Trabalho"
|
||||
msgstr "Voltar para a área de trabalho"
|
||||
|
||||
msgid "Logout"
|
||||
msgstr "Encerrar sessão"
|
||||
@@ -2547,9 +2620,6 @@ msgstr "Não foi possível excluir o tema."
|
||||
msgid "Prefix:"
|
||||
msgstr "Prefixo:"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "Usar por padrão"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Configuração do Wine"
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: support@linux-gaming.ru\n"
|
||||
"POT-Creation-Date: 2026-03-22 13:50+0500\n"
|
||||
"PO-Revision-Date: 2026-09-05 17:10+0000\n"
|
||||
"Last-Translator: adem4ik <adem4ik@noreply.codeberg.org>\n"
|
||||
"PO-Revision-Date: 2026-09-20 18:28+0000\n"
|
||||
"Last-Translator: Boria138 <boria138@noreply.codeberg.org>\n"
|
||||
"Language-Team: Russian <https://translate.codeberg.org/projects/portprotonqt/"
|
||||
"portprotonqt/ru/>\n"
|
||||
"Language: ru\n"
|
||||
@@ -19,7 +19,7 @@ msgstr ""
|
||||
"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 2026.8.1\n"
|
||||
"X-Generator: Weblate 2026.9.1\n"
|
||||
"Generated-By: Babel 2.18.0\n"
|
||||
|
||||
msgid "Stop Game"
|
||||
@@ -112,8 +112,8 @@ msgid ""
|
||||
"Are you sure you want to delete folder '{folder_name}'? This action "
|
||||
"cannot be undone."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить папку '{folder_name}'? Это действие нельзя"
|
||||
" отменить."
|
||||
"Уверены, что хотите удалить папку «{folder_name}»? Это действие нельзя "
|
||||
"отменить."
|
||||
|
||||
msgid "Yes"
|
||||
msgstr "Да"
|
||||
@@ -130,8 +130,7 @@ msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить файл '{file_name}'? Это действие нельзя "
|
||||
"отменить."
|
||||
"Уверены, что хотите удалить файл «{file_name}»? Это действие нельзя отменить."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
@@ -175,6 +174,9 @@ msgstr "Удалить"
|
||||
msgid "Import"
|
||||
msgstr "Импорт"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Редактировать ярлык"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "Обновить"
|
||||
|
||||
@@ -187,9 +189,6 @@ msgstr "Включить наложение EOS"
|
||||
msgid "Open Game Folder"
|
||||
msgstr "Открыть папку с игрой"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "Редактировать ярлык"
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr "Удалить из Steam"
|
||||
|
||||
@@ -232,8 +231,8 @@ msgid ""
|
||||
"Are you sure you want to delete '{game_name}'? This will remove the "
|
||||
".desktop file and custom data."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить '{game_name}'? Это приведёт к удалению "
|
||||
"файла .desktop и пользовательских данных."
|
||||
"Уверены, что хотите удалить «{game_name}»? Это приведёт к удалению файла "
|
||||
".desktop и пользовательских данных."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to add '{game_name}' to {location}: {error}"
|
||||
@@ -257,12 +256,27 @@ msgstr "Рабочий стол"
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr "Не удалось сохранить пользовательские данные: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found"
|
||||
msgstr "Исполняемый файл не найден"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Исполняемый файл не найден: {0}"
|
||||
|
||||
msgid "Select another executable"
|
||||
msgstr "Выбрать другой исполняемый файл"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr "Требуются название игры и путь к исполняемому файлу"
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr "Не удалось сгенерировать данные файла .desktop"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Не удалось сохранить файл .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr "Не удалось удалить старый файл .desktop: {error}"
|
||||
@@ -271,10 +285,6 @@ msgstr "Не удалось удалить старый файл .desktop: {erro
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr "Удалён старый файл .desktop для '{game_name}'"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "Не удалось сохранить файл .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr "Не удалось скопировать обложку: {error}"
|
||||
@@ -355,15 +365,24 @@ msgstr "Сломано"
|
||||
msgid "Denied"
|
||||
msgstr "Отказано"
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Название игры"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ПОСЛЕДНИЙ ЗАПУСК"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "ПРОВЕДЁННОЕ ВРЕМЯ"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Библиотека"
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr "Неизвестная игра"
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr "Скачивание Wine…"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "Библиотека"
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr "Автоустановка"
|
||||
|
||||
@@ -424,10 +443,6 @@ msgstr "Никогда"
|
||||
msgid "Unknown Application"
|
||||
msgstr "Неизвестное приложение"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "Исполняемый файл не найден: {0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr "Файл не найден: {0}"
|
||||
@@ -452,6 +467,10 @@ msgstr "Установить зависимости"
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr "Отсутствуют 32-битные зависимости. Установить их сейчас?"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "Удалить «{0}» и все файлы в папке установки?"
|
||||
|
||||
msgid "Select Epic game folder"
|
||||
msgstr "Выберите папку игры Epic"
|
||||
|
||||
@@ -819,6 +838,9 @@ msgstr "мин."
|
||||
msgid "sec."
|
||||
msgstr "сек."
|
||||
|
||||
msgid "Pause Game"
|
||||
msgstr "Приостановить игру"
|
||||
|
||||
msgid "Exit"
|
||||
msgstr "Выход"
|
||||
|
||||
@@ -831,6 +853,12 @@ msgstr "Избранное"
|
||||
msgid "Recent Games"
|
||||
msgstr "Недавние"
|
||||
|
||||
msgid "Resume Game"
|
||||
msgstr "Возобновить игру"
|
||||
|
||||
msgid "Failed to pause game"
|
||||
msgstr "Не удалось приостановить игру"
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr "Нет недавних игр"
|
||||
|
||||
@@ -839,7 +867,7 @@ msgstr "Нет избранных"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Launch \"{name}\" with PortProton"
|
||||
msgstr "Запустить \"{name}\" с помощью PortProton"
|
||||
msgstr "Запустить «{name}» с помощью PortProton"
|
||||
|
||||
msgid "Debug log mode was launched"
|
||||
msgstr "Запущен режим логирования"
|
||||
@@ -853,12 +881,6 @@ msgstr "Скачать"
|
||||
msgid "Size"
|
||||
msgstr "Размер"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "ПОСЛЕДНИЙ ЗАПУСК"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "ПРОВЕДЁННОЕ ВРЕМЯ"
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr "СЮЖЕТ"
|
||||
|
||||
@@ -883,15 +905,15 @@ msgstr "Настройки"
|
||||
msgid "Create Log"
|
||||
msgstr "Создать лог"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Остановить лог"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "Открыть карточку"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "Переустановить"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Остановить лог"
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr "Не удалось запустить процесс отладки"
|
||||
|
||||
@@ -1143,7 +1165,7 @@ msgid ""
|
||||
"\n"
|
||||
"This action cannot be undone."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить {} выбранные WINE/Proton?\n"
|
||||
"Уверены, что хотите удалить {} выбранных WINE/Proton?\n"
|
||||
"\n"
|
||||
"Это действие нельзя отменить."
|
||||
|
||||
@@ -1195,9 +1217,16 @@ msgstr "Скачивание или распаковка отменены."
|
||||
msgid "System WINE"
|
||||
msgstr "Системный WINE"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Global Game Settings"
|
||||
msgstr "Сохранить настройки"
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr "Настройки EXE"
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr "Поиск настроек…"
|
||||
|
||||
@@ -1222,6 +1251,10 @@ msgstr "Редактировать PPDB"
|
||||
msgid "Clear PPDB"
|
||||
msgstr "Очистить PPDB"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr "Не удалось загрузить темы"
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr "Путь к исполняемому файлу недоступен."
|
||||
|
||||
@@ -1231,6 +1264,10 @@ msgstr "Файл PPDB не существует по адресу: "
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr "Не удалось открыть файл PPDB:\n"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr "Не удалось открыть файл PPDB:\n"
|
||||
|
||||
msgid "Information"
|
||||
msgstr "Информация"
|
||||
|
||||
@@ -1238,11 +1275,17 @@ msgid "Confirm PPDB Clear"
|
||||
msgstr "Подтвердите очистку PPDB"
|
||||
|
||||
msgid "Are you sure you want to clear settings? This action cannot be undone."
|
||||
msgstr "Вы уверены, что хотите сбросить настройки? Это действие нельзя отменить."
|
||||
msgstr "Уверены, что хотите сбросить настройки? Это действие нельзя отменить."
|
||||
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "Не удалось удалить файл PPDB:\n"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Не удалось применить изменения. Проверьте логи."
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Стандартный"
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "отключено"
|
||||
|
||||
@@ -1252,9 +1295,6 @@ msgstr "Введите имя префикса"
|
||||
msgid "Default value"
|
||||
msgstr "По умолчанию"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "Не удалось применить изменения. Проверьте логи."
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr "Без рамок"
|
||||
|
||||
@@ -1443,7 +1483,7 @@ msgid "Display heatmap-style debug view of HDR luminance in nits"
|
||||
msgstr "Отображение отладочной тепловой карты вида яркости HDR в нитах"
|
||||
|
||||
msgid "Launch with the mangoapp (mangohud) performance overlay enabled"
|
||||
msgstr "Запуск с включенным mangoapp (mangohud)"
|
||||
msgstr "Запуск с оверлеем производительности mangoapp (mangohud)"
|
||||
|
||||
msgid "Enable adaptive sync if available (variable rate refresh)"
|
||||
msgstr ""
|
||||
@@ -1460,9 +1500,6 @@ msgstr "Быстрые профили"
|
||||
msgid "Enable {0}"
|
||||
msgstr "Включить {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Стандартный"
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr "FSR масштабирование"
|
||||
|
||||
@@ -1539,6 +1576,15 @@ msgstr "Прозрачность фона"
|
||||
msgid "Round corners (px)"
|
||||
msgstr "Скругление углов (пикс)"
|
||||
|
||||
msgid "Font scale"
|
||||
msgstr "Масштаб шрифта"
|
||||
|
||||
msgid "Font size"
|
||||
msgstr "Размер шрифта"
|
||||
|
||||
msgid "Font"
|
||||
msgstr "Шрифт"
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr "Слева сверху"
|
||||
|
||||
@@ -1819,7 +1865,7 @@ msgid "Local time"
|
||||
msgstr "Местное время"
|
||||
|
||||
msgid "Time without label"
|
||||
msgstr "Скрывать слово \"Time\" перед временем"
|
||||
msgstr "Скрывать слово «Time» перед временем"
|
||||
|
||||
msgid "Force trilinear filtering"
|
||||
msgstr "Включить трилинейную фильтрацию"
|
||||
@@ -1848,6 +1894,9 @@ msgstr "Использование видеопамяти"
|
||||
msgid "Layout and limiter"
|
||||
msgstr "Компоновка и ограничения"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Шрифты"
|
||||
|
||||
msgid "Presets"
|
||||
msgstr "Профили"
|
||||
|
||||
@@ -1936,9 +1985,6 @@ msgstr "Выбор"
|
||||
msgid "Libraries"
|
||||
msgstr "Библиотеки"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "Шрифты"
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr "Winetricks не найден. Повторите попытку."
|
||||
|
||||
@@ -2054,9 +2100,6 @@ msgstr "Ожидание…"
|
||||
msgid "Disk: "
|
||||
msgstr "Диск: "
|
||||
|
||||
msgid "Game Title"
|
||||
msgstr "Название игры"
|
||||
|
||||
msgid "Started at"
|
||||
msgstr "Начато"
|
||||
|
||||
@@ -2145,10 +2188,6 @@ msgstr "Выберите папку игры GOG"
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr "Выбранная папка не является этой игрой GOG"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr "Удалить «{0}» и все файлы в папке установки?"
|
||||
|
||||
msgid "Starting"
|
||||
msgstr "Запуск"
|
||||
|
||||
@@ -2199,10 +2238,10 @@ msgid "Display Filter:"
|
||||
msgstr "Фильтр:"
|
||||
|
||||
msgid "Only Installed"
|
||||
msgstr "Только Установленные"
|
||||
msgstr "Только установленные"
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr "Детальный"
|
||||
msgstr "Подробный"
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr "Скрытый"
|
||||
@@ -2210,13 +2249,47 @@ msgstr "Скрытый"
|
||||
msgid "Badge View Type:"
|
||||
msgstr "Тип отображения бейджей:"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Theme"
|
||||
msgstr "Темы"
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "List"
|
||||
msgstr "Светлая"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Table"
|
||||
msgstr "Стабильный"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr "Горизонтальное расположение HUD"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Cards"
|
||||
msgstr "Горизонтальное расположение HUD"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr "Горизонтальное расположение HUD"
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Grid Type:"
|
||||
msgstr "Тип геймпада:"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
"will remove the .desktop files and custom data."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить {count} карточек без исполняемого файла? "
|
||||
"Это приведёт к удалению файлов .desktop и пользовательских данных."
|
||||
"Уверены, что хотите удалить {count} карточек без исполняемых файлов? Это "
|
||||
"приведёт к удалению файлов .desktop и пользовательских данных."
|
||||
|
||||
msgid "PortProton Settings"
|
||||
msgstr "Настройки PortProtonQt"
|
||||
@@ -2261,7 +2334,7 @@ msgid "Start in tray"
|
||||
msgstr "Запускать свёрнутым"
|
||||
|
||||
msgid "Hide Auto-Install Tab"
|
||||
msgstr "Скрывать вкладку \"Автоустановка\""
|
||||
msgstr "Скрывать вкладку «Автоустановка»"
|
||||
|
||||
msgid "Hide Control Hints"
|
||||
msgstr "Скрывать подсказки управления"
|
||||
@@ -2275,6 +2348,9 @@ msgstr "Включить звуки интерфейса"
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr "Показывать отчёт о совместимости после сбоя игры"
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr "Отключить скачивание контейнера"
|
||||
|
||||
@@ -2355,8 +2431,7 @@ msgstr "Подтверждение сброса"
|
||||
|
||||
msgid "Are you sure you want to reset all settings? This action cannot be undone."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите сбросить все настройки? Это действие нельзя "
|
||||
"отменить."
|
||||
"Уверены, что хотите сбросить все настройки? Это действие нельзя отменить."
|
||||
|
||||
msgid "Migrate old PortProton shortcuts to PortProtonQt format?"
|
||||
msgstr "Обновить старые ярлыки PortProton до формата PortProtonQt?"
|
||||
@@ -2365,7 +2440,7 @@ msgid "Confirm Clear Cache"
|
||||
msgstr "Подтверждение очистки кэша"
|
||||
|
||||
msgid "Are you sure you want to clear the cache? This action cannot be undone."
|
||||
msgstr "Вы уверены, что хотите очистить кэш? Это действие нельзя отменить."
|
||||
msgstr "Уверены, что хотите очистить кэш? Это действие нельзя отменить."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "AppImage integrated at: {path}"
|
||||
@@ -2530,9 +2605,6 @@ msgstr "Не удалось удалить тему."
|
||||
msgid "Prefix:"
|
||||
msgstr "Префикс:"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "Использовать по умолчанию"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Конфигурация Wine"
|
||||
|
||||
@@ -2562,7 +2634,7 @@ msgstr "Не удалось запустить процесс."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Are you sure you want to clear prefix '{}'?"
|
||||
msgstr "Вы уверены, что хотите очистить префикс «{}»?"
|
||||
msgstr "Уверены, что хотите очистить префикс «{}»?"
|
||||
|
||||
msgid "Failed to start prefix clear process."
|
||||
msgstr "Не удалось запустить процесс очистки префикса."
|
||||
@@ -2595,7 +2667,7 @@ msgstr "Восстановление префикса не удалось."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Are you sure you want to delete prefix '{}'?"
|
||||
msgstr "Вы уверены, что хотите удалить префикс «{}»?"
|
||||
msgstr "Уверены, что хотите удалить префикс «{}»?"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Prefix '{}' deleted."
|
||||
|
||||
@@ -169,6 +169,9 @@ msgstr "删除"
|
||||
msgid "Import"
|
||||
msgstr ""
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "编辑快捷方式"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "更新"
|
||||
|
||||
@@ -183,9 +186,6 @@ msgstr "启用 mangoapp 叠加层"
|
||||
msgid "Open Game Folder"
|
||||
msgstr "打开游戏文件夹"
|
||||
|
||||
msgid "Edit Shortcut"
|
||||
msgstr "编辑快捷方式"
|
||||
|
||||
msgid "Remove from Steam"
|
||||
msgstr "从 Steam 移除"
|
||||
|
||||
@@ -251,12 +251,28 @@ msgstr "桌面"
|
||||
msgid "Failed to save custom data: {error}"
|
||||
msgstr "保存自定义数据失败:{error}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Executable not found"
|
||||
msgstr "找不到可执行文件:{0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "找不到可执行文件:{0}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Select another executable"
|
||||
msgstr "删除没有可执行文件的卡片"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr "游戏名称和可执行文件路径为必填项"
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr "生成 .desktop 文件数据失败"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "保存 .desktop 文件失败:{error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr "删除旧的 .desktop 文件失败:{error}"
|
||||
@@ -265,10 +281,6 @@ msgstr "删除旧的 .desktop 文件失败:{error}"
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr "已移除\"{game_name}\"的旧版 .desktop 文件"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr "保存 .desktop 文件失败:{error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr "复制封面图像失败:{error}"
|
||||
@@ -345,15 +357,25 @@ msgstr "损坏"
|
||||
msgid "Denied"
|
||||
msgstr "已拒绝"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Game Title"
|
||||
msgstr "游戏宽度"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "上次启动"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "游戏时长"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "库"
|
||||
|
||||
msgid "Unknown Game"
|
||||
msgstr "未知游戏"
|
||||
|
||||
msgid "Downloading Wine…"
|
||||
msgstr "正在下载 Wine…"
|
||||
|
||||
msgid "Library"
|
||||
msgstr "库"
|
||||
|
||||
msgid "Auto Install"
|
||||
msgstr "自动安装"
|
||||
|
||||
@@ -415,10 +437,6 @@ msgstr "从不"
|
||||
msgid "Unknown Application"
|
||||
msgstr "未知应用程序"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Executable not found: {0}"
|
||||
msgstr "找不到可执行文件:{0}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File not found: {0}"
|
||||
msgstr "找不到文件:{0}"
|
||||
@@ -443,6 +461,10 @@ msgstr "安装依赖"
|
||||
msgid "32-bit dependencies are missing. Install them now?"
|
||||
msgstr "缺少 32 位依赖项。现在安装吗?"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Select Epic game folder"
|
||||
msgstr "删除文件夹"
|
||||
@@ -780,6 +802,10 @@ msgstr "分钟。"
|
||||
msgid "sec."
|
||||
msgstr "秒。"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Pause Game"
|
||||
msgstr "启动游戏"
|
||||
|
||||
msgid "Exit"
|
||||
msgstr "退出"
|
||||
|
||||
@@ -792,6 +818,14 @@ msgstr "收藏夹"
|
||||
msgid "Recent Games"
|
||||
msgstr "最近游戏"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Resume Game"
|
||||
msgstr "最近游戏"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to pause game"
|
||||
msgstr "停止游戏失败"
|
||||
|
||||
msgid "No recent games"
|
||||
msgstr "无最近游戏"
|
||||
|
||||
@@ -814,12 +848,6 @@ msgstr "下载"
|
||||
msgid "Size"
|
||||
msgstr "大小"
|
||||
|
||||
msgid "LAST LAUNCH"
|
||||
msgstr "上次启动"
|
||||
|
||||
msgid "TIME SPENT"
|
||||
msgstr "游戏时长"
|
||||
|
||||
msgid "MAIN STORY"
|
||||
msgstr "主线剧情"
|
||||
|
||||
@@ -844,15 +872,15 @@ msgstr "设置"
|
||||
msgid "Create Log"
|
||||
msgstr "创建日志"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "停止日志"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "打开卡片"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "重新安装"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "停止日志"
|
||||
|
||||
msgid "Failed to start debug session"
|
||||
msgstr "启动调试会话失败"
|
||||
|
||||
@@ -1155,9 +1183,16 @@ msgstr "下载或提取已被取消。"
|
||||
msgid "System WINE"
|
||||
msgstr "系统 WINE"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Global Game Settings"
|
||||
msgstr "保存设置"
|
||||
|
||||
msgid "Exe Settings"
|
||||
msgstr "可执行文件设置"
|
||||
|
||||
msgid "Edit user.conf"
|
||||
msgstr ""
|
||||
|
||||
msgid "Search settings…"
|
||||
msgstr "搜索设置…"
|
||||
|
||||
@@ -1182,6 +1217,10 @@ msgstr "编辑 PPDB"
|
||||
msgid "Clear PPDB"
|
||||
msgstr "清除 PPDB"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to load global game settings."
|
||||
msgstr "加载主题失败"
|
||||
|
||||
msgid "Executable path is not available."
|
||||
msgstr "可执行文件路径不可用。"
|
||||
|
||||
@@ -1191,6 +1230,10 @@ msgstr "PPDB 文件不存在于: "
|
||||
msgid "Failed to open PPDB file:\n"
|
||||
msgstr "打开 PPDB 文件失败:\n"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Failed to open file:\n"
|
||||
msgstr "打开 PPDB 文件失败:\n"
|
||||
|
||||
msgid "Information"
|
||||
msgstr "信息"
|
||||
|
||||
@@ -1203,6 +1246,12 @@ msgstr "确定要清除设置吗?此操作无法撤销。"
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "移除 PPDB 文件失败:\n"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "应用更改失败。请检查日志。"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "默认"
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "已禁用"
|
||||
|
||||
@@ -1212,9 +1261,6 @@ msgstr "输入前缀名称"
|
||||
msgid "Default value"
|
||||
msgstr "默认值"
|
||||
|
||||
msgid "Failed to apply changes. Check logs."
|
||||
msgstr "应用更改失败。请检查日志。"
|
||||
|
||||
msgid "Borderless window"
|
||||
msgstr "无边框窗口"
|
||||
|
||||
@@ -1408,9 +1454,6 @@ msgstr "快速预设"
|
||||
msgid "Enable {0}"
|
||||
msgstr "启用 {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "默认"
|
||||
|
||||
msgid "FSR upscaling"
|
||||
msgstr "FSR 升频"
|
||||
|
||||
@@ -1487,6 +1530,18 @@ msgstr "背景不透明度"
|
||||
msgid "Round corners (px)"
|
||||
msgstr "圆角(像素)"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font scale"
|
||||
msgstr "字体"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font size"
|
||||
msgstr "字体"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Font"
|
||||
msgstr "字体"
|
||||
|
||||
msgid "Top-left"
|
||||
msgstr "左上角"
|
||||
|
||||
@@ -1796,6 +1851,9 @@ msgstr "VRAM 使用量"
|
||||
msgid "Layout and limiter"
|
||||
msgstr "布局和限制器"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "字体"
|
||||
|
||||
msgid "Presets"
|
||||
msgstr "预设"
|
||||
|
||||
@@ -1881,9 +1939,6 @@ msgstr "设置"
|
||||
msgid "Libraries"
|
||||
msgstr "库"
|
||||
|
||||
msgid "Fonts"
|
||||
msgstr "字体"
|
||||
|
||||
msgid "Winetricks not found. Please try again."
|
||||
msgstr "未找到 Winetricks。请重试。"
|
||||
|
||||
@@ -2005,10 +2060,6 @@ msgstr "警告"
|
||||
msgid "Disk: "
|
||||
msgstr "链接:"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Game Title"
|
||||
msgstr "游戏宽度"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Started at"
|
||||
msgstr "状态"
|
||||
@@ -2108,10 +2159,6 @@ msgstr "删除文件夹"
|
||||
msgid "Selected folder is not this GOG game"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Delete '{0}' and all files in its installation folder?"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Starting"
|
||||
msgstr "设置项"
|
||||
@@ -2180,6 +2227,40 @@ msgstr "隐藏"
|
||||
msgid "Badge View Type:"
|
||||
msgstr "徽章视图类型:"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Theme"
|
||||
msgstr "主题"
|
||||
|
||||
msgid "Grid"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "List"
|
||||
msgstr "浅色"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Table"
|
||||
msgstr "稳定"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Blocks"
|
||||
msgstr "水平 HUD 布局"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Cards"
|
||||
msgstr "水平 HUD 布局"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Horizontal Top Blocks"
|
||||
msgstr "水平 HUD 布局"
|
||||
|
||||
msgid "Horizontal Top Cards"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Grid Type:"
|
||||
msgstr "游戏手柄类型:"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete {count} cards without executable? This "
|
||||
@@ -2246,6 +2327,9 @@ msgstr "启用界面音效"
|
||||
msgid "Show compatibility report after game crash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable ALT Linux i586 dependency check"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable runtime download"
|
||||
msgstr "禁用运行时下载"
|
||||
|
||||
@@ -2504,9 +2588,6 @@ msgstr "加载主题失败"
|
||||
msgid "Prefix:"
|
||||
msgstr "前缀:"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "默认使用"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Wine 配置"
|
||||
|
||||
|
||||
@@ -42,20 +42,24 @@ STORE_CONTENT_LOCALES = {'es': 'es-ES', 'pt': 'pt-BR', 'zh': 'zh-CN'}
|
||||
|
||||
# Try local locale directory first, fallback to system for development
|
||||
_local_localedir = Path(__file__).parent / "locales"
|
||||
_system_prefix = "/app" if os.getenv("FLATPAK_ID") else os.getenv("SHARUN_DIR", "/usr")
|
||||
_system_localedir = Path(_system_prefix) / "share" / "locale"
|
||||
_locale_dirs = [_local_localedir]
|
||||
if os.getenv("SHARUN_DIR"):
|
||||
_locale_dirs.append(Path(os.environ["SHARUN_DIR"]) / "share" / "locale")
|
||||
_locale_dirs.extend(
|
||||
Path(data_dir) / "locale"
|
||||
for data_dir in os.getenv(
|
||||
"XDG_DATA_DIRS", "/usr/local/share:/usr/share"
|
||||
).split(os.pathsep)
|
||||
if data_dir
|
||||
)
|
||||
|
||||
try:
|
||||
translate = gettext.translation(
|
||||
domain="portprotonqt",
|
||||
localedir=_local_localedir,
|
||||
)
|
||||
except FileNotFoundError:
|
||||
translate = gettext.translation(
|
||||
domain="portprotonqt",
|
||||
localedir=_system_localedir,
|
||||
fallback=True,
|
||||
)
|
||||
translate = gettext.NullTranslations()
|
||||
for _locale_dir in _locale_dirs:
|
||||
try:
|
||||
translate = gettext.translation("portprotonqt", localedir=_locale_dir)
|
||||
break
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
|
||||
|
||||
def _(message: str) -> str:
|
||||
|
||||
+192
-137
@@ -5,7 +5,6 @@ import sys
|
||||
import signal
|
||||
import shlex
|
||||
import subprocess
|
||||
import tempfile
|
||||
import re
|
||||
import time
|
||||
from datetime import datetime
|
||||
@@ -67,6 +66,7 @@ from portprotonqt.disc_image_utils import DiscImageManager
|
||||
from portprotonqt.compatibility_report import (
|
||||
CompatibilityLaunch,
|
||||
analyze_launch,
|
||||
get_running_game_processes,
|
||||
has_dxvk_vulkan_incompatibility,
|
||||
is_suspected_crash,
|
||||
)
|
||||
@@ -99,55 +99,7 @@ DISC_IMAGE_EXTENSIONS = (".iso", ".mdf", ".nrg")
|
||||
ALT_BIARCH_REPO = "x86_64-i586"
|
||||
ALT_BIARCH_URL = "https://www.altlinux.org/Biarch"
|
||||
GAME_LAUNCH_MARKER = "PORTPROTONQT_GAME_LAUNCH_STARTED"
|
||||
ALT_I586_BASE_PACKAGES = (
|
||||
"glibc-nss",
|
||||
"glibc-gconv-modules",
|
||||
"libnm",
|
||||
"libvulkan1",
|
||||
"libd3d",
|
||||
"libfreetype",
|
||||
)
|
||||
ALT_I586_PACKAGE_PREFIXES = ("libnss-", "xorg-dri-")
|
||||
ALT_I586_EXCLUDED_PACKAGES = ("libnss-fallback",)
|
||||
ALT_INSTALL_SCRIPT_MODE = 0o700
|
||||
ALT_I586_INSTALL_SCRIPT = """#!/bin/sh
|
||||
set -u
|
||||
trap 'rm -f "$0"' EXIT
|
||||
|
||||
LIST=""
|
||||
|
||||
add_if_needed() {
|
||||
package="$1"
|
||||
i586_package="i586-$package"
|
||||
|
||||
if rpm -q "$package" >/dev/null 2>&1 && ! rpm -q "$i586_package" >/dev/null 2>&1; then
|
||||
LIST="$LIST $i586_package"
|
||||
fi
|
||||
}
|
||||
|
||||
for package in glibc-nss glibc-gconv-modules libnm libvulkan1 libd3d libfreetype; do
|
||||
add_if_needed "$package"
|
||||
done
|
||||
|
||||
for package in $(rpm -qa --qf '%{NAME}\\n' \
|
||||
| grep '^libnss-' \
|
||||
| grep -v '^libnss-fallback$' || true); do
|
||||
add_if_needed "$package"
|
||||
done
|
||||
|
||||
for package in $(rpm -qa --qf '%{NAME}\\n' | grep '^xorg-dri-' || true); do
|
||||
add_if_needed "$package"
|
||||
done
|
||||
|
||||
if ! apt-get update; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$LIST" ]; then
|
||||
apt-get install -y $LIST
|
||||
fi
|
||||
"""
|
||||
|
||||
GAME_EXIT_MARKER = "PORTPROTONQT_GAME_EXIT_CODE"
|
||||
|
||||
class MainWindow(
|
||||
MainWindowControlHintsMixin,
|
||||
@@ -308,7 +260,8 @@ class MainWindow(
|
||||
self.current_theme_name = selected_theme
|
||||
# Apply theme but defer heavy font loading
|
||||
self.theme = self.theme_manager.apply_theme(selected_theme)
|
||||
self.tray_manager = TrayManager(self, app_name, self.current_theme_name)
|
||||
self.tray_manager = None
|
||||
QTimer.singleShot(0, lambda: self._initialize_tray(app_name))
|
||||
self.card_width = ui_config.get_card_width()
|
||||
self.auto_card_width = ui_config.get_auto_card_width()
|
||||
self.setWindowTitle(f"{app_name} {version}")
|
||||
@@ -333,6 +286,7 @@ class MainWindow(
|
||||
self._pending_log_exe: str | None = None
|
||||
self.appimageUpdateWorker: AppImageUpdateWorker | None = None
|
||||
self.gogdlUpdateWorker: QThread | None = None
|
||||
self.initialCommandWorker: QThread | None = None
|
||||
self.compatibility_report_ready.connect(self._show_compatibility_report)
|
||||
|
||||
self.game_library_manager = GameLibraryManager(self, self.theme, None)
|
||||
@@ -771,7 +725,7 @@ class MainWindow(
|
||||
if state is None:
|
||||
continue
|
||||
status, percent, launch_started = state
|
||||
if launch_started:
|
||||
if launch_started or status == GAME_EXIT_MARKER:
|
||||
continue
|
||||
self._update_install_progress(status, percent)
|
||||
|
||||
@@ -873,6 +827,9 @@ class MainWindow(
|
||||
line_lower = line.lower()
|
||||
status = percent = None
|
||||
launch_started = line_text == GAME_LAUNCH_MARKER
|
||||
exit_match = re.fullmatch(rf"{GAME_EXIT_MARKER}=([0-9]{{1,3}})", line_text)
|
||||
if exit_match:
|
||||
return GAME_EXIT_MARKER, int(exit_match.group(1)), False
|
||||
progress_match = re.fullmatch(r'([0-9]*\.?[0-9]+)%', line_text)
|
||||
if progress_match:
|
||||
percent = float(progress_match.group(1))
|
||||
@@ -1094,6 +1051,9 @@ class MainWindow(
|
||||
def on_game_info(game: dict, steam_info: dict) -> None:
|
||||
nonlocal processed_count
|
||||
app_id = str(game.get("app_id", ""))
|
||||
name, custom_cover = MainWindow._get_custom_store_data(
|
||||
"gog", app_id, str(game.get("title", app_id))
|
||||
)
|
||||
is_installed = api.is_game_installed(app_id, installed)
|
||||
if not only_installed or is_installed:
|
||||
action = "launch" if is_installed else "install"
|
||||
@@ -1103,8 +1063,8 @@ class MainWindow(
|
||||
) if target else 0
|
||||
playtime_seconds = playtime_seconds or 0
|
||||
games.append((
|
||||
str(game.get("title", app_id)),
|
||||
str(game.get("description", "")), str(game.get("cover", "")),
|
||||
name, str(game.get("description", "")),
|
||||
custom_cover or str(game.get("cover", "")),
|
||||
app_id,
|
||||
steam_info.get("controller_support", ""),
|
||||
f"gog://{action}/{app_id}",
|
||||
@@ -1153,6 +1113,9 @@ class MainWindow(
|
||||
def on_game_info(game: dict, steam_info: dict) -> None:
|
||||
nonlocal processed_count
|
||||
app_id = str(game["app_id"])
|
||||
name, custom_cover = MainWindow._get_custom_store_data(
|
||||
"egs", app_id, str(game.get("title", app_id))
|
||||
)
|
||||
installed = self.egs_api.is_game_installed(app_id)
|
||||
if not only_installed or installed:
|
||||
target = self.egs_api.get_launch_target(app_id) if installed else None
|
||||
@@ -1164,8 +1127,8 @@ class MainWindow(
|
||||
) if target else 0
|
||||
playtime = playtime or 0
|
||||
games.append((
|
||||
str(game.get("title", app_id)), description,
|
||||
str(game.get("cover", "")), app_id,
|
||||
name, description,
|
||||
custom_cover or str(game.get("cover", "")), app_id,
|
||||
steam_info.get("controller_support", ""),
|
||||
f"egs://{'launch' if installed else 'install'}/{app_id}",
|
||||
get_last_launch(f"egs-{app_id}") if target else _("Never"),
|
||||
@@ -1263,12 +1226,30 @@ class MainWindow(
|
||||
appid: int | str, fallback_name: str
|
||||
) -> tuple[str, str]:
|
||||
"""Return custom Steam name and cover stored by AppID."""
|
||||
return MainWindow._get_custom_store_data("steam", appid, fallback_name)
|
||||
|
||||
@staticmethod
|
||||
def _get_custom_store_data(
|
||||
source: str, appid: int | str, fallback_name: str
|
||||
) -> tuple[str, str]:
|
||||
"""Return custom store name and cover stored by game ID."""
|
||||
appid_str = str(appid)
|
||||
if appid_str in {"", ".", ".."} or os.path.basename(appid_str) != appid_str:
|
||||
return fallback_name, ""
|
||||
xdg_data_home = os.getenv(
|
||||
"XDG_DATA_HOME", os.path.join(os.path.expanduser("~"), ".local", "share")
|
||||
)
|
||||
storage_id = f"{source}-{appid_str}"
|
||||
game_dir = os.path.join(
|
||||
xdg_data_home, "PortProtonQt", "custom_data", str(appid)
|
||||
xdg_data_home, "PortProtonQt", "custom_data", storage_id
|
||||
)
|
||||
if source == "steam" and not os.path.isdir(game_dir):
|
||||
# Remove the legacy AppID-only fallback after the migration period.
|
||||
legacy_dir = os.path.join(
|
||||
xdg_data_home, "PortProtonQt", "custom_data", appid_str
|
||||
)
|
||||
if os.path.isdir(legacy_dir):
|
||||
game_dir = legacy_dir
|
||||
metadata_path = os.path.join(game_dir, "metadata.txt")
|
||||
custom_name = fallback_name
|
||||
if os.path.isfile(metadata_path):
|
||||
@@ -2014,8 +1995,8 @@ class MainWindow(
|
||||
|
||||
def checkTargetExe(self):
|
||||
"""Update launch state from the marker and PortProton process."""
|
||||
child_running = self._has_running_game_process()
|
||||
dependency_active = self._drain_launch_output_progress()
|
||||
child_running = self._has_running_game_process()
|
||||
|
||||
if dependency_active:
|
||||
# Dependencies are downloading/extracting - update button with progress
|
||||
@@ -2038,7 +2019,8 @@ class MainWindow(
|
||||
def _finish_silent_launch(self) -> None:
|
||||
if not getattr(self, "silent_launch_mode", False):
|
||||
return
|
||||
self.tray_manager.tray_icon.hide()
|
||||
if self.tray_manager is not None:
|
||||
self.tray_manager.tray_icon.hide()
|
||||
QApplication.quit()
|
||||
|
||||
def _set_running_button_stop(self) -> None:
|
||||
@@ -2073,6 +2055,9 @@ class MainWindow(
|
||||
status, percent, launch_started = self.launch_output_queue.get_nowait()
|
||||
except Empty:
|
||||
break
|
||||
if status == GAME_EXIT_MARKER:
|
||||
self.game_command_exit_code = int(percent) if percent is not None else None
|
||||
continue
|
||||
if launch_started:
|
||||
if not self.game_launch_started:
|
||||
self.game_launch_monotonic = time.monotonic()
|
||||
@@ -2126,6 +2111,9 @@ class MainWindow(
|
||||
self.wine_download_percent = 0.0
|
||||
self.wine_download_status = _("Downloading Wine…")
|
||||
self.game_launch_started = False
|
||||
self.game_observed_processes = {}
|
||||
self.game_observed_started = None
|
||||
self.game_command_exit_code = None
|
||||
launcher_only = getattr(self, "launcher_process_only", False)
|
||||
self.launcher_process_only = False
|
||||
self.game_processes = [] if launcher_only else [
|
||||
@@ -2234,22 +2222,33 @@ class MainWindow(
|
||||
return extract_exec_target_path(exec_line) or ""
|
||||
|
||||
def _has_running_game_process(self) -> bool:
|
||||
if self._observe_game_processes():
|
||||
return True
|
||||
process_alive = any(proc.poll() is None for proc in self.game_processes)
|
||||
if process_alive and not (
|
||||
getattr(self, "launcher_process_only", False)
|
||||
and self.game_launch_started
|
||||
and (
|
||||
self.game_launch_started
|
||||
or getattr(self, "game_stopped_by_user", False)
|
||||
)
|
||||
):
|
||||
self.game_process_exit_monotonic = None
|
||||
if getattr(self, "game_observed_started", None) is None:
|
||||
self.game_process_exit_monotonic = None
|
||||
return True
|
||||
target = str(self.target_exe or "").lower()
|
||||
if target:
|
||||
for process in psutil.process_iter(attrs=["name"]):
|
||||
if target and not getattr(self, "game_start_exe", None):
|
||||
for process in psutil.process_iter(attrs=["name", "status"]):
|
||||
try:
|
||||
if str(process.info.get("name") or "").lower() == target:
|
||||
if (
|
||||
str(process.info.get("name") or "").lower() == target
|
||||
and process.info.get("status") != psutil.STATUS_ZOMBIE
|
||||
):
|
||||
self.game_process_exit_monotonic = None
|
||||
return True
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
continue
|
||||
if getattr(self, "game_stopped_by_user", False):
|
||||
return False
|
||||
launch_started = getattr(self, "game_launch_monotonic", None)
|
||||
if launch_started is not None:
|
||||
now = time.monotonic()
|
||||
@@ -2261,6 +2260,26 @@ class MainWindow(
|
||||
return False
|
||||
return (datetime.now() - started).total_seconds() < STORE_LAUNCH_GRACE_SECONDS
|
||||
|
||||
def _observe_game_processes(self) -> bool:
|
||||
executable = getattr(self, "game_start_exe", None)
|
||||
started = getattr(self, "game_start_time", None)
|
||||
if not executable or started is None:
|
||||
return False
|
||||
running = get_running_game_processes(executable, started.timestamp())
|
||||
previous = getattr(self, "game_observed_processes", {})
|
||||
for identity in running.keys() - previous.keys():
|
||||
logger.info("Game process appeared: pid=%s executable=%s", identity[0], running[identity])
|
||||
for identity in previous.keys() - running.keys():
|
||||
logger.info("Game process disappeared: pid=%s executable=%s", identity[0], previous[identity])
|
||||
self.game_observed_processes = running
|
||||
if running:
|
||||
if getattr(self, "game_observed_started", None) is None:
|
||||
self.game_observed_started = time.monotonic()
|
||||
self.game_process_exit_monotonic = None
|
||||
elif previous:
|
||||
self.game_process_exit_monotonic = time.monotonic()
|
||||
return bool(running)
|
||||
|
||||
def _start_launch_output_reader(self, process: subprocess.Popen[str]) -> None:
|
||||
"""Start background reader for PortProton launch output."""
|
||||
self.launch_output_queue = Queue()
|
||||
@@ -2325,28 +2344,43 @@ class MainWindow(
|
||||
|
||||
def _analyze_short_launch(self) -> None:
|
||||
if not ui_config.get_crash_reports_enabled():
|
||||
logger.info("Compatibility report skipped: crash reports disabled")
|
||||
return
|
||||
executable = getattr(self, "game_start_exe", None) or ""
|
||||
started = getattr(self, "game_launch_monotonic", None)
|
||||
started = getattr(self, "game_observed_started", None)
|
||||
if started is None:
|
||||
started = getattr(self, "game_launch_monotonic", None)
|
||||
if started is None:
|
||||
logger.info("Compatibility report skipped: no launch marker for %s", executable)
|
||||
return
|
||||
ended = getattr(self, "game_process_exit_monotonic", None)
|
||||
duration = (ended or time.monotonic()) - started
|
||||
stopped_by_user = getattr(self, "game_stopped_by_user", False)
|
||||
exit_code = next(
|
||||
launcher_exit_code = next(
|
||||
(process.poll() for process in self.game_processes if process.poll() is not None),
|
||||
None,
|
||||
)
|
||||
exit_code = getattr(self, "game_command_exit_code", None)
|
||||
launch = CompatibilityLaunch(
|
||||
executable=executable,
|
||||
exit_code=exit_code,
|
||||
duration=duration,
|
||||
)
|
||||
logger.info(
|
||||
"Compatibility launch: executable=%s duration=%.3fs wine_exit_code=%s "
|
||||
"launcher_exit_code=%s stopped_by_user=%s process_observed=%s",
|
||||
executable, duration, exit_code, launcher_exit_code, stopped_by_user,
|
||||
getattr(self, "game_observed_started", None) is not None,
|
||||
)
|
||||
worker = Thread(
|
||||
target=self._build_compatibility_report,
|
||||
args=(launch, stopped_by_user),
|
||||
daemon=True,
|
||||
)
|
||||
self.compatibility_workers = [
|
||||
active for active in getattr(self, "compatibility_workers", []) if active.is_alive()
|
||||
]
|
||||
self.compatibility_workers.append(worker)
|
||||
worker.start()
|
||||
|
||||
def _build_compatibility_report(
|
||||
@@ -2355,9 +2389,17 @@ class MainWindow(
|
||||
try:
|
||||
incompatible_dxvk = has_dxvk_vulkan_incompatibility(launch.executable)
|
||||
if not incompatible_dxvk and not is_suspected_crash(
|
||||
launch.duration, stopped_by_user, launch.executable
|
||||
launch.duration, stopped_by_user, launch.executable, launch.exit_code
|
||||
):
|
||||
logger.info(
|
||||
"Compatibility report skipped: crash criteria not met "
|
||||
"(duration=%.3fs stopped_by_user=%s windows_executable=%s exists=%s)",
|
||||
launch.duration, stopped_by_user,
|
||||
launch.executable.lower().endswith((".exe", ".msi")),
|
||||
os.path.isfile(launch.executable),
|
||||
)
|
||||
return
|
||||
logger.info("Compatibility analysis started: %s", launch.executable)
|
||||
report = analyze_launch(launch, self.portproton_location or "")
|
||||
except (OSError, ValueError, TypeError) as error:
|
||||
logger.error("Compatibility analysis failed for %s: %s", launch.executable, error)
|
||||
@@ -2365,6 +2407,7 @@ class MainWindow(
|
||||
self.compatibility_report_ready.emit(report)
|
||||
|
||||
def _show_compatibility_report(self, report: str) -> None:
|
||||
logger.info("Compatibility report dialog opened")
|
||||
dialog = CompatibilityReportDialog(self, self.theme, report)
|
||||
dialog.exec()
|
||||
|
||||
@@ -2398,6 +2441,10 @@ class MainWindow(
|
||||
self.current_running_button = button
|
||||
self.game_stopped_by_user = True
|
||||
self.egs_launch_cancelled = True
|
||||
if getattr(self, "launcher_process_only", False):
|
||||
if self._run_portproton_stop_command():
|
||||
return True
|
||||
|
||||
self._analyze_short_launch()
|
||||
|
||||
self._terminate_game_processes()
|
||||
@@ -2467,23 +2514,14 @@ class MainWindow(
|
||||
|
||||
return ALT_BIARCH_REPO in result.stdout
|
||||
|
||||
def _get_missing_alt_i586_packages(self) -> list[str]:
|
||||
try:
|
||||
installed = set(self._get_installed_alt_package_names())
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
logger.warning("Failed to check ALT i586 packages: %s", e)
|
||||
return [f"i586-{package}" for package in ALT_I586_BASE_PACKAGES]
|
||||
def _has_missing_alt_i586_packages(self) -> bool:
|
||||
if not self.start_sh:
|
||||
return True
|
||||
|
||||
return [
|
||||
f"i586-{package}" for package in self._get_alt_i586_package_names(installed)
|
||||
if f"i586-{package}" not in installed
|
||||
]
|
||||
|
||||
def _get_installed_alt_package_names(self) -> list[str]:
|
||||
with ThreadPoolExecutor(max_workers=1) as executor:
|
||||
future = executor.submit(
|
||||
subprocess.run,
|
||||
["rpm", "-qa", "--qf", "%{NAME}\n"],
|
||||
self.start_sh + ["cli", "--alt-i586-dependencies"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10,
|
||||
@@ -2494,46 +2532,44 @@ class MainWindow(
|
||||
while not future.done():
|
||||
QApplication.processEvents(event_flags)
|
||||
time.sleep(0.01)
|
||||
result = future.result()
|
||||
if result.returncode != 0:
|
||||
raise subprocess.SubprocessError(result.stderr.strip())
|
||||
try:
|
||||
result = future.result()
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
logger.warning("Failed to check ALT i586 packages: %s", e)
|
||||
return True
|
||||
|
||||
return result.stdout.splitlines()
|
||||
return result.returncode != 0
|
||||
|
||||
def _get_alt_i586_package_names(self, installed: set[str]) -> list[str]:
|
||||
packages = [
|
||||
package for package in ALT_I586_BASE_PACKAGES
|
||||
if package in installed
|
||||
]
|
||||
packages.extend(
|
||||
package for package in sorted(installed)
|
||||
if self._is_alt_i586_prefixed_package(package)
|
||||
)
|
||||
return packages
|
||||
|
||||
def _is_alt_i586_prefixed_package(self, package: str) -> bool:
|
||||
if package in ALT_I586_EXCLUDED_PACKAGES:
|
||||
def _install_alt_i586_dependencies(self) -> bool:
|
||||
if not self.start_sh:
|
||||
return False
|
||||
return any(package.startswith(prefix) for prefix in ALT_I586_PACKAGE_PREFIXES)
|
||||
|
||||
def _create_alt_i586_install_script(self) -> str | None:
|
||||
try:
|
||||
fd, script_path = tempfile.mkstemp(
|
||||
prefix="portprotonqt-alt-i586-",
|
||||
suffix=".sh",
|
||||
)
|
||||
with os.fdopen(fd, "w", encoding="utf-8") as script:
|
||||
script.write(ALT_I586_INSTALL_SCRIPT)
|
||||
os.chmod(script_path, ALT_INSTALL_SCRIPT_MODE)
|
||||
except OSError as e:
|
||||
logger.warning("Failed to create ALT i586 install script: %s", e)
|
||||
return None
|
||||
command = [
|
||||
"pkexec",
|
||||
*self.start_sh,
|
||||
"cli",
|
||||
"--alt-i586-dependencies",
|
||||
"install",
|
||||
]
|
||||
process = QProcess(self)
|
||||
event_loop = QEventLoop()
|
||||
process.finished.connect(event_loop.quit)
|
||||
process.start(
|
||||
sys.executable,
|
||||
["-m", "portprotonqt.scripts_utils.easyterm", "-e", shlex.join(command)],
|
||||
)
|
||||
if not process.waitForStarted(5000):
|
||||
logger.warning("Failed to start ALT i586 dependency installer")
|
||||
return False
|
||||
|
||||
return script_path
|
||||
event_loop.exec()
|
||||
return not self._has_missing_alt_i586_packages()
|
||||
|
||||
def _check_alt_i586_dependencies_before_launch(self) -> bool:
|
||||
if not self._is_alt_x86_64():
|
||||
return True
|
||||
if ui_config.get_disable_alt_i586_dependency_check():
|
||||
return True
|
||||
|
||||
if not self._has_alt_biarch_repo():
|
||||
QMessageBox.warning(
|
||||
@@ -2543,7 +2579,7 @@ class MainWindow(
|
||||
)
|
||||
return False
|
||||
|
||||
if not self._get_missing_alt_i586_packages():
|
||||
if not self._has_missing_alt_i586_packages():
|
||||
return True
|
||||
|
||||
msg_box = QMessageBox(self)
|
||||
@@ -2558,19 +2594,7 @@ class MainWindow(
|
||||
msg_box.setButtonText(QMessageBox.StandardButton.Cancel, _("Cancel"))
|
||||
reply = msg_box.exec()
|
||||
if reply == QMessageBox.StandardButton.Ok:
|
||||
script_path = self._create_alt_i586_install_script()
|
||||
if not script_path:
|
||||
return False
|
||||
|
||||
QProcess.startDetached(
|
||||
sys.executable,
|
||||
[
|
||||
"-m",
|
||||
"portprotonqt.scripts_utils.easyterm",
|
||||
"-e",
|
||||
f"pkexec /bin/sh {shlex.quote(script_path)}",
|
||||
],
|
||||
)
|
||||
return self._install_alt_i586_dependencies()
|
||||
return False
|
||||
|
||||
def _resolve_iso_launch_parts(self, iso_path: str) -> list[str] | None:
|
||||
@@ -2619,7 +2643,7 @@ class MainWindow(
|
||||
None,
|
||||
)
|
||||
if game:
|
||||
self._install_gog_game(game)
|
||||
self._select_store_dlcs("gog", game)
|
||||
|
||||
def _handle_egs_game(self, exec_line: str, button=None) -> None:
|
||||
action, app_id = exec_line.removeprefix("egs://").split("/", 1)
|
||||
@@ -2631,7 +2655,12 @@ class MainWindow(
|
||||
self._install_egs_game(app_id)
|
||||
|
||||
def _install_egs_game(self, app_id: str) -> None:
|
||||
self._install_egs_download(app_id)
|
||||
game = next(
|
||||
(item for item in self.egs_api.load_library()
|
||||
if str(item.get("app_id", "")) == app_id),
|
||||
{"app_id": app_id, "title": app_id, "cover": ""},
|
||||
)
|
||||
self._select_store_dlcs("egs", game)
|
||||
|
||||
def _repair_egs_game(self, app_id: str) -> None:
|
||||
self._start_egs_operation(
|
||||
@@ -2645,6 +2674,23 @@ class MainWindow(
|
||||
)
|
||||
|
||||
def _delete_egs_game(self, app_id: str) -> None:
|
||||
game = self.egs_api.load_installed().get(app_id, {})
|
||||
message_box = QMessageBox(self)
|
||||
message_box.setIcon(QMessageBox.Icon.Question)
|
||||
message_box.setWindowTitle(_("Confirm Deletion"))
|
||||
message_box.setText(
|
||||
_("Delete '{0}' and all files in its installation folder?").format(
|
||||
game.get("title") or app_id
|
||||
)
|
||||
)
|
||||
message_box.setStandardButtons(
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
)
|
||||
message_box.setDefaultButton(QMessageBox.StandardButton.No)
|
||||
message_box.setButtonText(QMessageBox.StandardButton.Yes, _("Yes"))
|
||||
message_box.setButtonText(QMessageBox.StandardButton.No, _("No"))
|
||||
if message_box.exec() != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
self._start_egs_operation(
|
||||
app_id, ["uninstall", app_id, "-y"], _("Delete")
|
||||
)
|
||||
@@ -2754,10 +2800,12 @@ class MainWindow(
|
||||
self, _("Error"), _("Cannot launch game while another game is running")
|
||||
)
|
||||
return
|
||||
if not self._check_alt_i586_dependencies_before_launch():
|
||||
self._finish_silent_launch()
|
||||
return
|
||||
try:
|
||||
wrapper = shlex.join([self.start_sh[0], "--epic-wrapper"])
|
||||
command = self.egs_api.build_command([
|
||||
"launch", app_id, "--json", "--wrapper", wrapper,
|
||||
"launch", app_id, "--json", "--wrapper", self.start_sh[0],
|
||||
"--no-wine", "--skip-version-check",
|
||||
])
|
||||
process = subprocess.Popen(
|
||||
@@ -2818,6 +2866,9 @@ class MainWindow(
|
||||
if self.game_processes:
|
||||
QMessageBox.warning(self, _("Error"), _("Cannot launch game while another game is running"))
|
||||
return
|
||||
if not self._check_alt_i586_dependencies_before_launch():
|
||||
self._finish_silent_launch()
|
||||
return
|
||||
needs_setup = getattr(self.gog_api, "needs_support_setup", lambda _app_id: False)
|
||||
if needs_setup(app_id):
|
||||
self._start_gog_support_setup(app_id, button)
|
||||
@@ -2921,6 +2972,9 @@ class MainWindow(
|
||||
if not self.stop_running_game(update_button):
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to stop game"))
|
||||
else:
|
||||
if not self._check_alt_i586_dependencies_before_launch():
|
||||
return
|
||||
|
||||
if update_button:
|
||||
try:
|
||||
update_button.setText(_("Stop"))
|
||||
@@ -2929,12 +2983,6 @@ class MainWindow(
|
||||
except RuntimeError:
|
||||
update_button = None
|
||||
SoundManager().play("game_launch")
|
||||
if not self._check_alt_i586_dependencies_before_launch():
|
||||
if update_button:
|
||||
update_button.setText(_("Start"))
|
||||
icon = self.theme_manager.get_icon("play", as_path=True)
|
||||
update_button.setIcon(icon)
|
||||
return
|
||||
|
||||
# Save button reference for reset after game completion
|
||||
self.current_running_button = update_button
|
||||
@@ -2983,6 +3031,11 @@ class MainWindow(
|
||||
logger.error(f"Failed to launch game {exe_name}: {e}")
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to launch game: {0}").format(str(e)))
|
||||
|
||||
def _initialize_tray(self, app_name: str) -> None:
|
||||
"""Create the tray item after the Qt event loop starts."""
|
||||
if self.tray_manager is None:
|
||||
self.tray_manager = TrayManager(self, app_name, self.current_theme_name)
|
||||
|
||||
def closeEvent(self, event):
|
||||
"""Handle window close: check minimize_to_tray setting.
|
||||
If True - minimize to tray. Otherwise - fully close.
|
||||
@@ -3004,11 +3057,13 @@ class MainWindow(
|
||||
watcher.wait()
|
||||
|
||||
# Hide and remove tray icon
|
||||
if hasattr(self, "tray_manager"):
|
||||
if self.tray_manager is not None:
|
||||
self.tray_manager.shutdown()
|
||||
|
||||
# Save card sizes only for grid layouts.
|
||||
layout_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
layout_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
size_slider = getattr(self.game_library_manager, 'sizeSlider', None)
|
||||
if size_slider is None or layout_mode not in {
|
||||
"list", "vertical", "horizontal", "horizontal_top"
|
||||
|
||||
@@ -28,12 +28,14 @@ _library.portproton_gamepad_close.argtypes = [_handle]
|
||||
_library.portproton_gamepad_close.restype = None
|
||||
_library.portproton_gamepad_connected.argtypes = [_handle]
|
||||
_library.portproton_gamepad_connected.restype = ctypes.c_bool
|
||||
_library.portproton_gamepad_update.argtypes = []
|
||||
_library.portproton_gamepad_update.argtypes = [_handle]
|
||||
_library.portproton_gamepad_update.restype = None
|
||||
_library.portproton_gamepad_get_button.argtypes = [_handle, ctypes.c_int]
|
||||
_library.portproton_gamepad_get_button.restype = ctypes.c_int
|
||||
_library.portproton_gamepad_get_axis.argtypes = [_handle, ctypes.c_int]
|
||||
_library.portproton_gamepad_get_axis.restype = ctypes.c_int16
|
||||
_library.portproton_gamepad_get_active_instance_id.argtypes = [_handle]
|
||||
_library.portproton_gamepad_get_active_instance_id.restype = ctypes.c_uint32
|
||||
_library.portproton_gamepad_get_name.argtypes = [_handle]
|
||||
_library.portproton_gamepad_get_name.restype = ctypes.c_char_p
|
||||
_library.portproton_gamepad_get_instance_id.argtypes = [_handle]
|
||||
@@ -45,7 +47,7 @@ _library.portproton_gamepad_shutdown.restype = None
|
||||
|
||||
|
||||
class GamepadBackendError(RuntimeError):
|
||||
"""SDL failed while discovering the active gamepad."""
|
||||
"""SDL failed while discovering connected gamepads."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -55,6 +57,7 @@ class SDLGamepad:
|
||||
path: str
|
||||
instance_id: int
|
||||
sdl_type: int
|
||||
active_instance_id: int = 0
|
||||
|
||||
def close(self) -> None:
|
||||
if self.controller:
|
||||
@@ -67,8 +70,16 @@ class SDLGamepad:
|
||||
def connected(self) -> bool:
|
||||
return bool(_library.portproton_gamepad_connected(self.controller))
|
||||
|
||||
def update(self) -> None:
|
||||
_library.portproton_gamepad_update()
|
||||
def update(self) -> bool:
|
||||
_library.portproton_gamepad_update(self.controller)
|
||||
self.sdl_type = int(_library.portproton_gamepad_get_type(self.controller))
|
||||
active_instance_id = int(
|
||||
_library.portproton_gamepad_get_active_instance_id(self.controller)
|
||||
)
|
||||
if active_instance_id == self.active_instance_id:
|
||||
return False
|
||||
self.active_instance_id = active_instance_id
|
||||
return True
|
||||
|
||||
def get_button(self, button: int) -> int:
|
||||
return int(_library.portproton_gamepad_get_button(self.controller, button))
|
||||
|
||||
@@ -340,17 +340,31 @@ class PortProtonAPI:
|
||||
|
||||
def _get_autoinstall_exe_name(self, script_path: str) -> str:
|
||||
install_exe = ""
|
||||
shortcut_name = ""
|
||||
try:
|
||||
with open(script_path, encoding="utf-8") as script_file:
|
||||
for line in script_file:
|
||||
if line.lstrip().startswith("#"):
|
||||
continue
|
||||
if "PORTWINE_CREATE_SHORTCUT_NAME=" in line:
|
||||
match = re.search(
|
||||
r'PORTWINE_CREATE_SHORTCUT_NAME=["\']([^"\']+)', line
|
||||
)
|
||||
if match:
|
||||
shortcut_name = match.group(1)
|
||||
if "PW_EXE_FILE" in line:
|
||||
exe_name = self._extract_exe_name_from_script_line(line)
|
||||
if exe_name:
|
||||
return exe_name
|
||||
install_exe = exe_name
|
||||
if line.strip().startswith("pw_create_unique_exe"):
|
||||
match = re.search(r'pw_create_unique_exe\s+["\']?([^"\' ]+)', line)
|
||||
unique_name = match.group(1) if match else shortcut_name
|
||||
if unique_name:
|
||||
return f"{os.path.splitext(unique_name)[0]}.exe"
|
||||
if "PW_AUTOINSTALL_EXE" not in line:
|
||||
continue
|
||||
exe_name = self._extract_exe_name_from_script_line(line)
|
||||
if exe_name:
|
||||
if exe_name and not install_exe:
|
||||
install_exe = exe_name
|
||||
except OSError as e:
|
||||
logger.warning("Failed to read autoinstall script %s: %s", script_path, e)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import codecs
|
||||
import errno
|
||||
import fcntl
|
||||
import os
|
||||
import pty
|
||||
@@ -14,6 +15,7 @@ from typing import Any
|
||||
|
||||
from PySide6.QtCore import QMimeData, QSocketNotifier, Qt, QTimer
|
||||
from PySide6.QtGui import (
|
||||
QCloseEvent,
|
||||
QColor,
|
||||
QFont,
|
||||
QFontDatabase,
|
||||
@@ -28,10 +30,13 @@ from PySide6.QtGui import (
|
||||
)
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QMenu, QPlainTextEdit
|
||||
|
||||
from portprotonqt.input_manager.constants import SDL_GAMEPAD_BUTTON_SOUTH
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.native_gamepad import GamepadBackendError, SDLGamepad, find_gamepad
|
||||
from portprotonqt.theme_manager import ThemeManager
|
||||
|
||||
logger = get_logger(__name__)
|
||||
APPLICATION_ID = "ru.linux_gaming.PortProtonQt"
|
||||
|
||||
CONF_NAME = "PortProtonQt Terminal"
|
||||
CONF_FALLBACK_SHELL = "/bin/bash"
|
||||
@@ -39,6 +44,7 @@ CONF_DEF_SIZE = (800, 260)
|
||||
CONF_FALLBACK_FONT_EXTRA = 6
|
||||
CONF_SCROLLBACK_LINES = 2000
|
||||
CONF_RENDER_INTERVAL_MS = 16
|
||||
CONF_GAMEPAD_POLL_INTERVAL_MS = 50
|
||||
|
||||
XDG_DATA_HOME = os.getenv(
|
||||
"XDG_DATA_HOME", os.path.join(os.path.expanduser("~"), ".local", "share")
|
||||
@@ -878,6 +884,9 @@ class TerminalWidget(QPlainTextEdit):
|
||||
self.app_theme = app_theme or load_current_theme()
|
||||
self.cmd_mode = cmd_mode
|
||||
self.child_pid: int | None = None
|
||||
self.exit_code: int | None = None
|
||||
self.gamepad: SDLGamepad | None = None
|
||||
self.gamepad_a_pressed = False
|
||||
self.pty_fd: int | None = None
|
||||
self.notifier: QSocketNotifier | None = None
|
||||
self.ansi_colors = _theme_ansi_colors(theme)
|
||||
@@ -906,6 +915,8 @@ class TerminalWidget(QPlainTextEdit):
|
||||
self.theme_manager = ThemeManager()
|
||||
self.child_timer = QTimer(self)
|
||||
self.child_timer.timeout.connect(self._check_child)
|
||||
self.gamepad_timer = QTimer(self)
|
||||
self.gamepad_timer.timeout.connect(self._poll_close_gamepad)
|
||||
self.render_timer = QTimer(self)
|
||||
self.render_timer.setSingleShot(True)
|
||||
self.render_timer.timeout.connect(self._render_screen)
|
||||
@@ -1043,11 +1054,15 @@ class TerminalWidget(QPlainTextEdit):
|
||||
except BlockingIOError:
|
||||
return
|
||||
except OSError as e:
|
||||
if e.errno == errno.EIO:
|
||||
if self.notifier is not None:
|
||||
self.notifier.setEnabled(False)
|
||||
return
|
||||
logger.warning("Terminal read failed: %s", e)
|
||||
QApplication.quit()
|
||||
return
|
||||
if not data:
|
||||
QApplication.quit()
|
||||
if self.notifier is not None:
|
||||
self.notifier.setEnabled(False)
|
||||
return
|
||||
text = self.output_decoder.decode(data)
|
||||
if self.cmd_mode:
|
||||
@@ -1061,15 +1076,65 @@ class TerminalWidget(QPlainTextEdit):
|
||||
if self.child_pid is None:
|
||||
return
|
||||
try:
|
||||
pid, _status = os.waitpid(self.child_pid, os.WNOHANG)
|
||||
pid, status = os.waitpid(self.child_pid, os.WNOHANG)
|
||||
except ChildProcessError:
|
||||
pid = self.child_pid
|
||||
status = 0
|
||||
if pid == 0:
|
||||
return
|
||||
self.child_pid = None
|
||||
self.child_timer.stop()
|
||||
self.viewport().setCursor(Qt.CursorShape.ArrowCursor)
|
||||
QApplication.quit()
|
||||
self._read_remaining_output()
|
||||
self.exit_code = os.waitstatus_to_exitcode(status)
|
||||
if self.exit_code == 0:
|
||||
QApplication.exit(0)
|
||||
return
|
||||
self._start_close_gamepad()
|
||||
|
||||
def _start_close_gamepad(self) -> None:
|
||||
try:
|
||||
self.gamepad = find_gamepad()
|
||||
except GamepadBackendError as e:
|
||||
logger.debug("Failed to find terminal gamepad: %s", e)
|
||||
return
|
||||
if self.gamepad is None:
|
||||
return
|
||||
self.gamepad.update()
|
||||
self.gamepad_a_pressed = bool(
|
||||
self.gamepad.get_button(SDL_GAMEPAD_BUTTON_SOUTH)
|
||||
)
|
||||
self.gamepad_timer.start(CONF_GAMEPAD_POLL_INTERVAL_MS)
|
||||
|
||||
def _poll_close_gamepad(self) -> None:
|
||||
if self.gamepad is None or not self.gamepad.connected():
|
||||
self.gamepad_timer.stop()
|
||||
return
|
||||
self.gamepad.update()
|
||||
pressed = bool(self.gamepad.get_button(SDL_GAMEPAD_BUTTON_SOUTH))
|
||||
if pressed and not self.gamepad_a_pressed:
|
||||
self.window().close()
|
||||
self.gamepad_a_pressed = pressed
|
||||
|
||||
def _close_gamepad(self) -> None:
|
||||
self.gamepad_timer.stop()
|
||||
if self.gamepad is not None:
|
||||
self.gamepad.close()
|
||||
self.gamepad = None
|
||||
|
||||
def _read_remaining_output(self) -> None:
|
||||
if self.pty_fd is None:
|
||||
return
|
||||
while True:
|
||||
try:
|
||||
data = os.read(self.pty_fd, 4096)
|
||||
except OSError:
|
||||
break
|
||||
if not data:
|
||||
break
|
||||
self._append_output(self.output_decoder.decode(data))
|
||||
if self.terminal_screen is not None:
|
||||
self._render_screen()
|
||||
|
||||
def _append_output(self, text: str) -> None:
|
||||
if self.terminal_screen is not None:
|
||||
@@ -1196,6 +1261,12 @@ class TerminalWidget(QPlainTextEdit):
|
||||
self._write_pty(source.text())
|
||||
|
||||
def keyPressEvent(self, event: QKeyEvent) -> None:
|
||||
if self.child_pid is None and event.key() in (
|
||||
Qt.Key.Key_Return,
|
||||
Qt.Key.Key_Enter,
|
||||
):
|
||||
self.window().close()
|
||||
return
|
||||
if self.cmd_mode and self._handle_cmd_key(event):
|
||||
return
|
||||
if self._handle_shortcut(event):
|
||||
@@ -1783,6 +1854,12 @@ class MainWindow(QMainWindow):
|
||||
if fullscreen:
|
||||
self.showFullScreen()
|
||||
|
||||
def closeEvent(self, event: QCloseEvent) -> None:
|
||||
exit_code = self.terminal.exit_code or 0
|
||||
self.terminal._close_gamepad()
|
||||
event.accept()
|
||||
QApplication.exit(exit_code)
|
||||
|
||||
|
||||
def parse_args(argv: list[str]) -> argparse.Namespace:
|
||||
"""Parse xterm-compatible arguments used by PortProton scripts."""
|
||||
@@ -1862,6 +1939,8 @@ def main(argv: list[str] | None = None) -> int:
|
||||
command = build_command(args)
|
||||
cmd_mode = _is_cmd_mode(args)
|
||||
app = QApplication(sys.argv[:1])
|
||||
app.setWindowIcon(QIcon.fromTheme(APPLICATION_ID))
|
||||
app.setDesktopFileName(APPLICATION_ID)
|
||||
app_theme = load_current_theme()
|
||||
theme = load_current_terminal_scheme() or load_terminal_scheme("default")
|
||||
window = MainWindow(
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
UNREAL_BOOTSTRAPPER_MAX_SIZE = 1_048_576
|
||||
LAUNCHER_NAME_MARKERS = ("launcher", "setup", "updater", "unins")
|
||||
|
||||
DIRECTX_IMPORTS = {
|
||||
"ddraw.dll": "DirectDraw",
|
||||
@@ -49,6 +52,8 @@ OPENGL_SIGNATURES = {
|
||||
"OpenGL Utility Library": (b"glu32.dll", b"gluPerspective", b"gluLookAt"),
|
||||
}
|
||||
|
||||
VULKAN_SIGNATURES = (b"vulkan-1.dll", b"vkCreateInstance", b"vkGetInstanceProcAddr")
|
||||
|
||||
|
||||
def analyze_executable(file_path: str) -> dict[str, Any]:
|
||||
"""Detect graphics API usage in a Windows executable."""
|
||||
@@ -59,23 +64,58 @@ def analyze_executable(file_path: str) -> dict[str, Any]:
|
||||
|
||||
directx = set()
|
||||
opengl = set()
|
||||
vulkan = set()
|
||||
|
||||
if analysis_path.suffix.lower() in {".exe", ".dll"}:
|
||||
_add_pe_imports(analysis_path, directx, opengl)
|
||||
_add_file_signatures(analysis_path, directx, opengl)
|
||||
_add_file_signatures(analysis_path, directx, opengl, vulkan)
|
||||
engine_family = _read_engine_render_family(analysis_path)
|
||||
if engine_family == "vulkan":
|
||||
vulkan.add("Vulkan")
|
||||
elif engine_family == "opengl":
|
||||
opengl.add("OpenGL")
|
||||
|
||||
return {
|
||||
"highest_directx": _highest_directx(list(directx)),
|
||||
"uses_opengl": bool(opengl),
|
||||
"uses_vulkan": bool(vulkan),
|
||||
"source": str(analysis_path),
|
||||
}
|
||||
|
||||
|
||||
def _read_engine_render_family(executable: Path) -> str | None:
|
||||
"""Read a renderer choice from the active Wine prefix engine config."""
|
||||
wineprefix = os.getenv("WINEPREFIX")
|
||||
if not wineprefix:
|
||||
return None
|
||||
config_root = Path(wineprefix) / "drive_c" / "users"
|
||||
try:
|
||||
config_paths = config_root.glob("*/Saved Games/**/kexengine.cfg")
|
||||
for config_path in config_paths:
|
||||
game_name = re.sub(r"[^a-z0-9]", "", config_path.parent.name.lower())
|
||||
executable_name = re.sub(
|
||||
r"[^a-z0-9]", "", executable.parent.name.lower()
|
||||
)
|
||||
executable_stem = re.sub(r"[^a-z0-9]", "", executable.stem.lower())
|
||||
if game_name not in executable_name and game_name not in executable_stem:
|
||||
continue
|
||||
for line in config_path.read_text(errors="ignore").splitlines():
|
||||
match = re.match(r'\s*seta\s+r_rhirenderfamily\s+"?([^"\s]+)', line)
|
||||
if match:
|
||||
return match.group(1).lower()
|
||||
except OSError:
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def resolve_graphics_executable(file_path: str) -> Path:
|
||||
"""Resolve a launcher to the binary that implements its graphics API."""
|
||||
path = Path(file_path).expanduser().resolve()
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"File not found: {path}")
|
||||
unity_player = path.parent / "UnityPlayer.dll"
|
||||
if unity_player.is_file():
|
||||
return unity_player
|
||||
if path.stat().st_size < UNREAL_BOOTSTRAPPER_MAX_SIZE:
|
||||
patterns = (
|
||||
"*/Binaries/Win64/*-Win64-Shipping.exe",
|
||||
@@ -89,9 +129,28 @@ def resolve_graphics_executable(file_path: str) -> Path:
|
||||
renpy_libraries = sorted(path.parent.glob("lib/*/librenpython.dll"))
|
||||
if renpy_libraries:
|
||||
return renpy_libraries[0]
|
||||
is_launcher = any(marker in path.stem.lower() for marker in LAUNCHER_NAME_MARKERS)
|
||||
if is_launcher or not _is_pe_file(path):
|
||||
pe_candidates = [
|
||||
candidate
|
||||
for candidate in path.parent.glob("*.exe")
|
||||
if candidate != path
|
||||
and _is_pe_file(candidate)
|
||||
and not any(marker in candidate.stem.lower() for marker in LAUNCHER_NAME_MARKERS)
|
||||
]
|
||||
if pe_candidates:
|
||||
return max(pe_candidates, key=lambda candidate: candidate.stat().st_size)
|
||||
return path
|
||||
|
||||
|
||||
def _is_pe_file(path: Path) -> bool:
|
||||
try:
|
||||
with path.open("rb") as executable:
|
||||
return executable.read(2) == b"MZ"
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def _add_pe_imports(path: Path, directx: set[str], opengl: set[str]) -> None:
|
||||
try:
|
||||
import pefile
|
||||
@@ -117,7 +176,9 @@ def _add_pe_imports(path: Path, directx: set[str], opengl: set[str]) -> None:
|
||||
return
|
||||
|
||||
|
||||
def _add_file_signatures(path: Path, directx: set[str], opengl: set[str]) -> None:
|
||||
def _add_file_signatures(
|
||||
path: Path, directx: set[str], opengl: set[str], vulkan: set[str]
|
||||
) -> None:
|
||||
try:
|
||||
with path.open("rb") as f:
|
||||
data = f.read(67108864).lower()
|
||||
@@ -131,6 +192,8 @@ def _add_file_signatures(path: Path, directx: set[str], opengl: set[str]) -> Non
|
||||
for name, patterns in OPENGL_SIGNATURES.items():
|
||||
if any(p.lower() in data for p in patterns):
|
||||
opengl.add(name)
|
||||
if any(signature.lower() in data for signature in VULKAN_SIGNATURES):
|
||||
vulkan.add("Vulkan")
|
||||
|
||||
|
||||
def _highest_directx(directx: list[str]) -> str:
|
||||
@@ -148,6 +211,8 @@ def _main(argv: list[str]) -> int:
|
||||
result = analyze_executable(argv[1])
|
||||
print(f"HIGHEST_DX={result['highest_directx']}")
|
||||
print(f"USES_OGL={'true' if result['uses_opengl'] else 'false'}")
|
||||
print(f"USES_VULKAN={'true' if result['uses_vulkan'] else 'false'}")
|
||||
print(f"SOURCE={result['source']}")
|
||||
return 0
|
||||
except Exception as e:
|
||||
print(f"Error: {e}", file=sys.stderr)
|
||||
|
||||
@@ -121,7 +121,6 @@ def _archive_entry(archive, source_path: str, archive_path: str) -> bool:
|
||||
flags=READDISK_NO_XATTR,
|
||||
pathname=archive_path,
|
||||
recursive=False,
|
||||
symlink_mode="physical",
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ from PIL import Image, UnidentifiedImageError
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.downloader import Downloader
|
||||
from portprotonqt.localization import get_steam_language
|
||||
from portprotonqt.config import THEMED_LAUNCH_ICON_NAMES, extract_exec_target_path, ui_config
|
||||
from portprotonqt.config import CACHE_DIR, THEMED_LAUNCH_ICON_NAMES, extract_exec_target_path, ui_config
|
||||
from portprotonqt.image_utils import COVER_IMAGE_EXTENSIONS
|
||||
from portprotonqt.steam_api.utils import decode_text, get_local_steam_cover
|
||||
from portprotonqt.steam_api.cache import (
|
||||
@@ -501,8 +501,7 @@ def _get_cached_data_and_index(
|
||||
|
||||
|
||||
def _get_cached_steam_cover_path(appid: int) -> str:
|
||||
xdg_cache_home = os.getenv("XDG_CACHE_HOME", os.path.join(os.path.expanduser("~"), ".cache"))
|
||||
image_folder = os.path.join(xdg_cache_home, "PortProtonQt", "images")
|
||||
image_folder = str(CACHE_DIR / "images")
|
||||
for ext in COVER_IMAGE_EXTENSIONS:
|
||||
cover_path = os.path.join(image_folder, f"{appid}{ext}")
|
||||
if os.path.exists(cover_path):
|
||||
|
||||
@@ -501,9 +501,9 @@ def _load_steam_app_metadata(
|
||||
|
||||
|
||||
def _is_steam_game(common: dict) -> bool:
|
||||
"""Return whether Steam metadata describes a game."""
|
||||
"""Return whether Steam metadata describes a game or related application."""
|
||||
app_type = str(common.get("type", "")).lower()
|
||||
return app_type == "game"
|
||||
return app_type in {"game", "demo", "mod", "application", "beta"}
|
||||
|
||||
|
||||
def get_steam_installed_games() -> list[tuple[str, int, int, int]]:
|
||||
|
||||
@@ -4,7 +4,9 @@ from typing import TYPE_CHECKING, Any, cast
|
||||
from PySide6.QtCore import Qt, QTimer
|
||||
from PySide6.QtGui import QIcon
|
||||
from PySide6.QtWidgets import (
|
||||
QGridLayout,
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QLineEdit,
|
||||
QScroller,
|
||||
QSlider,
|
||||
@@ -42,7 +44,18 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
autoInstallPage = QWidget()
|
||||
autoInstallPage.setProperty("theme_style_name", "LIBRARY_WIDGET_STYLE")
|
||||
autoInstallPage.setStyleSheet(self.theme.LIBRARY_WIDGET_STYLE)
|
||||
autoInstallLayout = QVBoxLayout(autoInstallPage)
|
||||
library_background = getattr(self.theme, "LIBRARY_BACKGROUND", None)
|
||||
stack_layout = QGridLayout(autoInstallPage)
|
||||
if isinstance(library_background, dict):
|
||||
stack_layout.setContentsMargins(*library_background["margins"])
|
||||
else:
|
||||
stack_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.autoInstallBackgroundLabel = QLabel()
|
||||
stack_layout.addWidget(self.autoInstallBackgroundLabel, 0, 0)
|
||||
content_widget = QWidget()
|
||||
content_widget.setStyleSheet(self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
autoInstallLayout = QVBoxLayout(content_widget)
|
||||
stack_layout.addWidget(content_widget, 0, 0)
|
||||
autoInstallLayout.setSpacing(15)
|
||||
|
||||
searchWidget = QWidget()
|
||||
@@ -90,8 +103,10 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
|
||||
self.autoInstallContainer = QWidget()
|
||||
self.autoInstallContainer.setStyleSheet(self.theme.LIST_WIDGET_STYLE)
|
||||
self.autoInstallContainerLayout = FlowLayout(self.autoInstallContainer)
|
||||
self.autoInstallContainer.setLayout(self.autoInstallContainerLayout)
|
||||
auto_layout_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
self._set_autoinstall_container_layout(auto_layout_mode)
|
||||
self.autoInstallScrollArea.setWidget(self.autoInstallContainer)
|
||||
|
||||
autoInstallLayout.addWidget(self.autoInstallScrollArea)
|
||||
@@ -111,9 +126,11 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
sliderLayout.addWidget(self.auto_size_slider)
|
||||
autoInstallLayout.addLayout(sliderLayout)
|
||||
|
||||
auto_layout_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
self.auto_size_slider.setVisible(auto_layout_mode != "list")
|
||||
if auto_layout_mode == "list":
|
||||
fixed_layout = auto_layout_mode in {
|
||||
"list", "vertical", "horizontal", "horizontal_top",
|
||||
}
|
||||
self.auto_size_slider.setVisible(not fixed_layout)
|
||||
if fixed_layout:
|
||||
self.auto_card_width = self.auto_size_slider.maximum()
|
||||
self.auto_size_slider.setValue(self.auto_card_width)
|
||||
self._gamepad_tooltip_map[self.auto_size_slider] = f"{self.auto_card_width} px"
|
||||
@@ -129,6 +146,13 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
def on_autoinstall_games_loaded(games: list[tuple]):
|
||||
self.autoInstallLoaded = True
|
||||
self.autoInstallLoading = False
|
||||
auto_layout_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
list_layout = auto_layout_mode in {"list", "vertical"}
|
||||
self.autoInstallContainer.setProperty(
|
||||
"library_layout_mode", auto_layout_mode
|
||||
)
|
||||
|
||||
# Clear
|
||||
while self.autoInstallContainerLayout.count():
|
||||
@@ -169,7 +193,7 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
exe_name = game_tuple[13]
|
||||
compact_cover = game_tuple[14] if len(game_tuple) > 14 else ""
|
||||
full_cover = game_tuple[15] if len(game_tuple) > 15 else cover_path
|
||||
if auto_layout_mode == "list":
|
||||
if list_layout:
|
||||
cover_path = compact_cover or full_cover
|
||||
else:
|
||||
cover_path = full_cover or compact_cover
|
||||
@@ -184,6 +208,8 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
parent=self.autoInstallContainer,
|
||||
)
|
||||
card.autoinstall_exe_name = exe_name
|
||||
card.hoverChanged.connect(self._on_autoinstall_card_active)
|
||||
card.focusChanged.connect(self._on_autoinstall_card_active)
|
||||
|
||||
# Hide badges and favorite button
|
||||
if hasattr(card, 'steamLabel'):
|
||||
@@ -210,6 +236,78 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
|
||||
self.stackedWidget.addWidget(autoInstallPage)
|
||||
|
||||
def _on_autoinstall_card_active(self, game_name: str, active: bool) -> None:
|
||||
if not active:
|
||||
return
|
||||
for card in self.allAutoInstallCards:
|
||||
if card.name != game_name:
|
||||
continue
|
||||
self.game_library_manager.render_library_background(
|
||||
self.autoInstallBackgroundLabel, card
|
||||
)
|
||||
return
|
||||
|
||||
def _set_autoinstall_container_layout(self, mode: str) -> None:
|
||||
old_layout = getattr(self, "autoInstallContainerLayout", None)
|
||||
if old_layout is not None:
|
||||
while old_layout.count():
|
||||
item = old_layout.takeAt(0)
|
||||
if item and item.widget():
|
||||
item.widget().deleteLater()
|
||||
QWidget().setLayout(old_layout)
|
||||
self.autoInstallContainer.setProperty("library_layout_mode", mode)
|
||||
if mode == "vertical":
|
||||
config = self.theme.GAME_CARD_VERTICAL
|
||||
layout = QVBoxLayout()
|
||||
layout.setContentsMargins(*config.get("layout_margins", (0, 0, 0, 0)))
|
||||
layout.setSpacing(config.get("layout_spacing", 0))
|
||||
layout.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
elif mode in {"horizontal", "horizontal_top"}:
|
||||
config = getattr(self.theme, "GAME_CARD_HORIZONTAL", {})
|
||||
layout = QHBoxLayout()
|
||||
layout.setContentsMargins(
|
||||
*config.get("layout_margins", (0, 0, 0, 0))
|
||||
)
|
||||
layout.setSpacing(config.get("layout_spacing", 0))
|
||||
layout.setAlignment(
|
||||
Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter
|
||||
)
|
||||
else:
|
||||
layout = FlowLayout()
|
||||
self.autoInstallContainerLayout = layout
|
||||
self.autoInstallContainer.setLayout(layout)
|
||||
horizontal = mode in {"horizontal", "horizontal_top"}
|
||||
vertical_policy = (
|
||||
Qt.ScrollBarPolicy.ScrollBarAlwaysOff
|
||||
if horizontal else Qt.ScrollBarPolicy.ScrollBarAsNeeded
|
||||
)
|
||||
horizontal_policy = (
|
||||
Qt.ScrollBarPolicy.ScrollBarAsNeeded
|
||||
if horizontal else Qt.ScrollBarPolicy.ScrollBarAlwaysOff
|
||||
)
|
||||
self.autoInstallScrollArea.setVerticalScrollBarPolicy(vertical_policy)
|
||||
self.autoInstallScrollArea.setHorizontalScrollBarPolicy(horizontal_policy)
|
||||
|
||||
def refresh_autoinstall_layout(self) -> None:
|
||||
"""Rebuild auto-install cards after a live library layout change."""
|
||||
if not hasattr(self, "autoInstallContainer"):
|
||||
return
|
||||
mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
fixed_layout = mode in {
|
||||
"list", "vertical", "horizontal", "horizontal_top",
|
||||
}
|
||||
self._set_autoinstall_container_layout(mode)
|
||||
self.auto_size_slider.setVisible(not fixed_layout)
|
||||
if fixed_layout:
|
||||
self.auto_card_width = self.auto_size_slider.maximum()
|
||||
self.auto_size_slider.setValue(self.auto_card_width)
|
||||
if self.autoInstallLoading:
|
||||
return
|
||||
self.autoInstallLoaded = False
|
||||
self._start_autoinstall_load()
|
||||
|
||||
def _open_autoinstall_card_after_script_download(
|
||||
self,
|
||||
game_data: dict,
|
||||
@@ -314,12 +412,17 @@ class MainWindowAutoInstallTabMixin(_MainWindowTypingBase):
|
||||
|
||||
def on_auto_slider_released(self):
|
||||
"""Handles auto-install slider release to update card size."""
|
||||
auto_layout_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
auto_layout_mode = ui_config.get_library_layout_mode(
|
||||
str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
)
|
||||
fixed_layout = auto_layout_mode in {
|
||||
"list", "vertical", "horizontal", "horizontal_top",
|
||||
}
|
||||
if hasattr(self, 'auto_size_slider') and self.auto_size_slider:
|
||||
if auto_layout_mode != "list":
|
||||
if not fixed_layout:
|
||||
self.auto_card_width = self.auto_size_slider.value()
|
||||
self._gamepad_tooltip_map[self.auto_size_slider] = f"{self.auto_card_width} px"
|
||||
if auto_layout_mode != "list":
|
||||
if not fixed_layout:
|
||||
ui_config.set_auto_card_width(self.auto_card_width)
|
||||
if not hasattr(self, 'allAutoInstallCards'):
|
||||
return
|
||||
|
||||
@@ -7,12 +7,18 @@ import subprocess
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
import orjson
|
||||
import requests
|
||||
from shiboken6 import isValid
|
||||
|
||||
from PySide6.QtCore import QProcess, QProcessEnvironment, QThread, QTimer, QUrl, Signal
|
||||
from PySide6.QtGui import QDesktopServices
|
||||
from PySide6.QtCore import Qt, QProcess, QProcessEnvironment, QThread, QTimer, QUrl, Signal
|
||||
from PySide6.QtGui import QDesktopServices, QPixmap
|
||||
from PySide6.QtWidgets import (
|
||||
QAbstractItemView,
|
||||
QApplication,
|
||||
QCheckBox,
|
||||
QDialog,
|
||||
QDialogButtonBox,
|
||||
QFrame,
|
||||
QHeaderView,
|
||||
QHBoxLayout,
|
||||
@@ -20,6 +26,7 @@ from PySide6.QtWidgets import (
|
||||
QMessageBox,
|
||||
QProgressBar,
|
||||
QPushButton,
|
||||
QScrollArea,
|
||||
QTableWidget,
|
||||
QTableWidgetItem,
|
||||
QVBoxLayout,
|
||||
@@ -27,9 +34,10 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from portprotonqt.dialogs.file_explorer import FileExplorer
|
||||
from portprotonqt.config.cache import CacheManager
|
||||
from portprotonqt.egs_api import EGSAPI, EGS_LOGIN_URL
|
||||
from portprotonqt.gog_api import GOGAPI, GOG_LOGIN_URL
|
||||
from portprotonqt.image_utils import load_pixmap_async
|
||||
from portprotonqt.image_utils import load_pixmap_async, round_corners
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.sound_manager import SoundManager
|
||||
@@ -39,6 +47,9 @@ GOG_CANCEL_KILL_TIMEOUT_MS = 3000
|
||||
GOG_LOGIN_TIMEOUT_MS = 300000
|
||||
EGS_LOGIN_TIMEOUT_MS = 300000
|
||||
MIB_PER_GIB = 1024.0
|
||||
STORE_INFO_TIMEOUT_SECONDS = 120
|
||||
STORE_DLC_ART_TIMEOUT_SECONDS = 15
|
||||
STORE_DLC_CACHE_TTL_SECONDS = 300
|
||||
|
||||
|
||||
def _format_download_size(size_mib: float) -> str:
|
||||
@@ -172,6 +183,137 @@ class GOGSupportWorker(QThread):
|
||||
self.failed.emit(self.error)
|
||||
|
||||
|
||||
class GOGRepairWorker(QThread):
|
||||
"""Restore an imported game's manifest outside the UI thread."""
|
||||
|
||||
def __init__(self, api: GOGAPI, game: dict) -> None:
|
||||
super().__init__()
|
||||
self.api = api
|
||||
self.game = game
|
||||
self.error = ""
|
||||
|
||||
def run(self) -> None:
|
||||
try:
|
||||
app_id = str(self.game["app_id"])
|
||||
install_path = self.api.get_installed_path(app_id)
|
||||
if install_path is None:
|
||||
raise OSError(f"GOG installation not found: {app_id}")
|
||||
self.api.prepare_repair_manifest(app_id, install_path)
|
||||
except Exception as error:
|
||||
logger.exception("Failed to prepare GOG repair")
|
||||
self.error = str(error)
|
||||
|
||||
|
||||
class StoreDLCWorker(QThread):
|
||||
"""Read owned, installable store DLC outside the UI thread."""
|
||||
|
||||
loaded = Signal(list)
|
||||
failed = Signal(str)
|
||||
|
||||
def __init__(self, api: GOGAPI | EGSAPI, app_id: str) -> None:
|
||||
super().__init__()
|
||||
self.api = api
|
||||
self.app_id = app_id
|
||||
|
||||
def run(self) -> None:
|
||||
try:
|
||||
epic = isinstance(self.api, EGSAPI)
|
||||
arguments = ["info", self.app_id, "--platform", "Windows" if epic else "windows"]
|
||||
if epic:
|
||||
arguments.append("--json")
|
||||
environment = os.environ.copy()
|
||||
environment["LEGENDARY_CONFIG_PATH" if epic else "GOGDL_CONFIG_PATH"] = str(self.api.config_dir)
|
||||
cache = CacheManager()
|
||||
cache_name = f"store-dlc-{'egs' if epic else 'gog'}-{self.app_id}"
|
||||
data = self._load_epic_dlc_info() if epic else cache.load_json(cache_name) if cache.is_fresh(cache_name, STORE_DLC_CACHE_TTL_SECONDS) else None
|
||||
if data is None:
|
||||
result = subprocess.run(
|
||||
self.api.build_command(arguments), env=environment, capture_output=True,
|
||||
timeout=STORE_INFO_TIMEOUT_SECONDS, check=True,
|
||||
)
|
||||
data = orjson.loads(result.stdout)
|
||||
cache.save_json(cache_name, data)
|
||||
entries = data.get("game", {}).get("owned_dlc", []) if epic else data.get("dlcs", [])
|
||||
installed = set(self.api.load_installed()) if epic else set()
|
||||
if isinstance(self.api, GOGAPI):
|
||||
install_path = self.api.get_installed_path(self.app_id)
|
||||
if install_path is not None:
|
||||
installed = {path.stem.removeprefix("goggame-") for path in install_path.glob("goggame-*.info")}
|
||||
installed.discard(self.app_id)
|
||||
self.api.prepare_repair_manifest(self.app_id, install_path)
|
||||
dlcs = []
|
||||
for entry in entries:
|
||||
if epic and not any("Windows" in release.get("platform", []) for release in entry.get("installable", [])):
|
||||
continue
|
||||
app_id = str(entry.get("app_name" if epic else "id", ""))
|
||||
if not app_id or app_id.startswith("-") or (not epic and not app_id.isdecimal()):
|
||||
continue
|
||||
dlcs.append({"app_id": app_id, "title": str(entry.get("title") or app_id), "installed": app_id in installed})
|
||||
if not epic:
|
||||
known = {dlc["app_id"] for dlc in dlcs}
|
||||
dlcs.extend({"app_id": app_id, "title": app_id, "installed": True} for app_id in sorted(installed - known))
|
||||
covers = self._load_dlc_covers() if dlcs else {}
|
||||
for dlc in dlcs:
|
||||
if covers.get(dlc["app_id"]):
|
||||
dlc["cover"] = covers[dlc["app_id"]]
|
||||
if not self.isInterruptionRequested():
|
||||
self.loaded.emit(dlcs)
|
||||
except Exception as error:
|
||||
logger.exception("Failed to load store DLC for %s", self.app_id)
|
||||
if not self.isInterruptionRequested():
|
||||
self.failed.emit(str(error))
|
||||
|
||||
def _load_epic_dlc_info(self) -> dict | None:
|
||||
assets = self.api._load_json(self.api.config_dir / "assets.json", None)
|
||||
data = self.api._load_json(self.api.config_dir / "metadata" / f"{self.app_id}.json", None)
|
||||
if not isinstance(assets, dict) or not isinstance(data, dict):
|
||||
return None
|
||||
owned = {asset.get("app_name") or asset.get("appName") for asset in assets.get("Windows", [])}
|
||||
dlcs = []
|
||||
for entry in data.get("metadata", {}).get("dlcItemList", []):
|
||||
for release in entry.get("releaseInfo", []):
|
||||
app_id = release.get("appId")
|
||||
if app_id in owned and "Windows" in release.get("platform", []):
|
||||
dlcs.append({"app_name": app_id, "title": entry.get("title", app_id), "installable": [release]})
|
||||
owned.remove(app_id)
|
||||
return {"game": {"owned_dlc": dlcs}}
|
||||
|
||||
def _load_dlc_covers(self) -> dict[str, str]:
|
||||
if isinstance(self.api, EGSAPI):
|
||||
data = self.api._load_json(self.api.config_dir / "metadata" / f"{self.app_id}.json", {})
|
||||
covers = {}
|
||||
for entry in data.get("metadata", {}).get("dlcItemList", []):
|
||||
images = entry.get("keyImages", [])
|
||||
cover = next((image.get("url", "") for image in images
|
||||
if image.get("type") in {"DieselGameBox", "OfferImageWide", "Thumbnail"}), "")
|
||||
cover = cover or next((image.get("url", "") for image in images), "")
|
||||
for release in entry.get("releaseInfo", []):
|
||||
if release.get("appId"):
|
||||
covers[str(release["appId"])] = str(cover)
|
||||
return covers
|
||||
cache = CacheManager()
|
||||
cache_name = f"store-dlc-art-gog-{self.app_id}"
|
||||
data = cache.load_json(cache_name)
|
||||
if data is None:
|
||||
try:
|
||||
response = requests.get(
|
||||
f"https://api.gog.com/products/{self.app_id}?expand=expanded_dlcs",
|
||||
timeout=STORE_DLC_ART_TIMEOUT_SECONDS,
|
||||
)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
cache.save_json(cache_name, data)
|
||||
except requests.RequestException as error:
|
||||
logger.warning("Failed to load GOG DLC covers: %s", error)
|
||||
return {}
|
||||
covers = {}
|
||||
for entry in data.get("expanded_dlcs", []):
|
||||
images = entry.get("images", {})
|
||||
cover = images.get("logo2x") or images.get("logo") or images.get("icon") or ""
|
||||
covers[str(entry.get("id", ""))] = f"https:{cover}" if cover.startswith("//") else cover
|
||||
return covers
|
||||
|
||||
|
||||
class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
"""Add account actions and the shared downloads page."""
|
||||
|
||||
@@ -181,7 +323,9 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
def createGOGDownloadsTab(self) -> None:
|
||||
self.gog_process = None
|
||||
self.egs_process = None
|
||||
self.gog_download_queue = []
|
||||
self.gog_repair_worker = None
|
||||
self.egs_install_importing = False
|
||||
self.store_download_queue = []
|
||||
self.gog_download_output = ""
|
||||
self.egs_download_output = ""
|
||||
self.egs_download_total = 0.0
|
||||
@@ -207,6 +351,17 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
completed_header.addStretch()
|
||||
layout.addLayout(completed_header)
|
||||
self.downloadCompletedTable = self._create_download_table("", layout)
|
||||
self.downloadCompletedTable.setSelectionBehavior(
|
||||
QAbstractItemView.SelectionBehavior.SelectRows
|
||||
)
|
||||
self.downloadCompletedTable.setSelectionMode(
|
||||
QAbstractItemView.SelectionMode.SingleSelection
|
||||
)
|
||||
self.downloadCompletedTable._on_confirm_callback = ( # type: ignore[attr-defined]
|
||||
lambda _table, row, column: self._open_completed_download(row, column)
|
||||
)
|
||||
self.downloadCompletedTable.cellClicked.connect(self._open_completed_download)
|
||||
self.downloadCompletedTable.viewport().setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
layout.addStretch()
|
||||
self.stackedWidget.addWidget(page)
|
||||
self._update_downloads_tab_visibility()
|
||||
@@ -311,6 +466,17 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
self._update_download_table_height(self.downloadCompletedTable)
|
||||
self._update_downloads_tab_visibility()
|
||||
|
||||
def _open_completed_download(self, row: int, _column: int) -> None:
|
||||
item = self.downloadCompletedTable.item(row, 1)
|
||||
if item is None:
|
||||
return
|
||||
app_id, source = item.data(Qt.ItemDataRole.UserRole)
|
||||
cards = self.game_library_manager.game_card_cache.values()
|
||||
card = next((card for card in cards if str(card.appid) == app_id
|
||||
and str(card.game_source).lower() == source), None)
|
||||
if card is not None:
|
||||
card.click()
|
||||
|
||||
def _start_gog_login(self) -> None:
|
||||
if getattr(self, "gog_auth_worker", None) is not None:
|
||||
return
|
||||
@@ -573,13 +739,30 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
def _on_egs_library_worker_finished(self) -> None:
|
||||
self.egs_library_worker = None
|
||||
|
||||
def _queue_store_download(self, source: str, game: dict) -> None:
|
||||
app_id = str(game["app_id"])
|
||||
active_game = (
|
||||
getattr(self, f"{source}_active_game", {})
|
||||
if getattr(self, f"{source}_process", None) is not None else {}
|
||||
)
|
||||
queued = any(
|
||||
queued_source == source and str(queued_game["app_id"]) == app_id
|
||||
for queued_source, queued_game in self.store_download_queue
|
||||
)
|
||||
if str(active_game.get("app_id", "")) == app_id or queued:
|
||||
return
|
||||
self.store_download_queue.append((source, game))
|
||||
store = "Epic Games" if source == "egs" else "GOG"
|
||||
self._append_download_row(self.downloadQueuedTable, game, _("Install"), store)
|
||||
self.switchTab(6)
|
||||
|
||||
def _install_gog_game(self, game: dict) -> None:
|
||||
if self.gog_process is not None:
|
||||
self.gog_download_queue.append(game)
|
||||
self._append_download_row(self.downloadQueuedTable, game, _("Install"))
|
||||
self.switchTab(6)
|
||||
if getattr(self, "gog_repair_worker", None) is not None:
|
||||
return
|
||||
app_id = str(game["app_id"])
|
||||
if self.gog_process is not None or self.egs_process is not None:
|
||||
self._queue_store_download("gog", game)
|
||||
return
|
||||
install_path = self.gog_api.get_install_path(app_id, str(game["title"]))
|
||||
install_path.mkdir(parents=True, exist_ok=True)
|
||||
selected_paths: list[str] = []
|
||||
@@ -595,6 +778,13 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
if not selected_paths:
|
||||
return
|
||||
install_path = Path(selected_paths[0])
|
||||
game_path = self.gog_api.find_install_path(app_id, install_path)
|
||||
if game_path is not None:
|
||||
self.gog_api.save_installed_game(
|
||||
app_id, {"install_path": str(game_path), "title": str(game["title"])}
|
||||
)
|
||||
self._repair_gog_game(game)
|
||||
return
|
||||
manifest_path = (
|
||||
self.gog_api.config_dir / "heroic_gogdl" / "manifests" / app_id
|
||||
)
|
||||
@@ -613,6 +803,8 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
[
|
||||
"download", app_id, "--path", str(install_path),
|
||||
"--support", str(support_path), "--platform", "windows",
|
||||
*(["--with-dlcs", "--dlcs", ",".join(dlc["app_id"] for dlc in game["_dlcs"])]
|
||||
if game.get("_dlcs") else ["--skip-dlcs"] if "_dlcs" in game else []),
|
||||
]
|
||||
)
|
||||
except FileNotFoundError as error:
|
||||
@@ -620,15 +812,127 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
return
|
||||
self._start_gog_download(game, install_path, command, _("Install"))
|
||||
|
||||
def _install_egs_download(self, app_id: str) -> None:
|
||||
if self.gog_process is not None or self.egs_process is not None:
|
||||
def _select_store_dlcs(self, source: str, game: dict) -> None:
|
||||
if getattr(self, "store_dlc_worker", None) is not None:
|
||||
QMessageBox.warning(self, _("Error"), _("Another download is running"))
|
||||
return
|
||||
api = self.egs_api if source == "egs" else self.gog_api
|
||||
worker = StoreDLCWorker(api, str(game["app_id"]))
|
||||
worker.loaded.connect(lambda dlcs: self._on_store_dlcs_loaded(source, game, dlcs))
|
||||
worker.failed.connect(lambda error: QMessageBox.warning(self, _("Error"), error))
|
||||
worker.finished.connect(self._on_store_dlc_worker_finished)
|
||||
self.store_dlc_worker = worker
|
||||
worker.start()
|
||||
|
||||
def _on_store_dlc_worker_finished(self) -> None:
|
||||
worker = self.store_dlc_worker
|
||||
self.store_dlc_worker = None
|
||||
if worker is not None:
|
||||
worker.deleteLater()
|
||||
|
||||
def _on_store_dlcs_loaded(self, source: str, game: dict, dlcs: list[dict]) -> None:
|
||||
selected = []
|
||||
if dlcs:
|
||||
dialog = QDialog(self)
|
||||
dialog.setWindowTitle(f"{game['title']} — DLC")
|
||||
dialog.setMinimumWidth(self.theme.storeDlcDialogWidth)
|
||||
dialog.setStyleSheet(self.theme.MESSAGE_BOX_STYLE)
|
||||
layout = QVBoxLayout(dialog)
|
||||
scroll = QScrollArea(dialog)
|
||||
scroll.setFrameShape(QFrame.Shape.NoFrame)
|
||||
scroll.setWidgetResizable(True)
|
||||
scroll.setMinimumHeight(min(len(dlcs), self.theme.storeDlcVisibleRows) * self.theme.storeDlcRowHeight)
|
||||
content = QWidget()
|
||||
content.setObjectName("storeDlcList")
|
||||
content.setStyleSheet(self.theme.STORE_DLC_LIST_STYLE)
|
||||
rows = QVBoxLayout(content)
|
||||
checkboxes = []
|
||||
for dlc in dlcs:
|
||||
row, checkbox = self._create_store_dlc_row(dlc, str(game.get("cover", "")))
|
||||
rows.addWidget(row)
|
||||
checkboxes.append((checkbox, dlc))
|
||||
scroll.setWidget(content)
|
||||
scroll.setStyleSheet(self.theme.SCROLL_STYLE)
|
||||
layout.addWidget(scroll)
|
||||
buttons = QDialogButtonBox(
|
||||
QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
|
||||
)
|
||||
buttons.button(QDialogButtonBox.StandardButton.Ok).setText(_("Install"))
|
||||
buttons.button(QDialogButtonBox.StandardButton.Cancel).setText(_("Cancel"))
|
||||
install_all_button = buttons.addButton(
|
||||
f"{_('Install')} {_('All').lower()}", QDialogButtonBox.ButtonRole.ActionRole
|
||||
)
|
||||
install_all_button.setIcon(self.theme_manager.get_icon("select_all"))
|
||||
buttons.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
|
||||
def install_all() -> None:
|
||||
for checkbox, _dlc in checkboxes:
|
||||
checkbox.setChecked(True)
|
||||
dialog.accept()
|
||||
|
||||
install_all_button.clicked.connect(install_all)
|
||||
buttons.accepted.connect(dialog.accept)
|
||||
buttons.rejected.connect(dialog.reject)
|
||||
layout.addWidget(buttons)
|
||||
result = dialog.exec()
|
||||
dialog.deleteLater()
|
||||
if result != QDialog.DialogCode.Accepted:
|
||||
return
|
||||
selected = [dlc for checkbox, dlc in checkboxes if checkbox.isChecked() and (source == "gog" or not dlc.get("installed"))]
|
||||
game = {**game, "_dlcs": selected}
|
||||
if source == "gog":
|
||||
self._install_gog_game(game)
|
||||
else:
|
||||
self.egs_selected_dlc_game = game
|
||||
self._install_egs_download(str(game["app_id"]))
|
||||
|
||||
def _create_store_dlc_row(self, dlc: dict, fallback_cover: str) -> tuple[QWidget, QCheckBox]:
|
||||
row, details = self._create_download_game_cell({**dlc, "cover": dlc.get("cover") or fallback_cover})
|
||||
details.hide()
|
||||
row.setObjectName("storeDlcRow")
|
||||
row.setStyleSheet(self.theme.STORE_DLC_ROW_STYLE)
|
||||
row.setMinimumHeight(self.theme.storeDlcRowHeight)
|
||||
cover = row.findChild(QLabel, "downloadGameCover")
|
||||
if cover is not None:
|
||||
cover.setFixedSize(*self.theme.storeDlcCoverSize)
|
||||
cover.setScaledContents(True)
|
||||
title = row.findChild(QLabel, "downloadGameTitle")
|
||||
if title is not None:
|
||||
title.setWordWrap(True)
|
||||
checkbox = QCheckBox()
|
||||
checkbox.setAccessibleName(dlc["title"])
|
||||
checkbox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
checkbox.setFixedWidth(checkbox.sizeHint().width())
|
||||
checkbox.setChecked(bool(dlc.get("installed")))
|
||||
checkbox.setEnabled(not dlc.get("installed", False))
|
||||
layout = row.layout()
|
||||
assert layout is not None
|
||||
layout.addWidget(checkbox)
|
||||
return row, checkbox
|
||||
|
||||
def _start_next_egs_dlc(self, game: dict, install_path: Path) -> None:
|
||||
dlc = game["_dlcs"][0]
|
||||
command = self.egs_api.build_command([
|
||||
"install", dlc["app_id"], "--base-path", str(install_path.parent),
|
||||
"--game-folder", install_path.name, "--platform", "Windows",
|
||||
"--skip-sdl", "--skip-dlcs", "-y",
|
||||
])
|
||||
game = {**game, "_dlcs": game["_dlcs"][1:]}
|
||||
self._start_egs_download(game, install_path, command)
|
||||
|
||||
def _install_egs_download(self, app_id: str) -> None:
|
||||
game = next(
|
||||
(item for item in self.egs_api.load_library()
|
||||
if str(item.get("app_id", "")) == app_id),
|
||||
{"app_id": app_id, "title": app_id, "cover": ""},
|
||||
)
|
||||
selected_game = getattr(self, "egs_selected_dlc_game", None)
|
||||
if selected_game is not None and str(selected_game["app_id"]) == app_id:
|
||||
game = selected_game
|
||||
self.egs_selected_dlc_game = None
|
||||
if self.gog_process is not None or self.egs_process is not None:
|
||||
self._queue_store_download("egs", game)
|
||||
return
|
||||
selected_paths: list[str] = []
|
||||
explorer = FileExplorer(
|
||||
self, theme=self.theme, initial_path=str(self.egs_api.games_dir),
|
||||
@@ -640,18 +944,39 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
if not selected_paths:
|
||||
return
|
||||
install_path = Path(selected_paths[0])
|
||||
folder_name = Path(str(game.get("folder_name") or app_id)).name
|
||||
try:
|
||||
command = self.egs_api.build_command([
|
||||
game_path = install_path
|
||||
child_path = install_path / folder_name
|
||||
if child_path.is_dir() and not any(path.is_file() for path in install_path.iterdir()):
|
||||
game_path = child_path
|
||||
existing_game = game_path.is_dir() and any(game_path.iterdir())
|
||||
arguments = [
|
||||
"install", app_id, "--base-path", str(install_path),
|
||||
"--platform", "Windows", "--skip-sdl", "--skip-dlcs", "-y",
|
||||
])
|
||||
]
|
||||
if existing_game:
|
||||
arguments = [
|
||||
"import", app_id, str(game_path), "--platform", "Windows",
|
||||
"--skip-dlcs", "--disable-check", "-y",
|
||||
]
|
||||
installed = self.egs_api.load_installed()
|
||||
if app_id in installed:
|
||||
if installed[app_id].get("install_path") != str(game_path):
|
||||
installed[app_id]["install_path"] = str(game_path)
|
||||
self.egs_api._save_json(self.egs_api.config_dir / "installed.json", installed)
|
||||
arguments = [
|
||||
"repair", app_id, "--repair-and-update", "--skip-sdl", "-y",
|
||||
]
|
||||
command = self.egs_api.build_command(arguments)
|
||||
except OSError as error:
|
||||
self.egsAccountStatus.setText(str(error))
|
||||
return
|
||||
self.egs_install_importing = arguments[0] == "import"
|
||||
self._start_egs_download(game, install_path, command)
|
||||
|
||||
def _repair_gog_game(self, game: dict) -> None:
|
||||
if self.gog_process is not None:
|
||||
if self.gog_process is not None or getattr(self, "gog_repair_worker", None) is not None:
|
||||
self.gogAccountStatus.setText(_("Another GOG operation is already running"))
|
||||
return
|
||||
app_id = str(game["app_id"])
|
||||
@@ -659,14 +984,28 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
if install_path is None:
|
||||
self.gogAccountStatus.setText(_("GOG installation not found"))
|
||||
return
|
||||
manifest_path = self.gog_api.config_dir / "heroic_gogdl" / "manifests" / app_id
|
||||
if not manifest_path.is_file():
|
||||
worker = GOGRepairWorker(self.gog_api, game)
|
||||
worker.finished.connect(self._on_gog_repair_prepared)
|
||||
self.gog_repair_worker = worker
|
||||
worker.start()
|
||||
return
|
||||
support_path = (
|
||||
self.gog_api.config_dir / "heroic_gogdl" / "gog-support" / app_id
|
||||
)
|
||||
if "_dlcs" in game:
|
||||
selected = {dlc["app_id"] for dlc in game["_dlcs"]}
|
||||
selected.update(path.stem.removeprefix("goggame-") for path in install_path.glob("goggame-*.info"))
|
||||
selected.discard(app_id)
|
||||
game = {**game, "_dlcs": [{"app_id": dlc_id} for dlc_id in sorted(selected)]}
|
||||
try:
|
||||
command = self.gog_api.build_command(
|
||||
[
|
||||
"repair", app_id, "--path", str(install_path),
|
||||
"--support", str(support_path), "--platform", "windows",
|
||||
*(["--with-dlcs", "--dlcs", ",".join(dlc["app_id"] for dlc in game["_dlcs"])]
|
||||
if game.get("_dlcs") else ["--skip-dlcs"] if "_dlcs" in game else []),
|
||||
]
|
||||
)
|
||||
except FileNotFoundError as error:
|
||||
@@ -674,6 +1013,16 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
return
|
||||
self._start_gog_download(game, install_path, command, _("Repair"))
|
||||
|
||||
def _on_gog_repair_prepared(self) -> None:
|
||||
worker = self.gog_repair_worker
|
||||
self.gog_repair_worker = None
|
||||
if worker is None or worker.isInterruptionRequested():
|
||||
return
|
||||
if worker.error:
|
||||
self.gogAccountStatus.setText(worker.error)
|
||||
return
|
||||
self._repair_gog_game(worker.game)
|
||||
|
||||
def _import_gog_game(self, game: dict) -> None:
|
||||
selected_paths: list[str] = []
|
||||
file_explorer = FileExplorer(
|
||||
@@ -840,6 +1189,8 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
process = self.gog_process or self.egs_process
|
||||
if process is None:
|
||||
return
|
||||
if self.egs_process is not None:
|
||||
self.egs_active_game.pop("_dlcs", None)
|
||||
self.downloadCancelButton.setEnabled(False)
|
||||
self.downloadActiveDetails.setText(_("Cancel"))
|
||||
process.terminate()
|
||||
@@ -871,9 +1222,17 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
table.insertRow(row)
|
||||
game_cell, details_label = self._create_download_game_cell(game)
|
||||
table.setCellWidget(row, 0, game_cell)
|
||||
if table is self.downloadCompletedTable:
|
||||
game_cell.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents)
|
||||
values = (datetime.now().strftime("%H:%M:%S"), action, store)
|
||||
for column, value in enumerate(values, 1):
|
||||
table.setItem(row, column, QTableWidgetItem(value))
|
||||
source = "egs" if store == "Epic Games" else "gog"
|
||||
started_item = table.item(row, 1)
|
||||
assert started_item is not None
|
||||
started_item.setData(
|
||||
Qt.ItemDataRole.UserRole, (str(game["app_id"]), source)
|
||||
)
|
||||
table.setRowHeight(row, self.theme.downloadsTableRowHeight)
|
||||
if table is self.downloadQueuedTable:
|
||||
details_label.setText(_("Queued"))
|
||||
@@ -883,24 +1242,38 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
self._update_downloads_tab_visibility()
|
||||
return row, details_label
|
||||
|
||||
def _remove_queued_download(self, app_id: str, source: str) -> None:
|
||||
for row in range(self.downloadQueuedTable.rowCount()):
|
||||
item = self.downloadQueuedTable.item(row, 1)
|
||||
if item is not None and item.data(Qt.ItemDataRole.UserRole) == (app_id, source):
|
||||
self.downloadQueuedTable.removeRow(row)
|
||||
self._update_download_table_height(self.downloadQueuedTable)
|
||||
return
|
||||
|
||||
def _create_download_game_cell(self, game: dict) -> tuple[QWidget, QLabel]:
|
||||
widget = QWidget()
|
||||
layout = QHBoxLayout(widget)
|
||||
layout.setContentsMargins(*self.theme.downloadsCellMargins)
|
||||
layout.setSpacing(self.theme.downloadsCellSpacing)
|
||||
cover = QLabel()
|
||||
cover.setObjectName("downloadGameCover")
|
||||
cover_width, cover_height = self.theme.downloadsCoverSize
|
||||
cover.setFixedSize(cover_width, cover_height)
|
||||
layout.addWidget(cover)
|
||||
text_layout = QVBoxLayout()
|
||||
title = QLabel(str(game["title"]))
|
||||
title.setObjectName("downloadGameTitle")
|
||||
details = QLabel(_("Waiting…"))
|
||||
details.setStyleSheet(self.theme.CONTENT_STYLE)
|
||||
text_layout.addWidget(title)
|
||||
text_layout.addWidget(details)
|
||||
layout.addLayout(text_layout)
|
||||
def set_cover(pixmap: QPixmap) -> None:
|
||||
if isValid(cover):
|
||||
cover.setPixmap(round_corners(pixmap, self.theme.downloadsCoverRadius))
|
||||
|
||||
load_pixmap_async(
|
||||
str(game.get("cover", "")), cover_width, cover_height, cover.setPixmap,
|
||||
str(game.get("cover", "")), cover_width, cover_height, set_cover,
|
||||
app_name=f"download-{game['app_id']}",
|
||||
)
|
||||
return widget, details
|
||||
@@ -1011,6 +1384,13 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
def _update_active_download_details(self, details: list[str]) -> None:
|
||||
self.downloadActiveDetails.setText(" · ".join(details))
|
||||
|
||||
def _notify_download_finished(self, game: dict, status: str) -> None:
|
||||
tray_manager = getattr(self, "tray_manager", None)
|
||||
if tray_manager is not None:
|
||||
tray_manager.tray_icon.showMessage(
|
||||
_("Downloads"), f"{game['title']}: {status}"
|
||||
)
|
||||
|
||||
def _on_gog_download_finished(
|
||||
self, code: int, _status: QProcess.ExitStatus
|
||||
) -> None:
|
||||
@@ -1041,21 +1421,62 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
error = self._get_gog_download_error()
|
||||
completed_details.setText(error)
|
||||
logger.error("GOG download failed for %s: %s", app_id, error)
|
||||
self._notify_download_finished(game, completed_action)
|
||||
self.gog_process = None
|
||||
self.downloadOverallProgress.setValue(0)
|
||||
self.downloadSpeedLabel.setText(_("Downloading: ") + "\u2014")
|
||||
self.diskSpeedLabel.setText(_("Disk: ") + "\u2014")
|
||||
if self.gog_download_queue:
|
||||
next_game = self.gog_download_queue.pop(0)
|
||||
self.downloadQueuedTable.removeRow(0)
|
||||
self._update_download_table_height(self.downloadQueuedTable)
|
||||
self._install_gog_game(next_game)
|
||||
self._start_next_store_download()
|
||||
|
||||
def _on_egs_download_finished(
|
||||
self, code: int, _status: QProcess.ExitStatus
|
||||
) -> None:
|
||||
game = self.egs_active_game
|
||||
app_id = str(game["app_id"])
|
||||
if self.egs_install_importing:
|
||||
self.egs_install_importing = False
|
||||
imported = app_id in self.egs_api.load_installed()
|
||||
no_game_files = "No files belonging to" in self.egs_download_output
|
||||
if code == 0 and (imported or no_game_files):
|
||||
process = self.egs_process
|
||||
self.egs_process = None
|
||||
self._clear_egs_data_lock()
|
||||
if process is not None:
|
||||
process.deleteLater()
|
||||
try:
|
||||
arguments = [
|
||||
"repair", app_id, "--repair-and-update", "--skip-sdl", "-y",
|
||||
]
|
||||
if not imported:
|
||||
arguments = [
|
||||
"install", app_id, "--base-path", str(self.egs_active_install_path),
|
||||
"--platform", "Windows", "--skip-sdl", "--skip-dlcs", "-y",
|
||||
]
|
||||
command = self.egs_api.build_command(arguments)
|
||||
except OSError as error:
|
||||
logger.error("Failed to start Epic repair: %s", error)
|
||||
self.egs_download_output = str(error)
|
||||
code = 1
|
||||
else:
|
||||
self._start_egs_download(game, self.egs_active_install_path, command)
|
||||
return
|
||||
else:
|
||||
code = 1
|
||||
if code == 0 and game.get("_dlcs"):
|
||||
process = self.egs_process
|
||||
self.egs_process = None
|
||||
self._clear_egs_data_lock()
|
||||
if process is not None:
|
||||
process.deleteLater()
|
||||
try:
|
||||
install_path = Path(self.egs_api.load_installed()[app_id]["install_path"])
|
||||
self._start_next_egs_dlc(game, install_path)
|
||||
except Exception as error:
|
||||
logger.exception("Failed to start Epic DLC installation")
|
||||
self.egs_download_output = str(error)
|
||||
code = 1
|
||||
else:
|
||||
return
|
||||
self.downloadActiveHeading.setVisible(False)
|
||||
self.downloadActiveCard.setVisible(False)
|
||||
completed_action = _("Installed") if code == 0 else _("Failed")
|
||||
@@ -1069,6 +1490,7 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
error = self._get_egs_download_error()
|
||||
completed_details.setText(error)
|
||||
logger.error("Epic download failed for %s: %s", app_id, error)
|
||||
self._notify_download_finished(game, completed_action)
|
||||
process = self.egs_process
|
||||
self.egs_process = None
|
||||
self._clear_egs_data_lock()
|
||||
@@ -1077,6 +1499,7 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
self.downloadOverallProgress.setValue(0)
|
||||
self.downloadSpeedLabel.setText(_("Downloading: ") + "\u2014")
|
||||
self.diskSpeedLabel.setText(_("Disk: ") + "\u2014")
|
||||
self._start_next_store_download()
|
||||
|
||||
def _finish_egs_visible_operation(self, action: str, success: bool) -> None:
|
||||
game = self.egs_active_game
|
||||
@@ -1095,6 +1518,18 @@ class MainWindowDownloadTabMixin(_MainWindowTypingBase):
|
||||
self.downloadOverallProgress.setValue(0)
|
||||
self.downloadSpeedLabel.setText(_("Downloading: ") + "\u2014")
|
||||
self.diskSpeedLabel.setText(_("Disk: ") + "\u2014")
|
||||
self._start_next_store_download()
|
||||
|
||||
def _start_next_store_download(self) -> None:
|
||||
if not self.store_download_queue:
|
||||
return
|
||||
source, game = self.store_download_queue.pop(0)
|
||||
self._remove_queued_download(str(game["app_id"]), source)
|
||||
if source == "gog":
|
||||
self._install_gog_game(game)
|
||||
return
|
||||
self.egs_selected_dlc_game = game
|
||||
self._install_egs_download(str(game["app_id"]))
|
||||
|
||||
def _start_gog_support_setup(self, app_id: str, button=None) -> None:
|
||||
if getattr(self, "gog_support_workers", []):
|
||||
|
||||
@@ -143,6 +143,24 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
|
||||
card.update_badge_visibility(display_filter)
|
||||
card.update_badge_view_mode(badge_view_mode)
|
||||
|
||||
def _on_library_layout_changed(self, index: int) -> None:
|
||||
if index < 0 or index >= len(self.library_layout_keys):
|
||||
return
|
||||
layout_mode = self.library_layout_keys[index]
|
||||
card_orientation = "theme"
|
||||
if layout_mode in {"horizontal_vertical", "horizontal_top_vertical"}:
|
||||
layout_mode = layout_mode.removesuffix("_vertical")
|
||||
card_orientation = "vertical"
|
||||
elif layout_mode in {"horizontal", "horizontal_top"}:
|
||||
card_orientation = "horizontal"
|
||||
ui_config.set_library_layout_mode(layout_mode)
|
||||
ui_config.set_horizontal_card_orientation(card_orientation)
|
||||
theme_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid"))
|
||||
self.game_library_manager.rebuild_library_layout(
|
||||
ui_config.get_library_layout_mode(theme_mode)
|
||||
)
|
||||
self.refresh_autoinstall_layout()
|
||||
|
||||
def _toggle_library_controls(self) -> None:
|
||||
self._position_library_controls_widget()
|
||||
self.libraryControlsAnimation.toggle(self.libraryControlsButton.isChecked())
|
||||
@@ -366,6 +384,36 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
|
||||
self.gamesBadgeViewCombo.activated.connect(self._delay_library_controls_hover_close)
|
||||
controls_layout.addWidget(self.gamesBadgeViewCombo, 0, 2)
|
||||
|
||||
self.library_layout_keys = [
|
||||
"theme", "grid", "list", "vertical", "horizontal",
|
||||
"horizontal_vertical", "horizontal_top", "horizontal_top_vertical",
|
||||
]
|
||||
self.library_layout_labels = [
|
||||
_("Theme"), _("Grid"), _("List"), _("Table"),
|
||||
_("Horizontal Blocks"), _("Horizontal Cards"),
|
||||
_("Horizontal Top Blocks"), _("Horizontal Top Cards"),
|
||||
]
|
||||
self.gamesLayoutCombo = self._create_library_combo(
|
||||
self.library_layout_labels, _("Grid Type:")
|
||||
)
|
||||
selected_layout = ui_config.get_library_layout_mode("theme")
|
||||
if (
|
||||
selected_layout in {"horizontal", "horizontal_top"}
|
||||
and ui_config.get_horizontal_card_orientation("horizontal")
|
||||
== "vertical"
|
||||
):
|
||||
selected_layout += "_vertical"
|
||||
self._set_combo_current_key(
|
||||
self.gamesLayoutCombo, self.library_layout_keys, selected_layout
|
||||
)
|
||||
self.gamesLayoutCombo.currentIndexChanged.connect(
|
||||
self._on_library_layout_changed
|
||||
)
|
||||
self.gamesLayoutCombo.activated.connect(
|
||||
self._delay_library_controls_hover_close
|
||||
)
|
||||
controls_layout.addWidget(self.gamesLayoutCombo, 0, 3)
|
||||
|
||||
def _delay_library_controls_hover_close(self, _index: int = -1) -> None:
|
||||
self._library_controls_hover_close_delayed = True
|
||||
QTimer.singleShot(350, self._allow_library_controls_hover_close)
|
||||
@@ -652,6 +700,7 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
|
||||
entry = parse_desktop_entry(desktop_path)
|
||||
if not entry:
|
||||
return
|
||||
self._known_portproton_desktops.add(desktop_path)
|
||||
description = entry.get("Comment", "")
|
||||
exec_line = entry.get("Exec", exe_path)
|
||||
cover_for_shortcut = dialog.last_cover_path if dialog.last_cover_path else user_cover
|
||||
@@ -693,11 +742,6 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
|
||||
if steam_desc and steam_desc != final_desc:
|
||||
final_desc = steam_desc
|
||||
|
||||
# Use Steam name as fallback if better
|
||||
steam_name = steam_info.get("name", "")
|
||||
if steam_name and steam_name != final_name:
|
||||
final_name = steam_name
|
||||
|
||||
# Build full game_data tuple with all Steam data
|
||||
game_data = (
|
||||
final_name,
|
||||
|
||||
@@ -441,6 +441,35 @@ class MainWindowSettingsTabMixin(_MainWindowTypingBase):
|
||||
crash_reports_enabled_layout.addStretch()
|
||||
uiForm.addRow(crash_reports_enabled_layout)
|
||||
|
||||
self.disableAltDependencyCheckCheckBox: QCheckBox | None = None
|
||||
if self._is_alt_x86_64():
|
||||
self.disableAltDependencyCheckCheckBox = QCheckBox()
|
||||
self.disableAltDependencyCheckCheckBox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
self.disableAltDependencyCheckCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
disable_alt_dependency_check_title = QLabel(
|
||||
_("Disable ALT Linux i586 dependency check")
|
||||
)
|
||||
disable_alt_dependency_check_title.setSizePolicy(
|
||||
QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed
|
||||
)
|
||||
disable_alt_dependency_check_title.setStyleSheet(
|
||||
self.theme.SETTINGS_TITLE_CHECKBOX_STYLE
|
||||
)
|
||||
disable_alt_dependency_check_title.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
self.disableAltDependencyCheckCheckBox.setChecked(
|
||||
ui_config.get_disable_alt_i586_dependency_check()
|
||||
)
|
||||
disable_alt_dependency_check_layout = QHBoxLayout()
|
||||
disable_alt_dependency_check_layout.setContentsMargins(0, 0, 0, 0)
|
||||
disable_alt_dependency_check_layout.addWidget(
|
||||
self.disableAltDependencyCheckCheckBox
|
||||
)
|
||||
disable_alt_dependency_check_layout.addWidget(
|
||||
disable_alt_dependency_check_title
|
||||
)
|
||||
disable_alt_dependency_check_layout.addStretch()
|
||||
uiForm.addRow(disable_alt_dependency_check_layout)
|
||||
|
||||
disable_runtime_download_layout = None
|
||||
if not os.getenv("FLATPAK_ID"):
|
||||
self.disableRuntimeDownloadCheckBox = QCheckBox()
|
||||
@@ -728,6 +757,15 @@ class MainWindowSettingsTabMixin(_MainWindowTypingBase):
|
||||
self.resetSettingsButton.clicked.connect(self.resetSettings)
|
||||
buttonsLayout.addWidget(self.resetSettingsButton)
|
||||
|
||||
self.globalGameSettingsButton = AutoSizeButton(
|
||||
_("Global Game Settings"), icon=self.theme_manager.get_icon("settings", as_path=True)
|
||||
)
|
||||
self.globalGameSettingsButton.setProperty("theme_style_name", "ACTION_BUTTON_STYLE")
|
||||
self.globalGameSettingsButton.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
self.globalGameSettingsButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.globalGameSettingsButton.clicked.connect(self.openGlobalGameSettings)
|
||||
buttonsLayout.addWidget(self.globalGameSettingsButton)
|
||||
|
||||
self.migrateShortcutsButton = AutoSizeButton(_("Migrate legacy shortcuts"), icon=self.theme_manager.get_icon("update", as_path=True))
|
||||
self.migrateShortcutsButton.setProperty("theme_style_name", "ACTION_BUTTON_STYLE")
|
||||
self.migrateShortcutsButton.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
@@ -748,6 +786,11 @@ class MainWindowSettingsTabMixin(_MainWindowTypingBase):
|
||||
layout.addLayout(buttonsLayout)
|
||||
self.stackedWidget.addWidget(self.portProtonWidget)
|
||||
|
||||
def openGlobalGameSettings(self) -> None:
|
||||
from portprotonqt.dialogs.settings_dialog import ExeSettingsDialog
|
||||
|
||||
ExeSettingsDialog(self, self.theme, user_conf=True).exec()
|
||||
|
||||
def resetSettings(self):
|
||||
"""Reset settings and restart application."""
|
||||
msg_box = QMessageBox(self)
|
||||
@@ -1053,6 +1096,10 @@ class MainWindowSettingsTabMixin(_MainWindowTypingBase):
|
||||
ui_config.set_crash_reports_enabled(
|
||||
self.crashReportsEnabledCheckBox.isChecked()
|
||||
)
|
||||
if self.disableAltDependencyCheckCheckBox is not None:
|
||||
ui_config.set_disable_alt_i586_dependency_check(
|
||||
self.disableAltDependencyCheckCheckBox.isChecked()
|
||||
)
|
||||
|
||||
from portprotonqt.sound_manager import SoundManager
|
||||
SoundManager().reload_config()
|
||||
|
||||
@@ -4,7 +4,7 @@ import time
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from collections.abc import Callable
|
||||
|
||||
from PySide6.QtCore import QTimer, Qt
|
||||
from PySide6.QtCore import QFileSystemWatcher, QTimer, Qt
|
||||
from PySide6.QtWidgets import (
|
||||
QAbstractButton,
|
||||
QHBoxLayout,
|
||||
@@ -24,7 +24,7 @@ from portprotonqt.image_utils import ImageCarousel
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.tabs.theme_store import THEME_STORE_ITEM, ThemeStoreMixin
|
||||
from portprotonqt.theme_manager import load_theme_screenshots
|
||||
from portprotonqt.theme_manager import _find_theme_folder, load_theme_screenshots
|
||||
from portprotonqt.tray_manager import restart_application_process
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -221,6 +221,50 @@ class MainWindowThemeTabMixin(ThemeStoreMixin, _MainWindowTypingBase):
|
||||
|
||||
# Add widget to stackedWidget
|
||||
self.theme_tab_index = self.stackedWidget.addWidget(self.themeTabWidget)
|
||||
self._setup_theme_file_watcher()
|
||||
|
||||
def _setup_theme_file_watcher(self) -> None:
|
||||
self.themeFileWatcher = QFileSystemWatcher(self)
|
||||
self.themeFileWatcher.fileChanged.connect(self._schedule_theme_reload)
|
||||
self.themeFileWatcher.directoryChanged.connect(self._schedule_theme_reload)
|
||||
self.themeReloadTimer = QTimer(self)
|
||||
self.themeReloadTimer.setSingleShot(True)
|
||||
self.themeReloadTimer.setInterval(250)
|
||||
self.themeReloadTimer.timeout.connect(self._reload_active_custom_theme)
|
||||
self._watch_active_theme_files()
|
||||
|
||||
def _watch_active_theme_files(self) -> None:
|
||||
watcher = self.themeFileWatcher
|
||||
watched_paths = [*watcher.files(), *watcher.directories()]
|
||||
if watched_paths:
|
||||
watcher.removePaths(watched_paths)
|
||||
theme_name = self.current_theme_name
|
||||
if not self.theme_manager.is_custom_theme(theme_name):
|
||||
return
|
||||
theme_folder = _find_theme_folder(theme_name)
|
||||
if theme_folder is None:
|
||||
return
|
||||
paths = [theme_folder]
|
||||
for root, dirs, files in os.walk(theme_folder):
|
||||
dirs[:] = [name for name in dirs if name != "__pycache__"]
|
||||
paths.extend(os.path.join(root, name) for name in dirs)
|
||||
paths.extend(os.path.join(root, name) for name in files)
|
||||
watcher.addPaths(paths)
|
||||
|
||||
def _schedule_theme_reload(self, _path: str) -> None:
|
||||
self._watch_active_theme_files()
|
||||
self.themeReloadTimer.start()
|
||||
|
||||
def _reload_active_custom_theme(self) -> None:
|
||||
theme_name = self.current_theme_name
|
||||
if not self.theme_manager.is_custom_theme(theme_name):
|
||||
return
|
||||
self.theme_manager.invalidate_theme(theme_name)
|
||||
try:
|
||||
self._apply_theme_live(theme_name)
|
||||
except Exception as e:
|
||||
logger.warning("Failed to reload theme '%s': %s", theme_name, e)
|
||||
self._watch_active_theme_files()
|
||||
|
||||
def _get_selected_custom_themes(self) -> list[str]:
|
||||
base_theme = self.themesCombo.currentText()
|
||||
@@ -394,6 +438,8 @@ class MainWindowThemeTabMixin(ThemeStoreMixin, _MainWindowTypingBase):
|
||||
),
|
||||
)
|
||||
self.updateControlHints("force")
|
||||
if hasattr(self, "themeFileWatcher"):
|
||||
self._watch_active_theme_files()
|
||||
|
||||
def _apply_deferred_theme_updates(
|
||||
self,
|
||||
@@ -433,10 +479,15 @@ class MainWindowThemeTabMixin(ThemeStoreMixin, _MainWindowTypingBase):
|
||||
def _refresh_theme_library_layout(
|
||||
self, old_theme: object, new_theme: object
|
||||
) -> None:
|
||||
if ui_config.get_library_layout_mode("theme") != "theme":
|
||||
return
|
||||
old_mode = getattr(old_theme, "LIBRARY_LAYOUT_MODE", "grid")
|
||||
new_mode = getattr(new_theme, "LIBRARY_LAYOUT_MODE", "grid")
|
||||
if old_mode == new_mode:
|
||||
return
|
||||
refresh_autoinstall = getattr(self, "refresh_autoinstall_layout", None)
|
||||
if callable(refresh_autoinstall):
|
||||
refresh_autoinstall()
|
||||
manager = getattr(self, "game_library_manager", None)
|
||||
layout = getattr(manager, "gamesListLayout", None)
|
||||
if manager is None or layout is None:
|
||||
|
||||
@@ -24,9 +24,13 @@ from portprotonqt.dialogs.prefix_backup import PrefixBackupDialog, PrefixBackupJ
|
||||
from portprotonqt.dialogs.proton_manager import show_proton_manager
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.portproton_api import get_user_conf_setting, set_user_conf_setting
|
||||
from portprotonqt.portproton_api import get_user_conf_setting
|
||||
from portprotonqt.scripts_utils.prefix_backup import is_legacy_squashfs_backup
|
||||
from portprotonqt.settings_manager import get_available_prefix_options, get_available_wine_options
|
||||
from portprotonqt.settings_manager import (
|
||||
LG_WINE_ALIASES,
|
||||
get_available_prefix_options,
|
||||
get_available_wine_options,
|
||||
)
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -64,9 +68,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
formLayout.setSpacing(self.theme.wineSettingsSetSpacing)
|
||||
formLayout.setLabelAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||
|
||||
self.wine_versions = get_available_wine_options(
|
||||
self.portproton_location, include_lg_aliases=True
|
||||
)
|
||||
self.wine_versions = get_available_wine_options(self.portproton_location)
|
||||
self.wineCombo = CustomComboBox(theme=self.theme)
|
||||
self.wineCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
@@ -84,7 +86,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
if self.wine_versions:
|
||||
self.wineCombo.setCurrentIndex(0)
|
||||
default_wine = get_user_conf_setting('PW_DEFAULT_WINE_USE')
|
||||
if default_wine:
|
||||
if default_wine and default_wine not in dict(LG_WINE_ALIASES):
|
||||
if self.wineCombo.findText(default_wine) == -1:
|
||||
self.wineCombo.addItem(default_wine)
|
||||
self.wineCombo.setCurrentText(default_wine)
|
||||
@@ -158,7 +160,6 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
tools_grid.setSpacing(6)
|
||||
|
||||
tools = [
|
||||
("default", _("Use by default")),
|
||||
("--winecfg", _("Wine Configuration")),
|
||||
("--winereg", _("Registry Editor")),
|
||||
("--winefile", _("File Explorer")),
|
||||
@@ -173,10 +174,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
btn.setProperty("theme_style_name", "ACTION_BUTTON_STYLE")
|
||||
btn.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
btn.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
if tool_cmd == "default":
|
||||
btn.clicked.connect(self.save_wine_defaults)
|
||||
else:
|
||||
btn.clicked.connect(lambda checked, t=tool_cmd: self.launch_generic_tool(t))
|
||||
btn.clicked.connect(lambda checked, t=tool_cmd: self.launch_generic_tool(t))
|
||||
tools_grid.addWidget(btn, row, col)
|
||||
|
||||
for col in range(3):
|
||||
@@ -228,16 +226,6 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
wine_progress_layout.addWidget(self.wine_progress_bar)
|
||||
layout.addLayout(wine_progress_layout)
|
||||
|
||||
def save_wine_defaults(self) -> None:
|
||||
default_wine = self.wineCombo.currentText().strip()
|
||||
raw_prefix = self.prefixCombo.currentText().strip()
|
||||
default_prefix = re.sub(r"[ \t]", "_", raw_prefix).upper() if raw_prefix else ""
|
||||
default_vulkan = self.defaultVulkanCombo.currentData()
|
||||
|
||||
set_user_conf_setting('PW_DEFAULT_WINE_USE', default_wine)
|
||||
set_user_conf_setting('PW_DEFAULT_PREFIX_NAME', default_prefix)
|
||||
set_user_conf_setting('PW_DEFAULT_VULKAN_USE', str(default_vulkan or ""))
|
||||
|
||||
def launch_generic_tool(self, cli_arg):
|
||||
wine = self.wineCombo.currentText()
|
||||
raw_prefix = self.prefixCombo.currentText().strip()
|
||||
@@ -471,9 +459,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
if not self.portproton_location:
|
||||
return
|
||||
|
||||
self.wine_versions = get_available_wine_options(
|
||||
self.portproton_location, include_lg_aliases=True
|
||||
)
|
||||
self.wine_versions = get_available_wine_options(self.portproton_location)
|
||||
self.wineCombo.clear()
|
||||
self.wineCombo.addItems(self.wine_versions)
|
||||
|
||||
|
||||
@@ -10,32 +10,80 @@ class MainWindowWorkersMixin:
|
||||
"bluetoothWorker": 12000,
|
||||
"storageWorker": 3000,
|
||||
"audioWorker": 3000,
|
||||
"autoInstallLoadThread": 3000,
|
||||
"autoInstallLoadThread": None,
|
||||
"autoInstallScriptLoadThread": None,
|
||||
"autoInstallCustomDataThread": None,
|
||||
"appimageUpdateWorker": 3000,
|
||||
"appImageIntegrationWorker": None,
|
||||
"gogdlUpdateWorker": None,
|
||||
"initialCommandWorker": None,
|
||||
"egs_library_worker": None,
|
||||
"egs_auth_worker": None,
|
||||
"gog_library_worker": None,
|
||||
"gog_metadata_worker": None,
|
||||
"gog_repair_worker": None,
|
||||
"store_dlc_worker": None,
|
||||
"gog_auth_worker": None,
|
||||
"gog_account_worker": None,
|
||||
"themeStoreListWorker": None,
|
||||
"themeStoreImageWorker": None,
|
||||
"themeStoreDetailImageWorker": None,
|
||||
"themeStoreDownloadWorker": None,
|
||||
}
|
||||
for worker_name, timeout_ms in worker_timeouts.items():
|
||||
self._stopWorkerThread(worker_name, timeout_ms)
|
||||
for workers_name in (
|
||||
"gog_support_workers",
|
||||
"_listWorkerPool",
|
||||
"_imageWorkerPool",
|
||||
"_detailImageWorkerPool",
|
||||
):
|
||||
self._stopWorkerThreads(workers_name)
|
||||
downloader = getattr(self, "downloader", None)
|
||||
for worker in list(getattr(downloader, "_active_threads", [])):
|
||||
self._stopWorker(worker, "downloader", None)
|
||||
for worker in getattr(self, "compatibility_workers", []):
|
||||
worker.join()
|
||||
self.compatibility_workers = []
|
||||
input_manager = getattr(self, "input_manager", None)
|
||||
if input_manager is not None:
|
||||
input_manager.cleanup()
|
||||
|
||||
def _stopWorkerThread(self, worker_name: str, timeout_ms: int = 3000) -> None:
|
||||
def _stopWorkerThread(
|
||||
self, worker_name: str, timeout_ms: int | None = 3000
|
||||
) -> None:
|
||||
worker = getattr(self, worker_name, None)
|
||||
if worker is None:
|
||||
return
|
||||
self._stopWorker(worker, worker_name, timeout_ms)
|
||||
setattr(self, worker_name, None)
|
||||
|
||||
def _stopWorkerThreads(self, workers_name: str) -> None:
|
||||
workers = getattr(self, workers_name, []) or []
|
||||
for worker in workers:
|
||||
self._stopWorker(worker, workers_name, None)
|
||||
setattr(self, workers_name, [])
|
||||
|
||||
def _stopWorker(
|
||||
self, worker: object, worker_name: str, timeout_ms: int | None
|
||||
) -> None:
|
||||
request_interruption = getattr(worker, "requestInterruption", None)
|
||||
cancel = getattr(worker, "cancel", None)
|
||||
try:
|
||||
if callable(request_interruption):
|
||||
request_interruption()
|
||||
if callable(cancel):
|
||||
cancel()
|
||||
|
||||
is_running = getattr(worker, "isRunning", None)
|
||||
wait_method = getattr(worker, "wait", None)
|
||||
if callable(is_running) and is_running() and callable(wait_method):
|
||||
wait_method(timeout_ms)
|
||||
if timeout_ms is None:
|
||||
wait_method()
|
||||
else:
|
||||
wait_method(timeout_ms)
|
||||
|
||||
if callable(is_running) and is_running():
|
||||
logger.warning("%s is still running during shutdown", worker_name)
|
||||
except RuntimeError as error:
|
||||
logger.debug("%s already deleted during shutdown: %s", worker_name, error)
|
||||
|
||||
setattr(self, worker_name, None)
|
||||
@@ -651,6 +651,11 @@ class ThemeWrapper:
|
||||
self._default_theme = None # Lazy-loaded default theme
|
||||
self._generated_styles = None # Lazy-generated standard styles with custom constants
|
||||
|
||||
def get_theme_override(self, name: str) -> Any | None:
|
||||
"""Return a value declared by the custom theme."""
|
||||
declared = getattr(self.custom_theme, "_declared_theme_names", set())
|
||||
return getattr(self.custom_theme, name, None) if name in declared else None
|
||||
|
||||
@property
|
||||
def screenshots(self) -> list[tuple[QPixmap, str]]:
|
||||
"""Load theme preview screenshots on first access."""
|
||||
@@ -842,6 +847,19 @@ def load_theme(theme_name, inherit_chain=None):
|
||||
if spec is None or spec.loader is None:
|
||||
continue
|
||||
custom_theme = importlib.util.module_from_spec(spec)
|
||||
try:
|
||||
with open(styles_file, encoding="utf-8") as source_file:
|
||||
theme_tree = ast.parse(source_file.read(), filename=styles_file)
|
||||
declared_theme_names = {
|
||||
target.id
|
||||
for node in theme_tree.body
|
||||
if isinstance(node, ast.Assign)
|
||||
for target in node.targets
|
||||
if isinstance(target, ast.Name)
|
||||
}
|
||||
custom_theme.__dict__["_declared_theme_names"] = declared_theme_names
|
||||
except (OSError, SyntaxError):
|
||||
custom_theme.__dict__["_declared_theme_names"] = set()
|
||||
|
||||
# Temporarily add the theme directory to sys.path to support relative imports
|
||||
theme_dir = os.path.dirname(styles_file)
|
||||
@@ -1028,6 +1046,11 @@ class ThemeManager:
|
||||
def invalidate_theme(self, theme_name: str) -> None:
|
||||
"""Discard a cached theme after its files change."""
|
||||
self._theme_module_cache.pop(theme_name, None)
|
||||
_icon_dirs_cache.pop(theme_name, None)
|
||||
marker = f"_{theme_name}_"
|
||||
for cache_key in list(_icon_cache):
|
||||
if marker in cache_key:
|
||||
_icon_cache.pop(cache_key, None)
|
||||
if self.current_theme_name == theme_name:
|
||||
self.current_theme_name = None
|
||||
self.current_theme_module = None
|
||||
|
||||
@@ -157,6 +157,7 @@ class ThemeSecurityChecker:
|
||||
return False, self.errors
|
||||
|
||||
self._check_top_level(tree, theme_file, allow_absolute_imports)
|
||||
self._check_disabled_card_shadow(tree, theme_file)
|
||||
self._check_forbidden_patterns(tree, theme_file)
|
||||
|
||||
except Exception as e:
|
||||
@@ -239,6 +240,34 @@ class ThemeSecurityChecker:
|
||||
f"Top-level {type(node).__name__} is forbidden in file {theme_file}"
|
||||
)
|
||||
|
||||
def _check_disabled_card_shadow(
|
||||
self, tree: ast.Module, theme_file: str,
|
||||
) -> None:
|
||||
"""Reject the card shadow combination that breaks Qt painting."""
|
||||
values = {}
|
||||
for node in tree.body:
|
||||
if not isinstance(node, ast.Assign) or len(node.targets) != 1:
|
||||
continue
|
||||
target = node.targets[0]
|
||||
if not isinstance(target, ast.Name):
|
||||
continue
|
||||
if target.id not in {
|
||||
"color_shadow_card", "shadow_blur_radius", "shadow_offset",
|
||||
}:
|
||||
continue
|
||||
try:
|
||||
values[target.id] = ast.literal_eval(node.value)
|
||||
except (ValueError, TypeError):
|
||||
continue
|
||||
if values == {
|
||||
"color_shadow_card": "#00000000",
|
||||
"shadow_blur_radius": 0,
|
||||
"shadow_offset": (0, 0),
|
||||
}:
|
||||
self._add_error(
|
||||
f"Disabled card shadow breaks Qt painting in file {theme_file}"
|
||||
)
|
||||
|
||||
def _check_import(
|
||||
self, node: ast.Import | ast.ImportFrom, theme_file: str,
|
||||
allow_absolute_imports: bool,
|
||||
|
||||
@@ -70,6 +70,25 @@ DOWNLOADS_SECTION_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
STORE_DLC_LIST_STYLE = f"""
|
||||
QWidget#storeDlcList {{
|
||||
background: {color_surface_elevated};
|
||||
border: {border_none};
|
||||
border-radius: {border_radius_small};
|
||||
}}
|
||||
"""
|
||||
|
||||
STORE_DLC_ROW_STYLE = f"""
|
||||
QWidget#storeDlcRow {{
|
||||
background: transparent;
|
||||
border: {border_none};
|
||||
}}
|
||||
QWidget#storeDlcRow QLabel, QWidget#storeDlcRow QCheckBox {{
|
||||
background: transparent;
|
||||
color: {color_text};
|
||||
}}
|
||||
"""
|
||||
|
||||
DOWNLOADS_TABLE_STYLE = f"""
|
||||
QTableWidget {{
|
||||
background: {color_surface_elevated};
|
||||
|
||||
@@ -22,10 +22,57 @@ wineSettingsSetSpacing = 10
|
||||
themeStorePageSpacing = 10
|
||||
themeStoreCardDefaultWidth = 280
|
||||
themeStoreDetailCarouselMinHeight = 300
|
||||
horizontalTopGameLimit = 10
|
||||
fullLibraryTileGameCount = 4
|
||||
fullLibraryTileSize = (180, 180)
|
||||
fullLibraryTileColumns = 2
|
||||
fullLibraryTileRows = 2
|
||||
fullLibraryTileRadius = 10
|
||||
GAME_CARD_LIST = {
|
||||
"extra_margin": 8,
|
||||
"spacing": 12,
|
||||
"cover_load_size": 64,
|
||||
"cover_size": 56,
|
||||
"min_cover_size": 48,
|
||||
"cover_left_margin": 10,
|
||||
"row_height": 72,
|
||||
"min_row_height": 68,
|
||||
"cover_radius": 8,
|
||||
"border_radius": 18,
|
||||
}
|
||||
GAME_CARD_GRID = {
|
||||
"extra_margin": 20,
|
||||
"spacing": 5,
|
||||
"cover_aspect_ratio": 1.5,
|
||||
"card_height_ratio": 1.8,
|
||||
"cover_radius": 15,
|
||||
"border_radius": 18,
|
||||
}
|
||||
GAME_CARD_HORIZONTAL = {
|
||||
"extra_margin": 20,
|
||||
"spacing": 5,
|
||||
"cover_aspect_ratio": 0.56,
|
||||
"card_height_ratio": 0.78,
|
||||
"cover_radius": 15,
|
||||
"border_radius": 18,
|
||||
"layout_margins": (20, 20, 20, 20),
|
||||
"layout_spacing": 20,
|
||||
}
|
||||
GAME_CARD_VERTICAL = {
|
||||
**GAME_CARD_LIST,
|
||||
"layout_margins": (0, 0, 0, 0),
|
||||
"layout_spacing": 0,
|
||||
"header_height": 40,
|
||||
"header_margins": (4, 0, 4, 0),
|
||||
"header_spacing": 12,
|
||||
"header_cover_width": 66,
|
||||
"column_stretches": (4, 2, 2, 2),
|
||||
}
|
||||
downloadsSummaryHeight = 96
|
||||
downloadsTableHeaderHeight = 38
|
||||
downloadsTableRowHeight = 68
|
||||
downloadsCoverSize = (72, 48)
|
||||
downloadsCoverRadius = 6
|
||||
downloadsSectionSpacing = 14
|
||||
downloadsCellMargins = (8, 6, 8, 6)
|
||||
downloadsCellSpacing = 10
|
||||
@@ -33,6 +80,10 @@ downloadsActiveCardHeight = 190
|
||||
downloadsActiveCoverSize = (180, 120)
|
||||
downloadsActiveCardMargins = (16, 14, 16, 14)
|
||||
downloadsActiveCardSpacing = 14
|
||||
storeDlcDialogWidth = 480
|
||||
storeDlcVisibleRows = 3
|
||||
storeDlcCoverSize = (56, 36)
|
||||
storeDlcRowHeight = 52
|
||||
mangoHudSwitchesColumns = 4
|
||||
mangoHudSwitchesVerticalSpacing = 10
|
||||
mangoHudFpsColumns = 4
|
||||
|
||||
@@ -9,6 +9,10 @@ GAME_CARD_WINDOW_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
FULL_LIBRARY_TILE_STYLE = GAME_CARD_WINDOW_STYLE
|
||||
|
||||
GAME_CARD_VERTICAL_STYLE = GAME_CARD_WINDOW_STYLE
|
||||
|
||||
# GAME NAME LABEL IN CARD (QLabel)
|
||||
GAME_CARD_NAME_LABEL_STYLE = f"""
|
||||
QLabel {{
|
||||
@@ -24,6 +28,34 @@ GAME_CARD_NAME_LABEL_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
GAME_CARD_VERTICAL_NAME_STYLE = GAME_CARD_NAME_LABEL_STYLE
|
||||
|
||||
GAME_CARD_COLUMN_LABEL_STYLE = f"""
|
||||
QLabel {{
|
||||
color: {color_text_muted};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_value};
|
||||
background: {color_transparent};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_HEADER_STYLE = f"""
|
||||
QWidget {{
|
||||
background: {color_surface_elevated};
|
||||
border-radius: {border_radius_small};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_HEADER_LABEL_STYLE = f"""
|
||||
QLabel {{
|
||||
color: {color_text_muted};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_small};
|
||||
font-weight: bold;
|
||||
background: {color_transparent};
|
||||
}}
|
||||
"""
|
||||
|
||||
# PROTONDB BADGE STYLES ON CARD
|
||||
def get_protondb_badge_style(tier):
|
||||
tier = tier.lower()
|
||||
|
||||
@@ -13,6 +13,7 @@ logger = get_logger(__name__)
|
||||
_migrated = False
|
||||
|
||||
|
||||
# Remove after the legacy statistics migration period.
|
||||
def _migrate_last_launch_file(data_home: str) -> str:
|
||||
"""Migrate last_launch from old cache dir to XDG_DATA_HOME."""
|
||||
global _migrated
|
||||
@@ -43,6 +44,7 @@ def get_last_launch_path():
|
||||
_stats_migrated = False
|
||||
|
||||
|
||||
# Remove after the legacy statistics migration period.
|
||||
def _migrate_statistics_file(data_home: str) -> str:
|
||||
"""Migrate statistics from old cache/tmp dir to XDG_DATA_HOME."""
|
||||
global _stats_migrated
|
||||
|
||||
@@ -79,6 +79,11 @@ class TrayManager:
|
||||
self.stop_game_action.setEnabled(False)
|
||||
self.stop_game_action.triggered.connect(self.stop_game)
|
||||
|
||||
self.pause_game_action = QAction(_("Pause Game"), self.main_window)
|
||||
self.pause_game_action.setEnabled(False)
|
||||
self.pause_game_action.triggered.connect(self.toggle_game_pause)
|
||||
|
||||
self.tray_menu.addAction(self.pause_game_action)
|
||||
self.tray_menu.addAction(self.stop_game_action)
|
||||
self.tray_menu.addSeparator()
|
||||
self.tray_menu.addSeparator()
|
||||
@@ -96,8 +101,9 @@ class TrayManager:
|
||||
def refresh_tray_menu(self):
|
||||
self.tray_menu.clear()
|
||||
|
||||
self.tray_menu.addAction(self.pause_game_action)
|
||||
self.tray_menu.addAction(self.stop_game_action)
|
||||
self.update_stop_game_action()
|
||||
self.update_game_actions()
|
||||
if self.minimal_mode:
|
||||
return
|
||||
self.tray_menu.addSeparator()
|
||||
@@ -139,11 +145,71 @@ class TrayManager:
|
||||
self._populate_themes_menu(themes_menu)
|
||||
self.tray_menu.addMenu(themes_menu)
|
||||
|
||||
def update_stop_game_action(self) -> None:
|
||||
def update_game_actions(self) -> None:
|
||||
processes = self._game_process_tree()
|
||||
game_processes = getattr(self.main_window, "game_processes", [])
|
||||
target_exe = getattr(self.main_window, "target_exe", None)
|
||||
has_running_game = bool(game_processes or target_exe)
|
||||
self.stop_game_action.setEnabled(has_running_game)
|
||||
self.pause_game_action.setEnabled(bool(processes))
|
||||
paused = self._are_processes_paused(processes)
|
||||
self.pause_game_action.setText(_("Resume Game") if paused else _("Pause Game"))
|
||||
|
||||
def _are_processes_paused(self, processes: list[psutil.Process]) -> bool:
|
||||
if not processes:
|
||||
return False
|
||||
try:
|
||||
return all(
|
||||
process.status() == psutil.STATUS_STOPPED for process in processes
|
||||
)
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
return False
|
||||
|
||||
def _game_process_tree(self) -> list[psutil.Process]:
|
||||
processes = {}
|
||||
for launcher in getattr(self.main_window, "game_processes", []):
|
||||
try:
|
||||
parent = psutil.Process(launcher.pid)
|
||||
for process in parent.children(recursive=True):
|
||||
processes[process.pid] = process
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
continue
|
||||
|
||||
target = str(getattr(self.main_window, "target_exe", "") or "").lower()
|
||||
if not target:
|
||||
return list(processes.values())
|
||||
for process in psutil.process_iter(attrs=["name"]):
|
||||
try:
|
||||
if str(process.info.get("name") or "").lower() != target:
|
||||
continue
|
||||
processes[process.pid] = process
|
||||
for child in process.children(recursive=True):
|
||||
processes[child.pid] = child
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
continue
|
||||
return list(processes.values())
|
||||
|
||||
def toggle_game_pause(self) -> None:
|
||||
processes = self._game_process_tree()
|
||||
if not processes:
|
||||
self.update_game_actions()
|
||||
return
|
||||
paused = self._are_processes_paused(processes)
|
||||
pause_signal = signal.SIGCONT if paused else signal.SIGSTOP
|
||||
failures = 0
|
||||
for process in processes:
|
||||
try:
|
||||
process.send_signal(pause_signal)
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied, OSError) as error:
|
||||
failures += 1
|
||||
logger.warning(
|
||||
"Failed to change pause state for process %s: %s",
|
||||
process.pid,
|
||||
error,
|
||||
)
|
||||
if failures == len(processes):
|
||||
QMessageBox.warning(self.main_window, _("Error"), _("Failed to pause game"))
|
||||
self.update_game_actions()
|
||||
|
||||
def handle_tray_click(self, reason):
|
||||
if reason == QSystemTrayIcon.ActivationReason.Context:
|
||||
@@ -189,7 +255,7 @@ class TrayManager:
|
||||
|
||||
def stop_game(self) -> None:
|
||||
if self.main_window.stop_running_game():
|
||||
self.update_stop_game_action()
|
||||
self.update_game_actions()
|
||||
if self.minimal_mode:
|
||||
self.tray_icon.hide()
|
||||
QApplication.quit()
|
||||
@@ -314,13 +380,10 @@ class TrayManager:
|
||||
|
||||
def switch_theme(self, theme_name: str):
|
||||
try:
|
||||
ui_config.set_theme(theme_name)
|
||||
logger.info(f"Saved theme {theme_name}, restarting application to apply changes")
|
||||
restart_application_process()
|
||||
self.main_window._apply_theme_live(theme_name)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to switch theme to {theme_name}: {e}")
|
||||
ui_config.set_theme("standart")
|
||||
restart_application_process()
|
||||
self.main_window._apply_theme_live("standart")
|
||||
|
||||
def force_exit(self):
|
||||
self.main_window.close()
|
||||
|
||||
+8
-9
@@ -2,7 +2,7 @@
|
||||
name = "portprotonqt"
|
||||
version = "1.4.1"
|
||||
description = "A project to rewrite PortProton (PortWINE) using PySide"
|
||||
requires-python = ">=3.10"
|
||||
requires-python = ">=3.11"
|
||||
readme = "README.md"
|
||||
license = { text = "GPL-3.0" }
|
||||
authors = [
|
||||
@@ -15,7 +15,6 @@ classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
@@ -24,18 +23,18 @@ classifiers = [
|
||||
]
|
||||
dependencies = [
|
||||
"babel>=2.18.0",
|
||||
"evdev>=1.9.3",
|
||||
"evdev>=2.0.0",
|
||||
"libarchive-c>=5.3",
|
||||
"orjson>=3.12.0",
|
||||
"pillow>=12.3.0",
|
||||
"psutil>=7.2.2",
|
||||
"pyside6>=6.11.2",
|
||||
"rapidfuzz>=3.14.5",
|
||||
"rapidfuzz>=3.14.6",
|
||||
"qrcode>=8.2",
|
||||
"requests>=2.34.2",
|
||||
"tqdm>=4.70.0",
|
||||
"tqdm>=4.70.1",
|
||||
"vdf>=3.4",
|
||||
"websocket-client>=1.9.1",
|
||||
"websocket-client>=1.9.2",
|
||||
"dbus-fast>=5.0.22",
|
||||
"pefile>=2024.8.26",
|
||||
]
|
||||
@@ -52,7 +51,7 @@ package = true
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pre-commit>=4.6.2",
|
||||
"pyright>=1.1.411",
|
||||
"pyright>=1.1.414",
|
||||
"pytest>=9.1.1",
|
||||
"pytest-mock>=3.15.1",
|
||||
]
|
||||
@@ -66,9 +65,9 @@ known-third-party = ["portprotonqt"]
|
||||
|
||||
[tool.ruff]
|
||||
exclude = [".eggs", ".git", "build", "dist", "portprotonqt.egg-info", ".venv", "venv", "dev-scripts", "portprotonqt/themes", ".vscode"]
|
||||
target-version = "py310"
|
||||
target-version = "py311"
|
||||
|
||||
[tool.pyright]
|
||||
pythonVersion = "3.10"
|
||||
pythonVersion = "3.11"
|
||||
pythonPlatform = "Linux"
|
||||
ignore = [".eggs", ".git", "build", "dist", "portprotonqt.egg-info", ".venv", "venv", "dev-scripts", "portprotonqt/themes", ".vscode"]
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Tests for config/base.py — BaseConfig read/write cycle."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -119,6 +120,14 @@ def test_crash_reports_config_defaults_to_enabled(tmp_path: Path):
|
||||
assert config.get_crash_reports_enabled() is False
|
||||
|
||||
|
||||
def test_alt_dependency_check_config_defaults_to_enabled(tmp_path: Path):
|
||||
config = UIConfig(config_file=tmp_path / "test.conf")
|
||||
|
||||
assert config.get_disable_alt_i586_dependency_check() is False
|
||||
config.set_disable_alt_i586_dependency_check(True)
|
||||
assert config.get_disable_alt_i586_dependency_check() is True
|
||||
|
||||
|
||||
def test_control_hints_are_visible_by_default(tmp_path: Path):
|
||||
config = UIConfig(config_file=tmp_path / "test.conf")
|
||||
|
||||
@@ -135,6 +144,26 @@ def test_force_english_is_disabled_by_default(tmp_path: Path):
|
||||
assert config.get_force_english() is True
|
||||
|
||||
|
||||
def test_library_layout_uses_theme_until_overridden(tmp_path: Path):
|
||||
config = UIConfig(config_file=tmp_path / "test.conf")
|
||||
|
||||
assert config.get_library_layout_mode("horizontal") == "horizontal"
|
||||
config.set_library_layout_mode("grid")
|
||||
assert config.get_library_layout_mode("horizontal") == "grid"
|
||||
config.set_library_layout_mode("horizontal_top")
|
||||
assert config.get_library_layout_mode("grid") == "horizontal_top"
|
||||
config.set_library_layout_mode("vertical")
|
||||
assert config.get_library_layout_mode("horizontal") == "vertical"
|
||||
|
||||
|
||||
def test_horizontal_card_orientation_uses_theme_until_overridden(tmp_path: Path):
|
||||
config = UIConfig(config_file=tmp_path / "test.conf")
|
||||
|
||||
assert config.get_horizontal_card_orientation("vertical") == "vertical"
|
||||
config.set_horizontal_card_orientation("horizontal")
|
||||
assert config.get_horizontal_card_orientation("vertical") == "horizontal"
|
||||
|
||||
|
||||
def test_translation_can_switch_to_english_without_restart(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
@@ -177,3 +206,51 @@ class TestUpdateAppVersion:
|
||||
from portprotonqt.config.base import update_app_version
|
||||
update_app_version("1.0.0")
|
||||
assert update_app_version("1.1.0") is True
|
||||
|
||||
|
||||
def test_cache_path_does_not_follow_temporary_xdg_cache(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "data"))
|
||||
source = Path(__file__).parents[1] / "portprotonqt" / "config" / "base.py"
|
||||
for launch in ("first", "second"):
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / launch))
|
||||
paths = runpy.run_path(str(source))
|
||||
assert paths["CACHE_DIR"] == tmp_path / "data" / "PortProtonQt" / "cache"
|
||||
|
||||
|
||||
def test_legacy_cache_is_moved_to_data_directory(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
legacy_cache = tmp_path / "legacy" / "PortProtonQt"
|
||||
legacy_cache.mkdir(parents=True)
|
||||
(legacy_cache / "steam_apps.json").write_text("cached", encoding="utf-8")
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "legacy"))
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "data"))
|
||||
|
||||
source = Path(__file__).parents[1] / "portprotonqt" / "config" / "base.py"
|
||||
paths = runpy.run_path(str(source))
|
||||
|
||||
assert (paths["CACHE_DIR"] / "steam_apps.json").read_text(encoding="utf-8") == "cached"
|
||||
assert not legacy_cache.exists()
|
||||
|
||||
|
||||
def test_legacy_cache_merges_into_existing_cache(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
legacy_cache = tmp_path / "legacy" / "PortProtonQt"
|
||||
legacy_images = legacy_cache / "images"
|
||||
legacy_images.mkdir(parents=True)
|
||||
(legacy_images / "cover.jpg").write_text("cover", encoding="utf-8")
|
||||
current_cache = tmp_path / "data" / "PortProtonQt" / "cache"
|
||||
current_cache.mkdir(parents=True)
|
||||
(current_cache / "steam_apps.json").write_text("apps", encoding="utf-8")
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "legacy"))
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "data"))
|
||||
|
||||
source = Path(__file__).parents[1] / "portprotonqt" / "config" / "base.py"
|
||||
runpy.run_path(str(source))
|
||||
|
||||
assert (current_cache / "images" / "cover.jpg").read_text(encoding="utf-8") == "cover"
|
||||
assert (current_cache / "steam_apps.json").read_text(encoding="utf-8") == "apps"
|
||||
assert not legacy_cache.exists()
|
||||
@@ -1,10 +1,13 @@
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
from pytest import MonkeyPatch
|
||||
from pytest import MonkeyPatch, mark
|
||||
|
||||
from portprotonqt import compatibility_report as compatibility
|
||||
from portprotonqt.scripts_utils.graphics_detector import resolve_graphics_executable
|
||||
from portprotonqt.scripts_utils.graphics_detector import (
|
||||
analyze_executable,
|
||||
resolve_graphics_executable,
|
||||
)
|
||||
|
||||
|
||||
class FakePE:
|
||||
@@ -29,6 +32,50 @@ def test_suspected_crash_requires_existing_windows_executable(tmp_path: Path) ->
|
||||
assert compatibility.is_suspected_crash(8.0, False, str(executable)) is False
|
||||
|
||||
|
||||
@mark.parametrize("case", [
|
||||
(90.0, 5, False, True),
|
||||
(1.0, 0, False, False),
|
||||
(90.0, 0, False, False),
|
||||
(1.0, 143, True, False),
|
||||
(1.0, None, False, True),
|
||||
(90.0, None, False, False),
|
||||
])
|
||||
def test_crash_detection_uses_command_status(
|
||||
tmp_path: Path, monkeypatch: MonkeyPatch, case: tuple[float, int | None, bool, bool],
|
||||
) -> None:
|
||||
monkeypatch.delenv(compatibility.COMPATIBILITY_ALWAYS_REPORT_ENV, raising=False)
|
||||
executable = tmp_path / "game.exe"
|
||||
executable.touch()
|
||||
duration, code, stopped, expected = case
|
||||
|
||||
assert compatibility.is_suspected_crash(duration, stopped, str(executable), code) is expected
|
||||
|
||||
|
||||
def test_game_process_discovery_matches_engine_children_and_ignores_unrelated(
|
||||
tmp_path: Path, monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
executable = tmp_path / "game" / "Bootstrap.exe"
|
||||
engine = executable.parent / "Binaries" / "Game-Win64-Shipping.exe"
|
||||
commands = [
|
||||
(str(executable), 11.0, "running"),
|
||||
("Z:" + str(engine).replace("/", "\\"), 12.0, "running"),
|
||||
(str(executable), 1.0, "running"),
|
||||
(str(tmp_path / "other" / executable.name), 12.0, "running"),
|
||||
("services.exe", 12.0, "running"),
|
||||
(str(engine), 12.0, compatibility.psutil.STATUS_ZOMBIE),
|
||||
("bash", 12.0, "running"),
|
||||
]
|
||||
processes = [SimpleNamespace(info={
|
||||
"pid": pid, "name": "truncated-name", "cmdline": [command, str(executable)],
|
||||
"cwd": str(tmp_path), "create_time": created, "status": status,
|
||||
}) for pid, (command, created, status) in enumerate(commands)]
|
||||
monkeypatch.setattr(compatibility.psutil, "process_iter", lambda attrs: processes)
|
||||
|
||||
assert compatibility.get_running_game_processes(str(executable), 10.0) == {
|
||||
(0, 11.0): str(executable), (1, 12.0): str(engine),
|
||||
}
|
||||
|
||||
|
||||
def test_always_report_environment_bypasses_duration(
|
||||
tmp_path: Path, monkeypatch: MonkeyPatch
|
||||
) -> None:
|
||||
@@ -432,6 +479,15 @@ def test_find_graphics_executable_uses_renpy_runtime(tmp_path: Path) -> None:
|
||||
assert result == runtime
|
||||
|
||||
|
||||
def test_resolve_graphics_executable_uses_unity_player(tmp_path: Path) -> None:
|
||||
launcher = tmp_path / "game.exe"
|
||||
unity_player = tmp_path / "UnityPlayer.dll"
|
||||
launcher.touch()
|
||||
unity_player.touch()
|
||||
|
||||
assert resolve_graphics_executable(str(launcher)) == unity_player
|
||||
|
||||
|
||||
def test_resolve_graphics_executable_uses_unreal_shipping_binary(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
@@ -446,6 +502,24 @@ def test_resolve_graphics_executable_uses_unreal_shipping_binary(
|
||||
assert result == shipping
|
||||
|
||||
|
||||
def test_graphics_detector_uses_kex_renderer_config(
|
||||
tmp_path: Path, monkeypatch: MonkeyPatch
|
||||
) -> None:
|
||||
executable = tmp_path / "DOOM64_x64.exe"
|
||||
executable.touch()
|
||||
config = (
|
||||
tmp_path / "prefix/drive_c/users/steamuser/Saved Games/Nightdive Studios/DOOM 64"
|
||||
/ "kexengine.cfg"
|
||||
)
|
||||
config.parent.mkdir(parents=True)
|
||||
config.write_text('seta r_rhirenderfamily "vulkan"\n', encoding="utf-8")
|
||||
monkeypatch.setenv("WINEPREFIX", str(tmp_path / "prefix"))
|
||||
|
||||
result = analyze_executable(str(executable))
|
||||
|
||||
assert result["uses_vulkan"] is True
|
||||
|
||||
|
||||
def test_dxvk_suggestion_only_appears_for_wined3d() -> None:
|
||||
active_dxvk = compatibility._compatibility_suggestions(
|
||||
{}, "DirectX 11", "", {"PW_VULKAN_USE": "6"}
|
||||
@@ -458,6 +532,15 @@ def test_dxvk_suggestion_only_appears_for_wined3d() -> None:
|
||||
assert "Switch from WineD3D to DXVK for DirectX 8-11." in wined3d
|
||||
|
||||
|
||||
@mark.parametrize("enabled", ["1", "0", ""])
|
||||
def test_optiscaler_suggestion_only_appears_when_enabled(enabled: str) -> None:
|
||||
suggestions = compatibility._compatibility_suggestions(
|
||||
{}, "DirectX 11", "", {"PW_USE_OPTISCALER": enabled}
|
||||
)
|
||||
|
||||
assert any("disable OptiScaler" in suggestion for suggestion in suggestions) == (enabled == "1")
|
||||
|
||||
|
||||
def test_runtime_suggestions_use_portproton_components() -> None:
|
||||
findings = {
|
||||
"Runtimes": ["Mono", "Visual C++ 2015-2022"],
|
||||
|
||||
@@ -406,7 +406,7 @@ class TestReleaseIdleInhibit:
|
||||
async def run():
|
||||
mock_bus = MagicMock()
|
||||
mock_iface = AsyncMock()
|
||||
mock_iface.call_un_inhibit.side_effect = asyncio.TimeoutError()
|
||||
mock_iface.call_un_inhibit.side_effect = TimeoutError()
|
||||
mock_bus.disconnect = MagicMock()
|
||||
await release_idle_inhibit(mock_bus, "screensaver", (mock_iface, "cookie"))
|
||||
return mock_bus
|
||||
|
||||
@@ -45,7 +45,7 @@ def test_detail_page_exe_fallback_uses_image_cache(
|
||||
) -> None:
|
||||
exe_path = tmp_path / "game.exe"
|
||||
exe_path.write_bytes(b"MZ")
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "cache"))
|
||||
monkeypatch.setattr("portprotonqt.icon_extractor.CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
|
||||
fallback_exe, fallback_path = DetailPageManager._get_exe_icon_fallback({
|
||||
"exec_line": str(exe_path),
|
||||
@@ -258,6 +258,26 @@ def test_compact_layout_rebuild_preserves_debug_log_button(monkeypatch: MonkeyPa
|
||||
new_button.setIcon.assert_called_once_with(stop_icon)
|
||||
|
||||
|
||||
def test_debug_log_checks_alt_i586_dependencies(monkeypatch: MonkeyPatch) -> None:
|
||||
manager = DetailPageManager.__new__(DetailPageManager)
|
||||
manager.main_window = SimpleNamespace(
|
||||
resolve_launch_file_path=lambda path: path,
|
||||
_check_alt_i586_dependencies_before_launch=MagicMock(return_value=False),
|
||||
)
|
||||
cast(Any, manager).debug_log_manager = SimpleNamespace(start=MagicMock())
|
||||
monkeypatch.setattr(
|
||||
"portprotonqt.detail_pages.get_portproton_start_command",
|
||||
MagicMock(return_value=["portproton"]),
|
||||
)
|
||||
|
||||
manager._start_debug_log("/games/game.exe", MagicMock())
|
||||
|
||||
main_window = cast(Any, manager.main_window)
|
||||
debug_log_manager = cast(Any, manager.debug_log_manager)
|
||||
main_window._check_alt_i586_dependencies_before_launch.assert_called_once_with()
|
||||
debug_log_manager.start.assert_not_called()
|
||||
|
||||
|
||||
def _make_palette(colors):
|
||||
"""Create mock palette with name() returning hex colors."""
|
||||
palette = []
|
||||
@@ -662,7 +682,9 @@ def test_installed_egs_detail_shows_store_controls(monkeypatch) -> None:
|
||||
"name": "DOOM 64",
|
||||
})
|
||||
|
||||
assert _get_added_buttons(manager) == ["Settings", "Create Log", "Open Folder"]
|
||||
assert _get_added_buttons(manager) == [
|
||||
"Edit Shortcut", "Settings", "Create Log", "Open Folder"
|
||||
]
|
||||
|
||||
|
||||
def test_steam_with_appid_shows_edit_not_add(monkeypatch) -> None:
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import time
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
from PySide6.QtCore import QEvent, Qt
|
||||
from PySide6.QtGui import QKeyEvent
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from portprotonqt.scripts_utils.easyterm import TerminalWidget
|
||||
|
||||
|
||||
def test_terminal_keeps_failed_command_output(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
application = QApplication.instance() or QApplication([])
|
||||
exit_codes = []
|
||||
monkeypatch.setattr(QApplication, "exit", exit_codes.append)
|
||||
monkeypatch.setattr(
|
||||
"portprotonqt.scripts_utils.easyterm.find_gamepad", lambda: None
|
||||
)
|
||||
terminal = TerminalWidget(
|
||||
["/bin/sh", "-c", "printf 'final failure\\n'; exit 7"],
|
||||
".",
|
||||
None,
|
||||
False,
|
||||
)
|
||||
|
||||
deadline = time.monotonic() + 5
|
||||
while terminal.child_pid is not None and time.monotonic() < deadline:
|
||||
application.processEvents()
|
||||
time.sleep(0.01)
|
||||
|
||||
assert terminal.exit_code == 7
|
||||
assert "final failure" in terminal.toPlainText()
|
||||
assert exit_codes == []
|
||||
closed = []
|
||||
window = SimpleNamespace(close=lambda: closed.append(True))
|
||||
monkeypatch.setattr(terminal, "window", lambda: window)
|
||||
event = QKeyEvent(
|
||||
QEvent.Type.KeyPress,
|
||||
Qt.Key.Key_Return,
|
||||
Qt.KeyboardModifier.NoModifier,
|
||||
)
|
||||
|
||||
terminal.keyPressEvent(event)
|
||||
assert closed == [True]
|
||||
|
||||
closed.clear()
|
||||
gamepad = SimpleNamespace(
|
||||
connected=lambda: True,
|
||||
update=lambda: None,
|
||||
get_button=lambda _button: 1,
|
||||
close=lambda: None,
|
||||
)
|
||||
monkeypatch.setattr(terminal, "gamepad", gamepad)
|
||||
terminal.gamepad_a_pressed = False
|
||||
terminal._poll_close_gamepad()
|
||||
assert closed == [True]
|
||||
terminal._close_gamepad()
|
||||
terminal.close()
|
||||
+10
-1
@@ -37,6 +37,7 @@ def test_build_command_places_confirmation_before_subcommand(
|
||||
def test_update_legendary_skips_matching_release(tmp_path: Path, monkeypatch) -> None:
|
||||
api = EGSAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
api.version_path = tmp_path / "bin/legendary.version"
|
||||
bundled = tmp_path / "bin/legendary"
|
||||
bundled.parent.mkdir()
|
||||
@@ -64,18 +65,26 @@ def test_normalize_game_uses_epic_metadata() -> None:
|
||||
"description": "Description",
|
||||
"cover": "cover.jpg",
|
||||
"namespace": "test-namespace",
|
||||
"folder_name": "TestGame",
|
||||
"description_locale": "",
|
||||
"description_preference": "",
|
||||
"description_cache_version": 0,
|
||||
}
|
||||
|
||||
|
||||
def test_refresh_library_skips_mobile_only_games(
|
||||
def test_refresh_library_skips_mobile_only_games_and_dlcs(
|
||||
tmp_path: Path, monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
api = EGSAPI()
|
||||
api.library_path = tmp_path / "library.json"
|
||||
games = [
|
||||
{
|
||||
"app_name": "GameDLC",
|
||||
"metadata": {
|
||||
"mainGameItem": {"id": "base-game"},
|
||||
"releaseInfo": [{"platform": ["Windows"]}],
|
||||
},
|
||||
},
|
||||
{
|
||||
"app_name": "MobileGame",
|
||||
"app_title": "Mobile Game",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import zlib
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import Mock
|
||||
@@ -10,6 +11,84 @@ from portprotonqt.gog_api import GOGAPI, GOGDL_UPDATE_INTERVAL, GOG_PRODUCT_LOCA
|
||||
from portprotonqt.localization import LOCALE_MAP
|
||||
|
||||
|
||||
@pytest.mark.parametrize("generation", [1, 2])
|
||||
def test_prepare_repair_manifest_restores_imported_build(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, generation: int
|
||||
) -> None:
|
||||
api = GOGAPI()
|
||||
api.config_dir = tmp_path / "gogdl"
|
||||
game_path = tmp_path / "game"
|
||||
game_path.mkdir()
|
||||
(game_path / "goggame-123.info").write_bytes(orjson.dumps({
|
||||
"buildId": "old", "languages": ["fr-FR"],
|
||||
}))
|
||||
(game_path / "goggame-123.id").write_bytes(orjson.dumps({"buildId": "installed"}))
|
||||
(game_path / "goggame-456.info").write_text("{}")
|
||||
manifest_data = orjson.dumps({"version": generation, "buildId": "installed"})
|
||||
builds_response = Mock()
|
||||
builds_response.json.return_value = {"items": [
|
||||
{"build_id": "other", "branch": None, "urls": [{"url": "other"}]},
|
||||
{"build_id": "installed", "generation": generation,
|
||||
"urls": [{"url": "https://content-system.gog.com/manifest"}]},
|
||||
]}
|
||||
manifest_response = Mock()
|
||||
manifest_response.content = zlib.compress(manifest_data) if generation == 2 else manifest_data
|
||||
request = Mock(side_effect=[builds_response, manifest_response])
|
||||
monkeypatch.setattr(api, "get_credentials", lambda: {"access_token": "token"})
|
||||
monkeypatch.setattr("portprotonqt.gog_api.requests.get", request)
|
||||
|
||||
api.prepare_repair_manifest("123", game_path)
|
||||
|
||||
manifest_path = api.config_dir / "heroic_gogdl/manifests/123"
|
||||
assert orjson.loads(manifest_path.read_bytes()) == {
|
||||
"version": generation, "buildId": "installed", "HGLPlatform": "windows",
|
||||
"HGLInstallLanguage": "fr-FR", "HGLdlcs": [{"id": "456"}],
|
||||
}
|
||||
assert request.call_args.args[0] == "https://content-system.gog.com/manifest"
|
||||
assert request.call_args_list[0].kwargs["params"] == {"generation": 2, "_version": 2}
|
||||
|
||||
|
||||
def test_prepare_repair_manifest_uses_public_build_when_installed_build_is_missing(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
api = GOGAPI()
|
||||
api.config_dir = tmp_path / "gogdl"
|
||||
(tmp_path / "goggame-123.info").write_bytes(orjson.dumps({"buildId": "removed"}))
|
||||
builds_response = Mock()
|
||||
builds_response.json.return_value = {"items": [
|
||||
{"build_id": "private", "branch": "beta", "urls": [{"url": "private"}]},
|
||||
{"build_id": "public", "branch": None, "generation": 2,
|
||||
"urls": [{"url": "https://content-system.gog.com/public"}]},
|
||||
]}
|
||||
manifest_response = Mock()
|
||||
manifest_response.content = zlib.compress(orjson.dumps({"version": 2, "buildId": "public"}))
|
||||
request = Mock(side_effect=[builds_response, manifest_response])
|
||||
monkeypatch.setattr(api, "get_credentials", lambda: {"access_token": "token"})
|
||||
monkeypatch.setattr("portprotonqt.gog_api.requests.get", request)
|
||||
|
||||
api.prepare_repair_manifest("123", tmp_path)
|
||||
|
||||
manifest = orjson.loads((api.config_dir / "heroic_gogdl/manifests/123").read_bytes())
|
||||
assert manifest["buildId"] == "public"
|
||||
assert request.call_args.args[0] == "https://content-system.gog.com/public"
|
||||
|
||||
|
||||
def test_prepare_repair_manifest_rejects_unavailable_build(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
api = GOGAPI()
|
||||
api.config_dir = tmp_path / "gogdl"
|
||||
response = Mock()
|
||||
response.json.return_value = {"items": []}
|
||||
monkeypatch.setattr(api, "get_credentials", lambda: {"access_token": "token"})
|
||||
monkeypatch.setattr("portprotonqt.gog_api.requests.get", lambda *_args, **_kwargs: response)
|
||||
|
||||
with pytest.raises(OSError, match="GOG build not found"):
|
||||
api.prepare_repair_manifest("123", tmp_path)
|
||||
|
||||
assert not (api.config_dir / "heroic_gogdl/manifests/123").exists()
|
||||
|
||||
|
||||
def test_default_games_directory_is_user_games_folder() -> None:
|
||||
api = GOGAPI()
|
||||
|
||||
@@ -248,6 +327,7 @@ def test_get_game_loads_localized_product_description(
|
||||
) -> None:
|
||||
gamesdb_response = Mock()
|
||||
gamesdb_response.json.return_value = {
|
||||
"type": "game",
|
||||
"game": {
|
||||
"title": {"*": "Game"},
|
||||
"visible_in_library": True,
|
||||
@@ -272,6 +352,26 @@ def test_get_game_loads_localized_product_description(
|
||||
assert request.call_args_list[1].kwargs["params"]["locale"] == "fr-FR"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("entry_type", ["game", "mod", "dlc", "pack", None])
|
||||
def test_get_game_filters_library_types(
|
||||
monkeypatch: pytest.MonkeyPatch, entry_type: str | None
|
||||
) -> None:
|
||||
response = Mock()
|
||||
response.json.return_value = {
|
||||
"type": entry_type,
|
||||
"game": {"title": {"*": "Game"}, "visible_in_library": True},
|
||||
}
|
||||
request = Mock(return_value=response)
|
||||
monkeypatch.setattr("portprotonqt.gog_api.requests.get", request)
|
||||
|
||||
game = GOGAPI()._get_game(
|
||||
{"platform_id": "gog", "external_id": "123"}, "token"
|
||||
)
|
||||
|
||||
assert bool(game) == (entry_type in {"game", "mod"})
|
||||
assert request.call_count == (2 if game else 1)
|
||||
|
||||
|
||||
def test_is_authenticated_requires_token_and_user_id(monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
|
||||
@@ -287,6 +387,7 @@ def test_is_authenticated_requires_token_and_user_id(monkeypatch) -> None:
|
||||
def test_ensure_gogdl_downloads_matching_architecture(tmp_path: Path, monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
asset = {"name": "gogdl_linux_x86_64"}
|
||||
response = Mock()
|
||||
response.json.return_value = {"assets": [asset], "tag_name": "v1.2.1"}
|
||||
@@ -303,6 +404,7 @@ def test_ensure_gogdl_downloads_matching_architecture(tmp_path: Path, monkeypatc
|
||||
def test_update_gogdl_skips_current_release(tmp_path: Path, monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
api.gogdl_version_path = tmp_path / "bin/gogdl.version"
|
||||
gogdl_path = tmp_path / "bin/gogdl"
|
||||
gogdl_path.parent.mkdir()
|
||||
@@ -322,6 +424,7 @@ def test_update_gogdl_skips_current_release(tmp_path: Path, monkeypatch) -> None
|
||||
def test_update_gogdl_checks_release_after_month(tmp_path: Path, monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
api.gogdl_version_path = tmp_path / "bin/gogdl.version"
|
||||
gogdl_path = tmp_path / "bin/gogdl"
|
||||
gogdl_path.parent.mkdir()
|
||||
@@ -344,6 +447,7 @@ def test_update_gogdl_checks_release_after_month(tmp_path: Path, monkeypatch) ->
|
||||
def test_update_gogdl_records_failed_monthly_check(tmp_path: Path, monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
api.gogdl_version_path = tmp_path / "bin/gogdl.version"
|
||||
gogdl_path = tmp_path / "bin/gogdl"
|
||||
gogdl_path.parent.mkdir()
|
||||
@@ -369,6 +473,7 @@ def test_update_gogdl_records_failed_monthly_check(tmp_path: Path, monkeypatch)
|
||||
def test_update_gogdl_installs_new_release(tmp_path: Path, monkeypatch) -> None:
|
||||
api = GOGAPI()
|
||||
api.data_dir = tmp_path
|
||||
api.bin_dir = tmp_path / "bin"
|
||||
api.gogdl_version_path = tmp_path / "bin/gogdl.version"
|
||||
asset = {"name": "gogdl_linux_x86_64"}
|
||||
monkeypatch.setattr(api, "_get_latest_gogdl_release", lambda: (asset, "v1.2.1"))
|
||||
|
||||
@@ -55,7 +55,8 @@ def test_exe_icon_cache_path_uses_shared_directory(
|
||||
tmp_path: Path,
|
||||
monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "cache"))
|
||||
monkeypatch.setattr("portprotonqt.icon_extractor.CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
monkeypatch.setattr(image_utils, "CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
|
||||
icon_path = get_exe_icon_cache_path("/games/Game Name.exe")
|
||||
|
||||
@@ -554,7 +555,8 @@ def test_game_card_exe_fallback_uses_image_cache(
|
||||
) -> None:
|
||||
exe_path = tmp_path / "game.exe"
|
||||
exe_path.write_bytes(b"MZ")
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "cache"))
|
||||
monkeypatch.setattr("portprotonqt.icon_extractor.CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
monkeypatch.setattr(image_utils, "CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
card: Any = SimpleNamespace(
|
||||
exec_line=str(exe_path),
|
||||
name="Game",
|
||||
@@ -626,7 +628,8 @@ def test_remote_cover_replaces_immediate_exe_fallback_only_on_success(
|
||||
) -> None:
|
||||
callbacks.append(callback)
|
||||
|
||||
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "cache"))
|
||||
monkeypatch.setattr("portprotonqt.icon_extractor.CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
monkeypatch.setattr(image_utils, "CACHE_DIR", tmp_path / "cache" / "PortProtonQt")
|
||||
monkeypatch.setattr(image_utils, "QPixmap", FakePixmap)
|
||||
monkeypatch.setattr(image_utils.image_executor, "submit", lambda callback: callback())
|
||||
monkeypatch.setattr(image_utils, "downloader", SimpleNamespace(download_async=defer_download))
|
||||
|
||||
+134
-6
@@ -91,6 +91,36 @@ def test_native_gamepad_result_preserves_python_interface(monkeypatch: MonkeyPat
|
||||
gamepad.close()
|
||||
|
||||
|
||||
def test_native_gamepad_update_passes_collection_handle(monkeypatch: MonkeyPatch) -> None:
|
||||
updated_handles: list[int] = []
|
||||
gamepad = SDLGamepad(42, "Gamepads", "sdl3-gamepad:7", 7, 1)
|
||||
monkeypatch.setattr(native_gamepad._library, "portproton_gamepad_close", lambda _handle: None)
|
||||
monkeypatch.setattr(
|
||||
native_gamepad._library,
|
||||
"portproton_gamepad_update",
|
||||
updated_handles.append,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
native_gamepad._library,
|
||||
"portproton_gamepad_get_active_instance_id",
|
||||
lambda _handle: 9,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
native_gamepad._library,
|
||||
"portproton_gamepad_get_type",
|
||||
lambda _handle: SDL_GAMEPAD_TYPE_PS5,
|
||||
)
|
||||
|
||||
changed = gamepad.update()
|
||||
|
||||
assert updated_handles == [42]
|
||||
assert changed is True
|
||||
assert gamepad.active_instance_id == 9
|
||||
assert gamepad.sdl_type == SDL_GAMEPAD_TYPE_PS5
|
||||
assert gamepad.update() is False
|
||||
gamepad.close()
|
||||
|
||||
|
||||
def test_native_gamepad_reports_sdl_discovery_error(monkeypatch: MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(native_gamepad._library, "portproton_gamepad_find", lambda: None)
|
||||
monkeypatch.setattr(
|
||||
@@ -274,10 +304,10 @@ def test_horizontal_library_navigation_wraps_at_both_ends() -> None:
|
||||
)
|
||||
cards[-1].setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
|
||||
assert manager._navigate_horizontal_library(cards, PAD_DPAD_X, 1)
|
||||
assert manager._navigate_horizontal_library(cards, 0, PAD_DPAD_X, 1)
|
||||
assert QApplication.focusWidget() is cards[0]
|
||||
|
||||
assert manager._navigate_horizontal_library(cards, PAD_DPAD_X, -1)
|
||||
assert manager._navigate_horizontal_library(cards, 0, PAD_DPAD_X, -1)
|
||||
assert QApplication.focusWidget() is cards[-1]
|
||||
|
||||
tile = FullLibraryTile(_tile_theme())
|
||||
@@ -287,19 +317,44 @@ def test_horizontal_library_navigation_wraps_at_both_ends() -> None:
|
||||
manager._parent.game_library_manager.layout_mode = "horizontal_top"
|
||||
manager._parent.game_library_manager.fullLibraryTile = tile
|
||||
navigable_cards = [*cards, tile]
|
||||
assert manager._navigate_horizontal_library(navigable_cards, PAD_DPAD_X, 1)
|
||||
assert manager._navigate_horizontal_library(navigable_cards, 0, PAD_DPAD_X, 1)
|
||||
assert QApplication.focusWidget() is tile
|
||||
|
||||
assert manager._navigate_horizontal_library(navigable_cards, PAD_DPAD_X, -1)
|
||||
assert manager._navigate_horizontal_library(navigable_cards, 0, PAD_DPAD_X, -1)
|
||||
assert QApplication.focusWidget() is cards[-1]
|
||||
|
||||
assert manager._navigate_horizontal_library(navigable_cards, PAD_DPAD_X, 1)
|
||||
assert manager._navigate_horizontal_library(navigable_cards, 0, PAD_DPAD_X, 1)
|
||||
assert QApplication.focusWidget() is tile
|
||||
|
||||
assert manager._navigate_horizontal_library(navigable_cards, PAD_DPAD_X, 1)
|
||||
assert manager._navigate_horizontal_library(navigable_cards, 0, PAD_DPAD_X, 1)
|
||||
assert QApplication.focusWidget() is cards[0]
|
||||
|
||||
|
||||
def test_horizontal_autoinstall_navigation_uses_its_layout() -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
container = QWidget()
|
||||
layout = QHBoxLayout(container)
|
||||
cards: list[QWidget] = [QPushButton() for _index in range(3)]
|
||||
for card in cards:
|
||||
layout.addWidget(card)
|
||||
card.show()
|
||||
container.show()
|
||||
app.processEvents()
|
||||
|
||||
manager = InputManager.__new__(InputManager)
|
||||
manager._parent = cast(
|
||||
MainWindowProtocol,
|
||||
SimpleNamespace(
|
||||
theme=SimpleNamespace(LIBRARY_LAYOUT_MODE="horizontal"),
|
||||
autoInstallContainerLayout=layout,
|
||||
),
|
||||
)
|
||||
cards[0].setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
|
||||
assert manager._navigate_horizontal_library(cards, 1, PAD_DPAD_X, 1)
|
||||
assert QApplication.focusWidget() is cards[1]
|
||||
|
||||
|
||||
def test_full_library_tile_arrow_does_not_switch_tabs() -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
tile = FullLibraryTile(_tile_theme())
|
||||
@@ -494,6 +549,27 @@ def test_confirm_button_opens_combo_popup() -> None:
|
||||
assert app is not None
|
||||
|
||||
|
||||
def test_user_conf_table_combo_gets_focus_and_opens() -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
table = QTableWidget(1, 2)
|
||||
combo = QComboBox()
|
||||
combo.addItems(["Default", "Yes", "No"])
|
||||
table.setCellWidget(0, 1, combo)
|
||||
table.setCurrentCell(0, 1)
|
||||
table.show()
|
||||
combo.show()
|
||||
app.processEvents()
|
||||
manager = InputManager.__new__(InputManager)
|
||||
manager.settings_dialog = SimpleNamespace(settings_table=table)
|
||||
|
||||
manager._focus_settings_advanced_value_widget(table, 0)
|
||||
assert QApplication.focusWidget() is combo
|
||||
assert manager.handle_table_confirm(table)
|
||||
assert combo.view().isVisible()
|
||||
combo.hidePopup()
|
||||
assert app is not None
|
||||
|
||||
|
||||
def test_back_button_closes_visible_combo_popup() -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
combo = QComboBox()
|
||||
@@ -562,6 +638,27 @@ def test_system_table_button_routes_action_and_sound(monkeypatch: MonkeyPatch) -
|
||||
assert app is not None
|
||||
|
||||
|
||||
def test_confirm_button_activates_table_callback(monkeypatch: MonkeyPatch) -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
table = QTableWidget(1, 1)
|
||||
table.setItem(0, 0, QTableWidgetItem("Game"))
|
||||
table.setCurrentCell(0, 0)
|
||||
activated = []
|
||||
table._on_confirm_callback = lambda _table, row, column: activated.append( # type: ignore[attr-defined]
|
||||
(row, column)
|
||||
)
|
||||
manager = InputManager.__new__(InputManager)
|
||||
monkeypatch.setattr(
|
||||
input_buttons, "SoundManager", lambda: SimpleNamespace(play=lambda _sound: None)
|
||||
)
|
||||
confirm_button = next(iter(input_manager.BUTTONS["confirm"]))
|
||||
|
||||
assert manager._handle_table_button(table, confirm_button)
|
||||
|
||||
assert activated == [(0, 0)]
|
||||
assert app is not None
|
||||
|
||||
|
||||
def test_confirm_button_routes_line_edit_to_keyboard() -> None:
|
||||
app = QApplication.instance() or QApplication([])
|
||||
shown_for = []
|
||||
@@ -817,6 +914,37 @@ def test_gamepad_poll_reports_disconnected_device() -> None:
|
||||
assert actions == ["remove"]
|
||||
|
||||
|
||||
def test_gamepad_poll_refreshes_type_when_active_device_changes(
|
||||
monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
refreshed: list[bool] = []
|
||||
manager: Any = InputManager.__new__(InputManager)
|
||||
manager.running = True
|
||||
manager._gamepad_polling_suspended = False
|
||||
manager.gamepad = SimpleNamespace(
|
||||
update=lambda: True,
|
||||
connected=lambda: True,
|
||||
active_instance_id=7,
|
||||
sdl_type=SDL_GAMEPAD_TYPE_PS5,
|
||||
)
|
||||
manager._reset_input_state = lambda: setattr(
|
||||
manager, "gamepad_type", GamepadType.UNKNOWN,
|
||||
)
|
||||
manager._refresh_gamepad_ui = lambda: refreshed.append(True)
|
||||
manager._poll_button_events = lambda *_args: None
|
||||
manager._handle_pending_menu_fullscreen = lambda *_args: None
|
||||
manager._poll_hat_events = lambda *_args: None
|
||||
manager._poll_axis_events = lambda *_args: None
|
||||
manager.last_update = 0.0
|
||||
manager.update_interval = float("inf")
|
||||
monkeypatch.setattr(input_runtime.gamepad_config, "get_gamepad_type", lambda: "auto")
|
||||
|
||||
manager._poll_gamepad()
|
||||
|
||||
assert manager.gamepad_type == GamepadType.PLAYSTATION
|
||||
assert refreshed == [True]
|
||||
|
||||
|
||||
def test_suspend_gamepad_polling_sets_runtime_guard() -> None:
|
||||
manager: Any = InputManager.__new__(InputManager)
|
||||
manager._gamepad_polling_suspended = False
|
||||
|
||||
+1036
-1114
File diff suppressed because it is too large.
Load diff
@@ -12,7 +12,10 @@ Covers all migration scenarios:
|
||||
"""
|
||||
import os
|
||||
import shlex
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock
|
||||
|
||||
from libarchive.flags import READDISK_NO_XATTR
|
||||
import pytest
|
||||
|
||||
from portprotonqt.config.portproton import (
|
||||
@@ -24,6 +27,7 @@ from portprotonqt.config.portproton import (
|
||||
)
|
||||
from portprotonqt.scripts_utils.prefix_backup import (
|
||||
is_legacy_squashfs_backup,
|
||||
_archive_entry,
|
||||
_prefix_path,
|
||||
_backup_path,
|
||||
_safe_entry_path,
|
||||
@@ -398,6 +402,21 @@ class TestBackupPath:
|
||||
assert final.endswith(BACKUP_EXTENSION)
|
||||
|
||||
|
||||
class TestArchiveEntry:
|
||||
def test_add_files_compatible_with_libarchive_5_1(self, tmp_path: Path) -> None:
|
||||
source = tmp_path / "file.txt"
|
||||
source.write_text("content")
|
||||
archive = Mock()
|
||||
|
||||
assert _archive_entry(archive, str(source), "file.txt") is True
|
||||
archive.add_files.assert_called_once_with(
|
||||
str(source),
|
||||
flags=READDISK_NO_XATTR,
|
||||
pathname="file.txt",
|
||||
recursive=False,
|
||||
)
|
||||
|
||||
|
||||
class TestSafeEntryPath:
|
||||
def test_valid_relative(self):
|
||||
result = _safe_entry_path("/target", "file.txt")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""Tests for PortProton API helpers."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from typing import Any, cast
|
||||
|
||||
import portprotonqt.portproton_api as portproton_api
|
||||
@@ -190,9 +192,40 @@ def test_autoinstall_script_uses_cached_card_data(
|
||||
assert "name=Cached Game" in metadata_path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_autoinstall_refresh_clears_cached_ppdb_images(tmp_config_dir: Path) -> None:
|
||||
@pytest.mark.parametrize(
|
||||
("unique_call", "shortcut_name", "expected_name"),
|
||||
(
|
||||
('pw_create_unique_exe "wosb_launcher_pp"', "World of Sea Battle", "wosb_launcher_pp"),
|
||||
("pw_create_unique_exe", "Anomaly Zone", "Anomaly Zone"),
|
||||
),
|
||||
)
|
||||
def test_autoinstall_custom_data_uses_unique_exe_name(
|
||||
tmp_config_dir: Path, tmp_path: Path, unique_call: str,
|
||||
shortcut_name: str, expected_name: str,
|
||||
) -> None:
|
||||
api = PortProtonAPI(downloader=cast(Any, DummyDownloader()))
|
||||
script_path = tmp_path / "game.ppai"
|
||||
script_path.write_text(
|
||||
f'PORTWINE_CREATE_SHORTCUT_NAME="{shortcut_name}"\n'
|
||||
'PW_EXE_FILE="$WINEPREFIX/drive_c/Game/launcher.exe"\n'
|
||||
f"{unique_call}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
api.write_autoinstall_custom_data(str(script_path), {"name": "Game"})
|
||||
|
||||
custom_root = tmp_config_dir.parent / "data" / "PortProtonQt" / "custom_data"
|
||||
assert (custom_root / expected_name / "metadata.txt").exists()
|
||||
assert not (custom_root / "launcher").exists()
|
||||
|
||||
|
||||
def test_autoinstall_refresh_clears_cached_ppdb_images(
|
||||
tmp_config_dir: Path, monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
api = PortProtonAPI()
|
||||
image_dir = tmp_config_dir.parent / "cache" / "PortProtonQt" / "images"
|
||||
cache_dir = tmp_config_dir.parent / "data" / "PortProtonQt" / "cache"
|
||||
monkeypatch.setattr("portprotonqt.image_utils.CACHE_DIR", cache_dir)
|
||||
image_dir = cache_dir / "images"
|
||||
image_dir.mkdir(parents=True)
|
||||
compact_cache = image_dir / "43_compat.webp"
|
||||
full_cache = image_dir / "43.webp"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
"""Tests for config/portproton.py — exec_line parsing, icon sanitization, launcher tail extraction."""
|
||||
import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from pytest import MonkeyPatch, mark
|
||||
|
||||
from portprotonqt.config.portproton import (
|
||||
extract_exec_target_path,
|
||||
_sanitize_icon_name,
|
||||
@@ -10,9 +13,26 @@ from portprotonqt.config.portproton import (
|
||||
WINDOWS_LAUNCH_EXTENSIONS,
|
||||
DISC_IMAGE_EXTENSIONS,
|
||||
THEMED_LAUNCH_ICON_NAMES,
|
||||
get_portproton_scripts_path,
|
||||
)
|
||||
|
||||
|
||||
def test_scripts_path_uses_xdg_data_dirs(
|
||||
tmp_path: Path,
|
||||
monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
data_dir = tmp_path / "share"
|
||||
scripts_dir = data_dir / "portproton" / "scripts"
|
||||
scripts_dir.mkdir(parents=True)
|
||||
(scripts_dir / "start.sh").write_text("#!/bin/sh\n", encoding="utf-8")
|
||||
monkeypatch.chdir(tmp_path)
|
||||
monkeypatch.setenv("XDG_DATA_DIRS", str(data_dir))
|
||||
monkeypatch.delenv("APPDIR", raising=False)
|
||||
monkeypatch.delenv("SHARUN_DIR", raising=False)
|
||||
|
||||
assert get_portproton_scripts_path() == str(scripts_dir)
|
||||
|
||||
|
||||
class TestExtractExecTargetPath:
|
||||
def test_simple_exe_path(self):
|
||||
assert extract_exec_target_path("/tmp/game.exe") == "/tmp/game.exe"
|
||||
@@ -193,6 +213,58 @@ def test_game_launch_marker_is_emitted_for_wine_and_proton() -> None:
|
||||
assert helper.count(marker) == 2
|
||||
|
||||
|
||||
def test_user_conf_get_without_name_lists_active_values(tmp_path: Path) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definition = helper.split("manage_user_conf_value () {", 1)[1].split(
|
||||
"use_exiftool () {", 1
|
||||
)[0]
|
||||
user_conf = tmp_path / "user.conf"
|
||||
user_conf.write_text(
|
||||
'# comment\nexport PW_USE_ESYNC="1"\n# export PW_USE_FSYNC="1"\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
script = "manage_user_conf_value () {" + definition + '\nmanage_user_conf_value get\n'
|
||||
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script], capture_output=True, text=True,
|
||||
env={"PATH": os.defpath, "USER_CONF": str(user_conf)}, check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert result.stdout == 'PW_USE_ESYNC="1"\n'
|
||||
|
||||
|
||||
@mark.parametrize("runtime,logging", [("0", "0"), ("0", "1"), ("1", "0"), ("1", "1")])
|
||||
def test_wine_exit_code_survives_log_output_and_wineserver_wait(
|
||||
tmp_path: Path, runtime: str, logging: str,
|
||||
) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definition = helper.split("pw_run () {", 1)[1].split("export -f pw_run", 1)[0]
|
||||
script = "pw_run () {" + definition + '''
|
||||
check_variables () { :; }
|
||||
pw_launch_wrapper () { return 37; }
|
||||
wait_wineserver () { return 0; }
|
||||
print_info () { :; }
|
||||
PATH_TO_GAME="$1"
|
||||
PW_TMPFS_PATH="$1"
|
||||
PW_LOG_FILE="$1/wine.log"
|
||||
PW_EXE_FILE="$1/game.exe"
|
||||
PW_USE_RUNTIME="$2"
|
||||
PW_LOG="$3"
|
||||
pw_run "$PW_EXE_FILE"
|
||||
exit $?
|
||||
'''
|
||||
(tmp_path / "game.exe").touch()
|
||||
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script, "bash", str(tmp_path), runtime, logging],
|
||||
capture_output=True, text=True, env={"PATH": os.defpath}, check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 37, result.stderr
|
||||
assert result.stdout.count("PORTPROTONQT_GAME_EXIT_CODE=37") == 1
|
||||
|
||||
|
||||
def test_vk_gpu_info_uses_build_aux_binary() -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text(
|
||||
encoding="utf-8",
|
||||
|
||||
@@ -31,6 +31,35 @@ def test_cachyos_releases_alternate_with_wineland() -> None:
|
||||
"proton-cachyos-wineland-11.0-20260713.3-slr-x86_64",
|
||||
]
|
||||
|
||||
|
||||
def test_wine_entries_match_host_architecture(monkeypatch) -> None:
|
||||
manager = ProtonManager.__new__(ProtonManager)
|
||||
manager.cpu_level = 4
|
||||
entries = [
|
||||
{"name": "GE-Proton11-6", "url": "https://example.com/x86.tar.gz"},
|
||||
{
|
||||
"name": "GE-Proton11-6-aarch64",
|
||||
"url": "https://example.com/aarch64.tar.gz",
|
||||
},
|
||||
{"name": "CachyOS", "url": "https://example.com/proton-arm64.tar.xz"},
|
||||
]
|
||||
|
||||
monkeypatch.setattr(
|
||||
"portprotonqt.dialogs.proton_manager.platform.machine", lambda: "x86_64"
|
||||
)
|
||||
filtered = manager.filter_entries_by_cpu_level(entries, "proton_ge")
|
||||
assert [entry["name"] for entry in filtered] == ["GE-Proton11-6"]
|
||||
|
||||
monkeypatch.setattr(
|
||||
"portprotonqt.dialogs.proton_manager.platform.machine", lambda: "aarch64"
|
||||
)
|
||||
filtered = manager.filter_entries_by_cpu_level(entries, "proton_ge")
|
||||
assert [entry["name"] for entry in filtered] == [
|
||||
"GE-Proton11-6-aarch64",
|
||||
"CachyOS",
|
||||
]
|
||||
|
||||
|
||||
def test_dropped_wine_archives_accepts_supported_local_files(tmp_path) -> None:
|
||||
wine_archive = tmp_path / "WINE_LG_11-10.tar.xz"
|
||||
wine_archive.touch()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Tests for searching MangoHud, vkBasalt, and Gamescope settings."""
|
||||
|
||||
import subprocess
|
||||
from types import SimpleNamespace
|
||||
from typing import cast
|
||||
|
||||
@@ -38,6 +39,35 @@ def test_mangohud_search_ignores_unavailable_categories() -> None:
|
||||
settings._filter_mangohud_settings("fps")
|
||||
|
||||
|
||||
def test_mangohud_parser_recognizes_font_settings() -> None:
|
||||
settings = MangoHudSettingsMixin()
|
||||
|
||||
parsed, raw_tokens = settings._parse_mangohud_config(
|
||||
"font_scale=1.25,font_size=28,font_file=/usr/share/fonts/test.ttf"
|
||||
)
|
||||
|
||||
assert parsed["font_scale"] == "1.25"
|
||||
assert parsed["font_size"] == "28"
|
||||
assert parsed["font_file"] == "/usr/share/fonts/test.ttf"
|
||||
assert raw_tokens == []
|
||||
|
||||
|
||||
def test_mangohud_font_options_use_fc_list(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
output = (
|
||||
"Noto Sans Regular\t/usr/share/fonts/NotoSans.ttf\n"
|
||||
"Bitmap Regular\t/usr/share/fonts/misc.pcf.gz\n"
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
subprocess,
|
||||
"run",
|
||||
lambda *args, **kwargs: subprocess.CompletedProcess(args, 0, output, ""),
|
||||
)
|
||||
|
||||
assert MangoHudSettingsMixin()._get_mangohud_font_options() == [
|
||||
("Noto Sans Regular", "/usr/share/fonts/NotoSans.ttf")
|
||||
]
|
||||
|
||||
|
||||
def test_gamescope_search_ignores_unavailable_categories() -> None:
|
||||
settings = GamescopeSettingsMixin()
|
||||
settings.gamescope_category_groups = {}
|
||||
|
||||
+268
-4
@@ -11,7 +11,7 @@ Covers:
|
||||
import os
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from PySide6.QtCore import QPoint, Qt
|
||||
@@ -445,6 +445,31 @@ class TestCreateDesktopFile:
|
||||
# ── parse_desktop_entry round-trip ───────────────────────────────────────────
|
||||
|
||||
class TestParseDesktopEntryRoundTrip:
|
||||
def test_recovers_multiline_values(self, tmp_path: Path) -> None:
|
||||
desktop_path = tmp_path / "multiline.desktop"
|
||||
desktop_path.write_text(
|
||||
"[Desktop Entry]\n"
|
||||
"Name=Game\nSubtitle\n"
|
||||
"Comment=Launch Game\nSubtitle\n"
|
||||
"Exec=/game.exe\n"
|
||||
"Icon=/icons/Game\nSubtitle.png\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
parsed = parse_desktop_entry(str(desktop_path))
|
||||
|
||||
assert parsed is not None
|
||||
assert parsed.get("Name") == "Game Subtitle"
|
||||
assert parsed.get("Comment") == "Launch Game Subtitle"
|
||||
assert parsed.get("Icon") == "/icons/Game Subtitle.png"
|
||||
assert desktop_path.read_text(encoding="utf-8") == (
|
||||
"[Desktop Entry]\n"
|
||||
"Name=Game Subtitle\n"
|
||||
"Comment=Launch Game Subtitle\n"
|
||||
"Exec=/game.exe\n"
|
||||
"Icon=/icons/Game Subtitle.png\n"
|
||||
)
|
||||
|
||||
def test_round_trip_simple(self, tmp_path: Path, monkeypatch: Any) -> None:
|
||||
_patch_location(monkeypatch, tmp_path)
|
||||
exe = _make_exe(tmp_path)
|
||||
@@ -496,6 +521,19 @@ class TestParseDesktopEntryRoundTrip:
|
||||
assert parsed is not None
|
||||
assert parsed.get("Name") == "Тест Игра"
|
||||
|
||||
def test_multiline_name_is_written_on_one_line(
|
||||
self, tmp_path: Path, monkeypatch: Any
|
||||
) -> None:
|
||||
_patch_location(monkeypatch, tmp_path)
|
||||
exe = _make_exe(tmp_path)
|
||||
|
||||
result = create_desktop_file(exe, game_name="Game\nSubtitle")
|
||||
|
||||
assert result is not None
|
||||
entry_text, desktop_path, _ = result
|
||||
assert "Name=Game Subtitle\n" in entry_text
|
||||
assert Path(desktop_path).name == "Game Subtitle.desktop"
|
||||
|
||||
|
||||
# ── extract_exec_target_path with spaces ─────────────────────────────────────
|
||||
|
||||
@@ -895,12 +933,12 @@ class TestEditSteamShortcut:
|
||||
manager.game_library_manager.games = [old_game]
|
||||
monkeypatch.setattr(context_menu, "AddGameDialog", make_dialog)
|
||||
|
||||
context_menu.ContextMenuManager._edit_steam_shortcut(
|
||||
manager, "Old Game", 730, "/cover.jpg"
|
||||
context_menu.ContextMenuManager._edit_id_shortcut(
|
||||
manager, "Old Game", "/cover.jpg", ("steam", "730")
|
||||
)
|
||||
|
||||
assert created_with["steam_appid"] == "730"
|
||||
game_dir = tmp_path / "PortProtonQt" / "custom_data" / "730"
|
||||
game_dir = tmp_path / "PortProtonQt" / "custom_data" / "steam-730"
|
||||
assert (game_dir / "cover.webp").read_bytes() == b"cover"
|
||||
assert (game_dir / "metadata.txt").read_text(encoding="utf-8") == (
|
||||
"name=New Game\n"
|
||||
@@ -915,6 +953,48 @@ class TestEditSteamShortcut:
|
||||
str(game_dir / "cover.webp"),
|
||||
)
|
||||
|
||||
def test_saves_name_and_cover_by_store_id(
|
||||
self, tmp_path: Path, monkeypatch: Any
|
||||
) -> None:
|
||||
import portprotonqt.context_menu_manager as context_menu
|
||||
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path))
|
||||
source_cover = tmp_path / "selected.png"
|
||||
source_cover.write_bytes(b"cover")
|
||||
dialog = MagicMock()
|
||||
dialog.nameEdit.text.return_value = "Custom GOG Game"
|
||||
dialog.coverEdit.text.return_value = str(source_cover)
|
||||
dialog.last_cover_path = str(source_cover)
|
||||
dialog.exec.return_value = context_menu.QDialog.DialogCode.Accepted
|
||||
manager = context_menu.ContextMenuManager.__new__(
|
||||
context_menu.ContextMenuManager
|
||||
)
|
||||
manager.parent = MagicMock()
|
||||
manager.theme = None
|
||||
manager.signals = MagicMock()
|
||||
gog_game = (
|
||||
"GOG Game", "", "/old.jpg", "123", "", "gog://launch/123",
|
||||
"", "", "", "", 0, 0, "gog",
|
||||
)
|
||||
egs_game = (
|
||||
"EGS Game", "", "/old.jpg", "ABC", "", "egs://launch/ABC",
|
||||
"", "", "", "", 0, 0, "egs",
|
||||
)
|
||||
manager.game_library_manager = MagicMock(games=[gog_game, egs_game])
|
||||
monkeypatch.setattr(context_menu, "AddGameDialog", lambda **_kwargs: dialog)
|
||||
|
||||
manager._edit_id_shortcut("GOG Game", "/old.jpg", ("gog", "123"))
|
||||
manager._edit_id_shortcut("EGS Game", "/old.jpg", ("egs", "ABC"))
|
||||
|
||||
custom_root = tmp_path / "PortProtonQt" / "custom_data"
|
||||
for storage_id in ("gog-123", "egs-ABC"):
|
||||
game_dir = custom_root / storage_id
|
||||
assert (game_dir / "metadata.txt").read_text() == "name=Custom GOG Game\n"
|
||||
assert (game_dir / "cover.png").read_bytes() == b"cover"
|
||||
replacement = manager.game_library_manager.replace_game_incremental
|
||||
assert replacement.call_count == 2
|
||||
assert all(call.args[2][0] == "Custom GOG Game" for call in replacement.call_args_list)
|
||||
|
||||
|
||||
# ── Delete installed shortcuts ───────────────────────────────────────────────
|
||||
|
||||
@@ -1246,3 +1326,187 @@ class TestCopyShortcut:
|
||||
_copy_shortcut(str(src), str(target_dir))
|
||||
dest = target_dir / "Game.desktop"
|
||||
assert os.access(str(dest), os.X_OK)
|
||||
|
||||
|
||||
def test_relocate_missing_executable_data(tmp_path: Path, monkeypatch: Any) -> None:
|
||||
from portprotonqt.context_menu_manager import ContextMenuManager
|
||||
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path))
|
||||
old_exe = tmp_path / "Old Game.exe"
|
||||
new_exe = tmp_path / "New Game.exe"
|
||||
new_exe.touch()
|
||||
old_ppdb = Path(f"{old_exe}.ppdb")
|
||||
old_ppdb.write_text('export WINEPREFIX="GamePrefix"\n')
|
||||
root = tmp_path / "PortProtonQt" / "custom_data"
|
||||
old_folder = root / "Old Game"
|
||||
old_folder.mkdir(parents=True)
|
||||
(old_folder / "metadata.txt").write_text("name=My Game\n")
|
||||
(old_folder / "cover.png").write_bytes(b"cover")
|
||||
(old_folder / "screenshots").mkdir()
|
||||
(old_folder / "screenshots" / "1.png").write_bytes(b"screenshot")
|
||||
manager = object.__new__(ContextMenuManager)
|
||||
|
||||
manager._relocate_shortcut_data(str(old_exe), str(new_exe))
|
||||
|
||||
new_folder = root / get_custom_data_dir_name(str(new_exe))
|
||||
assert not old_folder.exists()
|
||||
assert not old_ppdb.exists()
|
||||
assert (new_folder / "metadata.txt").read_text() == "name=My Game\n"
|
||||
assert (new_folder / "cover.png").read_bytes() == b"cover"
|
||||
assert (new_folder / "screenshots" / "1.png").read_bytes() == b"screenshot"
|
||||
assert Path(f"{new_exe}.ppdb").read_text() == 'export WINEPREFIX="GamePrefix"\n'
|
||||
|
||||
|
||||
def test_relocate_data_conflict_preserves_source(tmp_path: Path, monkeypatch: Any) -> None:
|
||||
import pytest
|
||||
from portprotonqt.context_menu_manager import ContextMenuManager
|
||||
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path))
|
||||
monkeypatch.setattr("portprotonqt.context_menu_manager._", lambda _text: "Conflict: {file_name}")
|
||||
old_exe, new_exe = str(tmp_path / "old.exe"), str(tmp_path / "new.exe")
|
||||
root = tmp_path / "PortProtonQt" / "custom_data"
|
||||
source = root / get_custom_data_dir_name(old_exe)
|
||||
source.mkdir(parents=True)
|
||||
(source / "metadata.txt").write_text("original")
|
||||
Path(new_exe + ".ppdb").write_text("destination")
|
||||
Path(old_exe + ".ppdb").write_text("source")
|
||||
manager = object.__new__(ContextMenuManager)
|
||||
|
||||
with pytest.raises(FileExistsError) as error:
|
||||
manager._relocate_shortcut_data(old_exe, new_exe)
|
||||
|
||||
assert str(error.value) == f"Conflict: {new_exe}.ppdb"
|
||||
assert (source / "metadata.txt").read_text() == "original"
|
||||
assert Path(new_exe + ".ppdb").read_text() == "destination"
|
||||
assert Path(old_exe + ".ppdb").read_text() == "source"
|
||||
|
||||
|
||||
def test_relocate_statistics_preserves_other_games(tmp_path: Path, monkeypatch: Any) -> None:
|
||||
from portprotonqt.context_menu_manager import ContextMenuManager
|
||||
from portprotonqt.time_utils import get_last_launch_path, get_statistics_path
|
||||
|
||||
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path))
|
||||
old_exe, new_exe = str(tmp_path / "Old Game.exe"), str(tmp_path / "New Game.exe")
|
||||
statistics = Path(get_statistics_path())
|
||||
statistics.parent.mkdir(parents=True, exist_ok=True)
|
||||
statistics.write_text(f"{old_exe.replace(' ', '#@_@#')} sha256 125\n/other.exe hash 10\n")
|
||||
last_launch = Path(get_last_launch_path())
|
||||
last_launch.write_text("Old Game 2026-09-11T12:00:00\nOther 2026-01-01T00:00:00\n")
|
||||
manager = object.__new__(ContextMenuManager)
|
||||
|
||||
manager._relocate_shortcut_statistics(old_exe, new_exe)
|
||||
|
||||
assert statistics.read_text() == f"{new_exe.replace(' ', '#@_@#')} sha256 125\n/other.exe hash 10\n"
|
||||
assert last_launch.read_text() == "New Game 2026-09-11T12:00:00\nOther 2026-01-01T00:00:00\n"
|
||||
|
||||
|
||||
def test_missing_executable_dialog_actions(monkeypatch: Any) -> None:
|
||||
import portprotonqt.context_menu_manager as context_menu
|
||||
|
||||
manager = object.__new__(context_menu.ContextMenuManager)
|
||||
manager.parent = None
|
||||
manager.delete_game = MagicMock()
|
||||
manager.edit_game_shortcut = MagicMock()
|
||||
card = SimpleNamespace(name="Game", exec_line="missing.exe", cover_path="cover.png",
|
||||
missing_executable_path="missing.exe")
|
||||
dialog = MagicMock()
|
||||
buttons = [object(), object(), object()]
|
||||
monkeypatch.setattr(context_menu, "QMessageBox", MagicMock(return_value=dialog))
|
||||
for selection in range(3):
|
||||
dialog.addButton.side_effect = buttons
|
||||
dialog.clickedButton.return_value = buttons[selection]
|
||||
manager.handle_missing_executable(cast(Any, card))
|
||||
|
||||
manager.delete_game.assert_called_once_with("Game", "missing.exe")
|
||||
manager.edit_game_shortcut.assert_called_once_with("Game", "missing.exe", "cover.png")
|
||||
|
||||
|
||||
def test_missing_executable_editor_can_be_cancelled(tmp_path: Path, monkeypatch: Any) -> None:
|
||||
import portprotonqt.context_menu_manager as context_menu
|
||||
|
||||
manager = object.__new__(context_menu.ContextMenuManager)
|
||||
manager.parent = None
|
||||
manager.theme = SimpleNamespace()
|
||||
manager._check_portproton = MagicMock(return_value=True)
|
||||
manager._get_exec_line = MagicMock(return_value=f'portprotonqt --silent "{tmp_path}/missing.exe"')
|
||||
manager._relocate_shortcut_data = MagicMock()
|
||||
dialog = MagicMock()
|
||||
dialog.exec.return_value = context_menu.QDialog.DialogCode.Rejected
|
||||
factory = MagicMock(return_value=dialog)
|
||||
monkeypatch.setattr(context_menu, "AddGameDialog", factory)
|
||||
|
||||
manager.edit_game_shortcut("Game", "old command", "cover.png")
|
||||
|
||||
assert factory.call_args.kwargs["exe_path"] == str(tmp_path / "missing.exe")
|
||||
manager._relocate_shortcut_data.assert_not_called()
|
||||
|
||||
|
||||
def test_missing_dialog_buttons_fit_translated_text(monkeypatch: Any) -> None:
|
||||
import portprotonqt.context_menu_manager as context_menu
|
||||
from portprotonqt.themes.standart.styles.base import MAIN_WINDOW_STYLE, MESSAGE_BOX_STYLE
|
||||
|
||||
app = QApplication.instance() or QApplication([])
|
||||
parent = QWidget()
|
||||
parent.setStyleSheet(MAIN_WINDOW_STYLE + MESSAGE_BOX_STYLE)
|
||||
manager = object.__new__(context_menu.ContextMenuManager)
|
||||
manager.parent = parent
|
||||
card = SimpleNamespace(missing_executable_path="/games/Long Game Name/missing.exe")
|
||||
translations = {"Delete from PortProton": "Удалить из PortProton",
|
||||
"Select another executable": "Указать другой исполняемый файл"}
|
||||
monkeypatch.setattr(context_menu, "_", lambda text: translations.get(text, text))
|
||||
widths = []
|
||||
|
||||
def inspect_dialog(dialog: Any) -> int:
|
||||
dialog.show()
|
||||
app.processEvents()
|
||||
widths.extend((button.width(), button.sizeHint().width()) for button in dialog.buttons())
|
||||
dialog.reject()
|
||||
return 0
|
||||
|
||||
monkeypatch.setattr(context_menu.QMessageBox, "exec", inspect_dialog)
|
||||
manager.handle_missing_executable(cast(Any, card))
|
||||
|
||||
assert len(widths) == 3
|
||||
assert all(actual >= required for actual, required in widths)
|
||||
|
||||
|
||||
def test_edit_shortcut_removes_desktop_file_with_original_filename(
|
||||
tmp_path: Path, monkeypatch: Any,
|
||||
) -> None:
|
||||
import portprotonqt.context_menu_manager as context_menu
|
||||
|
||||
desktop_dir = tmp_path / "Desktop"
|
||||
desktop_dir.mkdir()
|
||||
source = tmp_path / "Original.desktop"
|
||||
source.write_text("[Desktop Entry]\nName=Renamed\nExec=/games/game.exe\n")
|
||||
desktop_shortcut = desktop_dir / source.name
|
||||
desktop_shortcut.write_text(source.read_text())
|
||||
manager = object.__new__(context_menu.ContextMenuManager)
|
||||
manager.parent = None
|
||||
manager.theme = SimpleNamespace()
|
||||
manager.signals = MagicMock()
|
||||
manager._check_portproton = MagicMock(return_value=True)
|
||||
manager._get_exec_line = MagicMock(return_value="/games/game.exe")
|
||||
manager._get_desktop_path = MagicMock(return_value=str(source))
|
||||
manager._get_menu_shortcut_path = MagicMock(return_value=str(tmp_path / "missing.desktop"))
|
||||
manager._relocate_shortcut_data = MagicMock(return_value=[])
|
||||
dialog = MagicMock()
|
||||
dialog.exec.return_value = context_menu.QDialog.DialogCode.Accepted
|
||||
dialog.nameEdit.text.return_value = "Renamed"
|
||||
dialog.exeEdit.text.return_value = "/games/game.exe"
|
||||
dialog.coverEdit.text.return_value = ""
|
||||
dialog.getDesktopEntryData.return_value = (source.read_text(), str(source))
|
||||
dialog.add_to_menu_checkbox.isChecked.return_value = False
|
||||
dialog.add_to_desktop_checkbox.isChecked.return_value = False
|
||||
dialog.add_to_steam_checkbox.isChecked.return_value = False
|
||||
monkeypatch.setattr(context_menu, "AddGameDialog", lambda **_kwargs: dialog)
|
||||
monkeypatch.setattr(context_menu, "is_game_in_steam", lambda _name: False)
|
||||
monkeypatch.setattr(
|
||||
context_menu.QStandardPaths, "writableLocation", lambda _location: str(desktop_dir)
|
||||
)
|
||||
|
||||
manager.edit_game_shortcut("Renamed", "/games/game.exe", "")
|
||||
|
||||
assert not desktop_shortcut.exists()
|
||||
assert source.exists()
|
||||
manager.signals.show_warning_dialog.emit.assert_not_called()
|
||||
Loaded 100 of 105 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user