Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d6f6c1b82
|
||
|
|
4451d7e26a | ||
|
|
a4199e2a16
|
||
|
|
401d1ddac2
|
||
|
|
86f66a1174
|
||
|
|
8d5a99f0de
|
||
|
|
92f795f0e5
|
||
|
|
821c9172b2 | ||
|
|
9c2febb40a | ||
|
|
da21309b0c
|
||
|
|
9be9187ea5
|
||
|
|
18d1ad2d92
|
||
|
|
f9cefe501b
|
||
|
|
d385e4e120
|
||
|
|
4d9f7be000 | ||
|
|
ee6255a507 | ||
|
|
2a8630db1b | ||
|
|
078bb9e8c7 | ||
|
|
be7f7056d3 | ||
|
|
b31dcb9c63 | ||
|
|
0958914cf1
|
||
|
|
ff23e4c0df
|
||
|
|
4ae1b71823
|
||
|
|
25bf639f00
|
||
|
|
5dfdc91b75
|
||
|
|
e5076a683c | ||
|
|
c3d3668eee | ||
|
|
f6d2a37d6f | ||
|
|
6969c534a8 | ||
|
|
4fcf48a7cf
|
||
|
|
090818a356
|
||
|
|
7451d1f876 | ||
|
|
f30e3fd405
|
||
|
|
01e2c3bfd5
|
||
|
|
52e1b303ba
|
||
|
|
ab954936fc
|
||
|
|
d25342331d | ||
|
|
26d1661f63 | ||
|
|
6ddb630fea
|
||
|
|
2b934bef6e | ||
|
|
5d2101475e | ||
|
|
c16b481679
|
||
|
|
b91ed1b135
|
||
|
|
a25c30f463
|
||
|
|
ebded297d3
|
||
|
|
73d8c8e030
|
||
|
|
079d79f2c8
|
||
|
|
4f8e0c2d41
|
||
|
|
37d9104274 | ||
|
|
764bb3ced5
|
||
|
|
37dd71284f | ||
|
|
03da1b2c61 | ||
|
|
e77a7edf4c | ||
|
|
065cf835c5 | ||
|
|
3001fdac30
|
||
|
|
4456d06b50
|
||
|
|
1d423d7ebe | ||
|
|
1c91219cef
|
||
|
|
718b7f0eaa
|
||
|
|
0b4fcd37d4
|
||
|
|
f08ae3091e
|
||
|
|
947a5d522a
|
||
|
|
2ad468491e | ||
|
|
5bb0848f56
|
||
|
|
6d6ed36bc0
|
||
|
|
93d6c4610c
|
||
|
|
72ec18e099
|
||
|
|
a04b0e41e9
|
||
|
|
6e4664589b | ||
|
|
6ccf99c73f | ||
|
|
20372331d6 | ||
|
|
b17bbb2f46
|
||
|
|
4debfae5aa | ||
|
|
36a086129e
|
||
|
|
912dc2c77e
|
||
|
|
26f3a35560
|
||
|
|
ad8cbb35dc
|
||
|
|
612c10595d
|
||
|
|
ac3d1045e4
|
||
|
|
363ff0d86e | ||
|
|
fe6b84db56 | ||
|
|
02ebc440ec | ||
|
|
bf6421547d | ||
|
|
4679fb7eb0 | ||
|
|
5c5d544bc7 | ||
|
|
a4abeca70d
|
||
|
|
bb39b07445
|
||
|
|
4c27ca8365
|
||
|
|
8b0eb13d72
|
||
|
|
08ec0773fa
|
||
|
|
52f7c04cff
|
||
|
|
00e20f2165
|
||
|
|
758c731106 | ||
|
|
01a82510f2
|
||
|
|
72daab8cd6
|
||
|
|
a0445d8c45
|
||
|
|
343bc12c1e
|
||
|
|
8aff408bda
|
||
|
|
66586b2a36
|
||
|
|
3fb6727818
|
||
|
|
520fa55988
|
||
|
|
b34004cff3 | ||
|
|
2eb8c1f7b6 | ||
|
|
f36073ee32 | ||
|
|
a258a63c8e
|
||
|
|
def3fe27f8
|
||
|
|
45fd7da18a
|
||
|
|
6afce40576
|
||
|
|
c2f45736db
|
||
|
|
4f3fdb621e
|
||
|
|
e40e9811cf
|
||
|
|
d1bfab6c7c | ||
|
|
4f8929da40
|
||
|
|
4b0b613659
|
||
|
|
0802e7852f
|
||
|
|
4a03d803f4
|
||
|
|
4271461282
|
||
|
|
f4477101cc
|
||
|
|
0dc11ecd3c
|
||
|
|
3248392e78
|
||
|
|
9468c3f286
|
||
|
|
c826153ddf
|
||
|
|
f2b80604cb
|
||
|
|
dd61c72a3a
|
||
|
|
36a36ad7d2
|
||
|
|
03ada79e88
|
||
|
|
20444bc3d1
|
||
|
|
ae89b5a0fb
|
||
|
|
3372bb58ba
|
||
|
|
200b257622
|
||
|
|
0b8ef53cdd
|
||
|
|
41aea94fff
|
||
|
|
0a4cb81906
|
||
|
|
1743c69261
|
No files matched your search
@@ -1,142 +0,0 @@
|
||||
name: Nightly Build - AppImage, Arch, Fedora
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUILD_BRANCH: ${{ github.ref_name }}
|
||||
PKGDEST: "/tmp/portprotonqt"
|
||||
PACKAGE: "portprotonqt"
|
||||
|
||||
jobs:
|
||||
build-appimage:
|
||||
name: Build AppImage
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:6db772fd1dd128b9cf7b7231ca5284af70879596fe4ec754c911cfc4ac30d5eb
|
||||
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
|
||||
|
||||
- uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Install appimage dependencies
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
chmod +x get-dependencies.sh portprotonqt-appimage.sh
|
||||
./get-dependencies.sh --local --branch "${{ env.BUILD_BRANCH }}"
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
./portprotonqt-appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-AppImage
|
||||
path: build-aux/AppImage/dist/*.AppImage
|
||||
|
||||
build-fedora:
|
||||
name: Build Fedora RPM
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
fedora_version: [42, 43, 44, rawhide]
|
||||
|
||||
container:
|
||||
image: fedora:${{ matrix.fedora_version }}
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
dnf install -y git rpmdevtools meson ninja-build python3-devel \
|
||||
systemd-rpm-macros vulkan-loader-devel redhat-rpm-config nodejs npm \
|
||||
gcc gettext
|
||||
|
||||
- name: Setup rpmbuild environment
|
||||
run: |
|
||||
useradd rpmbuild -u 5002 -g users || true
|
||||
mkdir -p /home/rpmbuild/{BUILD,RPMS,SPECS,SRPMS,SOURCES}
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
echo '%_topdir /home/rpmbuild' > /home/rpmbuild/.rpmmacros
|
||||
|
||||
- name: Checkout repo
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Copy fedora.spec
|
||||
run: |
|
||||
sed "s|git clone https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|git clone -b ${{ env.BUILD_BRANCH }} https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|" \
|
||||
build-aux/fedora-git.spec > /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
|
||||
- name: Build RPM
|
||||
run: |
|
||||
su rpmbuild -c "rpmbuild -ba /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec"
|
||||
|
||||
- name: Upload RPM package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-RPM-Fedora-${{ matrix.fedora_version }}
|
||||
path: /home/rpmbuild/RPMS/**/*.rpm
|
||||
|
||||
build-arch:
|
||||
name: Build Arch Package
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:6db772fd1dd128b9cf7b7231ca5284af70879596fe4ec754c911cfc4ac30d5eb
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman -Syuu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm
|
||||
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc) -l$(nproc)"/g' /etc/makepkg.conf
|
||||
sed -i 's/OPTIONS=(.*)/OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge lto)/g' /etc/makepkg.conf
|
||||
yes | pacman -Scc
|
||||
pacman-key --init
|
||||
pacman -S --noconfirm archlinux-keyring
|
||||
mkdir -p /__w/portproton-repo
|
||||
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
||||
pacman-key --lsign-key 3056513887B78AEB
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
||||
cat << EOM >> /etc/pacman.conf
|
||||
|
||||
[chaotic-aur]
|
||||
Include = /etc/pacman.d/chaotic-mirrorlist
|
||||
EOM
|
||||
pacman -Syy
|
||||
useradd -m user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
echo "PACKAGER=\"Boris Yumankulov <boria138@altlinux.org>\"" >> /etc/makepkg.conf
|
||||
chown user -R /tmp
|
||||
chown user -R ..
|
||||
|
||||
- name: Checkout
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd /__w/portproton-repo
|
||||
cp -r "$GITHUB_WORKSPACE" PortProtonQt
|
||||
cd /__w/portproton-repo/PortProtonQt/build-aux
|
||||
sed -i "s|source=(\"git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git\")|source=(\"git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git#branch=${{ env.BUILD_BRANCH }}\")|" PKGBUILD-git
|
||||
chown user -R ..
|
||||
su user -c "yes '' | makepkg --noconfirm -s -p PKGBUILD-git"
|
||||
|
||||
- name: Upload Arch package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-Arch
|
||||
path: ${{ env.PKGDEST }}/*
|
||||
@@ -25,12 +25,12 @@ jobs:
|
||||
apt-get install -y build-essential pkg-config libvulkan-dev git curl wget nodejs npm
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: https://gitea.com/actions/setup-node@v2
|
||||
uses: https://git.linux-gaming.ru/actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Checkout code
|
||||
uses: https://gitea.com/actions/checkout@v3
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@v3
|
||||
|
||||
- name: Compile vk_gpu_info
|
||||
run: |
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Upload vk_gpu_info binary
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: vk_gpu_info-debian11-binary
|
||||
path: build-aux/vk_gpu_info
|
||||
+41
-11
@@ -1,4 +1,4 @@
|
||||
name: Build AppImage, Arch and Fedora Packages
|
||||
name: Build AppImage, Arch, Fedora and Debian Packages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
env:
|
||||
# Common version, will be used for tagging the release
|
||||
VERSION: 1.1.0
|
||||
VERSION: 1.2.0
|
||||
PKGDEST: "/tmp/portprotonqt"
|
||||
PACKAGE: "portprotonqt"
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
pacman -Sy --noconfirm archlinux-keyring
|
||||
pacman -Syu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm xorg-server-xvfb zsync
|
||||
|
||||
- uses: https://gitea.com/actions/checkout@v4
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
- name: Install appimage dependencies
|
||||
run: |
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
./portprotonqt-appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-AppImage
|
||||
path: build-aux/AppImage/dist/*.AppImage
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
chown user -R ..
|
||||
|
||||
- name: Checkout
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
su user -c "yes '' | makepkg --noconfirm -s"
|
||||
|
||||
- name: Upload Arch package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-Arch
|
||||
path: ${{ env.PKGDEST }}/*
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
echo '%_topdir /home/rpmbuild' > /home/rpmbuild/.rpmmacros
|
||||
|
||||
- name: Checkout repo
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
- name: Copy fedora.spec
|
||||
run: |
|
||||
@@ -133,16 +133,46 @@ jobs:
|
||||
su rpmbuild -c "rpmbuild -ba /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec"
|
||||
|
||||
- name: Upload RPM package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-RPM-Fedora-${{ matrix.fedora_version }}
|
||||
path: /home/rpmbuild/RPMS/**/*.rpm
|
||||
|
||||
build-debian:
|
||||
name: Build Debian Package
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:13
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y build-essential debhelper dpkg-dev gettext git \
|
||||
libvulkan-dev meson ninja-build nodejs npm \
|
||||
pkgconf python3
|
||||
|
||||
- name: Checkout
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
dpkg-buildpackage -us -uc -b
|
||||
mkdir -p dist/deb
|
||||
mv ../*.deb ../*.buildinfo ../*.changes dist/deb/
|
||||
|
||||
- name: Upload Debian package
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-DEB-Debian-13
|
||||
path: dist/deb/*
|
||||
|
||||
release:
|
||||
name: Create and Publish Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://gitea.com/actions/checkout@v4
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@v4
|
||||
|
||||
- name: Install required dependencies
|
||||
run: |
|
||||
@@ -150,7 +180,7 @@ jobs:
|
||||
sudo apt install -y original-awk unzip
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: https://gitea.com/actions/download-artifact@v3
|
||||
uses: https://git.linux-gaming.ru/actions/download-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: release/
|
||||
@@ -170,7 +200,7 @@ jobs:
|
||||
awk "/^## \\[$VERSION\\]/ {flag=1; next} /^## \\[/ || /^---/ {flag=0} flag" CHANGELOG.md > changelog.txt
|
||||
|
||||
- name: Release
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-release-action@v1
|
||||
env:
|
||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
||||
with:
|
||||
|
||||
@@ -15,12 +15,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: https://gitea.com/actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
name: Build Check - AppImage, Arch, Fedora
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'build-aux/AppImage/**'
|
||||
- 'build-aux/fedora-git.spec'
|
||||
- 'build-aux/PKGBUILD-git'
|
||||
- '.gitea/workflows/code-build.yml'
|
||||
|
||||
env:
|
||||
PKGDEST: "/tmp/portprotonqt"
|
||||
PACKAGE: "portprotonqt"
|
||||
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
|
||||
PR_BRANCH: ${{ github.head_ref }}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
appimage: ${{ steps.check.outputs.appimage }}
|
||||
fedora: ${{ steps.check.outputs.fedora }}
|
||||
arch: ${{ steps.check.outputs.arch }}
|
||||
steps:
|
||||
- uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Ensure git is installed
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git
|
||||
|
||||
- name: Check changed files
|
||||
id: check
|
||||
run: |
|
||||
# Get changed files
|
||||
git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} > changed_files.txt
|
||||
|
||||
echo "Changed files:"
|
||||
cat changed_files.txt
|
||||
|
||||
# Check AppImage files
|
||||
if grep -q "build-aux/AppImage/" changed_files.txt; then
|
||||
echo "appimage=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "appimage=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Check Fedora spec files (only fedora-git.spec)
|
||||
if grep -q "build-aux/fedora-git.spec" changed_files.txt; then
|
||||
echo "fedora=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "fedora=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Check Arch PKGBUILD-git
|
||||
if grep -q "build-aux/PKGBUILD-git" changed_files.txt; then
|
||||
echo "arch=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "arch=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build-appimage:
|
||||
name: Build AppImage
|
||||
runs-on: ubuntu-22.04
|
||||
needs: changes
|
||||
if: needs.changes.outputs.appimage == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:6db772fd1dd128b9cf7b7231ca5284af70879596fe4ec754c911cfc4ac30d5eb
|
||||
options: --privileged --device /dev/fuse
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Sy --noconfirm --disable-download-timeout --needed archlinux-keyring
|
||||
pacman -Syu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm xorg-server-xvfb zsync
|
||||
|
||||
- uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Install appimage dependencies
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
chmod +x get-dependencies.sh portprotonqt-appimage.sh
|
||||
./get-dependencies.sh --local --branch "${{ env.PR_BRANCH }}" --repo "${{ env.PR_REPO_URL }}"
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
./portprotonqt-appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-AppImage
|
||||
path: build-aux/AppImage/dist/*.AppImage
|
||||
|
||||
build-fedora:
|
||||
name: Build Fedora RPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.fedora == 'true' || github.event_name == 'workflow_dispatch'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
fedora_version: [42, 43, 44, rawhide]
|
||||
|
||||
container:
|
||||
image: fedora:${{ matrix.fedora_version }}
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
dnf install -y git rpmdevtools meson ninja-build python3-devel \
|
||||
systemd-rpm-macros redhat-rpm-config nodejs npm \
|
||||
gcc vulkan-loader-devel gettext
|
||||
|
||||
- name: Setup rpmbuild environment
|
||||
run: |
|
||||
useradd rpmbuild -u 5002 -g users || true
|
||||
mkdir -p /home/rpmbuild/{BUILD,RPMS,SPECS,SRPMS,SOURCES}
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
echo '%_topdir /home/rpmbuild' > /home/rpmbuild/.rpmmacros
|
||||
|
||||
- name: Checkout repo
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Copy fedora-git.spec
|
||||
run: |
|
||||
sed "s|git clone https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|git clone -b ${{ env.PR_BRANCH }} ${{ env.PR_REPO_URL }}|" \
|
||||
build-aux/fedora-git.spec > /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
|
||||
- name: Build RPM
|
||||
run: |
|
||||
su rpmbuild -c "rpmbuild -ba /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec"
|
||||
|
||||
- name: Upload RPM package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-RPM-Fedora-${{ matrix.fedora_version }}
|
||||
path: /home/rpmbuild/RPMS/**/*.rpm
|
||||
|
||||
build-arch:
|
||||
name: Build Arch Package
|
||||
runs-on: ubuntu-22.04
|
||||
needs: changes
|
||||
if: needs.changes.outputs.arch == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:6db772fd1dd128b9cf7b7231ca5284af70879596fe4ec754c911cfc4ac30d5eb
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman -Sy --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm
|
||||
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc) -l$(nproc)"/g' /etc/makepkg.conf
|
||||
sed -i 's/OPTIONS=(.*)/OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge lto)/g' /etc/makepkg.conf
|
||||
yes | pacman -Scc
|
||||
pacman-key --init
|
||||
pacman -S --noconfirm archlinux-keyring
|
||||
mkdir -p /__w/portproton-repo
|
||||
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
||||
pacman-key --lsign-key 3056513887B78AEB
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
||||
cat << EOM >> /etc/pacman.conf
|
||||
|
||||
[chaotic-aur]
|
||||
Include = /etc/pacman.d/chaotic-mirrorlist
|
||||
EOM
|
||||
pacman -Syy
|
||||
useradd -m user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
echo "PACKAGER=\"Boris Yumankulov <boria138@altlinux.org>\"" >> /etc/makepkg.conf
|
||||
chown user -R /tmp
|
||||
chown user -R ..
|
||||
|
||||
- name: Checkout
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd /__w/portproton-repo
|
||||
git clone -b ${{ env.PR_BRANCH }} ${{ env.PR_REPO_URL }} PortProtonQt
|
||||
cd /__w/portproton-repo/PortProtonQt/build-aux
|
||||
sed -i "s|source=(\"git+https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git\")|source=(\"git+${{ env.PR_REPO_URL }}#branch=${{ env.PR_BRANCH }}\")|" PKGBUILD-git
|
||||
chown user -R ..
|
||||
su user -c "yes '' | makepkg --noconfirm -s -p PKGBUILD-git"
|
||||
|
||||
- name: Upload Arch package
|
||||
uses: https://gitea.com/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-Arch
|
||||
path: ${{ env.PKGDEST }}/*
|
||||
@@ -20,10 +20,10 @@ jobs:
|
||||
name: Check code
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: https://gitea.com/actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
|
||||
- name: Set up Python
|
||||
uses: https://gitea.com/actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
name: Package Build - AppImage, Arch, Fedora, Debian
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'build-aux/AppImage/**'
|
||||
- 'build-aux/fedora-git.spec'
|
||||
- 'build-aux/PKGBUILD-git'
|
||||
- 'debian/**'
|
||||
- '.gitea/workflows/package-build.yml'
|
||||
|
||||
env:
|
||||
BUILD_BRANCH: ${{ github.ref_name }}
|
||||
PKGDEST: "/tmp/portprotonqt"
|
||||
PACKAGE: "portprotonqt"
|
||||
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
|
||||
PR_BRANCH: ${{ github.head_ref }}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
appimage: ${{ steps.check.outputs.appimage }}
|
||||
fedora: ${{ steps.check.outputs.fedora }}
|
||||
arch: ${{ steps.check.outputs.arch }}
|
||||
debian: ${{ steps.check.outputs.debian }}
|
||||
steps:
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Ensure git is installed
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git
|
||||
|
||||
- name: Check changed files
|
||||
if: github.event_name == 'pull_request'
|
||||
id: check
|
||||
run: |
|
||||
git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} > changed_files.txt
|
||||
|
||||
echo "Changed files:"
|
||||
cat changed_files.txt
|
||||
|
||||
if grep -q "build-aux/AppImage/" changed_files.txt; then
|
||||
echo "appimage=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "appimage=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
if grep -q "build-aux/fedora-git.spec" changed_files.txt; then
|
||||
echo "fedora=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "fedora=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
if grep -q "build-aux/PKGBUILD-git" changed_files.txt; then
|
||||
echo "arch=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "arch=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
if grep -q "debian/" changed_files.txt; then
|
||||
echo "debian=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "debian=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Skip change detection
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
run: true
|
||||
|
||||
build-appimage:
|
||||
name: Build AppImage
|
||||
runs-on: ubuntu-22.04
|
||||
needs: changes
|
||||
if: needs.changes.outputs.appimage == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:c84ad63503efc5d386e30a5f44945fa8eee10fcb21b3d5fceda260783de394ff
|
||||
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
|
||||
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Install appimage dependencies
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
chmod +x get-dependencies.sh portprotonqt-appimage.sh
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
./get-dependencies.sh --local --branch "${{ env.PR_BRANCH }}" --repo "${{ env.PR_REPO_URL }}"
|
||||
else
|
||||
./get-dependencies.sh --local --branch "${{ env.BUILD_BRANCH }}"
|
||||
fi
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
cd build-aux/AppImage
|
||||
./portprotonqt-appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-AppImage
|
||||
path: build-aux/AppImage/dist/*.AppImage
|
||||
|
||||
build-fedora:
|
||||
name: Build Fedora RPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.fedora == 'true' || github.event_name == 'workflow_dispatch'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
fedora_version: [42, 43, 44, rawhide]
|
||||
|
||||
container:
|
||||
image: fedora:${{ matrix.fedora_version }}
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
dnf install -y git rpmdevtools meson ninja-build python3-devel \
|
||||
systemd-rpm-macros vulkan-loader-devel redhat-rpm-config nodejs npm \
|
||||
gcc gettext
|
||||
|
||||
- name: Setup rpmbuild environment
|
||||
run: |
|
||||
useradd rpmbuild -u 5002 -g users || true
|
||||
mkdir -p /home/rpmbuild/{BUILD,RPMS,SPECS,SRPMS,SOURCES}
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
echo '%_topdir /home/rpmbuild' > /home/rpmbuild/.rpmmacros
|
||||
|
||||
- name: Checkout PR
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- name: Checkout branch
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Copy fedora.spec
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
sed "s|git clone https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|git clone -b ${{ env.PR_BRANCH }} ${{ env.PR_REPO_URL }}|" \
|
||||
build-aux/fedora-git.spec > /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec
|
||||
else
|
||||
sed "s|git clone https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|git clone -b ${{ env.BUILD_BRANCH }} https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git|" \
|
||||
build-aux/fedora-git.spec > /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec
|
||||
fi
|
||||
chown -R rpmbuild:users /home/rpmbuild
|
||||
|
||||
- name: Build RPM
|
||||
run: |
|
||||
su rpmbuild -c "rpmbuild -ba /home/rpmbuild/SPECS/${{ env.PACKAGE }}.spec"
|
||||
|
||||
- name: Upload RPM package
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-RPM-Fedora-${{ matrix.fedora_version }}
|
||||
path: /home/rpmbuild/RPMS/**/*.rpm
|
||||
|
||||
build-arch:
|
||||
name: Build Arch Package
|
||||
runs-on: ubuntu-22.04
|
||||
needs: changes
|
||||
if: needs.changes.outputs.arch == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: archlinux:base-devel@sha256:c84ad63503efc5d386e30a5f44945fa8eee10fcb21b3d5fceda260783de394ff
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
pacman -Syuu --noconfirm --disable-download-timeout --needed git wget gnupg nodejs npm
|
||||
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc) -l$(nproc)"/g' /etc/makepkg.conf
|
||||
sed -i 's/OPTIONS=(.*)/OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge lto)/g' /etc/makepkg.conf
|
||||
yes | pacman -Scc
|
||||
pacman-key --init
|
||||
pacman -S --noconfirm archlinux-keyring
|
||||
mkdir -p /__w/portproton-repo
|
||||
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
||||
pacman-key --lsign-key 3056513887B78AEB
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
|
||||
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
||||
cat << EOM >> /etc/pacman.conf
|
||||
|
||||
[chaotic-aur]
|
||||
Include = /etc/pacman.d/chaotic-mirrorlist
|
||||
EOM
|
||||
pacman -Syy
|
||||
useradd -m user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
echo "PACKAGER=\"Boris Yumankulov <boria138@altlinux.org>\"" >> /etc/makepkg.conf
|
||||
chown user -R /tmp
|
||||
chown user -R ..
|
||||
|
||||
- name: Checkout PR
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- name: Checkout branch
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd /__w/portproton-repo
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
git clone -b ${{ env.PR_BRANCH }} ${{ env.PR_REPO_URL }} PortProtonQt
|
||||
else
|
||||
cp -r "$GITHUB_WORKSPACE" PortProtonQt
|
||||
fi
|
||||
cd /__w/portproton-repo/PortProtonQt/build-aux
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
sed -i "s|source=(\"git+https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt.git\")|source=(\"git+${{ env.PR_REPO_URL }}#branch=${{ env.PR_BRANCH }}\")|" PKGBUILD-git
|
||||
else
|
||||
sed -i "s|source=(\"git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git\")|source=(\"git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git#branch=${{ env.BUILD_BRANCH }}\")|" PKGBUILD-git
|
||||
fi
|
||||
chown user -R ..
|
||||
su user -c "yes '' | makepkg --noconfirm -s -p PKGBUILD-git"
|
||||
|
||||
- name: Upload Arch package
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-Arch
|
||||
path: ${{ env.PKGDEST }}/*
|
||||
|
||||
build-debian:
|
||||
name: Build Debian Package
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.debian == 'true' || github.event_name == 'workflow_dispatch'
|
||||
container:
|
||||
image: debian:13@sha256:4ae67669760b807c19f23902a3fd7c121a6a70cf2ae709035674b23e712e4d62
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y build-essential debhelper dpkg-dev gettext git \
|
||||
libvulkan-dev meson ninja-build nodejs npm \
|
||||
pkgconf python3
|
||||
|
||||
- name: Checkout PR
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- name: Checkout branch
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
ref: ${{ env.BUILD_BRANCH }}
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
dpkg-buildpackage -us -uc -b
|
||||
mkdir -p dist/deb
|
||||
mv ../*.deb ../*.buildinfo ../*.changes dist/deb/
|
||||
|
||||
- name: Upload Debian package
|
||||
uses: https://git.linux-gaming.ru/actions/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: PortProtonQt-DEB-Debian-13
|
||||
path: dist/deb/*
|
||||
@@ -10,10 +10,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/renovatebot/renovate:latest@sha256:47421f2f3f82048e969b5195dd808d5ac2c5f69d43d192191c4a3dca390afe06
|
||||
steps:
|
||||
- uses: https://gitea.com/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
- uses: https://git.linux-gaming.ru/actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: https://gitea.com/actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
uses: https://git.linux-gaming.ru/actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ wheels/
|
||||
|
||||
# Meson
|
||||
builddir/
|
||||
build-deb/
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
||||
|
||||
@@ -628,6 +628,11 @@ shadow.setBlurRadius(self.theme.shadow_blur_radius)
|
||||
label.setStyleSheet(self.theme.CONTENT_STYLE)
|
||||
```
|
||||
|
||||
**Tooltip rule:**
|
||||
- Prefer the themed `gamepad_tooltip`/`TOOLTIP_STYLE` mechanism for in-app `QWidget` tooltips
|
||||
- Avoid `setToolTip()` for regular widgets when the themed tooltip can be used
|
||||
- `setToolTip()` is acceptable only for APIs that are not regular widgets, such as `QSystemTrayIcon`
|
||||
|
||||
### Comments
|
||||
```python
|
||||
# NEVER: Russian or verbose
|
||||
|
||||
@@ -3,6 +3,78 @@
|
||||
Все заметные изменения в этом проекте фиксируются в этом файле.
|
||||
Формат основан на [Keep a Changelog](https://keepachangelog.com/) и придерживается принципов [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [1.2.0] - 2026-06-10
|
||||
|
||||
### Added
|
||||
- Добавлено удаление и переименование файла в файловом менеджере
|
||||
- Добавлена поддержка Special K
|
||||
- Добавлены настройки Wine, префикса и 3D Api по умолчанию
|
||||
- Добавлена настройка выбора звукового драйвера
|
||||
- Добавлена поддержка команд в настройке `запуск после`
|
||||
- Добавлена кнопка выхода во вкладку `Система`
|
||||
- Добавлена поддержка перетаскивания `.ppack` для восстановления префиксов
|
||||
- Добавлен скрытый тип отображения времени, скрывающий последний запуск и проведённое время
|
||||
- Добавлена сборка Deb-пакета (Debian 13+ и Ubuntu 25.04+)
|
||||
- Добавлена кнопка открытия установленного приложения из карточки автоустановки
|
||||
- Добавлено создание `.desktop` ярлыков под AppImage и их миграция при смене AppImage
|
||||
- Добавлено обновление `steam_scripts` в миграции ярлыков
|
||||
- Добавлена вкладка избранных параметров в диалог настроек exe
|
||||
- Добавлена вкладка настроек vkBasalt в диалог настроек exe
|
||||
- Добавлена проверка хэш-суммы после скачивания компонентов
|
||||
- Добавлена поддержка запуска `.nrg`
|
||||
- Начат португальский перевод `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/pt_BR/`
|
||||
|
||||
### Changed
|
||||
- Действия управления питанием во вкладке `Система` переведены на использование `loginctl`
|
||||
- В пресет MangoHud `PortProton` добавлен параметр `display_server`
|
||||
- Возвращена настройка типа геймпада для подсказок: Авто, Xbox или PlayStation (для авто нужен libSDL3)
|
||||
- Убрано лишнее сообщение об успешной очистке PPDB в диалоге настроек exe
|
||||
- Улучшено выделение строк и читаемость комбобоксов в настройках exe
|
||||
- Увеличена скорость передвижения курсора при эмуляции мыши
|
||||
- Ярлыки по умолчанию создаются только внутри PortProtonQt, без копирования в меню приложений и на рабочий стол
|
||||
- Обновлён WINE_LG: 11-1 -> 11-10
|
||||
- Обновлён испанский перевод `https://translate.codeberg.org/projects/portprotonqt/portprotonqt/es/`
|
||||
|
||||
### Fixed
|
||||
- Исправлена работа Winetricks с версиями Proton/Wine имеющими путь `files/bin/wine`
|
||||
- `exiftool` больше не запускается, если он не установлен
|
||||
- Исправлено копирование PPDB к exe
|
||||
- Исправлено отображение настроек `.bat`, `.cmd`, `.msi` и `.reg`
|
||||
- Исправлена настройка запуска нативного Wayland
|
||||
- Исправлен запуск PortProtonQt AppImage в режиме `--silent`
|
||||
- Исправлен запуск добавленных в Steam приложений из AppImage
|
||||
- Исправлено отключение скачивания контейнера во Flatpak
|
||||
- Исправлено чтение XDG Base Directory в скриптах: теперь пути читаются всегда, если заданы, без привязки к Flatpak
|
||||
- Исправлена миграция ярлыков на рабочем столе
|
||||
- Исправлен выбор системного `MangoHud.conf` в Flatpak: сначала проверяется `~/.config`, затем `XDG_CONFIG_HOME`
|
||||
- Исправлен выбор системного `vkBasalt.conf` в Flatpak: сначала проверяется `~/.config`, затем `XDG_CONFIG_HOME`
|
||||
- Исправлено авто-включение MangoHud при наличии `MANGOHUD_CONFIG`
|
||||
- Добавлена пропущенная поддержка `.cmd` рядом с `.bat`
|
||||
- Исправлено определение каталога Steam на OpenSUSE и Deb-based системах
|
||||
- Исправлен запуск игр Steam с учётом native, Snap и Flatpak установок
|
||||
- Исправлена передача параметров запуска игр в Steam compatibility mode
|
||||
- Исправлено определение установленных автоустановок по `.desktop`
|
||||
- Исправлена загрузка встроенных цветовых схем терминала
|
||||
- Исправлено попадание NFS и SMB шар в список смонтированных дисков
|
||||
- Исправлено создание папки в файловом менеджере
|
||||
- Исправлено редактирование имени папки в файловом менеджере
|
||||
- Исправлен сброс фокуса в файловом менеджере при навигации геймпадом
|
||||
- Исправлено прерывание автоустановки при выходе из карточки
|
||||
- Исправлено чтение последнего запуска для приложений с пробелами в имени exe
|
||||
- Исправлено отображение настроек exe с расширением в верхнем регистре
|
||||
- Исправлена неработоспособность правого стика геймпада из-за обработки прокрутки
|
||||
- Получение списка компонентов winetricks теперь занимает 0.11 с, а не 6.8
|
||||
- Исправлено бесконечное скачивание компонентов из автоустановок, если скорость скачивания падает до нуля
|
||||
|
||||
### Contributors
|
||||
- @VanoMJ
|
||||
- @CastroFidel
|
||||
- @Dervart
|
||||
- @rogerio-mattos
|
||||
- @gallegonovato
|
||||
|
||||
---
|
||||
|
||||
## [1.1.0] - 2026-05-26
|
||||
|
||||
### Added
|
||||
|
||||
@@ -60,7 +60,7 @@ 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 в iso, лицензия GPLv3
|
||||
- [iat](https://sourceforge.net/projects/iat.berlios) — библиотека для конвертации mdf и nrg в iso, лицензия GPLv3
|
||||
- [pyte](https://github.com/selectel/pyte) — разбор ANSI escape-кодов, лицензия [LGPLv3](https://github.com/selectel/pyte?tab=LGPL-3.0-1-ov-file)
|
||||
Полный текст лицензий см. в файле [LICENSE](LICENSE).
|
||||
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
pkgname=('portprotonqt')
|
||||
pkgver=1.1.0
|
||||
pkgver=1.2.0
|
||||
pkgrel=1
|
||||
pkgdesc="Modern GUI for managing and launching games from PortProton and Steam"
|
||||
arch=('any')
|
||||
url="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt"
|
||||
license=('GPL-3.0')
|
||||
depends=('python-requests' 'python-babel' 'python-evdev' 'python-pygame' 'python-orjson'
|
||||
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'python-rapidfuzz' 'python-pefile' 'python-pillow' 'perl-image-exiftool' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'jq' 'file' 'findutils' 'gawk' 'grep' 'tar' 'xz' 'zstd' 'gzip' 'unrar' 'qt6-svg' 'qt6-imageformats' 'pciutils' 'mesa-utils' 'vulkan-icd-loader' 'procps-ng' 'psmisc' '7zip' 'python-dbus-fast')
|
||||
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'python-rapidfuzz' 'python-pefile' 'python-pillow' 'perl-image-exiftool' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'jq' 'file' 'findutils' 'gawk' 'grep' 'tar' 'xz' 'zstd' 'gzip' 'unrar' 'qt6-svg' 'qt6-imageformats' 'pciutils' 'mesa-utils' 'vulkan-icd-loader' 'procps-ng' 'psmisc' '7zip' 'python-dbus-fast' 'sdl3')
|
||||
makedepends=('meson' 'ninja' 'vulkan-headers' 'gettext')
|
||||
conflicts=("portprotonqt-steam-compat")
|
||||
provides=('portprotonqt-steam-compat')
|
||||
|
||||
@@ -6,7 +6,7 @@ arch=('any')
|
||||
url="https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt"
|
||||
license=('GPL-3.0')
|
||||
depends=('python-requests' 'python-babel' 'python-evdev' 'python-pygame' 'python-orjson'
|
||||
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'python-rapidfuzz' 'python-pefile' 'python-pillow' 'perl-image-exiftool' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'jq' 'file' 'findutils' 'gawk' 'grep' 'tar' 'xz' 'zstd' 'gzip' 'unrar' 'qt6-svg' 'qt6-imageformats' 'pciutils' 'mesa-utils' 'vulkan-icd-loader' 'procps-ng' 'psmisc' '7zip' 'python-dbus-fast')
|
||||
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'python-rapidfuzz' 'python-pefile' 'python-pillow' 'perl-image-exiftool' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'jq' 'file' 'findutils' 'gawk' 'grep' 'tar' 'xz' 'zstd' 'gzip' 'unrar' 'qt6-svg' 'qt6-imageformats' 'pciutils' 'mesa-utils' 'vulkan-icd-loader' 'procps-ng' 'psmisc' '7zip' 'python-dbus-fast' 'sdl3')
|
||||
makedepends=('meson' 'ninja' 'vulkan-headers' 'gettext')
|
||||
conflicts=("portprotonqt-steam-compat")
|
||||
provides=('portprotonqt-steam-compat')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%global pypi_name portprotonqt
|
||||
%global pypi_version 1.1.0
|
||||
%global pypi_version 1.2.0
|
||||
%global oname PortProtonQt
|
||||
%global build_timestamp %(date +"%Y%m%d")
|
||||
%global _python_no_extras_requires 1
|
||||
@@ -43,6 +43,7 @@ Requires: python3-pillow-qt
|
||||
Requires: python3-rapidfuzz
|
||||
Requires: python3-libarchive-c
|
||||
Requires: perl-Image-ExifTool
|
||||
Requires: SDL3
|
||||
Requires: qt6-qtsvg
|
||||
Requires: qt6-qtimageformats
|
||||
Requires: cabextract
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%global pypi_name portprotonqt
|
||||
%global pypi_version 1.1.0
|
||||
%global pypi_version 1.2.0
|
||||
%global oname PortProtonQt
|
||||
%global _python_no_extras_requires 1
|
||||
|
||||
@@ -40,6 +40,7 @@ Requires: python3-pillow-qt
|
||||
Requires: python3-rapidfuzz
|
||||
Requires: python3-libarchive-c
|
||||
Requires: perl-Image-ExifTool
|
||||
Requires: SDL3
|
||||
Requires: qt6-qtsvg
|
||||
Requires: qt6-qtimageformats
|
||||
Requires: cabextract
|
||||
|
||||
@@ -11,4 +11,4 @@ Terminal=false
|
||||
Icon=ru.linux_gaming.PortProtonQt
|
||||
StartupWMClass=ru.linux_gaming.PortProtonQt
|
||||
Categories=Game;Utility;
|
||||
MimeType=x-scheme-handler/portproton;application/x-portproton-prefix-backup;application/x-ms-dos-exec;application/x-ms-dos-batch;application/x-msi;text/x-ms-regedit;application/x-executable;application/x-dosexec;application/x-iso9660-image;application/x-cd-image;application/x-raw-disk-image;application/x-mdf;application/x-mds-disk;
|
||||
MimeType=x-scheme-handler/portproton;application/x-portproton-prefix-backup;application/x-ms-dos-exec;application/x-ms-dos-batch;application/x-bat;application/x-msi;text/x-ms-regedit;application/x-executable;application/x-dosexec;application/x-iso9660-image;application/x-cd-image;application/x-raw-disk-image;application/x-mdf;application/x-mds-disk;application/x-nrg;
|
||||
@@ -24,34 +24,51 @@
|
||||
</developer>
|
||||
|
||||
<releases>
|
||||
<release version="1.0.0" date="2026-04-28">
|
||||
<description>
|
||||
<ul>
|
||||
<li>Built-in PortProton scripts with full PortProton feature parity</li>
|
||||
<li>New classic theme for an easier transition from PortProton</li>
|
||||
<li>Network-saving mode, improved caching, and fully local Steam game covers</li>
|
||||
<li>File manager actions for creating, deleting, and renaming folders</li>
|
||||
<li>Support for animated covers, JXL images, MDF launch, and external Steam Proton builds</li>
|
||||
<li>New tray controls for stopping a running game and silent exe launch support</li>
|
||||
<li>Improved gamepad controls with automatic Xbox and PlayStation type selection</li>
|
||||
<li>Improved tray, auto-install page, lost exe handling, and Wine/Proton list ordering</li>
|
||||
<li>Fixes for Bluetooth, SteamGridDB, QComboBox scrolling, Steam Compatdata, and desktop shortcuts</li>
|
||||
</ul>
|
||||
</description>
|
||||
<release version="1.2.0" date="2026-06-10">
|
||||
<description></description>
|
||||
</release>
|
||||
<release version="1.1.0" date="2026-05-26">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="1.0" date="2026-05-23">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.12" date="2026-04-17" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.11" date="2026-02-18" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.10" date="2026-01-14" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.9" date="2025-12-08" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.8" date="2025-10-18" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.7" date="2025-10-12" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.6" date="2025-09-23" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.5" date="2025-08-31" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.4" date="2025-07-21" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.3" date="2025-07-05" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.2" date="2025-06-15" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
<release version="0.1.1" date="2025-05-17" type="development">
|
||||
<description/>
|
||||
</release>
|
||||
|
||||
<release version="0.1.12" date="2026-04-17" type="development"/>
|
||||
<release version="0.1.11" date="2026-02-18" type="development"/>
|
||||
<release version="0.1.10" date="2026-01-14" type="development"/>
|
||||
<release version="0.1.9" date="2025-12-08" type="development"/>
|
||||
<release version="0.1.8" date="2025-10-18" type="development"/>
|
||||
<release version="0.1.7" date="2025-10-12" type="development"/>
|
||||
<release version="0.1.6" date="2025-09-23" type="development"/>
|
||||
<release version="0.1.5" date="2025-08-31" type="development"/>
|
||||
<release version="0.1.4" date="2025-07-21" type="development"/>
|
||||
<release version="0.1.3" date="2025-07-05" type="development"/>
|
||||
<release version="0.1.2" date="2025-06-15" type="development"/>
|
||||
<release version="0.1.1" date="2025-05-17" type="development"/>
|
||||
</releases>
|
||||
|
||||
<recommends>
|
||||
|
||||
@@ -481,34 +481,34 @@ try_download () {
|
||||
# If gamescope session is active, use PW_TERM for downloading
|
||||
if check_gamescope_session ; then
|
||||
$PW_TERM "echo ; echo ; echo \"Downloading: $filename. Please wait...\" \
|
||||
; curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
; curl -f -# --connect-timeout 5 --speed-limit 1 --speed-time 5 -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
-H 'Pragma: no-cache' -L ${FIRST_URL[*]} -o \"$dest\""
|
||||
|
||||
|
||||
[[ "$?" != 0 ]] && return 1 || return 0
|
||||
fi
|
||||
|
||||
# Normal download
|
||||
print_info "Download $filename from ${FIRST_URL[0]}..."
|
||||
if [[ "$silent" == "true" ]] ; then
|
||||
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
curl -f -# --connect-timeout 5 --speed-limit 1 --speed-time 5 -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
-H 'Pragma: no-cache' -L "${FIRST_URL[@]}" -o "$dest" 2>&1
|
||||
else
|
||||
# set -o pipefail
|
||||
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
curl -f -# --connect-timeout 5 --speed-limit 1 --speed-time 5 -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
-H 'Pragma: no-cache' -L "${FIRST_URL[@]}" -o "$dest" 2>&1 \
|
||||
| tr '\r' '\n' | sed -ur 's|[# ]+||g;s|100||g;s|0-||g;s|.*=.*||g'
|
||||
|
||||
#TODO: check download errror
|
||||
# [[ "${PIPESTATUS[0]}" != 0 ]] && local curl_status="error"
|
||||
# if [[ $no_mirror != "true" ]] \
|
||||
# && [[ $curl_status != "error" ]] \
|
||||
# && try_check_sha256sum "${FIRST_URL[@]}"
|
||||
# then
|
||||
# print_ok "File downloaded successfully: $filename from ${FIRST_URL[0]}"
|
||||
# return 0
|
||||
# else
|
||||
# local curl_status="error"
|
||||
# fi
|
||||
local curl_exit="${PIPESTATUS[0]}"
|
||||
if [[ "$curl_exit" == 28 ]] ; then
|
||||
fatal "Download $filename failed: server did not respond or transfer stalled for more than 5 seconds."
|
||||
elif [[ "$curl_exit" != 0 ]] ; then
|
||||
fatal "Download $filename failed (curl exit code: $curl_exit)."
|
||||
elif [[ "$no_mirror" != "true" ]] ; then
|
||||
try_check_sha256sum "${FIRST_URL[@]}" || fatal "Download $filename failed: the file is broken"
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
var_winedlloverride_update () {
|
||||
@@ -602,7 +602,7 @@ check_wayland_session () {
|
||||
if [[ -n "$WAYLAND_IN_USE" ]]
|
||||
then [[ "$WAYLAND_IN_USE" == 1 ]] && return 0 || return 1
|
||||
fi
|
||||
if echo "${XDG_SESSION_TYPE}" | grep -i "wayland" &>/dev/null ; then
|
||||
if [[ -n "${WAYLAND_DISPLAY:-}" ]] ; then
|
||||
export WAYLAND_IN_USE=1
|
||||
return 0
|
||||
else
|
||||
@@ -689,6 +689,16 @@ unpack () {
|
||||
*.tar.gz) local command="tar -xhzf" ;;
|
||||
*.tar.zst) local command="tar -I zstd -xhf" ;;
|
||||
*.tar) local command="tar -xhf" ;;
|
||||
*.7z|*.zip|*.exe|*.nupkg)
|
||||
if [[ -z "$pw_7z" ]] ; then
|
||||
if command -v 7z &>/dev/null
|
||||
then pw_7z="7z"
|
||||
else pw_7z="${PW_PLUGINS_PATH}/portable/lib/p7zip/7z"
|
||||
fi
|
||||
fi
|
||||
local command="$pw_7z"
|
||||
local is_p7zip=true
|
||||
;;
|
||||
esac
|
||||
|
||||
case $3 in
|
||||
@@ -697,15 +707,27 @@ unpack () {
|
||||
|
||||
# If gamescope session is active, use PW_TERM for unpack
|
||||
if check_gamescope_session ; then
|
||||
$PW_TERM "echo ; echo ; echo \"Unpacking file: $1. Please wait...\" ; $command \"$1\" -C \"$2\""
|
||||
if [[ "$is_p7zip" == "true" ]] ; then
|
||||
$PW_TERM "echo ; echo ; echo \"Unpacking file: $1. Please wait...\" ; \"$command\" x -y \"$1\" -o\"$2\""
|
||||
else
|
||||
$PW_TERM "echo ; echo ; echo \"Unpacking file: $1. Please wait...\" ; $command \"$1\" -C \"$2\""
|
||||
fi
|
||||
[[ "$?" != 0 ]] && return 1 || return 0
|
||||
elif [[ "$silent" != "true" ]] ; then
|
||||
print_info "Unpacking file: $(basename "$1") Please wait..."
|
||||
set -o pipefail
|
||||
$command "$1" -C "$2" 2>/dev/null
|
||||
if [[ "$is_p7zip" == "true" ]] ; then
|
||||
"$command" x -y "$1" "-o$2" 2>/dev/null
|
||||
else
|
||||
$command "$1" -C "$2" 2>/dev/null
|
||||
fi
|
||||
[[ "${PIPESTATUS[0]}" != 0 ]] && print_error "File $1 unpacking error." && return 1 || return 0
|
||||
else
|
||||
$command "$1" -C "$2" && return 0 || return 1
|
||||
if [[ "$is_p7zip" == "true" ]] ; then
|
||||
"$command" x -y "$1" "-o$2" && return 0 || return 1
|
||||
else
|
||||
$command "$1" -C "$2" && return 0 || return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -800,7 +822,7 @@ search_desktop_file () {
|
||||
|
||||
while read -r -a line2 ; do
|
||||
if [[ -z ${line2[0]} ]] \
|
||||
|| [[ ! ${line2[0],,} =~ .(bat|exe|msi|reg)$ ]] ; then
|
||||
|| [[ ! ${line2[0],,} =~ .(bat|cmd|exe|msi|reg)$ ]] ; then
|
||||
BROKEN_LINE=1
|
||||
break
|
||||
fi
|
||||
@@ -829,10 +851,10 @@ search_desktop_file () {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .msi, .reg
|
||||
# Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .cmd, .msi, .reg
|
||||
if [[ $BROKEN_LINE == 1 ]] ; then
|
||||
while read -r -a line4 ; do
|
||||
if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|exe|msi|reg)$ ]]
|
||||
if [[ -n ${line4[0]} ]] && [[ ${line4[0],,} =~ .(bat|cmd|exe|msi|reg)$ ]]
|
||||
then echo "${line4[*]}"
|
||||
fi
|
||||
done < "$PORT_WINE_TMP_PATH/statistics" > "$PORT_WINE_TMP_PATH/statistics_repair"
|
||||
@@ -1190,6 +1212,10 @@ check_user_conf () {
|
||||
# export DXVK_HUD=full
|
||||
# export GALLIUM_HUD=fps
|
||||
export PW_GPU_USE="disabled"
|
||||
# Optional defaults for executables without matching db values:
|
||||
# export PW_DEFAULT_WINE_USE="WINE_LG"
|
||||
# export PW_DEFAULT_PREFIX_NAME="DEFAULT"
|
||||
# export PW_DEFAULT_VULKAN_USE="2"
|
||||
EOF
|
||||
else
|
||||
sed -i \
|
||||
@@ -1366,7 +1392,7 @@ ${PW_PV_OVERRIDES}/i386-linux-gnu/aliases:\
|
||||
|
||||
export PW_PATH="${PW_PLUGINS_PATH}/portable/bin${PATH:+:$PATH}"
|
||||
|
||||
if [[ "$PW_LOG" == "1" ]] ; then
|
||||
if [[ "$SLR_DEBUG" == "1" ]] ; then
|
||||
PW_ADD_TO_ARGS_IN_RUNTIME="--verbose $PW_ADD_TO_ARGS_IN_RUNTIME"
|
||||
fi
|
||||
|
||||
@@ -1440,6 +1466,49 @@ pw_mangohud_check () {
|
||||
return 0
|
||||
}
|
||||
|
||||
pw_select_mangohud_user_conf () {
|
||||
unset MANGOHUD_CONFIG
|
||||
|
||||
if ! check_flatpak ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local home_config="${HOME}/.config/MangoHud/MangoHud.conf"
|
||||
local xdg_config="${XDG_CONFIG_HOME:-${HOME}/.config}/MangoHud/MangoHud.conf"
|
||||
|
||||
if [[ -f "$home_config" ]] ; then
|
||||
export MANGOHUD_CONFIGFILE="$home_config"
|
||||
elif [[ -f "$xdg_config" ]] ; then
|
||||
export MANGOHUD_CONFIGFILE="$xdg_config"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_info "System MangoHud.conf in use: $MANGOHUD_CONFIGFILE"
|
||||
}
|
||||
|
||||
pw_select_vkbasalt_user_conf () {
|
||||
unset VKBASALT_CONFIG_FILE
|
||||
unset PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS
|
||||
|
||||
if ! check_flatpak ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local home_config="${HOME}/.config/vkBasalt/vkBasalt.conf"
|
||||
local xdg_config="${XDG_CONFIG_HOME:-${HOME}/.config}/vkBasalt/vkBasalt.conf"
|
||||
|
||||
if [[ -f "$home_config" ]] ; then
|
||||
export VKBASALT_CONFIG_FILE="$home_config"
|
||||
elif [[ -f "$xdg_config" ]] ; then
|
||||
export VKBASALT_CONFIG_FILE="$xdg_config"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_info "System vkBasalt.conf in use: $VKBASALT_CONFIG_FILE"
|
||||
}
|
||||
|
||||
pw_mangohud_preview () {
|
||||
if pgrep -f "${PW_PLUGINS_PATH}/portable/bin/vkcube" ; then
|
||||
return 0
|
||||
@@ -1525,9 +1594,10 @@ pw_vkbasalt_check () {
|
||||
if ! grep "${PW_PLUGINS_PATH}/reshade" "${VKBASALT_CONFIG_FILE}" &>/dev/null
|
||||
then sed -ri "s|= .*/reshade|= \"${PW_PLUGINS_PATH}\"/reshade|g" "${VKBASALT_CONFIG_FILE}"
|
||||
fi
|
||||
if [[ -n "${PW_VKBASALT_EFFECTS}" ]] && [[ -n "${PW_VKBASALT_FFX_CAS}" ]] ; then
|
||||
if [[ -n "${PW_VKBASALT_EFFECTS}" ]] && [[ -n "${PW_VKBASALT_FFX_CAS}" ]] && [[ -n "${PW_VKBASALT_TOOGLE_KEY}" ]] ; then
|
||||
sed -ri "s/effects = .*/effects = ${PW_VKBASALT_EFFECTS}/g" "${VKBASALT_CONFIG_FILE}"
|
||||
sed -ri "s/casSharpness .*/casSharpness = ${PW_VKBASALT_FFX_CAS}/g" "${VKBASALT_CONFIG_FILE}"
|
||||
sed -ri "s/toggleKey = .*/toggleKey = ${PW_VKBASALT_TOOGLE_KEY}/g" "${VKBASALT_CONFIG_FILE}"
|
||||
fi
|
||||
else
|
||||
export DISABLE_VKBASALT="1"
|
||||
@@ -1793,10 +1863,6 @@ pw_check_and_download_plugins () {
|
||||
# export PW_PLUGINS_PATH="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}"
|
||||
fi
|
||||
fi
|
||||
if command -v 7z &>/dev/null
|
||||
then export pw_7z="7z"
|
||||
else export pw_7z="${PW_PLUGINS_PATH}/portable/lib/p7zip/7z"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1848,8 +1914,7 @@ check_dirs_and_files_in_pfx () {
|
||||
fi
|
||||
|
||||
DRIVES=(d e f g i j k l m n o p q r t u v w x y)
|
||||
DEF_MOUNT_DIRS=('/media' '/mnt' '/run/media')
|
||||
MOUNT_DIRS=($(find "${DEF_MOUNT_DIRS[@]}" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | sort -u))
|
||||
mapfile -t MOUNT_DIRS < <(python_module mount_points)
|
||||
find -L "$WINEPREFIX/dosdevices" -maxdepth 1 -type l -exec rm -rf {} \; 2>/dev/null ;
|
||||
|
||||
for drive_dir in "${MOUNT_DIRS[@]}" ; do
|
||||
@@ -1883,6 +1948,10 @@ check_dirs_and_files_in_pfx () {
|
||||
}
|
||||
|
||||
pw_init_db () {
|
||||
[[ -n "${PW_DEFAULT_WINE_USE:-}" ]] && export PW_WINE_USE="${PW_DEFAULT_WINE_USE}"
|
||||
[[ -n "${PW_DEFAULT_PREFIX_NAME:-}" ]] && export PW_PREFIX_NAME="${PW_DEFAULT_PREFIX_NAME}"
|
||||
[[ -n "${PW_DEFAULT_VULKAN_USE:-}" ]] && export PW_VULKAN_USE="${PW_DEFAULT_VULKAN_USE}"
|
||||
|
||||
if echo "$LSPCI_VGA" | grep -i -q 'nvidia.*rtx' ; then
|
||||
export PW_USE_NVAPI_AND_DLSS="1"
|
||||
export PW_USE_RAY_TRACING="1"
|
||||
@@ -1981,7 +2050,11 @@ pw_init_db () {
|
||||
export PORTWINE_DB_FILE
|
||||
use_exiftool "$PW_EXE_FILE"
|
||||
grep -q "Sony" "${PW_TMPFS_PATH}/exiftool.tmp" && PW_WINE_USE="WINE_LG"
|
||||
if [[ -z "${PORTWINE_DB_FILE}" ]] ; then
|
||||
if [[ -n "${PORTWINE_DB_FILE}" ]] ; then
|
||||
try_copy_file "${PORTWINE_DB_FILE}" "${PW_EXE_FILE}".ppdb
|
||||
export PORTWINE_DB_FILE="${PW_EXE_FILE}".ppdb
|
||||
fi
|
||||
if [[ ! -f "${PORTWINE_DB_FILE}" ]] ; then
|
||||
{
|
||||
echo "#!/usr/bin/env bash"
|
||||
echo "#Author: ${USER}"
|
||||
@@ -2018,7 +2091,10 @@ pw_init_db () {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${PATH_TO_GAME}" ]] || [[ ! -d "$(realpath "${PATH_TO_GAME}")" ]] ; then
|
||||
if [[ -z "${PATH_TO_GAME}" ]] \
|
||||
|| [[ "${PATH_TO_GAME}" == "." ]] \
|
||||
|| [[ ! -d "$(realpath "${PATH_TO_GAME}")" ]]
|
||||
then
|
||||
if [[ -f "${PW_EXE_FILE}" ]] ; then
|
||||
PATH_TO_GAME="$(dirname "$(realpath "${PW_EXE_FILE}")")"
|
||||
export PATH_TO_GAME
|
||||
@@ -2208,15 +2284,18 @@ edit_user_conf_from_gui () {
|
||||
elif [[ $proxy_mod_db =~ ^(Enabled|Enable)$ ]] ; then
|
||||
proxy_mod_db=enabled
|
||||
fi
|
||||
proxy_mod_db=$(echo "$proxy_mod_db" | sed 's/\\/\\\\\\\\/g; s/"/\\"/g')
|
||||
proxy_mod_db_escaped=$(printf '%s\n' "$proxy_mod_db" | sed 's/[\/&]/\\&/g')
|
||||
|
||||
if ! grep "export ${mod_db}=" "${USER_CONF}" &>/dev/null
|
||||
then echo "export ${mod_db}=\"$proxy_mod_db\"" >> "${USER_CONF}"
|
||||
elif grep "export ${mod_db}=" "${USER_CONF}" | grep -v "#" &>/dev/null
|
||||
then
|
||||
if [[ "$(grep "export ${mod_db}=" "${USER_CONF}" | grep -v "#")" != "export ${mod_db}=\"$proxy_mod_db\"" ]]
|
||||
then sed -ri "s/^export ${mod_db}=.*/export ${mod_db}=\"$proxy_mod_db\"/" "${USER_CONF}"
|
||||
then sed -ri "s|^export ${mod_db}=.*|export ${mod_db}=\"${proxy_mod_db_escaped}\"|" "${USER_CONF}"
|
||||
fi
|
||||
elif [[ "$(grep "export ${mod_db}=" "${USER_CONF}")" != "export ${mod_db}=$proxy_mod_db" ]]
|
||||
then sed -ri "s/.*export ${mod_db}=.*/export ${mod_db}=\"$proxy_mod_db\"/g" "${USER_CONF}"
|
||||
then sed -ri "s|.*export ${mod_db}=.*|export ${mod_db}=\"${proxy_mod_db_escaped}\"|g" "${USER_CONF}"
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
@@ -2291,20 +2370,6 @@ use_exiftool () {
|
||||
}
|
||||
|
||||
pw_create_gui_png () {
|
||||
if [[ -z $name_desktop_png ]] ; then
|
||||
basename_PW_EXE_FILE="$(basename "${PW_EXE_FILE}")"
|
||||
if echo "$basename_PW_EXE_FILE" | grep -ie 'setup\|install\|\.msi$' &>/dev/null ; then
|
||||
export name_desktop_png="setup"
|
||||
return 0
|
||||
elif echo "$basename_PW_EXE_FILE" | grep -ie '\.reg$' &>/dev/null ; then
|
||||
export name_desktop_png="reg"
|
||||
return 0
|
||||
elif echo "$basename_PW_EXE_FILE"| grep -ie '\.bat$' &>/dev/null ; then
|
||||
export name_desktop_png="bat"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$PORTPROTON_NAME" ]] \
|
||||
|| [[ "$PW_NO_RESTART_PPDB" == "1" ]]
|
||||
then
|
||||
@@ -2397,7 +2462,8 @@ pw_optiscaler_sync_files () {
|
||||
done
|
||||
|
||||
if [[ "${PW_USE_OPTISCALER}" != "1" ]] ; then
|
||||
if [[ -f "$PATH_TO_GAME/dlssg_to_fsr3_amd_is_better.dll" ]] ; then
|
||||
if [[ -f "$PATH_TO_GAME/optiscaler_version" ]]
|
||||
then
|
||||
for dll in $OPTISCALER_FILES ; do rm -fr "$PATH_TO_GAME/$dll"; done
|
||||
for dll in $ORIGINAL_GAME_DLLS ; do [[ -e "$PATH_TO_GAME/${dll}.b" ]] && mv -f "$PATH_TO_GAME/${dll}.b" "$PATH_TO_GAME/${dll}" 2>/dev/null; done
|
||||
try_remove_file "$PATH_TO_GAME/optiscaler_version"
|
||||
@@ -2414,10 +2480,19 @@ pw_optiscaler_sync_files () {
|
||||
check_variables OPTISCALER_FG_TYPE "Nukems"
|
||||
sed -i "s|FGType =.*|FGType = $OPTISCALER_FG_TYPE|g" "$OPTISCALER_PATH/OptiScaler.ini"
|
||||
echo "" > "$PATH_TO_GAME/dxvk.conf"
|
||||
if [[ -f "$PATH_TO_GAME/dxgi.dll" ]] \
|
||||
&& [[ -f "$PATH_TO_GAME/specialk_version" ]]
|
||||
then
|
||||
create_new_dir "$PATH_TO_GAME/plugins"
|
||||
mv -f "$PATH_TO_GAME/dxgi.dll" "$PATH_TO_GAME/plugins/dxgi.dll"
|
||||
mv -f "$PATH_TO_GAME/specialk_version" "$PATH_TO_GAME/plugins/specialk_version"
|
||||
fi
|
||||
if [[ ! -f "$PATH_TO_GAME/dlssg_to_fsr3_amd_is_better.dll" && -f "$PATH_TO_GAME/dxgi.dll" ]] ; then
|
||||
fatal 'dxgi.dll is already present in the game folder!\nThis script uses dxgi.dll to load required files.\nRemove the mod using dxgi.dll.'
|
||||
fi
|
||||
for dll in $ORIGINAL_GAME_DLLS ; do [[ -e "$PATH_TO_GAME/$dll" && ! -e "$PATH_TO_GAME/${dll}.b" ]] && mv -f "$PATH_TO_GAME/$dll" "$PATH_TO_GAME/${dll}.b" 2>/dev/null; done
|
||||
if [[ ! -f "$PATH_TO_GAME/optiscaler_version" ]] ; then
|
||||
for dll in $ORIGINAL_GAME_DLLS ; do [[ -e "$PATH_TO_GAME/$dll" && ! -e "$PATH_TO_GAME/${dll}.b" ]] && mv -f "$PATH_TO_GAME/$dll" "$PATH_TO_GAME/${dll}.b" 2>/dev/null; done
|
||||
fi
|
||||
if [[ ! -f "$PATH_TO_GAME/optiscaler_version" ]] || ! grep -q "$PW_OPTISCALER_VER" "$PATH_TO_GAME/optiscaler_version" ; then
|
||||
for dll in $OPTISCALER_FILES ; do cp -fr "$OPTISCALER_PATH/$dll" "$PATH_TO_GAME/$dll" || print_error "$OPTISCALER_PATH/$dll not found for copy!"; done
|
||||
echo "$PW_OPTISCALER_VER" > "$PATH_TO_GAME/optiscaler_version"
|
||||
@@ -2426,7 +2501,113 @@ pw_optiscaler_sync_files () {
|
||||
set_to_dxvk_conf nvidia_new
|
||||
}
|
||||
|
||||
pw_specialk_set_ini_value () {
|
||||
local ini_file section key value
|
||||
ini_file="$1"
|
||||
section="$2"
|
||||
key="$3"
|
||||
value="$4"
|
||||
|
||||
[[ -f "$ini_file" ]] && sed -i '/./,$!d' "$ini_file"
|
||||
|
||||
if grep -q "^\[$section\]" "$ini_file" ; then
|
||||
if sed -n "/^\[$section\]/,/^\[/{p}" "$ini_file" | grep -q "^$key=" ; then
|
||||
sed -i "/^\[$section\]/,/^\[/{s/^$key=.*/$key=$value/}" "$ini_file"
|
||||
else
|
||||
sed -i "/^\[$section\]/a $key=$value" "$ini_file"
|
||||
fi
|
||||
else
|
||||
[[ -s "$ini_file" ]] && printf '\n' >> "$ini_file"
|
||||
printf '[%s]\n%s=%s\n' "$section" "$key" "$value" >> "$ini_file"
|
||||
fi
|
||||
}
|
||||
|
||||
pw_specialk_sync_files () {
|
||||
local SPECIALK_PATH SPECIALK_DLLS dll PW_SK_DLL_NAME PW_SK_ARCH_DLL PW_SK_INI_FILE PW_SK_VERSION_FILE
|
||||
|
||||
SPECIALK_PATH="${PW_PLUGINS_PATH}/specialk/specialk-${PW_SPECIALK_VER}"
|
||||
SPECIALK_DLLS="d3d9.dll d3d11.dll dinput8.dll dxgi.dll opengl32.dll"
|
||||
PW_SK_VERSION_FILE="$PATH_TO_GAME/specialk_version"
|
||||
|
||||
if [[ "${PW_USE_SPECIALK}" != "1" ]] ; then
|
||||
if [[ -f "$PW_SK_VERSION_FILE" ]] ; then
|
||||
for dll in $SPECIALK_DLLS ; do rm -fr "$PATH_TO_GAME/$dll"; done
|
||||
for dll in $SPECIALK_DLLS ; do [[ -e "$PATH_TO_GAME/${dll}.b" ]] && mv -f "$PATH_TO_GAME/${dll}.b" "$PATH_TO_GAME/${dll}" 2>/dev/null; done
|
||||
for dll in $SPECIALK_DLLS ; do try_remove_file "$PATH_TO_GAME/${dll%.*}.ini"; done
|
||||
for dll in $SPECIALK_DLLS ; do try_remove_file "$PATH_TO_GAME/custom_${dll%.*}.ini"; done
|
||||
try_remove_file "$PW_SK_VERSION_FILE"
|
||||
fi
|
||||
if [[ -f "$PATH_TO_GAME/plugins/specialk_version" ]] ; then
|
||||
try_remove_file "$PATH_TO_GAME/plugins/dxgi.dll"
|
||||
try_remove_file "$PATH_TO_GAME/plugins/specialk_version"
|
||||
try_remove_file "$PATH_TO_GAME/dxgi.ini"
|
||||
try_remove_file "$PATH_TO_GAME/custom_dxgi.ini"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ ! -d "$SPECIALK_PATH" ]] && try_download "github.com/SpecialKO/SpecialK/releases/download/${PW_SPECIALK_VER}/SpecialK.7z" "${PORT_DATA_PATH}/data/tmp/SpecialK.7z" ; then
|
||||
create_new_dir "$SPECIALK_PATH"
|
||||
unpack "${PORT_DATA_PATH}/data/tmp/SpecialK.7z" "$SPECIALK_PATH" silent
|
||||
try_remove_file "${PORT_DATA_PATH}/data/tmp/SpecialK.7z"
|
||||
fi
|
||||
|
||||
if [[ -d "$SPECIALK_PATH" ]] ; then
|
||||
if file "$PW_EXE_FILE" | grep -q "x86-64" ; then
|
||||
PW_SK_ARCH_DLL="SpecialK64.dll"
|
||||
else
|
||||
PW_SK_ARCH_DLL="SpecialK32.dll"
|
||||
fi
|
||||
|
||||
if [[ "${PW_USE_OPTISCALER}" == "1" ]] && [[ -f "$SPECIALK_PATH/$PW_SK_ARCH_DLL" ]] ; then
|
||||
create_new_dir "$PATH_TO_GAME/plugins"
|
||||
if [[ ! -f "$PATH_TO_GAME/plugins/specialk_version" ]] || ! grep -q "$PW_SPECIALK_VER" "$PATH_TO_GAME/plugins/specialk_version" ; then
|
||||
cp -f "$SPECIALK_PATH/$PW_SK_ARCH_DLL" "$PATH_TO_GAME/plugins/dxgi.dll"
|
||||
echo "$PW_SPECIALK_VER" > "$PATH_TO_GAME/plugins/specialk_version"
|
||||
fi
|
||||
PW_SK_INI_FILE="$PATH_TO_GAME/custom_dxgi.ini"
|
||||
pw_specialk_set_ini_value "$PW_SK_INI_FILE" "Compatibility.General" "UsingWINE" "true"
|
||||
pw_specialk_set_ini_value "$PW_SK_INI_FILE" "Steam.Log" "Silent" "true"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local DETECT_OUT HIGHEST_DX USES_OGL
|
||||
DETECT_OUT=$(python_module graphics_detector "$PW_EXE_FILE")
|
||||
HIGHEST_DX=$(echo "$DETECT_OUT" | grep "^HIGHEST_DX=" | cut -d'=' -f2)
|
||||
USES_OGL=$(echo "$DETECT_OUT" | grep "^USES_OGL=" | cut -d'=' -f2)
|
||||
|
||||
PW_SK_DLL_NAME="dxgi.dll"
|
||||
case "$HIGHEST_DX" in
|
||||
"DirectX 12") PW_SK_DLL_NAME="dxgi.dll" ;;
|
||||
"DirectX 11") PW_SK_DLL_NAME="d3d11.dll" ;;
|
||||
"DirectX 9") PW_SK_DLL_NAME="d3d9.dll" ;;
|
||||
"DirectX 8"|"DirectDraw") return 0 ;;
|
||||
*) [[ "$USES_OGL" == "true" ]] && PW_SK_DLL_NAME="opengl32.dll" || PW_SK_DLL_NAME="dxgi.dll" ;;
|
||||
esac
|
||||
|
||||
if [[ -f "$SPECIALK_PATH/$PW_SK_ARCH_DLL" ]] ; then
|
||||
PW_SK_INI_FILE="$PATH_TO_GAME/custom_${PW_SK_DLL_NAME%.*}.ini"
|
||||
if [[ ! -f "$PW_SK_VERSION_FILE" ]] \
|
||||
&& [[ -f "$PATH_TO_GAME/$PW_SK_DLL_NAME" ]] \
|
||||
&& [[ ! -f "$PATH_TO_GAME/${PW_SK_DLL_NAME}.b" ]]
|
||||
then
|
||||
mv -f "$PATH_TO_GAME/$PW_SK_DLL_NAME" "$PATH_TO_GAME/${PW_SK_DLL_NAME}.b"
|
||||
fi
|
||||
if [[ ! -f "$PW_SK_VERSION_FILE" ]] || ! grep -q "$PW_SPECIALK_VER" "$PW_SK_VERSION_FILE" ; then
|
||||
cp -f "$SPECIALK_PATH/$PW_SK_ARCH_DLL" "$PATH_TO_GAME/$PW_SK_DLL_NAME"
|
||||
echo "$PW_SPECIALK_VER" > "$PW_SK_VERSION_FILE"
|
||||
fi
|
||||
var_winedlloverride_update "${PW_SK_DLL_NAME%.*}=n,b"
|
||||
pw_specialk_set_ini_value "$PW_SK_INI_FILE" "Compatibility.General" "UsingWINE" "true"
|
||||
pw_specialk_set_ini_value "$PW_SK_INI_FILE" "Steam.Log" "Silent" "true"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
pw_prepare_gamescope_launch () {
|
||||
[[ "$PW_USE_NATIVE_WAYLAND" == "1" ]] && export PW_GAMESCOPE="0"
|
||||
|
||||
local gpu_vendor
|
||||
local gamescope_available="0"
|
||||
|
||||
@@ -2620,6 +2801,13 @@ start_portproton () {
|
||||
print_warning "System mangohud, vkBasalt, obs-vk capture and other applications using vulkan layers are forcibly used."
|
||||
fi
|
||||
|
||||
if check_wayland_session \
|
||||
&& [[ $PW_USE_NATIVE_WAYLAND == "1" || $PW_USE_DXVK_HDR == "1" ]]
|
||||
then
|
||||
print_warning "Native Wayland in use. Force disabled SLR."
|
||||
export PW_USE_RUNTIME="0"
|
||||
fi
|
||||
|
||||
pw_init_runtime
|
||||
|
||||
if [[ "${PW_USE_GSTREAMER}" == "1" ]] ; then
|
||||
@@ -2709,6 +2897,7 @@ start_portproton () {
|
||||
${pw_runtime} GST_PLUGIN_SYSTEM_PATH_1_0="" LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}:${WINE_LIBRARY_PATH}" \
|
||||
WINEDEBUG="err+all" "${WINELOADER}" wineboot $@ &>>"${PW_TMPFS_PATH}/update_pfx_log"
|
||||
wait_wineserver
|
||||
get_and_set_reg_file --add 'Software\Wine\Drivers' 'Graphics' 'REG_SZ' "x11,wayland" "user"
|
||||
print_info "The prefix has been updated."
|
||||
}
|
||||
|
||||
@@ -2849,6 +3038,7 @@ start_portproton () {
|
||||
fi
|
||||
|
||||
pw_optiscaler_sync_files
|
||||
pw_specialk_sync_files
|
||||
|
||||
if [[ "${PW_USE_RAY_TRACING}" == "1" ]] ; then
|
||||
var_vkd3d_config_update dxr
|
||||
@@ -2894,10 +3084,10 @@ start_portproton () {
|
||||
export MANGOHUD_CONFIGFILE="$PATH_TO_GAME/MangoHud.conf"
|
||||
print_info "Custom MangoHud.conf in use: $MANGOHUD_CONFIGFILE"
|
||||
elif [[ "${PW_MANGOHUD_USER_CONF}" == 1 ]] ; then
|
||||
unset MANGOHUD_CONFIG
|
||||
pw_select_mangohud_user_conf
|
||||
fi
|
||||
|
||||
[[ "${PW_VKBASALT_USER_CONF}" == 1 ]] && unset PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS
|
||||
[[ "${PW_VKBASALT_USER_CONF}" == 1 ]] && pw_select_vkbasalt_user_conf
|
||||
|
||||
if [[ $PW_GPU_USE != "disabled" ]] ; then
|
||||
export DXVK_FILTER_DEVICE_NAME="$PW_GPU_USE"
|
||||
@@ -3148,7 +3338,7 @@ start_portproton () {
|
||||
fi
|
||||
|
||||
# DGVOODOO2 enable:
|
||||
if [[ "${PW_DGVOODOO2}" == "1" ]] ; then
|
||||
if [[ "${PW_DGVOODOO2}" == "1" ]] && [[ "${PW_USE_SPECIALK}" != "1" ]] ; then
|
||||
if [[ ! -f "${PW_VULKAN_DIR}/dgvoodoo2-${DGV2_VER}/dgVoodoo.conf" ]] ; then
|
||||
print_info "Download and install DGVOODOO2 v.${DGV2_VER}"
|
||||
if try_download "https://github.com/Castro-Fidel/vulkan/releases/download/dgvoodoo2-${DGV2_VER}/dgvoodoo2-${DGV2_VER}.tar.xz" \
|
||||
@@ -3502,7 +3692,12 @@ start_portproton () {
|
||||
export VKD3D_SHADER_CACHE_PATH="0"
|
||||
fi
|
||||
|
||||
if [[ "${PW_WINE_FULLSCREEN_FSR}" == "1" ]] \
|
||||
if check_wayland_session \
|
||||
&& [[ $PW_USE_NATIVE_WAYLAND == "1" || $PW_USE_DXVK_HDR == "1" ]]
|
||||
then
|
||||
export WINE_FULLSCREEN_FSR="0"
|
||||
unset WINE_FULLSCREEN_FAKE_CURRENT_RES WINE_FULLSCREEN_FSR_STRENGTH WINE_FULLSCREEN_INTEGER_SCALING
|
||||
elif [[ "${PW_WINE_FULLSCREEN_FSR}" == "1" ]] \
|
||||
&& ! check_gamescope_session
|
||||
then
|
||||
export WINE_FULLSCREEN_FSR="1"
|
||||
@@ -3632,30 +3827,16 @@ start_portproton () {
|
||||
export PROTON_NO_STEAMINPUT="1"
|
||||
export WAYLANDDRV_NO_IME="1"
|
||||
export PROTON_USE_XALIA="0"
|
||||
unset SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD SDL_GAMECONTROLLER_IGNORE_DEVICES
|
||||
|
||||
if [[ -d "$WINEDIR/share/X11/locale" ]] ; then
|
||||
check_variables "XLOCALEDIR" "$WINEDIR/share/X11/locale"
|
||||
fi
|
||||
|
||||
var_winedlloverride_update "winex11.drv=d;winewayland.drv=b"
|
||||
get_and_set_reg_file --add 'Software\Wine\Drivers' 'Graphics' 'REG_SZ' "x11,wayland" "user"
|
||||
|
||||
print_warning "Wayland in use. Force dpi=96"
|
||||
export PW_FORCE_SYSTEM_DPI="1"
|
||||
export PW_WINE_DPI_VALUE="96"
|
||||
|
||||
if [[ -f "$WINEDIR/lib/libxkbregistry.so" ]] \
|
||||
|| [[ -f "$WINEDIR/lib/x86_64-linux-gnu/libxkbregistry.so" ]]
|
||||
then print_info "runtime in use with native wayland."
|
||||
else
|
||||
print_warning "Wine is not support native wayland with runtime! Force disabled SLR."
|
||||
export PW_USE_RUNTIME="0"
|
||||
fi
|
||||
var_winedlloverride_update "winex11.drv=;winewayland.drv=b"
|
||||
else
|
||||
export GST_GL_WINDOW="x11"
|
||||
unset WINE_WAYLAND_HACKS DXVK_HDR
|
||||
check_variables PROTON_USE_XALIA 0
|
||||
get_and_set_reg_file --delete 'Software\Wine\Drivers' 'Graphics'
|
||||
unset DXVK_HDR WINE_WAYLAND_HACKS
|
||||
fi
|
||||
|
||||
if [[ "${PW_FORCE_SYSTEM_DPI}" == "1" ]] ; then
|
||||
@@ -3724,7 +3905,10 @@ pw_run () {
|
||||
return $?
|
||||
fi
|
||||
|
||||
if [[ -n "${PATH_TO_GAME}" ]] \
|
||||
if [[ "${PATH_TO_GAME}" == "." ]]
|
||||
then
|
||||
PATH_TO_GAME="$( cd "$( dirname "${PW_EXE_FILE}" )" >/dev/null 2>&1 && pwd )"
|
||||
elif [[ -n "${PATH_TO_GAME}" ]] \
|
||||
&& [[ -d "${PATH_TO_GAME}" ]]
|
||||
then
|
||||
:
|
||||
@@ -3764,10 +3948,12 @@ pw_run () {
|
||||
echo "Log WINE:" >> "${PW_LOG_FILE}"
|
||||
echo ""
|
||||
print_info "Log from RUNTIME and WINE:"
|
||||
pw_launch_wrapper \
|
||||
${PW_RUN_GAMESCOPE} \
|
||||
${PW_INHIBIT_SLR} \
|
||||
${PW_TASKSET_SLR} \
|
||||
${pw_runtime} \
|
||||
env \
|
||||
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
|
||||
LD_PRELOAD="${PW_LD_PRELOAD}" \
|
||||
VK_ADD_IMPLICIT_LAYER_PATH="${PW_VK_LAYER_PATH}" \
|
||||
@@ -3782,10 +3968,12 @@ pw_run () {
|
||||
fi
|
||||
echo ""
|
||||
echo "Log WINE:" > "${PW_LOG_FILE}"
|
||||
pw_launch_wrapper \
|
||||
${PW_RUN_GAMESCOPE} \
|
||||
${PW_INHIBIT_SLR} \
|
||||
${PW_TASKSET_SLR} \
|
||||
${pw_runtime} \
|
||||
env \
|
||||
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
|
||||
LD_PRELOAD="${PW_LD_PRELOAD}" \
|
||||
VK_ADD_IMPLICIT_LAYER_PATH="${PW_VK_LAYER_PATH}" \
|
||||
@@ -3810,6 +3998,7 @@ pw_run () {
|
||||
echo "Log WINE:" >> "${PW_LOG_FILE}"
|
||||
echo ""
|
||||
print_info "Log WINE:"
|
||||
pw_launch_wrapper \
|
||||
env FAKE_VAR= \
|
||||
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
|
||||
LD_PRELOAD="${PW_LD_PRELOAD}" \
|
||||
@@ -3829,6 +4018,7 @@ pw_run () {
|
||||
echo ""
|
||||
echo "Log WINE:" > "${PW_LOG_FILE}"
|
||||
print_info "Log WINE:"
|
||||
pw_launch_wrapper \
|
||||
env FAKE_VAR= \
|
||||
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
|
||||
LD_PRELOAD="${PW_LD_PRELOAD}" \
|
||||
@@ -3847,6 +4037,39 @@ pw_run () {
|
||||
}
|
||||
export -f pw_run
|
||||
|
||||
pw_launch_wrapper () {
|
||||
if [[ -z "${PW_RUN_AFTER_EXE:-}" ]] ; then
|
||||
"$@"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -f "${PW_RUN_AFTER_EXE}" ]] ; then
|
||||
if [[ "${PW_RUN_AFTER_EXE,,}" =~ \.exe$ ]] ; then
|
||||
"$@"
|
||||
return
|
||||
fi
|
||||
"${PW_RUN_AFTER_EXE}"
|
||||
"$@"
|
||||
return
|
||||
fi
|
||||
|
||||
local -a wrapper_cmd
|
||||
eval "wrapper_cmd=(${PW_RUN_AFTER_EXE})"
|
||||
if [[ ${#wrapper_cmd[@]} -eq 0 ]] ; then
|
||||
"$@"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ "${wrapper_cmd[0]##*/}" == "systemd-run" ]] ; then
|
||||
"${wrapper_cmd[@]}" -- "$@"
|
||||
return
|
||||
fi
|
||||
|
||||
"${wrapper_cmd[@]}"
|
||||
"$@"
|
||||
}
|
||||
export -f pw_launch_wrapper
|
||||
|
||||
steamplay_launch () {
|
||||
pw_check_and_download_plugins
|
||||
|
||||
@@ -3868,10 +4091,13 @@ steamplay_launch () {
|
||||
export MANGOHUD_CONFIGFILE="$PATH_TO_GAME/MangoHud.conf"
|
||||
print_info "Custom MangoHud.conf in use: $MANGOHUD_CONFIGFILE"
|
||||
elif [[ "${PW_MANGOHUD_USER_CONF}" == 1 ]] ; then
|
||||
unset MANGOHUD_CONFIG
|
||||
pw_select_mangohud_user_conf
|
||||
fi
|
||||
|
||||
[[ "${PW_VKBASALT_USER_CONF}" == 1 ]] && pw_select_vkbasalt_user_conf
|
||||
|
||||
pw_optiscaler_sync_files
|
||||
pw_specialk_sync_files
|
||||
|
||||
PORT_WINE_PREFIX="$STEAM_COMPAT_DATA_PATH/pfx"
|
||||
|
||||
@@ -3963,6 +4189,7 @@ steamplay_launch () {
|
||||
fi
|
||||
|
||||
print_info "$proton_runner in use."
|
||||
pw_launch_wrapper \
|
||||
${PW_RUN_GAMESCOPE} \
|
||||
env \
|
||||
LD_LIBRARY_PATH="${steamplay_ld_library_path}" \
|
||||
@@ -4006,6 +4233,7 @@ portwine_launch () {
|
||||
else
|
||||
if [[ -n "${PW_RUN_AFTER_EXE:-}" ]] \
|
||||
&& [[ -f "${PW_RUN_AFTER_EXE}" ]] \
|
||||
&& [[ "${PW_RUN_AFTER_EXE,,}" =~ \.exe$ ]] \
|
||||
&& [[ "${PW_RUN_AFTER_EXE}" != "${PW_EXE_FILE}" ]] \
|
||||
&& [[ "${PW_EXE_FILE,,}" =~ \.exe$ ]]
|
||||
then
|
||||
@@ -4030,7 +4258,7 @@ EOF
|
||||
*.exe)
|
||||
pw_run "${PW_VD_TMP[@]}" ${WINE_WIN_START} "${PW_EXE_FILE}"
|
||||
;;
|
||||
*.bat)
|
||||
*.bat|*.cmd)
|
||||
PW_USE_TERMINAL=1
|
||||
pw_run "${PW_VD_TMP[@]}" "${PW_EXE_FILE}"
|
||||
;;
|
||||
@@ -4116,7 +4344,8 @@ export -f gui_proton_downloader
|
||||
gui_edit_db () {
|
||||
KEY_EDIT_DB_GUI=$RANDOM
|
||||
DISABLE_EDIT_DB_LIST=""
|
||||
PW_EDIT_DB_LIST=(PW_MANGOHUD PW_MANGOHUD_USER_CONF PW_VKBASALT PW_VKBASALT_USER_CONF PW_DGVOODOO2
|
||||
PW_EDIT_DB_LIST=(PW_MANGOHUD PW_MANGOHUD_USER_CONF PW_VKBASALT PW_VKBASALT_USER_CONF
|
||||
PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS PW_DGVOODOO2 PW_USE_SPECIALK
|
||||
PW_USE_ESYNC PW_USE_FSYNC PW_USE_NTSYNC PW_USE_RAY_TRACING PW_USE_NVAPI_AND_DLSS PW_USE_OPTISCALER
|
||||
PW_USE_LS_FRAME_GEN PW_WINE_FULLSCREEN_FSR PW_HIDE_NVIDIA_GPU PW_VIRTUAL_DESKTOP PW_USE_TERMINAL
|
||||
PW_USE_GAMEMODE PW_USE_INHIBIT_SLEEP PW_USE_D3D_EXTRAS PW_FIX_VIDEO_IN_GAME PW_REDUCE_PULSE_LATENCY
|
||||
@@ -4149,6 +4378,7 @@ gui_edit_db () {
|
||||
if [[ "$PW_VULKAN_USE" == "0" ]] ; then
|
||||
DISABLE_EDIT_DB_LIST+=" PW_VKBASALT PW_VKBASALT_USER_CONF PW_USE_RAY_TRACING PW_USE_OBS_VKCAPTURE PW_USE_GALLIUM_ZINK PW_USE_WINED3D_VULKAN"
|
||||
fi
|
||||
[[ "${PW_USE_SPECIALK}" == "1" ]] && DISABLE_EDIT_DB_LIST+=" PW_DGVOODOO2"
|
||||
|
||||
[[ ! -e "/dev/ntsync" ]] && DISABLE_EDIT_DB_LIST+=" PW_USE_NTSYNC"
|
||||
|
||||
@@ -4516,8 +4746,8 @@ portwine_create_shortcut () {
|
||||
fi
|
||||
pw_create_gui_png
|
||||
|
||||
check_variables PW_SHORTCUT_MENU "TRUE"
|
||||
check_variables PW_SHORTCUT_DESKTOP "TRUE"
|
||||
check_variables PW_SHORTCUT_MENU "FALSE"
|
||||
check_variables PW_SHORTCUT_DESKTOP "FALSE"
|
||||
|
||||
unset name_desktop
|
||||
create_name_desktop
|
||||
@@ -4531,8 +4761,8 @@ portwine_output_yad_shortcut () {
|
||||
|
||||
pw_create_gui_png
|
||||
unset name_desktop
|
||||
check_variables PW_SHORTCUT_MENU "TRUE"
|
||||
check_variables PW_SHORTCUT_DESKTOP "TRUE"
|
||||
check_variables PW_SHORTCUT_MENU "FALSE"
|
||||
check_variables PW_SHORTCUT_DESKTOP "FALSE"
|
||||
|
||||
if [[ -z $name_desktop ]] ; then
|
||||
create_name_desktop
|
||||
|
||||
@@ -13,7 +13,7 @@ export PORTWINE_CREATE_SHORTCUT_NAME="DC Universe Online"
|
||||
start_portproton
|
||||
if try_download "https://launch.daybreakgames.com/installer/DCUO_setup.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/Daybreak Game Company"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/Program Files (x86)/Daybreak Game Company"
|
||||
PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/Daybreak Game Company/LaunchPad.exe"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
try_remove_file "${PW_EXE_FILE}.ppdb"
|
||||
|
||||
@@ -26,10 +26,10 @@ if try_download "https://launcher.ccpgames.com/eve-online/release/win32/x64/eve-
|
||||
then
|
||||
EVE_LAUNCHER_DIR="${WINEPREFIX}/drive_c/users/steamuser/AppData/Local/eve-online"
|
||||
|
||||
$pw_7z x "${PORT_WINE_TMP_PATH}/eve-online-latest+Setup.exe" -o"${EVE_LAUNCHER_DIR}" -y
|
||||
unpack "${PORT_WINE_TMP_PATH}/eve-online-latest+Setup.exe" "${EVE_LAUNCHER_DIR}"
|
||||
EVE_VERSION="$(cat "${EVE_LAUNCHER_DIR}/RELEASES" | awk '{print $2}' | awk -F"-" '{print $3}')"
|
||||
|
||||
$pw_7z x "${EVE_LAUNCHER_DIR}/eve-online-${EVE_VERSION}-full.nupkg" -o"${EVE_LAUNCHER_DIR}/tmp" -y
|
||||
unpack "${EVE_LAUNCHER_DIR}/eve-online-${EVE_VERSION}-full.nupkg" "${EVE_LAUNCHER_DIR}/tmp"
|
||||
|
||||
|
||||
create_new_dir "${EVE_LAUNCHER_DIR}/app-$EVE_VERSION"
|
||||
|
||||
@@ -15,8 +15,8 @@ start_portproton
|
||||
if try_download "https://static-gl.lilithgame.com/p/pcsdk/launcher/10060/prodef4621e968ad6b383b8754148b63/0/launcher/res/release/Farlight84_setup_1.3.0.1_238.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
create_new_dir "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84"
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/Farlight84"
|
||||
"$pw_7z" x -y "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84/launcher.7z" -o"$WINEPREFIX/drive_c/Program Files (x86)/Farlight84"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84"
|
||||
unpack "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84/launcher.7z" "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84"
|
||||
PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/Farlight84/Farlight84Launcher.exe"
|
||||
try_remove_file "$WINEPREFIX/drive_c/Program Files (x86)/Farlight84/launcher.7z"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
|
||||
@@ -13,7 +13,7 @@ export PORTWINE_CREATE_SHORTCUT_NAME="Last Chaos"
|
||||
start_portproton
|
||||
if try_download "https://last-chaos.ru/download/Last%20Chaos.zip" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"${WINEPREFIX}/drive_c/Program Files/"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "${WINEPREFIX}/drive_c/Program Files/"
|
||||
PW_EXE_FILE="${WINEPREFIX}/drive_c/Program Files/Last Chaos/LC.exe"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
try_remove_file "${PW_EXE_FILE}.ppdb"
|
||||
|
||||
@@ -15,7 +15,7 @@ URL_LOST_LIGHT="$(curl -s --list-only "https://adl.easebar.com/d/g/yhtj/c/lostli
|
||||
start_portproton
|
||||
if try_download "${URL_LOST_LIGHT}" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/LostLight"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/Program Files (x86)/LostLight"
|
||||
export PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/LostLight/launcher.exe"
|
||||
pw_create_unique_exe "lostlight_launcher_pp"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
|
||||
@@ -15,7 +15,7 @@ export PORTWINE_CREATE_SHORTCUT_NAME="Mini World"
|
||||
start_portproton
|
||||
if try_download "https://mwu-api.miniworldgame.com/app_install/${URL_VER//[[:space:]]/}universal" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/miniworldOverseasgame"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/miniworldOverseasgame"
|
||||
PW_EXE_FILE="$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/miniworldOverseasgame/MicroMiniNew.exe"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
try_remove_file "${PW_EXE_FILE}.ppdb"
|
||||
|
||||
@@ -14,7 +14,7 @@ export PORTWINE_CREATE_SHORTCUT_NAME="Rise of Flight"
|
||||
start_portproton
|
||||
if try_download "https://il2bosrd1.cdnvideo.ru/ROF/ROF_UE.zip" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/1C-777/Rise of Flight"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/Program Files (x86)/1C-777/Rise of Flight"
|
||||
pw_kill_autostart "3rd_party" &
|
||||
pw_run "$WINEPREFIX/drive_c/Program Files (x86)/1C-777/Rise of Flight/ROF_UE/setup.exe"
|
||||
PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/1C-777/Rise of Flight/bin_game/release/rof_updater.exe"
|
||||
|
||||
@@ -12,7 +12,7 @@ export PW_AUTOINSTALL_EXE="${PORT_WINE_TMP_PATH}/saturn.zip"
|
||||
start_portproton
|
||||
if try_download "https://cdn-s3.quadrosim.ru/saturn/saturn.zip" "${PW_AUTOINSTALL_EXE}" no_mirror
|
||||
then
|
||||
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/saturn"
|
||||
unpack "${PW_AUTOINSTALL_EXE}" "$WINEPREFIX/drive_c/Program Files (x86)/saturn"
|
||||
PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/saturn/Saturn.exe"
|
||||
try_remove_file "${PW_AUTOINSTALL_EXE}"
|
||||
try_remove_file "${PW_EXE_FILE}.ppdb"
|
||||
|
||||
@@ -23,8 +23,7 @@ PORT_IMG_PATH="$(dirname "$PORT_SCRIPTS_PATH")/img"
|
||||
PORT_CONF_PATH="$(dirname "$PORT_SCRIPTS_PATH")/conf"
|
||||
|
||||
if [[ -z "$PORT_DATA_PATH" ]] ; then
|
||||
if [[ -n "${FLATPAK_ID:-}" ]] \
|
||||
&& [[ -n "${XDG_DATA_HOME:-}" ]] ; then
|
||||
if [[ -n "${XDG_DATA_HOME:-}" ]] ; then
|
||||
PORT_DATA_PATH="$(dirname "${XDG_DATA_HOME}")"
|
||||
elif [[ -f "$HOME/.config/PortProtonQt.conf" ]] \
|
||||
&& grep "portdata_path" "$HOME/.config/PortProtonQt.conf" ; then
|
||||
@@ -37,8 +36,11 @@ if [[ -z "$PORT_DATA_PATH" ]] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "$HOME/.config/PortProtonQt.conf" ]] \
|
||||
&& grep "disable_runtime_download = True" "$HOME/.config/PortProtonQt.conf" ; then
|
||||
if [[ -n "${XDG_CONFIG_HOME:-}" ]] \
|
||||
&& grep -q "disable_runtime_download = True" "$XDG_CONFIG_HOME/PortProtonQt.conf" ; then
|
||||
export PW_DISABLE_RUNTIME_DOWNLOAD=1
|
||||
elif [[ -f "$HOME/.config/PortProtonQt.conf" ]] \
|
||||
&& grep -q "disable_runtime_download = True" "$HOME/.config/PortProtonQt.conf" ; then
|
||||
export PW_DISABLE_RUNTIME_DOWNLOAD=1
|
||||
fi
|
||||
|
||||
@@ -92,7 +94,7 @@ if [[ "${1,,}" =~ \.ppack$ ]] ; then
|
||||
export PW_NO_RESTART_PPDB="1"
|
||||
export PW_DISABLED_CREATE_DB="1"
|
||||
PW_EXE_FILE="$1"
|
||||
elif [[ "${1,,}" =~ \.(exe|bat|msi|reg|lnk)$ ]] ; then
|
||||
elif [[ "${1,,}" =~ \.(exe|bat|cmd|msi|reg|lnk)$ ]] ; then
|
||||
if [[ -f "$1" ]] ; then
|
||||
PW_EXE_FILE="$(realpath -s "$1")"
|
||||
elif [[ -f "$OLDPWD/$1" ]] ; then
|
||||
@@ -105,7 +107,7 @@ elif [[ "${1,,}" =~ \.(exe|bat|msi|reg|lnk)$ ]] ; then
|
||||
get_lnk "${PW_EXE_FILE}"
|
||||
PW_EXE_FILE="$(realpath "${link_path}" 2>/dev/null)"
|
||||
fi
|
||||
elif [[ "$1" =~ ^--(debug|launch|edit-db)$ && "${2,,}" =~ \.(exe|bat|msi|reg)$ ]] ; then
|
||||
elif [[ "$1" =~ ^--(debug|launch|edit-db)$ && "${2,,}" =~ \.(exe|bat|cmd|msi|reg)$ ]] ; then
|
||||
if [[ -f "$2" ]] ; then
|
||||
PW_EXE_FILE="$(realpath -s "$2")"
|
||||
elif [[ -f "$OLDPWD/$2" ]] ; then
|
||||
@@ -159,6 +161,8 @@ cd "${PORT_SCRIPTS_PATH}" || fatal
|
||||
|
||||
# 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
|
||||
|
||||
[[ ! -f "$VKBASALT_CONFIG_FILE" ]] && cp -f "${PORT_CONF_PATH}/vkBasalt.conf" "$VKBASALT_CONFIG_FILE"
|
||||
[[ ! -f "$DXVK_CONFIG_FILE" ]] && cp -f "${PORT_CONF_PATH}/dxvk.conf" "$DXVK_CONFIG_FILE"
|
||||
@@ -269,6 +273,8 @@ case "$1" in
|
||||
--winecmd Open wine command prompt, requires WINE version and prefix name
|
||||
--winereg Open wine registry editor, requires WINE version and prefix name
|
||||
--wine_uninstaller Open wine uninstaller, requires WINE version and prefix name
|
||||
--winetricks-list-all List winetricks DLLs, fonts, and settings
|
||||
--winetricks-install Install winetricks items, requires WINE version and prefix name
|
||||
--clear_pfx Clear specified prefix, requires WINE version and prefix name
|
||||
--mangohud-preview Starts MangoHud preview in vkcube (optional argument: inline MangoHud config)
|
||||
--initial Initial setup command
|
||||
@@ -285,6 +291,8 @@ Usage examples:
|
||||
portproton cli --backup-prefix DEFAULT /path/to/backup/directory
|
||||
portproton cli --restore-prefix /path/to/backup/file.ppack
|
||||
portproton cli --winecfg WINE_LG DEFAULT
|
||||
portproton cli --winetricks-list-all WINE_LG DEFAULT
|
||||
portproton cli --winetricks-install WINE_LG DEFAULT --no-force corefonts
|
||||
portproton cli --mangohud-preview \"fps,frametime,cpu_temp,gpu_temp\"
|
||||
portproton cli --autoinstall [script_name_from_pw_autoinstall]
|
||||
"
|
||||
@@ -325,8 +333,15 @@ Usage examples:
|
||||
export PW_USE_D3D_EXTRAS=1
|
||||
export WINE_LARGE_ADDRESS_AWARE=0
|
||||
trap "stop_portproton" SIGTERM SIGINT
|
||||
# shellcheck source=/dev/null
|
||||
. "${PORT_SCRIPTS_PATH}/pw_autoinstall/${2}"
|
||||
if [[ "$2" =~ "/" ]] && [[ -f "$2" ]] ; then
|
||||
# shellcheck source=/dev/null
|
||||
. "${2}"
|
||||
elif [[ -f "${PORT_SCRIPTS_PATH}/pw_autoinstall/${2}" ]] ; then
|
||||
# shellcheck source=/dev/null
|
||||
. "${PORT_SCRIPTS_PATH}/pw_autoinstall/${2}"
|
||||
else
|
||||
fatal "Not found autoinstal script: $2"
|
||||
fi
|
||||
stop_portproton
|
||||
;;
|
||||
--debug)
|
||||
@@ -357,12 +372,12 @@ Usage examples:
|
||||
exit 0
|
||||
;;
|
||||
--show-ppdb)
|
||||
# --show-ppdb /полный/путь/до/файла.exe ИЛИ /полный/путь/до/файла.exe.ppdb
|
||||
# --show-ppdb /полный/путь/до/файла.(exe|bat|cmd|msi|reg) ИЛИ /полный/путь/до/файла.ext.ppdb
|
||||
input_path="$2"
|
||||
|
||||
case "$input_path" in
|
||||
*.ppdb) exe_path="${input_path%.ppdb}" ;;
|
||||
*.exe) exe_path="$input_path" ;;
|
||||
*.[bB][aA][tT]|*.[cC][mM][dD]|*.[eE][xX][eE]|*.[mM][sS][iI]|*.[rR][eE][gG]) exe_path="$input_path" ;;
|
||||
esac
|
||||
|
||||
ppdb_path="${exe_path}.ppdb"
|
||||
@@ -396,6 +411,11 @@ Usage examples:
|
||||
done < <(grep -E '^export ' "$USER_CONF" 2>/dev/null | sed -E 's/[[:space:]]*#.*$//' | sed '/^[[:space:]]*$/d')
|
||||
fi
|
||||
|
||||
[[ -n "${PW_DEFAULT_WINE_USE:-}" && -z "${all_vars[PW_WINE_USE]+x}" ]] && all_vars["PW_WINE_USE"]="$PW_DEFAULT_WINE_USE"
|
||||
[[ -n "${PW_DEFAULT_PREFIX_NAME:-}" && -z "${all_vars[PW_PREFIX_NAME]+x}" ]] && all_vars["PW_PREFIX_NAME"]="$PW_DEFAULT_PREFIX_NAME"
|
||||
[[ -n "${PW_DEFAULT_VULKAN_USE:-}" && -z "${all_vars[PW_VULKAN_USE]+x}" ]] && all_vars["PW_VULKAN_USE"]="$PW_DEFAULT_VULKAN_USE"
|
||||
all_vars["PW_PLUGINS_VER"]="$PW_PLUGINS_VER"
|
||||
|
||||
while IFS='=' read -r key val; do
|
||||
key="${key#export }"
|
||||
val="${val#\"}"
|
||||
@@ -459,6 +479,64 @@ Usage examples:
|
||||
pw_run uninstaller
|
||||
stop_portproton
|
||||
;;
|
||||
--winetricks-list-all)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
update_winetricks >&2
|
||||
sh -n "${PORT_WINE_TMP_PATH}/winetricks" >&2 || exit 1
|
||||
awk '
|
||||
function save_entry() {
|
||||
if (category == "") {
|
||||
return
|
||||
}
|
||||
count[category]++
|
||||
entries[category, count[category]] = name " " title
|
||||
category = ""
|
||||
name = ""
|
||||
title = ""
|
||||
}
|
||||
/^w_metadata[[:space:]]+/ {
|
||||
save_entry()
|
||||
if ($3 == "dlls" || $3 == "fonts" || $3 == "settings") {
|
||||
name = $2
|
||||
category = $3
|
||||
}
|
||||
next
|
||||
}
|
||||
category != "" && /^[[:space:]]*title="/ {
|
||||
title = $0
|
||||
sub(/^[[:space:]]*title="/, "", title)
|
||||
sub(/[[:space:]]*\\$/, "", title)
|
||||
sub(/"$/, "", title)
|
||||
}
|
||||
END {
|
||||
save_entry()
|
||||
split("dlls fonts settings", categories, " ")
|
||||
for (i = 1; i <= 3; i++) {
|
||||
category = categories[i]
|
||||
print "__PORTPROTONQT_WINETRICKS_SECTION__:" category
|
||||
for (j = 1; j <= count[category]; j++) {
|
||||
print entries[category, j]
|
||||
}
|
||||
}
|
||||
}
|
||||
' "${PORT_WINE_TMP_PATH}/winetricks"
|
||||
winetricks_status="$?"
|
||||
exit "$winetricks_status"
|
||||
;;
|
||||
--winetricks-install)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
winetricks_force="$4"
|
||||
shift 4
|
||||
start_portproton
|
||||
update_winetricks
|
||||
winetricks_args=("--unattended")
|
||||
[[ "$winetricks_force" == "--force" ]] && winetricks_args+=("--force")
|
||||
"${PORT_WINE_TMP_PATH}/winetricks" "${winetricks_args[@]}" "$@"
|
||||
winetricks_status=$?
|
||||
wait_wineserver
|
||||
stop_portproton
|
||||
exit "$winetricks_status"
|
||||
;;
|
||||
--clear_pfx)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
pw_clear_pfx
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
###BASE VARIABLES###
|
||||
export PW_PROTON_LG_VER="PROTON_LG_10-30"
|
||||
export PW_WINE_LG_VER="WINE_LG_11-1"
|
||||
export PW_WINE_LG_VER="WINE_LG_11-10"
|
||||
export PW_LIBS_VER="_v3.0.20260218"
|
||||
export PW_PLUGINS_VER="_v20"
|
||||
export DXVK_NEW_VER="2.7.1-509"
|
||||
@@ -14,6 +14,7 @@ export VKD3D_OLD_VER="2.14.1"
|
||||
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_GALLIUM_NINE_VER="0.10"
|
||||
export DOTPFX_VER="48v9"
|
||||
export DEFPFX_VER="v1"
|
||||
@@ -29,6 +30,7 @@ export PW_RT_MOUNT_RW=("/media" "/mnt" "/run/media/${USER}" "${PORT_DATA_PATH}")
|
||||
check_variables PW_WINE_USE "PROTON_LG"
|
||||
check_variables PROTON_USE_XALIA "0"
|
||||
check_variables PW_USE_RUNTIME "1"
|
||||
check_variables PW_USE_SPECIALK "0"
|
||||
check_variables PW_USE_ESYNC "0"
|
||||
check_variables PW_USE_FSYNC "0"
|
||||
check_variables PW_USE_NTSYNC "0"
|
||||
@@ -70,6 +72,7 @@ check_variables VKD3D_LIMIT_TESS_FACTORS "64"
|
||||
check_variables PW_VKBASALT "0"
|
||||
check_variables PW_VKBASALT_EFFECTS "Curves:cas"
|
||||
check_variables PW_VKBASALT_FFX_CAS "0.50"
|
||||
check_variables PW_VKBASALT_TOOGLE_KEY "Home"
|
||||
export VKBASALT_CONFIG_FILE="${PORT_DATA_PATH}/data/vkBasalt.conf"
|
||||
|
||||
###GAMESCOPE###
|
||||
@@ -80,7 +83,7 @@ export PW_GAMESCOPE_ARGS_NEW=" -f --sharpness 10 --hdr-sdr-content-nits 0"
|
||||
|
||||
###MANGOHUD###
|
||||
check_variables PW_MANGOHUD "0"
|
||||
export DEFAULT_MANGOHUD_CONFIG="arch,cpu_mhz,cpu_temp,engine_version,gamemode,gpu_core_clock,gpu_mem_clock,gpu_name,gpu_temp,ram,resolution,vkbasalt,vram,vulkan_driver,wine,winesync"
|
||||
export DEFAULT_MANGOHUD_CONFIG="arch,cpu_mhz,cpu_temp,engine_version,gamemode,gpu_core_clock,gpu_mem_clock,gpu_name,gpu_temp,ram,resolution,vkbasalt,vram,vulkan_driver,wine,winesync,display_server"
|
||||
|
||||
###DGVOODOO2###
|
||||
check_variables PW_DGVOODOO2 "0"
|
||||
|
||||
Binary file not shown.
+14886
-1046
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
portprotonqt (1.0) unstable; urgency=medium
|
||||
|
||||
* Add Debian packaging.
|
||||
|
||||
-- Ivan Mazhukin <vanyamajukin@outlook.com> Sat, 23 May 2026 13:32:57 +0300
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
completions/
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
Source: portprotonqt
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Ivan Mazhukin <vanyamajukin@outlook.com>
|
||||
Build-Depends:
|
||||
debhelper-compat (= 13),
|
||||
gettext,
|
||||
libvulkan-dev,
|
||||
meson,
|
||||
ninja-build,
|
||||
pkgconf,
|
||||
python3,
|
||||
Standards-Version: 4.7.0
|
||||
Homepage: https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: portprotonqt
|
||||
Architecture: linux-any
|
||||
Depends:
|
||||
7zip,
|
||||
cabextract,
|
||||
curl,
|
||||
file,
|
||||
gawk,
|
||||
jq,
|
||||
libimage-exiftool-perl,
|
||||
libsdl3-0,
|
||||
mesa-utils,
|
||||
pciutils,
|
||||
procps,
|
||||
psmisc,
|
||||
python3,
|
||||
python3-babel,
|
||||
python3-dbus-fast,
|
||||
python3-evdev,
|
||||
python3-libarchive-c,
|
||||
python3-orjson,
|
||||
python3-pefile,
|
||||
python3-pil,
|
||||
python3-psutil,
|
||||
python3-pygame,
|
||||
python3-pyside6.qtcore,
|
||||
python3-pyside6.qtgui,
|
||||
python3-pyside6.qtnetwork,
|
||||
python3-pyside6.qtsvg,
|
||||
python3-pyside6.qtwidgets,
|
||||
python3-qrcode,
|
||||
python3-rapidfuzz,
|
||||
python3-requests,
|
||||
python3-tqdm,
|
||||
python3-vdf,
|
||||
python3-websocket,
|
||||
qt6-image-formats-plugins,
|
||||
qt6-svg-plugins,
|
||||
unrar-free,
|
||||
unzip,
|
||||
xz-utils,
|
||||
zstd,
|
||||
${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
Recommends:
|
||||
bluez,
|
||||
network-manager,
|
||||
pulseaudio-utils,
|
||||
squashfs-tools,
|
||||
udisks2,
|
||||
upower,
|
||||
Description: GUI for managing PortProton and Steam games
|
||||
PortProtonQt provides a graphical interface for managing and launching
|
||||
games from PortProton and Steam.
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: PortProtonQt
|
||||
Source: https://git.linux-gaming.ru/Linux-Gaming/PortProtonQt
|
||||
|
||||
Files: *
|
||||
Copyright:
|
||||
2026 PortProtonQt contributors
|
||||
License: GPL-3.0
|
||||
|
||||
Files: debian/*
|
||||
Copyright:
|
||||
2026 PortProtonQt contributors
|
||||
License: GPL-3.0
|
||||
|
||||
License: GPL-3.0
|
||||
This package is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 3.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
version 3 can be found in /usr/share/common-licenses/GPL-3.
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
usr/bin/portprotonqt
|
||||
usr/bin/vk_gpu_info
|
||||
usr/lib/python3/dist-packages/portprotonqt/
|
||||
usr/lib/udev/rules.d/60-portprotonqt.rules
|
||||
usr/share/applications/ru.linux_gaming.PortProtonQt.desktop
|
||||
usr/share/bash-completion/completions/portprotonqt
|
||||
usr/share/fish/vendor_completions.d/portprotonqt.fish
|
||||
usr/share/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg
|
||||
usr/share/locale/
|
||||
usr/share/metainfo/ru.linux_gaming.PortProtonQt.metainfo.xml
|
||||
usr/share/mime/packages/ru.linux_gaming.PortProtonQt.xml
|
||||
usr/share/polkit-1/rules.d/ru.linux_gaming.PortProtonQt.rules
|
||||
usr/share/portproton/
|
||||
usr/share/zsh/site-functions/_portprotonqt
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@ --buildsystem=meson
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- \
|
||||
-Dpython_purelibdir=/usr/lib/python3/dist-packages \
|
||||
-Dudev_rulesdir=/usr/lib/udev/rules.d
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install --destdir=debian/tmp
|
||||
|
||||
execute_after_dh_auto_install:
|
||||
bash ./dev-scripts/generate-completions.sh
|
||||
install -Dpm 0644 completions/portprotonqt \
|
||||
debian/tmp/usr/share/bash-completion/completions/portprotonqt
|
||||
install -Dpm 0644 completions/_portprotonqt \
|
||||
debian/tmp/usr/share/zsh/site-functions/_portprotonqt
|
||||
install -Dpm 0644 completions/portprotonqt.fish \
|
||||
debian/tmp/usr/share/fish/vendor_completions.d/portprotonqt.fish
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
@@ -77,3 +77,5 @@ State
|
||||
HLTB
|
||||
Delete Folder
|
||||
PPQT
|
||||
SpecialK
|
||||
Reshade
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
remote="${1:-origin}"
|
||||
main_branch="${2:-main}"
|
||||
weblate_branch="${3:-weblate}"
|
||||
|
||||
if ! git diff --quiet || ! git diff --cached --quiet; then
|
||||
echo "Working tree is not clean."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git fetch "$remote" "$main_branch" "$weblate_branch"
|
||||
git switch "$main_branch"
|
||||
git merge --ff-only "$remote/$main_branch"
|
||||
|
||||
if git merge-base --is-ancestor "$remote/$weblate_branch" HEAD; then
|
||||
echo "No new Weblate changes to merge."
|
||||
elif git merge-base --is-ancestor HEAD "$remote/$weblate_branch"; then
|
||||
git merge --ff-only "$remote/$weblate_branch"
|
||||
else
|
||||
git switch -C "$weblate_branch" "$remote/$weblate_branch"
|
||||
git rebase "$main_branch"
|
||||
git switch "$main_branch"
|
||||
git merge --ff-only "$weblate_branch"
|
||||
fi
|
||||
|
||||
python dev-scripts/l10n.py
|
||||
|
||||
git push "$remote" "$main_branch"
|
||||
git push "$remote" "$main_branch:$weblate_branch"
|
||||
|
||||
echo "Weblate translations accepted and $weblate_branch synced to $main_branch."
|
||||
+45
-1
@@ -18,6 +18,7 @@ MESON_BUILD = BASE_DIR / "meson.build"
|
||||
APP_PY = BASE_DIR / "portprotonqt" / "app.py"
|
||||
GITEA_WORKFLOW = BASE_DIR / ".gitea" / "workflows" / "build.yml"
|
||||
CHANGELOG = BASE_DIR / "CHANGELOG.md"
|
||||
METAINFO = BASE_DIR / "build-aux" / "share" / "metainfo" / "ru.linux_gaming.PortProtonQt.metainfo.xml"
|
||||
|
||||
def bump_appimage(path: Path, old: str, new: str) -> bool:
|
||||
"""
|
||||
@@ -125,6 +126,48 @@ def bump_changelog(path: Path, old: str, new: str) -> bool:
|
||||
path.write_text(new_text, encoding='utf-8')
|
||||
return bool(count)
|
||||
|
||||
def bump_metainfo(path: Path, old: str, new: str) -> bool:
|
||||
"""
|
||||
Update releases in metainfo:
|
||||
1. Change old version's <description></description> to <description/>
|
||||
2. Prepend new version with <description></description>
|
||||
"""
|
||||
if not path.exists():
|
||||
return False
|
||||
text = path.read_text(encoding='utf-8')
|
||||
|
||||
# 1. Update the old version entry to use self-closing description
|
||||
# Match tag starting with <release version="OLD" and ending with >
|
||||
old_pattern = re.compile(
|
||||
r'(<release version="' + re.escape(old) + r'"[^>]*>)\s*<description></description>\s*(</release>)',
|
||||
re.DOTALL
|
||||
)
|
||||
|
||||
current_date = date.today().strftime('%Y-%m-%d')
|
||||
type_attr = ' type="development"' if new.startswith('0.') else ''
|
||||
new_entry = (
|
||||
f' <release version="{new}" date="{current_date}"{type_attr}>\n'
|
||||
f' <description></description>\n'
|
||||
f' </release>'
|
||||
)
|
||||
|
||||
# Replace old entry's description with self-closing
|
||||
new_text, count = old_pattern.subn(r'\1\n <description/>\n \2', text, count=1)
|
||||
|
||||
if count:
|
||||
# 2. Insert the new entry at the beginning of the <releases> tag
|
||||
new_text = new_text.replace('<releases>', f'<releases>\n{new_entry}')
|
||||
path.write_text(new_text, encoding='utf-8')
|
||||
return True
|
||||
|
||||
# Fallback if old version wasn't found with expected pattern
|
||||
if f'version="{new}"' not in text:
|
||||
new_text = text.replace('<releases>', f'<releases>\n{new_entry}')
|
||||
path.write_text(new_text, encoding='utf-8')
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Bump project version in specific files')
|
||||
parser.add_argument('old', help='Old version string')
|
||||
@@ -141,7 +184,8 @@ def main():
|
||||
(MESON_BUILD, bump_meson),
|
||||
(APP_PY, bump_app_py),
|
||||
(GITEA_WORKFLOW, bump_workflow),
|
||||
(CHANGELOG, bump_changelog)
|
||||
(CHANGELOG, bump_changelog),
|
||||
(METAINFO, bump_metainfo)
|
||||
]
|
||||
|
||||
updated = []
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
project('portprotonqt', 'c',
|
||||
version: '1.1.0',
|
||||
version: '1.2.0',
|
||||
meson_version: '>= 0.61.2',
|
||||
license: 'GPL-3.0',
|
||||
)
|
||||
@@ -33,7 +33,7 @@ bindir = prefix / get_option('bindir')
|
||||
|
||||
# Use custom purelibdir if specified, otherwise use default
|
||||
purelibdir_opt = get_option('python_purelibdir')
|
||||
pythondir = purelibdir_opt != '' ? purelibdir_opt : python3.get_install_dir(pure: true)
|
||||
pythondir = purelibdir_opt != '' ? purelibdir_opt: python3.get_install_dir(pure: true)
|
||||
pkgdatadir = pythondir / meson.project_name()
|
||||
|
||||
# C compiler for vk_gpu_info
|
||||
@@ -133,7 +133,7 @@ install_subdir(
|
||||
|
||||
# Install udev rules
|
||||
udev_rulesdir_opt = get_option('udev_rulesdir')
|
||||
udevdir = udev_rulesdir_opt != '' ? udev_rulesdir_opt : prefix / 'lib' / 'udev' / 'rules.d'
|
||||
udevdir = udev_rulesdir_opt != '' ? udev_rulesdir_opt: prefix / 'lib' / 'udev' / 'rules.d'
|
||||
|
||||
install_data(
|
||||
'build-aux/lib/udev/rules.d/60-portprotonqt.rules',
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from portprotonqt.animations.detail_page import DetailPageAnimations
|
||||
from portprotonqt.animations.game_card import GameCardAnimations
|
||||
from portprotonqt.animations.library_controls import ExpandingSearchAnimation, LibraryControlsAnimation
|
||||
from portprotonqt.animations.virtual_keyboard import VirtualKeyboardAnimations
|
||||
|
||||
__all__ = [
|
||||
"DetailPageAnimations",
|
||||
"ExpandingSearchAnimation",
|
||||
"GameCardAnimations",
|
||||
"LibraryControlsAnimation",
|
||||
"VirtualKeyboardAnimations",
|
||||
]
|
||||
@@ -0,0 +1,117 @@
|
||||
from PySide6.QtCore import (
|
||||
QAbstractAnimation,
|
||||
QByteArray,
|
||||
QEasingCurve,
|
||||
QParallelAnimationGroup,
|
||||
QPropertyAnimation,
|
||||
)
|
||||
from PySide6.QtWidgets import QGraphicsOpacityEffect, QWidget
|
||||
|
||||
|
||||
class ExpandingSearchAnimation:
|
||||
def __init__(self, widget: QWidget, theme: object, fallback_duration: int):
|
||||
self.widget = widget
|
||||
self.theme = theme
|
||||
self.fallback_duration = fallback_duration
|
||||
self.animation = QPropertyAnimation(widget, QByteArray(b"maximumWidth"))
|
||||
|
||||
def setup(self, collapsed_width: int, expanded_width: int) -> None:
|
||||
self.collapsed_width = collapsed_width
|
||||
self.expanded_width = expanded_width
|
||||
self.widget.setMaximumWidth(collapsed_width)
|
||||
|
||||
def expand(self) -> None:
|
||||
self._start(self.expanded_width)
|
||||
|
||||
def collapse(self) -> None:
|
||||
if getattr(self.widget, "text", lambda: "")():
|
||||
return
|
||||
self._start(self.collapsed_width)
|
||||
|
||||
def _start(self, target_width: int) -> None:
|
||||
if self.animation.state() == QAbstractAnimation.State.Running:
|
||||
self.animation.stop()
|
||||
self.animation = QPropertyAnimation(self.widget, QByteArray(b"maximumWidth"))
|
||||
self.animation.setDuration(self._duration())
|
||||
self.animation.setStartValue(self.widget.maximumWidth())
|
||||
self.animation.setEndValue(target_width)
|
||||
self.animation.setEasingCurve(self._easing(target_width == self.expanded_width))
|
||||
self.animation.start()
|
||||
|
||||
def _duration(self) -> int:
|
||||
animation_config = getattr(self.theme, "GAME_CARD_ANIMATION", {})
|
||||
return animation_config.get("scale_anim_duration", self.fallback_duration)
|
||||
|
||||
def _easing(self, opening: bool) -> QEasingCurve:
|
||||
animation_config = getattr(self.theme, "GAME_CARD_ANIMATION", {})
|
||||
key = "scale_easing_curve" if opening else "scale_easing_curve_out"
|
||||
easing_name = animation_config.get(key, QEasingCurve.Type.InOutQuad.name)
|
||||
easing_type = getattr(QEasingCurve.Type, easing_name, QEasingCurve.Type.InOutQuad)
|
||||
return QEasingCurve(easing_type)
|
||||
|
||||
|
||||
class LibraryControlsAnimation:
|
||||
def __init__(self, widget: QWidget, theme: object, fallback_duration: int):
|
||||
self.widget = widget
|
||||
self.theme = theme
|
||||
self.fallback_duration = fallback_duration
|
||||
self.opacity_effect = QGraphicsOpacityEffect(widget)
|
||||
self.opacity_effect.setOpacity(0)
|
||||
self.widget.setGraphicsEffect(self.opacity_effect)
|
||||
self.group = QParallelAnimationGroup(widget)
|
||||
|
||||
def setup_hidden(self) -> None:
|
||||
self.widget.setVisible(False)
|
||||
self.widget.setMaximumHeight(0)
|
||||
|
||||
def toggle(self, opening: bool) -> None:
|
||||
if self.group.state() == QAbstractAnimation.State.Running:
|
||||
self.group.stop()
|
||||
if opening:
|
||||
self.widget.setVisible(True)
|
||||
|
||||
target_height = self.widget.sizeHint().height() if opening else 0
|
||||
self.group = QParallelAnimationGroup(self.widget)
|
||||
height_animation = self._create_widget_animation(
|
||||
b"maximumHeight",
|
||||
self.widget.maximumHeight(),
|
||||
target_height,
|
||||
)
|
||||
opacity_animation = self._create_opacity_animation(opening, height_animation.duration())
|
||||
self.group.addAnimation(height_animation)
|
||||
self.group.addAnimation(opacity_animation)
|
||||
if not opening:
|
||||
self.group.finished.connect(self.widget.hide)
|
||||
self.group.start()
|
||||
|
||||
def _create_widget_animation(
|
||||
self,
|
||||
property_name: bytes,
|
||||
start_value: object,
|
||||
end_value: object,
|
||||
) -> QPropertyAnimation:
|
||||
animation = QPropertyAnimation(self.widget, QByteArray(property_name))
|
||||
animation.setDuration(self._duration())
|
||||
animation.setStartValue(start_value)
|
||||
animation.setEndValue(end_value)
|
||||
animation.setEasingCurve(self._easing(end_value != 0))
|
||||
return animation
|
||||
|
||||
def _create_opacity_animation(self, opening: bool, duration: int) -> QPropertyAnimation:
|
||||
animation = QPropertyAnimation(self.opacity_effect, QByteArray(b"opacity"))
|
||||
animation.setDuration(duration)
|
||||
animation.setStartValue(self.opacity_effect.opacity())
|
||||
animation.setEndValue(1 if opening else 0)
|
||||
animation.setEasingCurve(self._easing(opening))
|
||||
return animation
|
||||
|
||||
def _duration(self) -> int:
|
||||
animation_config = getattr(self.theme, "GAME_CARD_ANIMATION", {})
|
||||
return animation_config.get("scale_anim_duration", self.fallback_duration)
|
||||
|
||||
def _easing(self, opening: bool) -> QEasingCurve:
|
||||
animation_config = getattr(self.theme, "GAME_CARD_ANIMATION", {})
|
||||
key = "scale_easing_curve" if opening else "scale_easing_curve_out"
|
||||
easing_name = animation_config.get(key, QEasingCurve.Type.InOutQuad.name)
|
||||
easing_type = getattr(QEasingCurve.Type, easing_name, QEasingCurve.Type.InOutQuad)
|
||||
return QEasingCurve(easing_type)
|
||||
+3
-2
@@ -18,7 +18,7 @@ try:
|
||||
APP_VERSION = version_module.APP_VERSION
|
||||
except ImportError:
|
||||
APP_COMMIT = ""
|
||||
APP_VERSION = "1.1.0"
|
||||
APP_VERSION = "1.2.0"
|
||||
|
||||
__app_version__ = APP_VERSION
|
||||
|
||||
@@ -240,10 +240,11 @@ def main():
|
||||
logger = get_logger(__name__)
|
||||
setup_logger(parsed_args.debug_level)
|
||||
logger.info("Running in Steam compatibility mode, launching: %s", exe_path)
|
||||
logger.info("Steam compatibility launch arguments: %s", parsed_args.launch_args)
|
||||
|
||||
# Launch game via PortProton without GUI
|
||||
env_vars = os.environ.copy()
|
||||
cmd = start_sh + [exe_path]
|
||||
cmd = start_sh + [exe_path] + parsed_args.launch_args
|
||||
try:
|
||||
subprocess.run(cmd, env=env_vars)
|
||||
except Exception as e:
|
||||
|
||||
+33
-8
@@ -2,11 +2,12 @@ import argparse
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from portprotonqt.steam_api import get_steam_home
|
||||
|
||||
LAUNCH_FILE_EXTENSIONS = ('.exe', '.bat', '.msi', '.reg', '.iso', '.mdf')
|
||||
LAUNCH_FILE_EXTENSIONS = ('.exe', '.bat', '.cmd', '.msi', '.reg', '.iso', '.mdf', '.nrg')
|
||||
PREFIX_BACKUP_EXTENSION = '.ppack'
|
||||
|
||||
|
||||
@@ -82,9 +83,25 @@ def parse_args():
|
||||
parser.add_argument(
|
||||
'file_or_url',
|
||||
nargs='?',
|
||||
help="Launch file path (.exe/.bat/.msi/.reg/.iso/.mdf) or portproton:// URL"
|
||||
help="Launch file path (.exe/.bat/.cmd/.msi/.reg/.iso/.mdf/.nrg) or portproton:// URL"
|
||||
)
|
||||
return parser.parse_args()
|
||||
if os.environ.get("STEAM_COMPAT") == "1" and "--" in sys.argv[1:]:
|
||||
separator_index = sys.argv.index("--")
|
||||
args = parser.parse_args(sys.argv[1:separator_index])
|
||||
steam_args = sys.argv[separator_index + 1:]
|
||||
if steam_args:
|
||||
args.file_or_url = steam_args[0]
|
||||
launch_args = steam_args[1:]
|
||||
else:
|
||||
launch_args = []
|
||||
elif os.environ.get("STEAM_COMPAT") == "1":
|
||||
args, launch_args = parser.parse_known_args()
|
||||
else:
|
||||
args = parser.parse_args()
|
||||
launch_args = []
|
||||
|
||||
args.launch_args = launch_args
|
||||
return args
|
||||
|
||||
|
||||
def add_steam_compat_tool(force_install: bool = False) -> bool:
|
||||
@@ -156,8 +173,16 @@ unset LD_LIBRARY_PATH
|
||||
|
||||
export STEAM_COMPAT=1
|
||||
|
||||
exe_name="$(basename "$1")"
|
||||
exe_dir="$(dirname "$1")"
|
||||
launch_args=("$@")
|
||||
case "${1:-}" in
|
||||
run|waitforexitandrun)
|
||||
launch_args=("${@:2}")
|
||||
;;
|
||||
esac
|
||||
|
||||
launch_target="${launch_args[0]:-}"
|
||||
exe_name="$(basename "$launch_target")"
|
||||
exe_dir="$(dirname "$launch_target")"
|
||||
|
||||
# Ignore specific executables
|
||||
if [[ "$exe_name" == "iscriptevaluator.exe" ]] \\
|
||||
@@ -234,11 +259,11 @@ fi
|
||||
|
||||
# Use AppImage if specified, then Flatpak if installed, otherwise use portprotonqt from PATH
|
||||
if [[ -n "$PPQT_BIN_PATH" ]]; then
|
||||
"$PPQT_BIN_PATH" --debug-level INFO "$@"
|
||||
"$PPQT_BIN_PATH" --debug-level INFO -- "${launch_args[@]}"
|
||||
elif command -v flatpak >/dev/null 2>&1 && flatpak info ru.linux_gaming.PortProtonQt >/dev/null 2>&1; then
|
||||
flatpak run ru.linux_gaming.PortProtonQt --debug-level INFO "$@"
|
||||
flatpak run ru.linux_gaming.PortProtonQt --debug-level INFO -- "${launch_args[@]}"
|
||||
else
|
||||
portprotonqt --debug-level INFO "$@"
|
||||
portprotonqt --debug-level INFO -- "${launch_args[@]}"
|
||||
fi
|
||||
''')
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from portprotonqt.config.base import (
|
||||
)
|
||||
from portprotonqt.config.cache import CacheConfig, CacheManager
|
||||
from portprotonqt.config.display import DisplayConfig, apply_xdg_autostart
|
||||
from portprotonqt.config.favorites import FavoritesConfig, FavoritesFoldersConfig
|
||||
from portprotonqt.config.favorites import ExeSettingsFavoritesConfig, FavoritesConfig, FavoritesFoldersConfig
|
||||
from portprotonqt.config.game import GameConfig
|
||||
from portprotonqt.config.gamepad import GamepadConfig
|
||||
from portprotonqt.config.portproton import (
|
||||
@@ -46,6 +46,7 @@ display_config = DisplayConfig()
|
||||
window_config = MainWindowConfig()
|
||||
favorites_config = FavoritesConfig()
|
||||
favorites_folders_config = FavoritesFoldersConfig()
|
||||
exe_settings_favorites_config = ExeSettingsFavoritesConfig()
|
||||
portproton_config = PortProtonConfig()
|
||||
|
||||
__all__ = [
|
||||
@@ -60,6 +61,7 @@ __all__ = [
|
||||
"MainWindowConfig",
|
||||
"FavoritesConfig",
|
||||
"FavoritesFoldersConfig",
|
||||
"ExeSettingsFavoritesConfig",
|
||||
"PortProtonConfig",
|
||||
"LAUNCH_FILE_EXTENSIONS",
|
||||
"THEMED_LAUNCH_ICON_NAMES",
|
||||
@@ -80,6 +82,7 @@ __all__ = [
|
||||
"window_config",
|
||||
"favorites_config",
|
||||
"favorites_folders_config",
|
||||
"exe_settings_favorites_config",
|
||||
"portproton_config",
|
||||
"load_theme_metainfo",
|
||||
"apply_xdg_autostart",
|
||||
|
||||
@@ -68,3 +68,34 @@ class FavoritesFoldersConfig(BaseConfig):
|
||||
fav_str = ", ".join([os.path.normpath(f) for f in folders])
|
||||
cp[self._section]["folders"] = f'"{fav_str}"'
|
||||
self._save_config(cp)
|
||||
|
||||
|
||||
class ExeSettingsFavoritesConfig(BaseConfig):
|
||||
"""Favorite executable settings configuration."""
|
||||
|
||||
_section = "ExeSettingsFavorites"
|
||||
|
||||
def get_keys(self) -> list[str]:
|
||||
"""Get list of favorite executable setting keys."""
|
||||
cp = self._read_config()
|
||||
if cp is None or not cp.has_section(self._section):
|
||||
return []
|
||||
|
||||
keys = cp.get(self._section, "keys", fallback="").strip()
|
||||
if keys.startswith('"') and keys.endswith('"'):
|
||||
keys = keys[1:-1]
|
||||
return [key.strip() for key in keys.split(",") if key.strip()]
|
||||
|
||||
def set_keys(self, keys: list[str]) -> None:
|
||||
"""Set list of favorite executable setting keys."""
|
||||
if not isinstance(keys, list):
|
||||
raise ValidationError("keys must be a list", "keys", keys)
|
||||
for key in keys:
|
||||
validate_string(key, "key", min_len=1, max_len=255)
|
||||
|
||||
cp = self._read_config() or configparser.ConfigParser()
|
||||
if self._section not in cp:
|
||||
cp[self._section] = {}
|
||||
fav_str = ", ".join(keys)
|
||||
cp[self._section]["keys"] = f'"{fav_str}"'
|
||||
self._save_config(cp)
|
||||
@@ -1,7 +1,24 @@
|
||||
"""Gamepad configuration settings."""
|
||||
from portprotonqt.config.base import BaseConfig
|
||||
|
||||
|
||||
class GamepadConfig(BaseConfig):
|
||||
"""Gamepad configuration settings."""
|
||||
|
||||
_section = "Gamepad"
|
||||
|
||||
def get_gamepad_type(self) -> str:
|
||||
"""Get configured gamepad type."""
|
||||
value = self._get_str("type", "auto").lower()
|
||||
if value in ("auto", "xbox", "playstation"):
|
||||
return value
|
||||
if value in ("ps", "sony"):
|
||||
return "playstation"
|
||||
return "auto"
|
||||
|
||||
def set_gamepad_type(self, gamepad_type: str) -> None:
|
||||
"""Set configured gamepad type."""
|
||||
value = gamepad_type.lower()
|
||||
if value not in ("auto", "xbox", "playstation"):
|
||||
value = "auto"
|
||||
self._save_value("type", value, "str")
|
||||
@@ -3,7 +3,10 @@ import configparser
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
import sys
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from PySide6.QtCore import QStandardPaths
|
||||
from portprotonqt.config.base import (
|
||||
BaseConfig,
|
||||
CONFIG_FILE,
|
||||
@@ -143,17 +146,27 @@ def save_portdata_path_to_config(portdata_path: str) -> bool:
|
||||
|
||||
def get_portproton_scripts_path() -> str | None:
|
||||
"""Return PortProton scripts directory path."""
|
||||
appdir_prefix = os.getenv("APPDIR")
|
||||
sharun_prefix = os.getenv("SHARUN_DIR")
|
||||
prefixes = [("system package", Path("/usr")), ("Flatpak package", Path("/app"))]
|
||||
appimage_path = os.getenv("APPIMAGE", "").strip()
|
||||
prefixes = []
|
||||
if appdir_prefix:
|
||||
prefixes.append(("AppImage appdir", Path(appdir_prefix)))
|
||||
if sharun_prefix:
|
||||
prefixes.append(("AppImage", Path(sharun_prefix)))
|
||||
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")))
|
||||
|
||||
scripts_dirs = (
|
||||
("repository", Path.cwd() / "build-aux" / "share" / "portproton" / "scripts"),
|
||||
*[(source, prefix / "share" / "portproton" / "scripts") for source, prefix in prefixes],
|
||||
)
|
||||
for source, scripts_dir in scripts_dirs:
|
||||
if scripts_dir.exists():
|
||||
if (scripts_dir / "start.sh").is_file():
|
||||
logger.info("Using PortProton scripts from %s: %s", source, scripts_dir)
|
||||
return str(scripts_dir)
|
||||
logger.info(
|
||||
@@ -178,6 +191,82 @@ def get_portproton_start_command() -> list[str] | None:
|
||||
return None
|
||||
|
||||
|
||||
def _get_current_launcher_command() -> list[str] | None:
|
||||
"""Return the current launcher command for shortcut migration."""
|
||||
appimage_path = os.getenv("APPIMAGE", "").strip()
|
||||
if appimage_path and os.path.isfile(appimage_path):
|
||||
return [appimage_path, "--silent"]
|
||||
|
||||
flatpak_id = os.getenv("FLATPAK_ID", "").strip()
|
||||
if flatpak_id:
|
||||
return ["flatpak", "run", flatpak_id, "--silent"]
|
||||
|
||||
scripts_path = get_portproton_scripts_path()
|
||||
if scripts_path:
|
||||
return [os.path.join(scripts_path, "start.sh")]
|
||||
|
||||
if shutil.which("portprotonqt"):
|
||||
return ["portprotonqt", "--silent"]
|
||||
return None
|
||||
|
||||
|
||||
def _extract_launcher_tail(parts: list[str]) -> list[str] | None:
|
||||
"""Return shortcut args after the launcher command."""
|
||||
if not parts:
|
||||
return None
|
||||
|
||||
command_name = os.path.basename(parts[0])
|
||||
if parts[0].lower().endswith(".appimage") or command_name == "portprotonqt" or command_name == "start.sh":
|
||||
tail = parts[1:]
|
||||
if tail[:1] == ["--silent"]:
|
||||
tail = tail[1:]
|
||||
return tail
|
||||
|
||||
if parts[0] == "flatpak" and len(parts) >= 3 and parts[1] == "run":
|
||||
tail = parts[3:]
|
||||
if tail[:1] == ["--silent"]:
|
||||
tail = tail[1:]
|
||||
return tail
|
||||
return None
|
||||
|
||||
|
||||
def _migrate_launcher_line(line: str, launcher_command: list[str] | None) -> str:
|
||||
"""Update launcher command in desktop Exec or shell script line."""
|
||||
if not launcher_command:
|
||||
return line
|
||||
|
||||
prefix = "Exec=" if line.startswith("Exec=") else ""
|
||||
command = line[len(prefix):].strip() if prefix else line.strip()
|
||||
if not command or command.startswith("#"):
|
||||
return line
|
||||
|
||||
try:
|
||||
parts = shlex.split(command)
|
||||
except ValueError:
|
||||
return line
|
||||
|
||||
tail = _extract_launcher_tail(parts)
|
||||
if tail is None:
|
||||
return line
|
||||
|
||||
updated_parts = launcher_command + tail
|
||||
if not prefix and updated_parts[-1:] == ["$@"]:
|
||||
return f'{shlex.join(updated_parts[:-1])} "$@"'
|
||||
return f"{prefix}{shlex.join(updated_parts)}"
|
||||
|
||||
|
||||
def _get_desktop_paths(desktop_dir: str | None) -> tuple[str, ...]:
|
||||
"""Return desktop directories to scan for shortcuts."""
|
||||
if desktop_dir:
|
||||
return (desktop_dir,)
|
||||
|
||||
desktop_path = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.DesktopLocation)
|
||||
if desktop_path:
|
||||
return (desktop_path,)
|
||||
|
||||
return (os.path.join(os.path.expanduser("~"), "Desktop"),)
|
||||
|
||||
|
||||
def migrate_legacy_shortcut(portproton_path: str, desktop_dir: str | None = None) -> int:
|
||||
"""Migrate legacy PortProton shortcuts in known desktop directories."""
|
||||
flatpak_id = os.getenv("FLATPAK_ID", "").strip()
|
||||
@@ -197,11 +286,11 @@ def migrate_legacy_shortcut(portproton_path: str, desktop_dir: str | None = None
|
||||
except OSError as error:
|
||||
logger.warning("Failed to read legacy PortProton config %s: %s", PORTPROTON_CONFIG_FILE, error)
|
||||
|
||||
desktop_path = desktop_dir or os.path.join(os.path.expanduser("~"), "Desktop")
|
||||
launcher_command = _get_current_launcher_command()
|
||||
desktop_paths = (
|
||||
portproton_path,
|
||||
os.path.join(os.path.expanduser("~"), ".local", "share", "applications"),
|
||||
desktop_path,
|
||||
os.path.join(user_home, ".local", "share", "applications"),
|
||||
*_get_desktop_paths(desktop_dir),
|
||||
)
|
||||
migrated = 0
|
||||
for current_path in desktop_paths:
|
||||
@@ -281,6 +370,9 @@ def migrate_legacy_shortcut(portproton_path: str, desktop_dir: str | None = None
|
||||
if "--silent" not in parts:
|
||||
updated_line = f'Exec={shlex.join(["portprotonqt", "--silent", *parts[2:]])}'
|
||||
|
||||
if updated_line.startswith("Exec="):
|
||||
updated_line = _migrate_launcher_line(updated_line, launcher_command)
|
||||
|
||||
if updated_line == line_content:
|
||||
continue
|
||||
|
||||
@@ -295,6 +387,40 @@ def migrate_legacy_shortcut(portproton_path: str, desktop_dir: str | None = None
|
||||
migrated += 1
|
||||
except OSError as error:
|
||||
logger.warning("Failed to update desktop file %s: %s", entry.path, error)
|
||||
|
||||
steam_scripts_path = os.path.join(portproton_path, "steam_scripts")
|
||||
if not os.path.isdir(steam_scripts_path):
|
||||
return migrated
|
||||
|
||||
for entry in os.scandir(steam_scripts_path):
|
||||
if not entry.name.endswith(".sh") or not entry.is_file():
|
||||
continue
|
||||
|
||||
try:
|
||||
lines = Path(entry.path).read_text(encoding="utf-8").splitlines(keepends=True)
|
||||
except OSError as error:
|
||||
logger.warning("Failed to read steam script %s: %s", entry.path, error)
|
||||
continue
|
||||
|
||||
changed = False
|
||||
for idx, line in enumerate(lines):
|
||||
line_end = "\r\n" if line.endswith("\r\n") else "\n"
|
||||
line_content = line[:-len(line_end)] if line.endswith(("\n", "\r\n")) else line
|
||||
updated_line = _migrate_launcher_line(line_content, launcher_command)
|
||||
if updated_line == line_content:
|
||||
continue
|
||||
|
||||
lines[idx] = f"{updated_line}{line_end}"
|
||||
changed = True
|
||||
|
||||
if not changed:
|
||||
continue
|
||||
|
||||
try:
|
||||
Path(entry.path).write_text("".join(lines), encoding="utf-8")
|
||||
migrated += 1
|
||||
except OSError as error:
|
||||
logger.warning("Failed to update steam script %s: %s", entry.path, error)
|
||||
return migrated
|
||||
|
||||
|
||||
@@ -307,11 +433,12 @@ def parse_desktop_entry(file_path: str) -> configparser.SectionProxy | None:
|
||||
return cp["Desktop Entry"]
|
||||
|
||||
|
||||
WINDOWS_LAUNCH_EXTENSIONS = (".exe", ".bat", ".msi", ".reg")
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf")
|
||||
WINDOWS_LAUNCH_EXTENSIONS = (".exe", ".bat", ".cmd", ".msi", ".reg")
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf", ".nrg")
|
||||
LAUNCH_FILE_EXTENSIONS = WINDOWS_LAUNCH_EXTENSIONS + DISC_IMAGE_EXTENSIONS
|
||||
THEMED_LAUNCH_ICON_NAMES = {
|
||||
".bat": "bat",
|
||||
".cmd": "bat",
|
||||
".msi": "msi",
|
||||
".reg": "reg",
|
||||
}
|
||||
@@ -393,8 +520,11 @@ def create_desktop_file(
|
||||
os.makedirs(os.path.dirname(icon_path), exist_ok=True)
|
||||
|
||||
flatpak_id = os.getenv("FLATPAK_ID")
|
||||
appimage_path = os.getenv("APPIMAGE", "").strip()
|
||||
if flatpak_id:
|
||||
exec_str = f'flatpak run {flatpak_id} --silent "{exe_path}"'
|
||||
elif appimage_path and os.path.isfile(appimage_path):
|
||||
exec_str = shlex.join([appimage_path, "--silent", exe_path])
|
||||
else:
|
||||
exec_str = f'portprotonqt --silent "{exe_path}"'
|
||||
|
||||
|
||||
@@ -124,39 +124,53 @@ class ContextMenuManager:
|
||||
|
||||
return hasattr(self.parent, 'target_exe') and self.parent.target_exe == current_exe
|
||||
|
||||
def show_folder_context_menu(self, file_explorer, pos):
|
||||
"""Shows the context menu for a folder in FileExplorer."""
|
||||
def show_file_explorer_context_menu(self, file_explorer, pos):
|
||||
"""Shows the context menu for a file or folder in FileExplorer."""
|
||||
try:
|
||||
item = file_explorer.file_list.itemAt(pos)
|
||||
if not item:
|
||||
logger.debug("No folder selected at position %s", pos)
|
||||
logger.debug("No item selected at position %s", pos)
|
||||
return
|
||||
|
||||
# Ensure the item is visually selected
|
||||
file_explorer.file_list.setCurrentItem(item)
|
||||
file_explorer.handle_item_click(item)
|
||||
|
||||
selected = item.text()
|
||||
if not selected.endswith("/"):
|
||||
logger.debug("Selected item is not a folder: %s", selected)
|
||||
return # Only for folders
|
||||
full_path = os.path.normpath(os.path.join(file_explorer.current_path, selected.rstrip("/")))
|
||||
if not os.path.isdir(full_path):
|
||||
logger.debug("Path is not a directory: %s", full_path)
|
||||
if selected in ("../", "./"):
|
||||
return
|
||||
|
||||
is_folder = selected.endswith("/")
|
||||
full_path = os.path.normpath(os.path.join(file_explorer.current_path, selected.rstrip("/")))
|
||||
|
||||
menu = QMenu(file_explorer)
|
||||
menu.setWindowFlags(menu.windowFlags() | Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint)
|
||||
menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||
menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE)
|
||||
menu.setParent(file_explorer, Qt.WindowType.Popup) # Set transientParent for Wayland
|
||||
|
||||
favorite_folders = favorites_folders_config.get_folders()
|
||||
is_favorite = full_path in favorite_folders
|
||||
action_text = _("Remove from Favorites") if is_favorite else _("Add to Favorites")
|
||||
favorite_action = menu.addAction(self._get_safe_icon("star" if is_favorite else "star_full"), action_text)
|
||||
favorite_action.triggered.connect(lambda: self.toggle_favorite_folder(file_explorer, full_path, not is_favorite))
|
||||
if is_folder:
|
||||
favorite_folders = favorites_folders_config.get_folders()
|
||||
is_favorite = full_path in favorite_folders
|
||||
action_text = _("Remove from Favorites") if is_favorite else _("Add to Favorites")
|
||||
favorite_action = menu.addAction(self._get_safe_icon("star" if is_favorite else "star_full"), action_text)
|
||||
favorite_action.triggered.connect(lambda: self.toggle_favorite_folder(file_explorer, full_path, not is_favorite))
|
||||
|
||||
create_folder_action = menu.addAction(self._get_safe_icon("folder"), _("Create Folder"))
|
||||
create_folder_action.triggered.connect(lambda: self.create_folder(file_explorer))
|
||||
rename_folder_action = menu.addAction(self._get_safe_icon("edit"), _("Rename Folder"))
|
||||
rename_folder_action.triggered.connect(lambda: self.rename_folder(file_explorer, full_path))
|
||||
delete_folder_action = menu.addAction(self._get_safe_icon("delete"), _("Delete Folder"))
|
||||
delete_folder_action.triggered.connect(lambda: self.delete_folder(file_explorer, full_path))
|
||||
create_folder_action.triggered.connect(
|
||||
lambda: self.create_folder(file_explorer, file_explorer.current_path)
|
||||
)
|
||||
|
||||
if is_folder:
|
||||
rename_action = menu.addAction(self._get_safe_icon("edit"), _("Rename Folder"))
|
||||
rename_action.triggered.connect(lambda: self.rename_folder(file_explorer, full_path))
|
||||
delete_action = menu.addAction(self._get_safe_icon("delete"), _("Delete Folder"))
|
||||
delete_action.triggered.connect(lambda: self.delete_folder(file_explorer, full_path))
|
||||
else:
|
||||
rename_action = menu.addAction(self._get_safe_icon("edit"), _("Rename File"))
|
||||
rename_action.triggered.connect(lambda: self.rename_file(file_explorer, full_path))
|
||||
delete_action = menu.addAction(self._get_safe_icon("delete"), _("Delete File"))
|
||||
delete_action.triggered.connect(lambda: self.delete_file(file_explorer, full_path))
|
||||
|
||||
# Disconnect file_list signals to prevent navigation during menu interaction
|
||||
try:
|
||||
@@ -184,7 +198,7 @@ class ContextMenuManager:
|
||||
global_pos = file_explorer.file_list.mapToGlobal(pos)
|
||||
menu.exec(global_pos)
|
||||
except Exception as e:
|
||||
logger.error("Error displaying folder context menu: %s", e)
|
||||
logger.error("Error displaying file explorer context menu: %s", e)
|
||||
|
||||
def toggle_favorite_folder(self, file_explorer, folder_path, add):
|
||||
"""Adds or removes a folder from favorites."""
|
||||
@@ -280,12 +294,12 @@ class ContextMenuManager:
|
||||
if hasattr(parent, "file_list") and parent.file_list:
|
||||
parent.file_list.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
|
||||
def create_folder(self, file_explorer) -> None:
|
||||
def create_folder(self, file_explorer, parent_path: str | None = None) -> None:
|
||||
"""Create a new folder in the current directory."""
|
||||
folder_name = self._prompt_folder_name(file_explorer, _("Create Folder"), _("Folder Name:"))
|
||||
if not folder_name:
|
||||
return
|
||||
target_path = os.path.join(file_explorer.current_path, folder_name)
|
||||
target_path = os.path.join(parent_path or file_explorer.current_path, folder_name)
|
||||
if os.path.exists(target_path):
|
||||
self.signals.show_warning_dialog.emit(_("Error"), _("Folder already exists: {folder_name}").format(folder_name=folder_name))
|
||||
return
|
||||
@@ -352,6 +366,49 @@ class ContextMenuManager:
|
||||
_("Failed to delete folder: {error}").format(error=str(e))
|
||||
)
|
||||
|
||||
def delete_file(self, file_explorer, file_path: str) -> None:
|
||||
"""Delete selected file after confirmation."""
|
||||
file_name = os.path.basename(file_path)
|
||||
msg_box = QMessageBox(file_explorer)
|
||||
msg_box.setWindowTitle(_("Confirm Deletion"))
|
||||
msg_box.setText(
|
||||
_("Are you sure you want to delete file '{file_name}'? This action cannot be undone.")
|
||||
.format(file_name=file_name)
|
||||
)
|
||||
msg_box.setIcon(QMessageBox.Icon.Warning)
|
||||
msg_box.setStandardButtons(QMessageBox.StandardButton.Yes | 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
|
||||
try:
|
||||
os.remove(file_path)
|
||||
file_explorer.update_file_list()
|
||||
except OSError as e:
|
||||
self.signals.show_warning_dialog.emit(
|
||||
_("Error"),
|
||||
_("Failed to delete file: {error}").format(error=str(e))
|
||||
)
|
||||
|
||||
def rename_file(self, file_explorer, file_path: str) -> None:
|
||||
"""Rename selected file."""
|
||||
current_name = os.path.basename(file_path)
|
||||
new_name = self._prompt_folder_name(file_explorer, _("Rename File"), _("New File Name:"), current_name)
|
||||
if not new_name or new_name == current_name:
|
||||
return
|
||||
target_path = os.path.join(os.path.dirname(file_path), new_name)
|
||||
if os.path.exists(target_path):
|
||||
self.signals.show_warning_dialog.emit(_("Error"), _("File already exists: {file_name}").format(file_name=new_name))
|
||||
return
|
||||
try:
|
||||
os.rename(file_path, target_path)
|
||||
file_explorer.update_file_list()
|
||||
except OSError as e:
|
||||
self.signals.show_warning_dialog.emit(
|
||||
_("Error"),
|
||||
_("Failed to rename file: {error}").format(error=str(e))
|
||||
)
|
||||
|
||||
def _get_safe_icon(self, icon_name: str) -> QIcon:
|
||||
"""Returns a QIcon, ensuring it is valid."""
|
||||
icon = self.theme_manager.get_icon(icon_name)
|
||||
|
||||
@@ -45,9 +45,13 @@ def get_cached_vk_gpu_info() -> str:
|
||||
if result.returncode == 0:
|
||||
_vk_gpu_info_output = result.stdout
|
||||
else:
|
||||
logger.warning(_format_command_error("vk_gpu_info", result))
|
||||
_vk_gpu_info_output = ""
|
||||
except FileNotFoundError:
|
||||
_vk_gpu_info_output = ""
|
||||
except subprocess.TimeoutExpired as e:
|
||||
logger.warning(_format_command_timeout("vk_gpu_info", e))
|
||||
_vk_gpu_info_output = ""
|
||||
except Exception as e:
|
||||
logger.error("Error running vk_gpu_info: %s", e)
|
||||
_vk_gpu_info_output = ""
|
||||
@@ -332,10 +336,54 @@ def _parse_glxinfo_output(stdout: str) -> list[str]:
|
||||
"OpenGL profile mask",
|
||||
"OpenGL ES profile",
|
||||
]
|
||||
return [
|
||||
line for line in stdout.split("\n")
|
||||
if any(p in line for p in keep_patterns)
|
||||
]
|
||||
lines = []
|
||||
|
||||
for line in stdout.split("\n"):
|
||||
if ":" not in line:
|
||||
continue
|
||||
|
||||
key, value = line.split(":", 1)
|
||||
if any(p in line for p in keep_patterns):
|
||||
lines.append(f"{key}: {value.strip()}")
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def _get_last_output_line(output: str | bytes | None) -> str | None:
|
||||
"""Return the last non-empty process output line."""
|
||||
if not output:
|
||||
return None
|
||||
if isinstance(output, bytes):
|
||||
output = output.decode(errors="replace")
|
||||
|
||||
lines = [line.strip() for line in output.splitlines() if line.strip()]
|
||||
if not lines:
|
||||
return None
|
||||
return lines[-1]
|
||||
|
||||
|
||||
def _format_command_error(
|
||||
command: str,
|
||||
result: subprocess.CompletedProcess[str]
|
||||
) -> str:
|
||||
"""Format process error details for debug output."""
|
||||
last_line = _get_last_output_line(result.stderr or result.stdout)
|
||||
if last_line:
|
||||
return f"{command} error: {last_line}"
|
||||
return f"{command} exited with code {result.returncode}"
|
||||
|
||||
|
||||
def _format_command_timeout(
|
||||
command: str,
|
||||
error: subprocess.TimeoutExpired
|
||||
) -> str:
|
||||
"""Format process timeout details for debug output."""
|
||||
details = [f"{command} timed out after {error.timeout} seconds"]
|
||||
last_line = _get_last_output_line(error.stderr or error.output)
|
||||
if last_line:
|
||||
details.append(f"last output: {last_line}")
|
||||
|
||||
return "; ".join(details)
|
||||
|
||||
|
||||
def _parse_gpu_properties(
|
||||
@@ -422,6 +470,10 @@ def get_graphics_info_detailed() -> str:
|
||||
if result.returncode == 0:
|
||||
devices_info = _parse_lspci_output(result.stdout)
|
||||
lines.extend(_build_graphics_section(devices_info))
|
||||
else:
|
||||
lines.append(_format_command_error("lspci", result))
|
||||
except subprocess.TimeoutExpired as e:
|
||||
lines.append(_format_command_timeout("lspci", e))
|
||||
except Exception as e:
|
||||
lines.append(f"lspci error: {e}")
|
||||
|
||||
@@ -429,7 +481,7 @@ def get_graphics_info_detailed() -> str:
|
||||
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["glxinfo"],
|
||||
["glxinfo", "-B"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10,
|
||||
@@ -437,8 +489,12 @@ def get_graphics_info_detailed() -> str:
|
||||
)
|
||||
if result.returncode == 0:
|
||||
lines.extend(_parse_glxinfo_output(result.stdout))
|
||||
else:
|
||||
lines.append(_format_command_error("glxinfo", result))
|
||||
except FileNotFoundError:
|
||||
lines.append("glxinfo not found")
|
||||
except subprocess.TimeoutExpired as e:
|
||||
lines.append(_format_command_timeout("glxinfo", e))
|
||||
except Exception as e:
|
||||
lines.append(f"glxinfo error: {e}")
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ from portprotonqt.detail_pages.utils import (
|
||||
create_focus_helper,
|
||||
toggle_favorite,
|
||||
check_autoinstall_installed,
|
||||
find_autoinstall_entry_path,
|
||||
)
|
||||
from portprotonqt.howlongtobeat_api import HowLongToBeat, GameEntry
|
||||
from portprotonqt.config import (
|
||||
@@ -77,6 +78,7 @@ class DetailPageManager:
|
||||
self.debug_log_manager = DebugLogManager()
|
||||
self._debug_log_button: AutoSizeButton | None = None
|
||||
self._debug_log_timer = None
|
||||
self._autoinstall_status_controls = None
|
||||
|
||||
def openGameDetailPage(self, game_data: dict) -> None:
|
||||
"""Open detailed game information page."""
|
||||
@@ -250,10 +252,11 @@ class DetailPageManager:
|
||||
game_info_layout = QVBoxLayout()
|
||||
game_info_layout.setSpacing(10)
|
||||
|
||||
first_row = self._create_playtime_row(
|
||||
game_data.get("last_launch", ""), game_data.get("formatted_playtime", "")
|
||||
)
|
||||
game_info_layout.addLayout(first_row)
|
||||
if ui_config.get_time_detail_level() != "hidden":
|
||||
first_row = self._create_playtime_row(
|
||||
game_data.get("last_launch", ""), game_data.get("formatted_playtime", "")
|
||||
)
|
||||
game_info_layout.addLayout(first_row)
|
||||
|
||||
hltb_layout = QHBoxLayout()
|
||||
hltb_layout.setSpacing(10)
|
||||
@@ -718,6 +721,7 @@ class DetailPageManager:
|
||||
|
||||
exec_line = game_data.get("exec_line", "")
|
||||
script_name = self._extract_script_name(exec_line)
|
||||
self._return_to_autoinstall_card = game_data.get("autoinstall_exe_name", "")
|
||||
description = self._get_enhanced_description(script_name, game_data.get("description", ""))
|
||||
|
||||
cover_frame = create_cover_frame(
|
||||
@@ -837,43 +841,123 @@ class DetailPageManager:
|
||||
self, script_name: str, name: str, buttons_layout: FlowLayout
|
||||
) -> AutoSizeButton:
|
||||
"""Create install button for auto-install page."""
|
||||
install_button = self._make_action_button(_("Install"), self.main_window.theme_manager.get_icon("save", as_path=True))
|
||||
install_button = self._make_action_button(
|
||||
_("Install"),
|
||||
self.main_window.theme_manager.get_icon("save", as_path=True),
|
||||
)
|
||||
install_button.clicked.connect(
|
||||
lambda: self.main_window.launch_autoinstall(script_name, install_button)
|
||||
)
|
||||
buttons_layout.addWidget(install_button)
|
||||
|
||||
self._check_install_status(script_name, name, install_button)
|
||||
open_button = self._make_action_button(
|
||||
_("Open Card"),
|
||||
self.main_window.theme_manager.get_icon("play", as_path=True),
|
||||
)
|
||||
open_button.clicked.connect(
|
||||
lambda: self._open_installed_autoinstall_card(script_name, name)
|
||||
)
|
||||
open_button.setVisible(False)
|
||||
buttons_layout.addWidget(open_button)
|
||||
|
||||
self._autoinstall_status_controls = (
|
||||
script_name, name, install_button, open_button
|
||||
)
|
||||
self._check_install_status(script_name, name, install_button, open_button)
|
||||
|
||||
return install_button
|
||||
|
||||
def refresh_autoinstall_install_status(self, script_name: str | None) -> None:
|
||||
"""Refresh install buttons for opened auto-install page."""
|
||||
controls = self._autoinstall_status_controls
|
||||
if not script_name or not controls or controls[0] != script_name:
|
||||
return
|
||||
self._check_install_status(*controls)
|
||||
|
||||
def _check_install_status(
|
||||
self, script_name: str, name: str, install_button: AutoSizeButton
|
||||
self,
|
||||
script_name: str,
|
||||
name: str,
|
||||
install_button: AutoSizeButton,
|
||||
open_button: AutoSizeButton,
|
||||
) -> None:
|
||||
"""Check install status asynchronously and update button."""
|
||||
def on_result(is_installed: bool) -> None:
|
||||
if (
|
||||
self.main_window.installing
|
||||
and self.main_window.current_install_script == script_name
|
||||
):
|
||||
icon = self.main_window.theme_manager.get_icon("stop", as_path=True)
|
||||
if icon:
|
||||
install_button.setIcon(icon)
|
||||
install_button.setText(_("Stop"))
|
||||
return
|
||||
|
||||
text = _("Reinstall") if is_installed else _("Install")
|
||||
icon_name = "update" if is_installed else "save"
|
||||
icon = self.main_window.theme_manager.get_icon(icon_name, as_path=True)
|
||||
if icon:
|
||||
install_button.setIcon(icon)
|
||||
# Update text without changing button size drastically
|
||||
install_button.setText(text)
|
||||
open_button.setVisible(is_installed)
|
||||
|
||||
if (
|
||||
self.main_window.installing
|
||||
and self.main_window.current_install_script == script_name
|
||||
):
|
||||
self.main_window._set_install_button_stop(install_button)
|
||||
status = getattr(self.main_window, "current_install_status", None)
|
||||
percent = getattr(self.main_window, "current_percent", None)
|
||||
self.main_window._set_install_button_progress_text(status, percent)
|
||||
return
|
||||
|
||||
check_autoinstall_installed(
|
||||
script_name, name, self.main_window.portproton_location, callback=on_result
|
||||
)
|
||||
|
||||
def _open_installed_autoinstall_card(self, script_name: str, name: str) -> None:
|
||||
"""Open detail page for installed autoinstall game."""
|
||||
desktop_path = find_autoinstall_entry_path(
|
||||
script_name, self.main_window.portproton_location
|
||||
)
|
||||
if not desktop_path:
|
||||
QMessageBox.warning(self.main_window, _("Error"), _("Game not found."))
|
||||
return
|
||||
|
||||
def on_game_data(game_tuple: tuple | None) -> None:
|
||||
if not game_tuple:
|
||||
QMessageBox.warning(self.main_window, _("Error"), _("Game not found."))
|
||||
return
|
||||
game_data = self._game_tuple_to_data(game_tuple)
|
||||
self._return_to_autoinstall_card = self._get_exec_name(game_data["exec_line"])
|
||||
self._remove_current_detail_page()
|
||||
self.openGameDetailPage(game_data)
|
||||
self._return_to_tab_index = self.main_window.auto_install_tab_index
|
||||
|
||||
self.main_window._process_desktop_file_async(desktop_path, on_game_data)
|
||||
|
||||
def _get_exec_name(self, exec_line: str) -> str:
|
||||
exec_path = extract_exec_target_path(exec_line)
|
||||
if not exec_path:
|
||||
return ""
|
||||
return os.path.splitext(os.path.basename(exec_path))[0]
|
||||
|
||||
def _remove_current_detail_page(self) -> None:
|
||||
page = self.main_window.currentDetailPage
|
||||
if page and self._page_in_stacked(page):
|
||||
self.main_window.detach_install_button(page)
|
||||
self.main_window.stackedWidget.removeWidget(page)
|
||||
page.deleteLater()
|
||||
self._autoinstall_status_controls = None
|
||||
self.main_window.currentDetailPage = None
|
||||
self._current_detail_page = None
|
||||
|
||||
def _game_tuple_to_data(self, game_tuple: tuple) -> dict:
|
||||
return {
|
||||
"name": game_tuple[0],
|
||||
"description": game_tuple[1],
|
||||
"cover_path": game_tuple[2],
|
||||
"appid": game_tuple[3],
|
||||
"controller_support": game_tuple[4],
|
||||
"exec_line": game_tuple[5],
|
||||
"last_launch": game_tuple[6],
|
||||
"formatted_playtime": game_tuple[7],
|
||||
"protondb_tier": game_tuple[8],
|
||||
"anticheat_status": game_tuple[9],
|
||||
"game_source": game_tuple[12],
|
||||
"anticheat_slug": game_tuple[13] if len(game_tuple) > 13 else "",
|
||||
}
|
||||
|
||||
def _finalize_autoinstall_page(
|
||||
self,
|
||||
detail_page: QWidget,
|
||||
@@ -1081,6 +1165,7 @@ class DetailPageManager:
|
||||
self._finalize_cleanup()
|
||||
return
|
||||
|
||||
self.main_window.detach_install_button(page)
|
||||
self.main_window.stackedWidget.removeWidget(page)
|
||||
page.deleteLater()
|
||||
return_tab_index = getattr(self, "_return_to_tab_index", 0)
|
||||
@@ -1128,6 +1213,30 @@ class DetailPageManager:
|
||||
QTimer.singleShot(10, lambda: self.main_window.autoInstallContainer.updateGeometry())
|
||||
if hasattr(self.main_window, "autoInstallContainerLayout"):
|
||||
QTimer.singleShot(15, lambda: self.main_window.autoInstallContainerLayout.update())
|
||||
QTimer.singleShot(50, self._focus_return_autoinstall_card)
|
||||
|
||||
def _focus_return_autoinstall_card(self) -> None:
|
||||
exe_name = getattr(self, "_return_to_autoinstall_card", "")
|
||||
if not exe_name:
|
||||
return
|
||||
cards = getattr(self.main_window, "autoInstallGameCards", {})
|
||||
card = cards.get(exe_name)
|
||||
if card is None or not card.isVisible():
|
||||
return
|
||||
self._clear_current_card_state(card)
|
||||
card.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
self.main_window.current_focused_card = card
|
||||
card.update()
|
||||
|
||||
def _clear_current_card_state(self, target_card: QWidget) -> None:
|
||||
current_card = getattr(self.main_window, "current_focused_card", None)
|
||||
if current_card and current_card != target_card:
|
||||
try:
|
||||
current_card._focused = False
|
||||
current_card.clearFocus()
|
||||
current_card.update()
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def _focus_first_library_card(self) -> None:
|
||||
container = getattr(self.main_window, "gamesListWidget", None)
|
||||
|
||||
@@ -9,7 +9,12 @@ from PySide6.QtGui import QPixmap
|
||||
|
||||
from portprotonqt.image_utils import get_animated_cover_pixmap
|
||||
from portprotonqt.image_utils import load_pixmap_async, round_corners, set_animated_cover
|
||||
from portprotonqt.config import favorites_config
|
||||
from portprotonqt.config import (
|
||||
extract_exec_target_path,
|
||||
favorites_config,
|
||||
get_portproton_scripts_path,
|
||||
parse_desktop_entry,
|
||||
)
|
||||
from portprotonqt.logger import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -23,6 +28,12 @@ class _PixmapReadyRelay(QObject):
|
||||
pixmap_ready = Signal(object)
|
||||
|
||||
|
||||
class _AutoinstallCheckRelay(QObject):
|
||||
"""Relay autoinstall check results to GUI thread safely."""
|
||||
|
||||
result_ready = Signal(bool)
|
||||
|
||||
|
||||
def setup_image_loading(
|
||||
detail_page: QWidget,
|
||||
image_label: QLabel,
|
||||
@@ -287,13 +298,42 @@ def _check_autoinstall_installed_sync(
|
||||
except (OSError, AttributeError):
|
||||
return False
|
||||
|
||||
autoinstall_exe = _get_autoinstall_exe_name(script_name)
|
||||
if not autoinstall_exe:
|
||||
return False
|
||||
|
||||
for file in desktop_files:
|
||||
if _check_desktop_file(file, portproton_location, script_name, game_name):
|
||||
if _check_desktop_file(file, portproton_location, autoinstall_exe):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def find_autoinstall_entry_path(
|
||||
script_name: str,
|
||||
portproton_location: str | None,
|
||||
) -> str | None:
|
||||
"""Find installed autoinstall desktop entry path."""
|
||||
if not portproton_location:
|
||||
return None
|
||||
|
||||
try:
|
||||
desktop_files = os.listdir(portproton_location)
|
||||
except (OSError, AttributeError):
|
||||
return None
|
||||
|
||||
autoinstall_exe = _get_autoinstall_exe_name(script_name)
|
||||
if not autoinstall_exe:
|
||||
return None
|
||||
|
||||
for filename in desktop_files:
|
||||
if not _check_desktop_file(filename, portproton_location, autoinstall_exe):
|
||||
continue
|
||||
return os.path.join(portproton_location, filename)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _check_autoinstall_installed_async(
|
||||
script_name: str,
|
||||
game_name: str,
|
||||
@@ -302,13 +342,20 @@ def _check_autoinstall_installed_async(
|
||||
) -> None:
|
||||
"""Asynchronous check for installed autoinstall game."""
|
||||
from threading import Thread
|
||||
from PySide6.QtCore import QTimer
|
||||
|
||||
relay = _AutoinstallCheckRelay(QApplication.instance())
|
||||
|
||||
def on_result(result: bool) -> None:
|
||||
callback(result)
|
||||
relay.deleteLater()
|
||||
|
||||
relay.result_ready.connect(on_result, Qt.ConnectionType.QueuedConnection)
|
||||
|
||||
def worker() -> None:
|
||||
result = _check_autoinstall_installed_sync(
|
||||
script_name, game_name, portproton_location
|
||||
)
|
||||
QTimer.singleShot(0, lambda: callback(result))
|
||||
relay.result_ready.emit(result)
|
||||
|
||||
thread = Thread(target=worker, daemon=True)
|
||||
thread.start()
|
||||
@@ -317,19 +364,55 @@ def _check_autoinstall_installed_async(
|
||||
def _check_desktop_file(
|
||||
filename: str,
|
||||
location: str,
|
||||
script_name: str,
|
||||
game_name: str,
|
||||
autoinstall_exe: str,
|
||||
) -> bool:
|
||||
"""Check if desktop file contains script or game name."""
|
||||
"""Check if desktop file targets autoinstall exe."""
|
||||
if not filename.endswith(".desktop"):
|
||||
return False
|
||||
|
||||
try:
|
||||
with open(os.path.join(location, filename), encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
return (
|
||||
script_name.lower() in content.lower()
|
||||
or game_name.lower() in content.lower()
|
||||
)
|
||||
except (OSError, UnicodeDecodeError):
|
||||
desktop_entry = parse_desktop_entry(os.path.join(location, filename))
|
||||
if not desktop_entry:
|
||||
return False
|
||||
|
||||
exec_path = extract_exec_target_path(desktop_entry.get("Exec", ""))
|
||||
if not exec_path:
|
||||
return False
|
||||
if not os.path.isfile(exec_path):
|
||||
return False
|
||||
|
||||
exec_name = os.path.basename(exec_path).lower()
|
||||
real_exec_name = os.path.basename(os.path.realpath(exec_path)).lower()
|
||||
return autoinstall_exe.lower() in (exec_name, real_exec_name)
|
||||
|
||||
|
||||
def _get_autoinstall_exe_name(script_name: str) -> str:
|
||||
scripts_path = get_portproton_scripts_path()
|
||||
if not scripts_path:
|
||||
return ""
|
||||
|
||||
script_path = os.path.join(scripts_path, "pw_autoinstall", script_name)
|
||||
install_exe = ""
|
||||
try:
|
||||
with open(script_path, encoding="utf-8") as script_file:
|
||||
for line in script_file:
|
||||
if "PW_EXE_FILE" in line:
|
||||
exe_name = _extract_exe_name(line)
|
||||
if exe_name:
|
||||
return exe_name
|
||||
if "PW_AUTOINSTALL_EXE" not in line:
|
||||
continue
|
||||
exe_name = _extract_exe_name(line)
|
||||
if exe_name:
|
||||
install_exe = exe_name
|
||||
except OSError:
|
||||
return ""
|
||||
|
||||
return install_exe
|
||||
|
||||
|
||||
def _extract_exe_name(line: str) -> str:
|
||||
for part in line.replace("\\", "/").split("/"):
|
||||
clean_part = part.strip().strip('"\' }')
|
||||
if clean_part.lower().endswith(".exe"):
|
||||
return clean_part
|
||||
return ""
|
||||
@@ -31,7 +31,7 @@ from portprotonqt.icon_extractor import generate_thumbnail
|
||||
|
||||
logger = get_logger(__name__)
|
||||
theme_manager = ThemeManager()
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf")
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf", ".nrg")
|
||||
|
||||
|
||||
class FileSelectedSignal(QObject):
|
||||
|
||||
@@ -47,6 +47,7 @@ def create_dialog_hints_widget(theme, main_window, input_manager, context='defau
|
||||
("confirm", _("Toggle")),
|
||||
("add_game", _("Save")),
|
||||
("prev_dir", _("Search")),
|
||||
("context_menu", _("Menu")),
|
||||
("back", _("Cancel")),
|
||||
("prev_tab", _("Prev Tab")),
|
||||
("next_tab", _("Next Tab")),
|
||||
|
||||
@@ -24,10 +24,11 @@ from portprotonqt.dialogs.dialog_utils import create_dialog_hints_widget, update
|
||||
from portprotonqt.icon_extractor import generate_thumbnail
|
||||
from portprotonqt.dialogs.base import DraggableDialog, FileSelectedSignal
|
||||
from portprotonqt.image_utils import COVER_IMAGE_EXTENSIONS
|
||||
from portprotonqt.scripts_utils.mount_points import list_mounted_drive_paths
|
||||
|
||||
logger = get_logger(__name__)
|
||||
theme_manager = ThemeManager()
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf")
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf", ".nrg")
|
||||
THUMBNAIL_PRELOAD_ROWS = 5
|
||||
THUMBNAIL_QUEUE_LIMIT = 24
|
||||
THUMBNAIL_SCROLL_DELAY_MS = 80
|
||||
@@ -279,30 +280,7 @@ class FileExplorer(DraggableDialog):
|
||||
|
||||
def get_mounted_drives(self):
|
||||
"""Retrieve a list of mounted drives from /proc/mounts, excluding system paths."""
|
||||
mounted_drives = []
|
||||
try:
|
||||
mounts = []
|
||||
with open('/proc/mounts') as f:
|
||||
for line in f:
|
||||
parts = line.strip().split()
|
||||
if len(parts) < 2:
|
||||
continue
|
||||
mount_point = parts[1]
|
||||
mounts.append(mount_point)
|
||||
|
||||
for mount_point in mounts:
|
||||
if mount_point == "/":
|
||||
continue
|
||||
if mount_point in ("/media", "/mnt", "/run/media"):
|
||||
continue
|
||||
if mount_point != "/" and not mount_point.startswith(("/run/media/", "/media/", "/mnt/")):
|
||||
continue
|
||||
if os.path.isdir(mount_point) and os.access(mount_point, os.R_OK):
|
||||
mounted_drives.append(mount_point)
|
||||
return sorted(mounted_drives)
|
||||
except Exception as e:
|
||||
logger.error(f"Error retrieving mounted drives: {e}")
|
||||
return []
|
||||
return list_mounted_drive_paths()
|
||||
|
||||
def setup_ui(self):
|
||||
"""Set up the user interface."""
|
||||
@@ -335,7 +313,7 @@ class FileExplorer(DraggableDialog):
|
||||
self.file_list.itemClicked.connect(self.handle_item_click)
|
||||
self.file_list.itemDoubleClicked.connect(self.handle_item_double_click)
|
||||
self.file_list.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.file_list.customContextMenuRequested.connect(self.show_folder_context_menu)
|
||||
self.file_list.customContextMenuRequested.connect(self.show_context_menu)
|
||||
self.file_list.setHorizontalScrollMode(QListWidget.ScrollMode.ScrollPerPixel)
|
||||
self.file_list.setVerticalScrollMode(QListWidget.ScrollMode.ScrollPerPixel)
|
||||
self.file_list.setUniformItemSizes(True)
|
||||
@@ -357,10 +335,10 @@ class FileExplorer(DraggableDialog):
|
||||
self.select_button.clicked.connect(self.select_item)
|
||||
self.cancel_button.clicked.connect(self.reject)
|
||||
|
||||
def show_folder_context_menu(self, pos):
|
||||
"""Shows the context menu for a folder using ContextMenuManager."""
|
||||
def show_context_menu(self, pos):
|
||||
"""Shows the context menu for an item using ContextMenuManager."""
|
||||
if self.context_menu_manager:
|
||||
self.context_menu_manager.show_folder_context_menu(self, pos)
|
||||
self.context_menu_manager.show_file_explorer_context_menu(self, pos)
|
||||
else:
|
||||
logger.warning("ContextMenuManager not found in parent")
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ from PySide6.QtWidgets import (
|
||||
QHBoxLayout, QProgressBar, QFrame, QSizePolicy, QAbstractItemView,
|
||||
QStackedWidget, QPushButton
|
||||
)
|
||||
from PySide6.QtCore import Qt, QTimer
|
||||
from PySide6.QtCore import Qt, QTimer, QEvent, QObject
|
||||
from PySide6.QtGui import QGuiApplication
|
||||
|
||||
from portprotonqt.config import get_portproton_start_command, ui_config
|
||||
from portprotonqt.dialogs.base import DraggableDialog
|
||||
@@ -60,10 +61,65 @@ class ProtonManager(DraggableDialog):
|
||||
if self.input_manager:
|
||||
self.enable_proton_manager_mode()
|
||||
|
||||
def _init_gamepad_tooltip(self) -> None:
|
||||
self._gamepad_tooltip_map = {}
|
||||
self.gamepad_tooltip = QLabel()
|
||||
self.gamepad_tooltip.setWordWrap(True)
|
||||
self.gamepad_tooltip.setStyleSheet(self.theme.TOOLTIP_STYLE)
|
||||
self.gamepad_tooltip.setVisible(False)
|
||||
self.gamepad_tooltip.setParent(self)
|
||||
self.gamepad_tooltip.setWindowFlags(Qt.WindowType.ToolTip)
|
||||
self.gamepad_tooltip.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
|
||||
self.gamepad_tooltip.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
|
||||
self.gamepad_tooltip_timer = QTimer(self)
|
||||
self.gamepad_tooltip_timer.setSingleShot(True)
|
||||
self.gamepad_tooltip_timer.timeout.connect(lambda: self.gamepad_tooltip.setVisible(False))
|
||||
|
||||
def _register_gamepad_tooltip(self, widget: QWidget, text: str) -> None:
|
||||
self._gamepad_tooltip_map[widget] = text
|
||||
widget.installEventFilter(self)
|
||||
|
||||
def _show_gamepad_tooltip(self, show: bool, text: str = "", anchor_widget: QWidget | None = None) -> None:
|
||||
if not show or not text or anchor_widget is None or not anchor_widget.isVisible():
|
||||
self.gamepad_tooltip_timer.stop()
|
||||
self.gamepad_tooltip.setVisible(False)
|
||||
return
|
||||
self.gamepad_tooltip.setText(text)
|
||||
self.gamepad_tooltip.setFixedSize(500, 300)
|
||||
font_metrics = self.gamepad_tooltip.fontMetrics()
|
||||
text_rect = font_metrics.boundingRect(
|
||||
0, 0, 480, 1000,
|
||||
Qt.TextFlag.TextWordWrap | Qt.TextFlag.TextExpandTabs,
|
||||
text,
|
||||
)
|
||||
required_width = min(500, text_rect.width() + 25)
|
||||
required_height = min(300, text_rect.height() + 25)
|
||||
anchor_pos = anchor_widget.mapToGlobal(anchor_widget.rect().bottomLeft())
|
||||
x = anchor_pos.x() + self.theme.settings_tooltip_offset_x
|
||||
y = anchor_pos.y() + self.theme.settings_tooltip_offset_y
|
||||
screen = QGuiApplication.screenAt(anchor_pos) or QGuiApplication.primaryScreen()
|
||||
if screen:
|
||||
available_rect = screen.availableGeometry()
|
||||
x = max(available_rect.left(), min(x, available_rect.right() - required_width))
|
||||
y = max(available_rect.top(), min(y, available_rect.bottom() - required_height))
|
||||
self.gamepad_tooltip.setFixedSize(required_width, required_height)
|
||||
self.gamepad_tooltip.move(x, y)
|
||||
self.gamepad_tooltip.setVisible(True)
|
||||
self.gamepad_tooltip_timer.start(max(2500, min(12000, 1500 + len(text) * 30)))
|
||||
|
||||
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
|
||||
if isinstance(obj, QWidget) and obj in getattr(self, "_gamepad_tooltip_map", {}):
|
||||
if event.type() in (QEvent.Type.Enter, QEvent.Type.FocusIn):
|
||||
self._show_gamepad_tooltip(True, self._gamepad_tooltip_map[obj], obj)
|
||||
elif event.type() in (QEvent.Type.Leave, QEvent.Type.FocusOut, QEvent.Type.MouseButtonPress):
|
||||
self._show_gamepad_tooltip(False)
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
def initUI(self):
|
||||
self.setWindowTitle(_('Manage WINE versions'))
|
||||
self.resize(1133, 720)
|
||||
self.setStyleSheet(self.theme.MAIN_WINDOW_STYLE + self.theme.MESSAGE_BOX_STYLE)
|
||||
self._init_gamepad_tooltip()
|
||||
|
||||
layout = QVBoxLayout(self)
|
||||
layout.setContentsMargins(5, 5, 5, 5)
|
||||
@@ -493,7 +549,7 @@ class ProtonManager(DraggableDialog):
|
||||
checkbox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
checkbox_layout.setContentsMargins(0, 0, 0, 0)
|
||||
checkbox = QCheckBox()
|
||||
checkbox_widget.setToolTip(_("Select to remove this WINE/Proton"))
|
||||
self._register_gamepad_tooltip(checkbox_widget, _("Select to remove this WINE/Proton"))
|
||||
checkbox.stateChanged.connect(lambda state: self.on_installed_version_toggled(state))
|
||||
checkbox_layout.addWidget(checkbox)
|
||||
table.setCellWidget(row_index, 0, checkbox_widget)
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from typing import cast, TYPE_CHECKING
|
||||
|
||||
from PySide6.QtCore import Qt, QObject, QEvent, QProcess, QTimer, QUrl
|
||||
from PySide6.QtGui import QColor, QContextMenuEvent, QDesktopServices, QGuiApplication
|
||||
from PySide6.QtCore import Qt, QObject, QEvent, QPoint, QProcess, QTimer, QUrl
|
||||
from PySide6.QtGui import QColor, QContextMenuEvent, QDesktopServices, QGuiApplication, QIcon
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QAbstractItemView,
|
||||
@@ -18,6 +16,7 @@ from PySide6.QtWidgets import (
|
||||
QHeaderView,
|
||||
QLabel,
|
||||
QLineEdit,
|
||||
QMenu,
|
||||
QMessageBox,
|
||||
QStackedWidget,
|
||||
QTabWidget,
|
||||
@@ -34,6 +33,7 @@ from portprotonqt.config import (
|
||||
get_portproton_location,
|
||||
get_portproton_scripts_path,
|
||||
get_portproton_start_command,
|
||||
exe_settings_favorites_config,
|
||||
ui_config,
|
||||
)
|
||||
from portprotonqt.custom_widgets import AutoSizeButton
|
||||
@@ -41,17 +41,19 @@ from portprotonqt.dialogs.base import DraggableDialog
|
||||
from portprotonqt.dialogs.dialog_utils import create_dialog_hints_widget, update_dialog_hints
|
||||
from portprotonqt.dialogs.settings_mangohud import MANGOHUD_ENV_KEYS, MangoHudSettingsMixin
|
||||
from portprotonqt.dialogs.settings_gamescope import GAMESCOPE_ENV_KEYS, GamescopeSettingsMixin
|
||||
from portprotonqt.dialogs.settings_vkbasalt import VKBASALT_ENV_KEYS, VkBasaltSettingsMixin
|
||||
from portprotonqt.localization import _, format_setting_name_for_display
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.preloader import Preloader
|
||||
from portprotonqt.settings_manager import (
|
||||
ADVANCED_SETTING_KEYS,
|
||||
get_available_prefix_options,
|
||||
get_available_wine_options,
|
||||
get_advanced_settings,
|
||||
get_toggle_settings,
|
||||
read_lg_dist_versions_from_var,
|
||||
)
|
||||
from portprotonqt.theme_manager import ThemeManager
|
||||
from portprotonqt.version_utils import include_pinned_prefixes, version_sort_key
|
||||
from portprotonqt.virtual_keyboard import VirtualKeyboard
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -60,6 +62,8 @@ TOGGLE_BOOL_KEYS = {
|
||||
'PW_MANGOHUD',
|
||||
'PW_MANGOHUD_USER_CONF',
|
||||
'PW_GAMESCOPE',
|
||||
'PW_VKBASALT',
|
||||
'PW_VKBASALT_USER_CONF',
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +95,11 @@ def _normalize_prefix_directories(prefixes_dir):
|
||||
logger.warning("Failed to rename prefix %s: %s", prefix_name, exc)
|
||||
|
||||
|
||||
def _format_setting_value_for_display(value: str) -> str:
|
||||
"""Hide shell-escaped quotes in GUI fields."""
|
||||
return value.replace('\\"', '"')
|
||||
|
||||
|
||||
def _get_numa_nodes() -> dict[str, str]:
|
||||
"""Read NUMA nodes from lscpu output."""
|
||||
try:
|
||||
@@ -118,7 +127,12 @@ def _get_numa_nodes() -> dict[str, str]:
|
||||
return numa_nodes
|
||||
|
||||
|
||||
class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSettingsMixin):
|
||||
class ExeSettingsDialog(
|
||||
DraggableDialog,
|
||||
MangoHudSettingsMixin,
|
||||
GamescopeSettingsMixin,
|
||||
VkBasaltSettingsMixin,
|
||||
):
|
||||
"""Dialog for configuring executable-specific settings."""
|
||||
|
||||
def __init__(self, parent=None, theme=None, exe_path=None, appid=None, game_source=None):
|
||||
@@ -142,50 +156,29 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.lg_dist_aliases = {}
|
||||
self.prefix_options = []
|
||||
if self.portproton_path:
|
||||
dist_dir = os.path.join(self.portproton_path, "data", 'dist')
|
||||
if os.path.exists(dist_dir):
|
||||
self.dist_options = sorted(
|
||||
[f for f in os.listdir(dist_dir) if os.path.isdir(os.path.join(dist_dir, f))],
|
||||
key=version_sort_key
|
||||
)
|
||||
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)
|
||||
for version in self.lg_dist_aliases.values():
|
||||
if version not in self.dist_options:
|
||||
self.dist_options.append(version)
|
||||
from portprotonqt.steam_api import get_steam_proton_versions
|
||||
from portprotonqt.steam_api.utils import _is_steam_proton_dir
|
||||
for version in get_steam_proton_versions():
|
||||
if version not in self.dist_options:
|
||||
self.dist_options.append(version)
|
||||
if self.game_source == "steam":
|
||||
self.dist_options = [
|
||||
version for version in self.dist_options
|
||||
if _is_steam_proton_dir(
|
||||
Path(version) if os.path.isabs(version) else Path(dist_dir, version)
|
||||
)
|
||||
]
|
||||
self.dist_options.sort(key=version_sort_key)
|
||||
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"
|
||||
)
|
||||
prefixes_dir = os.path.join(self.portproton_path, 'prefixes')
|
||||
prefixes = []
|
||||
if os.path.exists(prefixes_dir):
|
||||
_normalize_prefix_directories(prefixes_dir)
|
||||
prefixes = [f for f in os.listdir(prefixes_dir) if os.path.isdir(os.path.join(prefixes_dir, f))]
|
||||
self.prefix_options = include_pinned_prefixes(prefixes)
|
||||
|
||||
if self.game_source != "steam" and shutil.which('wine'):
|
||||
if _('System WINE') not in self.dist_options:
|
||||
self.dist_options.append(_('System WINE'))
|
||||
self.prefix_options = get_available_prefix_options(self.portproton_path)
|
||||
|
||||
self.current_settings = {}
|
||||
self.value_widgets = {}
|
||||
self.original_values = {}
|
||||
self.advanced_widgets = {}
|
||||
self.original_display_values = {}
|
||||
self.exe_setting_favorites = exe_settings_favorites_config.get_keys()
|
||||
self.advanced_settings_by_key = {}
|
||||
self.init_mangohud_state()
|
||||
self.init_gamescope_state()
|
||||
self.init_vkbasalt_state()
|
||||
self.blocked_keys = set()
|
||||
self.numa_nodes = {}
|
||||
self.locale_options = []
|
||||
@@ -218,6 +211,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
|
||||
if self.input_manager:
|
||||
self.input_manager.enable_settings_mode(self)
|
||||
self.input_manager.gamepad_hotplug.connect(self._update_vkbasalt_toggle_key_visibility)
|
||||
|
||||
self.hints_widget, self.hints_labels = create_dialog_hints_widget(
|
||||
self.theme, self.main_window, self.input_manager, context='settings'
|
||||
@@ -247,11 +241,25 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
normalized = os.path.normpath(os.path.expanduser(exe_path))
|
||||
if os.path.isabs(normalized):
|
||||
return normalized
|
||||
if " " in exe_path:
|
||||
return exe_path
|
||||
game_dir = os.path.dirname(self.exe_path or "")
|
||||
if not game_dir:
|
||||
return normalized
|
||||
return os.path.normpath(os.path.join(game_dir, normalized))
|
||||
|
||||
def _get_setting_file_selector_path(self, current_path: str) -> str:
|
||||
"""Get initial path for setting file selectors."""
|
||||
initial_path = os.path.expanduser("~")
|
||||
if not current_path:
|
||||
return initial_path
|
||||
normalized = self._resolve_run_after_exe_path(current_path)
|
||||
if os.path.isfile(normalized):
|
||||
return os.path.dirname(normalized)
|
||||
if os.path.isdir(normalized):
|
||||
return normalized
|
||||
return initial_path
|
||||
|
||||
def setup_ui(self):
|
||||
"""Set up the user interface."""
|
||||
self.main_layout = QVBoxLayout(self)
|
||||
@@ -270,18 +278,23 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
|
||||
self.tab_widget = QTabWidget()
|
||||
self.tab_widget.setStyleSheet(self.theme.TAB_STYLE)
|
||||
self.favorites_tab = QWidget()
|
||||
self.favorites_tab_layout = QVBoxLayout(self.favorites_tab)
|
||||
self.main_tab = QWidget()
|
||||
self.main_tab_layout = QVBoxLayout(self.main_tab)
|
||||
self.advanced_tab = QWidget()
|
||||
self.advanced_tab_layout = QVBoxLayout(self.advanced_tab)
|
||||
self.mangohud_tab = QWidget()
|
||||
self.mangohud_tab_layout = QVBoxLayout(self.mangohud_tab)
|
||||
self.vkbasalt_tab = QWidget()
|
||||
self.vkbasalt_tab_layout = QVBoxLayout(self.vkbasalt_tab)
|
||||
self.gamescope_tab = QWidget()
|
||||
self.gamescope_tab_layout = QVBoxLayout(self.gamescope_tab)
|
||||
|
||||
self.tab_widget.addTab(self.main_tab, _("Main"))
|
||||
self.tab_widget.addTab(self.advanced_tab, _("Advanced"))
|
||||
self.tab_widget.addTab(self.mangohud_tab, "MangoHud")
|
||||
self.tab_widget.addTab(self.vkbasalt_tab, "vkBasalt")
|
||||
if self.gamescope_available:
|
||||
self.tab_widget.addTab(self.gamescope_tab, "Gamescope")
|
||||
self.tab_widget.currentChanged.connect(self.on_table_selection_changed)
|
||||
@@ -289,7 +302,8 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.settings_table = QTableWidget()
|
||||
self.settings_table.setAlternatingRowColors(True)
|
||||
self.settings_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection)
|
||||
self.settings_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.settings_table.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.settings_table.setColumnCount(3)
|
||||
self.settings_table.setHorizontalHeaderLabels([_("Setting"), _("Value"), _("Description")])
|
||||
@@ -300,8 +314,13 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.settings_table.setWordWrap(True)
|
||||
self.settings_table.verticalHeader().setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents)
|
||||
self.settings_table.setTextElideMode(Qt.TextElideMode.ElideNone)
|
||||
self.settings_table.setStyleSheet(self.theme.WINETRICKS_TABBLE_STYLE + self.theme.COMBOBOX_STYLE + self.theme.LINE_EDIT_STYLE + self.theme.SCROLL_STYLE)
|
||||
settings_combo_style = getattr(self.theme, "SETTINGS_TABLE_COMBOBOX_STYLE", "")
|
||||
self.settings_table.setStyleSheet(self.theme.WINETRICKS_TABBLE_STYLE + self.theme.COMBOBOX_STYLE + settings_combo_style + self.theme.LINE_EDIT_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.settings_table.setMouseTracking(True)
|
||||
self.settings_table.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.settings_table.customContextMenuRequested.connect(
|
||||
lambda pos: self.show_setting_context_menu(self.settings_table, pos)
|
||||
)
|
||||
|
||||
self.settings_preloader = Preloader()
|
||||
settings_preloader_container = QWidget()
|
||||
@@ -327,8 +346,8 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.advanced_table = QTableWidget()
|
||||
self.advanced_table.setAlternatingRowColors(True)
|
||||
self.advanced_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.advanced_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection)
|
||||
self.advanced_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
self.advanced_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.advanced_table.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.advanced_table.setColumnCount(3)
|
||||
self.advanced_table.setHorizontalHeaderLabels([_("Setting"), _("Value"), _("Description")])
|
||||
@@ -339,8 +358,43 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.advanced_table.setWordWrap(True)
|
||||
self.advanced_table.verticalHeader().setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents)
|
||||
self.advanced_table.setTextElideMode(Qt.TextElideMode.ElideNone)
|
||||
self.advanced_table.setStyleSheet(self.theme.WINETRICKS_TABBLE_STYLE + self.theme.COMBOBOX_STYLE + self.theme.LINE_EDIT_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.advanced_table.setStyleSheet(self.theme.WINETRICKS_TABBLE_STYLE + self.theme.COMBOBOX_STYLE + settings_combo_style + self.theme.LINE_EDIT_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.advanced_table.setMouseTracking(True)
|
||||
self.advanced_table.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.advanced_table.customContextMenuRequested.connect(
|
||||
lambda pos: self.show_setting_context_menu(self.advanced_table, pos)
|
||||
)
|
||||
|
||||
self.favorites_table = QTableWidget()
|
||||
self.favorites_table.setAlternatingRowColors(True)
|
||||
self.favorites_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.favorites_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
self.favorites_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.favorites_table.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.favorites_table.setColumnCount(3)
|
||||
self.favorites_table.setHorizontalHeaderLabels([_("Setting"), _("Value"), _("Description")])
|
||||
self.favorites_table.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeMode.ResizeToContents)
|
||||
self.favorites_table.horizontalHeader().setSectionResizeMode(1, QHeaderView.ResizeMode.Fixed)
|
||||
self.favorites_table.horizontalHeader().setSectionResizeMode(2, QHeaderView.ResizeMode.Stretch)
|
||||
self.favorites_table.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
|
||||
self.favorites_table.setWordWrap(True)
|
||||
self.favorites_table.verticalHeader().setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents)
|
||||
self.favorites_table.setTextElideMode(Qt.TextElideMode.ElideNone)
|
||||
self.favorites_table.setStyleSheet(
|
||||
self.theme.WINETRICKS_TABBLE_STYLE
|
||||
+ self.theme.COMBOBOX_STYLE
|
||||
+ settings_combo_style
|
||||
+ self.theme.LINE_EDIT_STYLE
|
||||
+ self.theme.SCROLL_STYLE
|
||||
)
|
||||
self.favorites_table.setMouseTracking(True)
|
||||
self.favorites_table.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.favorites_table.customContextMenuRequested.connect(
|
||||
lambda pos: self.show_setting_context_menu(self.favorites_table, pos)
|
||||
)
|
||||
self.favorites_tab_layout.addWidget(self.favorites_table)
|
||||
self.favorites_table.currentCellChanged.connect(self.on_table_selection_changed)
|
||||
self.favorites_table.cellEntered.connect(self.on_table_cell_hovered)
|
||||
|
||||
self.advanced_preloader = Preloader()
|
||||
advanced_preloader_container = QWidget()
|
||||
@@ -364,6 +418,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.advanced_table.installEventFilter(self)
|
||||
|
||||
self.setup_mangohud_tab()
|
||||
self.setup_vkbasalt_tab()
|
||||
if self.gamescope_available:
|
||||
self.setup_gamescope_tab()
|
||||
|
||||
@@ -447,10 +502,12 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
or key in ADVANCED_SETTING_KEYS
|
||||
or key in MANGOHUD_ENV_KEYS
|
||||
or key in GAMESCOPE_ENV_KEYS
|
||||
or key in VKBASALT_ENV_KEYS
|
||||
or key in TOGGLE_BOOL_KEYS
|
||||
):
|
||||
if val.startswith('"') and val.endswith('"') and len(val) >= 2:
|
||||
val = val[1:-1]
|
||||
val = _format_setting_value_for_display(val)
|
||||
self.current_settings[key] = val
|
||||
except ValueError:
|
||||
continue
|
||||
@@ -470,14 +527,17 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.current_settings[key] = '0'
|
||||
for adv_key in ADVANCED_SETTING_KEYS:
|
||||
self.current_settings[adv_key] = 'disabled' if any(
|
||||
x in adv_key for x in ['TOPOLOGY', 'SELECT', 'MODE', 'LEVEL', 'GL_VERSION', 'NUMA']
|
||||
x in adv_key for x in ['TOPOLOGY', 'SELECT', 'MODE', 'LEVEL', 'GL_VERSION', 'NUMA', 'DRIVER']
|
||||
) else ''
|
||||
for key in MANGOHUD_ENV_KEYS:
|
||||
self.current_settings[key] = ''
|
||||
for key in GAMESCOPE_ENV_KEYS:
|
||||
self.current_settings[key] = ''
|
||||
for key in VKBASALT_ENV_KEYS:
|
||||
self.current_settings[key] = ''
|
||||
else:
|
||||
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'
|
||||
@@ -501,8 +561,10 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.populate_table()
|
||||
self.populate_advanced()
|
||||
self.populate_mangohud()
|
||||
self.populate_vkbasalt()
|
||||
if self.gamescope_available:
|
||||
self.populate_gamescope()
|
||||
self.populate_favorites(select_tab=True)
|
||||
|
||||
self.settings_container.setCurrentIndex(1)
|
||||
self.advanced_container.setCurrentIndex(1)
|
||||
@@ -552,7 +614,6 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
QMessageBox.warning(self, _("Error"), _("Failed to remove PPDB file:\n") + db_path)
|
||||
return
|
||||
|
||||
QMessageBox.information(self, _("Success"), _("PPDB settings cleared."))
|
||||
self.load_current_settings()
|
||||
|
||||
def populate_table(self):
|
||||
@@ -582,6 +643,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
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)
|
||||
@@ -609,6 +671,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.settings_table.resizeRowsToContents()
|
||||
if self.settings_table.rowCount() > 0:
|
||||
self.settings_table.setCurrentCell(0, 1)
|
||||
self.settings_table.selectRow(0)
|
||||
first_widget = self.value_widgets.get((0, 1))
|
||||
if isinstance(first_widget, QCheckBox):
|
||||
first_widget.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
@@ -635,6 +698,9 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
dist_options=self.dist_options,
|
||||
prefix_options=self.prefix_options
|
||||
)
|
||||
self.advanced_settings_by_key = {
|
||||
setting['key']: setting for setting in advanced_settings
|
||||
}
|
||||
|
||||
for setting in advanced_settings:
|
||||
row = self.advanced_table.rowCount()
|
||||
@@ -642,11 +708,13 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
is_blocked = setting.get("type") == "combo" and len(setting.get("options", [])) == 1
|
||||
|
||||
name_item = QTableWidgetItem(setting['name'])
|
||||
name_item.setData(Qt.ItemDataRole.UserRole, setting['key'])
|
||||
name_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
self.advanced_table.setItem(row, 0, name_item)
|
||||
|
||||
if setting['type'] == 'combo':
|
||||
combo = QComboBox()
|
||||
combo.setObjectName("settingsTableCombo")
|
||||
combo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
@@ -736,23 +804,20 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
browse_button.setEnabled(False)
|
||||
|
||||
def open_run_after_exe_selector(
|
||||
_checked: bool = False, target_line_edit=line_edit
|
||||
_checked: bool = False,
|
||||
target_line_edit=line_edit,
|
||||
file_filter="",
|
||||
):
|
||||
from portprotonqt.dialogs.file_explorer import FileExplorer
|
||||
|
||||
initial_path = os.path.expanduser("~")
|
||||
current_path = target_line_edit.text().strip()
|
||||
if current_path:
|
||||
normalized = self._resolve_run_after_exe_path(current_path)
|
||||
if os.path.isfile(normalized):
|
||||
initial_path = os.path.dirname(normalized)
|
||||
elif os.path.isdir(normalized):
|
||||
initial_path = normalized
|
||||
initial_path = self._get_setting_file_selector_path(
|
||||
target_line_edit.text().strip()
|
||||
)
|
||||
|
||||
file_explorer = FileExplorer(
|
||||
self,
|
||||
theme=self.theme,
|
||||
file_filter=".exe",
|
||||
file_filter=file_filter,
|
||||
initial_path=initial_path,
|
||||
)
|
||||
file_explorer.file_signal.file_selected.connect(
|
||||
@@ -779,6 +844,234 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.on_table_selection_changed()
|
||||
self._install_line_edit_event_filters()
|
||||
|
||||
def _get_current_settings_table(self) -> QTableWidget | None:
|
||||
current_widget = self.tab_widget.currentWidget()
|
||||
if current_widget == self.favorites_tab:
|
||||
return self.favorites_table
|
||||
if current_widget == self.main_tab:
|
||||
return self.settings_table
|
||||
if current_widget == self.advanced_tab:
|
||||
return self.advanced_table
|
||||
return None
|
||||
|
||||
def show_setting_context_menu(self, table: QTableWidget, pos: QPoint) -> None:
|
||||
"""Show favorite actions for a settings row."""
|
||||
row = table.rowAt(pos.y())
|
||||
if row < 0:
|
||||
return
|
||||
|
||||
item = table.item(row, 0)
|
||||
if item is None:
|
||||
return
|
||||
|
||||
key = item.data(Qt.ItemDataRole.UserRole)
|
||||
if not isinstance(key, str) or not key:
|
||||
return
|
||||
|
||||
is_favorite = key in self.exe_setting_favorites
|
||||
icon_name = "star" if is_favorite else "star_full"
|
||||
raw_icon = theme_manager.get_icon(icon_name)
|
||||
if isinstance(raw_icon, QIcon):
|
||||
icon = raw_icon
|
||||
elif isinstance(raw_icon, str):
|
||||
icon = QIcon(raw_icon)
|
||||
else:
|
||||
icon = QIcon()
|
||||
menu = QMenu(table)
|
||||
menu.setWindowFlags(
|
||||
menu.windowFlags()
|
||||
| Qt.WindowType.Popup
|
||||
| Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||
menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE)
|
||||
menu.setParent(table, Qt.WindowType.Popup)
|
||||
text = _("Remove from Favorites") if is_favorite else _("Add to Favorites")
|
||||
action = menu.addAction(icon, text)
|
||||
action.triggered.connect(lambda: self.toggle_setting_favorite(key, not is_favorite))
|
||||
menu.setActiveAction(action)
|
||||
menu.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
QTimer.singleShot(0, lambda: menu.setActiveAction(action))
|
||||
menu.exec(table.viewport().mapToGlobal(pos))
|
||||
|
||||
def handle_settings_context_menu(self) -> bool:
|
||||
"""Open favorite context menu for the current settings row."""
|
||||
table = self._get_current_settings_table()
|
||||
if table is None or table.currentRow() < 0:
|
||||
return False
|
||||
|
||||
column = table.currentColumn()
|
||||
if column < 0:
|
||||
column = 0
|
||||
index = table.model().index(table.currentRow(), column)
|
||||
if not index.isValid():
|
||||
return False
|
||||
|
||||
point = table.visualRect(index).center()
|
||||
self.show_setting_context_menu(table, point)
|
||||
return True
|
||||
|
||||
def toggle_setting_favorite(self, key: str, add: bool) -> None:
|
||||
"""Toggle favorite state for an executable setting."""
|
||||
favorites = list(self.exe_setting_favorites)
|
||||
if add and key not in favorites:
|
||||
favorites.append(key)
|
||||
elif not add and key in favorites:
|
||||
favorites.remove(key)
|
||||
else:
|
||||
return
|
||||
|
||||
self.exe_setting_favorites = favorites
|
||||
exe_settings_favorites_config.set_keys(favorites)
|
||||
self.populate_favorites()
|
||||
|
||||
def populate_favorites(self, select_tab: bool = False) -> None:
|
||||
"""Populate the favorites tab with selected settings."""
|
||||
self.favorites_table.setRowCount(0)
|
||||
self.favorites_table.verticalHeader().setVisible(False)
|
||||
for key in self.exe_setting_favorites:
|
||||
if key in self.toggle_settings:
|
||||
self._add_favorite_toggle_row(key)
|
||||
elif key in self.advanced_widgets:
|
||||
self._add_favorite_advanced_row(key)
|
||||
self.favorites_table.resizeRowsToContents()
|
||||
self._sync_favorites_table_columns()
|
||||
self._sync_favorites_tab_visibility(select_tab)
|
||||
if self.search_edit.text():
|
||||
self.filter_settings(self.search_edit.text())
|
||||
|
||||
def _sync_favorites_table_columns(self) -> None:
|
||||
source_table = self.settings_table
|
||||
for key in self.exe_setting_favorites:
|
||||
if key in self.advanced_widgets and key not in self.toggle_settings:
|
||||
source_table = self.advanced_table
|
||||
break
|
||||
|
||||
source_header = source_table.horizontalHeader()
|
||||
target_header = self.favorites_table.horizontalHeader()
|
||||
target_header.setSectionResizeMode(0, QHeaderView.ResizeMode.Fixed)
|
||||
target_header.setSectionResizeMode(1, QHeaderView.ResizeMode.Fixed)
|
||||
target_header.setSectionResizeMode(2, QHeaderView.ResizeMode.Stretch)
|
||||
target_header.resizeSection(0, source_header.sectionSize(0))
|
||||
target_header.resizeSection(1, source_header.sectionSize(1))
|
||||
|
||||
def _sync_favorites_tab_visibility(self, select_tab: bool) -> None:
|
||||
favorites_index = self.tab_widget.indexOf(self.favorites_tab)
|
||||
has_favorites = self.favorites_table.rowCount() > 0
|
||||
if has_favorites and favorites_index < 0:
|
||||
self.tab_widget.insertTab(0, self.favorites_tab, _("Favorites"))
|
||||
if not select_tab:
|
||||
return
|
||||
self.tab_widget.setCurrentIndex(0)
|
||||
self.favorites_table.setCurrentCell(0, 1)
|
||||
self.favorites_table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
elif has_favorites and select_tab:
|
||||
self.tab_widget.setCurrentIndex(0)
|
||||
self.favorites_table.setCurrentCell(0, 1)
|
||||
self.favorites_table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
elif not has_favorites and favorites_index >= 0:
|
||||
self.tab_widget.removeTab(favorites_index)
|
||||
|
||||
def _add_favorite_toggle_row(self, key: str) -> None:
|
||||
row = self.favorites_table.rowCount()
|
||||
self.favorites_table.insertRow(row)
|
||||
self._set_favorite_text_cells(
|
||||
row,
|
||||
key,
|
||||
format_setting_name_for_display(key),
|
||||
self.toggle_settings[key],
|
||||
)
|
||||
|
||||
source_widget = self._find_toggle_widget(key)
|
||||
checkbox = QCheckBox()
|
||||
checkbox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
checkbox.setChecked(source_widget.isChecked() if source_widget else False)
|
||||
checkbox.setEnabled(source_widget.isEnabled() if source_widget else False)
|
||||
checkbox.stateChanged.connect(
|
||||
lambda _state, widget=source_widget, cb=checkbox: self._sync_checkbox(widget, cb)
|
||||
)
|
||||
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)
|
||||
checkbox_container.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
checkbox_item = QTableWidgetItem()
|
||||
checkbox_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
self.favorites_table.setItem(row, 1, checkbox_item)
|
||||
self.favorites_table.setCellWidget(row, 1, checkbox_container)
|
||||
|
||||
def _add_favorite_advanced_row(self, key: str) -> None:
|
||||
setting = self.advanced_settings_by_key.get(key)
|
||||
source_widget = self.advanced_widgets.get(key)
|
||||
if setting is None or source_widget is None:
|
||||
return
|
||||
|
||||
row = self.favorites_table.rowCount()
|
||||
self.favorites_table.insertRow(row)
|
||||
self._set_favorite_text_cells(row, key, setting['name'], setting['description'])
|
||||
if isinstance(source_widget, QComboBox):
|
||||
self._add_favorite_combo(row, source_widget)
|
||||
elif isinstance(source_widget, QLineEdit):
|
||||
self._add_favorite_line_edit(row, source_widget)
|
||||
|
||||
def _set_favorite_text_cells(self, row: int, key: str, name: str, description: str) -> None:
|
||||
name_item = QTableWidgetItem(name)
|
||||
name_item.setData(Qt.ItemDataRole.UserRole, key)
|
||||
name_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
desc_item = QTableWidgetItem(description)
|
||||
desc_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
|
||||
desc_item.setTextAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
|
||||
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:
|
||||
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:
|
||||
return widget
|
||||
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())
|
||||
|
||||
def _add_favorite_combo(self, row: int, source_widget: QComboBox) -> None:
|
||||
combo = QComboBox()
|
||||
combo.setObjectName("settingsTableCombo")
|
||||
combo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
combo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
combo.setEditable(source_widget.isEditable())
|
||||
for index in range(source_widget.count()):
|
||||
combo.addItem(source_widget.itemText(index), source_widget.itemData(index))
|
||||
combo.setCurrentText(source_widget.currentText())
|
||||
combo.setEnabled(source_widget.isEnabled())
|
||||
settings_combo_style = getattr(self.theme, "SETTINGS_TABLE_COMBOBOX_STYLE", "")
|
||||
combo.setStyleSheet(
|
||||
self.theme.COMBOBOX_STYLE
|
||||
+ settings_combo_style
|
||||
+ self.theme.SCROLL_STYLE
|
||||
)
|
||||
combo.currentTextChanged.connect(source_widget.setCurrentText)
|
||||
self.favorites_table.setCellWidget(row, 1, combo)
|
||||
|
||||
def _add_favorite_line_edit(self, row: int, source_widget: QLineEdit) -> None:
|
||||
line_edit = QLineEdit()
|
||||
line_edit.setText(source_widget.text())
|
||||
line_edit.setPlaceholderText(source_widget.placeholderText())
|
||||
line_edit.setEnabled(source_widget.isEnabled())
|
||||
line_edit.setStyleSheet(source_widget.styleSheet() or self.theme.ADDGAME_INPUT_STYLE)
|
||||
line_edit.textChanged.connect(source_widget.setText)
|
||||
line_edit.installEventFilter(self)
|
||||
self.favorites_table.setCellWidget(row, 1, line_edit)
|
||||
|
||||
def init_virtual_keyboard(self):
|
||||
"""Initialize virtual keyboard."""
|
||||
self.keyboard = VirtualKeyboard(self, theme=self.theme, button_width=50)
|
||||
@@ -800,6 +1093,15 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
if text:
|
||||
self._gamepad_tooltip_map[widget] = text
|
||||
|
||||
def _select_checkbox_row(self, widget: QCheckBox) -> bool:
|
||||
for (row, column), checkbox in self.value_widgets.items():
|
||||
if checkbox != widget:
|
||||
continue
|
||||
self.settings_table.setCurrentCell(row, column)
|
||||
self.settings_table.selectRow(row)
|
||||
return True
|
||||
return False
|
||||
|
||||
def show_registered_gamepad_tooltip(self, widget: QWidget) -> bool:
|
||||
"""Show registered tooltip for the provided widget."""
|
||||
text = self._gamepad_tooltip_map.get(widget, "")
|
||||
@@ -819,6 +1121,18 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
def filter_settings(self, text):
|
||||
"""Filter settings based on search text."""
|
||||
search_text = text.lower()
|
||||
for row in range(self.favorites_table.rowCount()):
|
||||
name_item = self.favorites_table.item(row, 0)
|
||||
desc_item = self.favorites_table.item(row, 2)
|
||||
should_show = False
|
||||
|
||||
if name_item and search_text in name_item.text().lower():
|
||||
should_show = True
|
||||
elif desc_item and search_text in desc_item.text().lower():
|
||||
should_show = True
|
||||
|
||||
self.favorites_table.setRowHidden(row, not should_show)
|
||||
|
||||
for row in range(self.settings_table.rowCount()):
|
||||
name_item = self.settings_table.item(row, 0)
|
||||
desc_item = self.settings_table.item(row, 2)
|
||||
@@ -844,6 +1158,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
self.advanced_table.setRowHidden(row, not should_show)
|
||||
|
||||
self._filter_mangohud_settings(search_text)
|
||||
self._filter_vkbasalt_settings(search_text)
|
||||
self._filter_gamescope_settings(search_text)
|
||||
|
||||
def apply_changes(self):
|
||||
@@ -914,17 +1229,12 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
if self.gamescope_available:
|
||||
gamescope_changes = self._collect_gamescope_changes()
|
||||
changes.extend(mangohud_changes)
|
||||
changes.extend(self._collect_vkbasalt_changes())
|
||||
changes.extend(gamescope_changes)
|
||||
|
||||
# Check if PW_MANGOHUD or PW_GAMESCOPE toggle changes are already in the list
|
||||
has_mangohud_toggle = any(change.startswith("PW_MANGOHUD=") for change in mangohud_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)
|
||||
|
||||
# Only force-enable if there are other changes but no explicit toggle change
|
||||
if mangohud_changes and not has_mangohud_toggle:
|
||||
changes = [change for change in changes if not change.startswith("PW_MANGOHUD=")]
|
||||
changes.append("PW_MANGOHUD=1")
|
||||
|
||||
if gamescope_changes and not has_gamescope_toggle:
|
||||
changes = [change for change in changes if not change.startswith("PW_GAMESCOPE=")]
|
||||
changes.append("PW_GAMESCOPE=1")
|
||||
@@ -968,6 +1278,9 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
super().closeEvent(event)
|
||||
|
||||
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
|
||||
if isinstance(obj, QWidget) and self._handle_vkbasalt_key_button_event(obj, event):
|
||||
return True
|
||||
|
||||
action_buttons = (
|
||||
getattr(self, "apply_button", None),
|
||||
getattr(self, "cancel_button", None),
|
||||
@@ -997,6 +1310,9 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
if focused_widget not in self._gamepad_tooltip_map:
|
||||
self.show_gamepad_tooltip(show=False)
|
||||
|
||||
if isinstance(obj, QCheckBox) and event.type() == QEvent.Type.FocusIn:
|
||||
self._select_checkbox_row(obj)
|
||||
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
def show_gamepad_tooltip(self, show=True, text="", anchor_widget=None, anchor_global_pos=None):
|
||||
@@ -1057,7 +1373,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
_show_tooltip_at(anchor_widget.mapToGlobal(widget_rect.bottomLeft()))
|
||||
return
|
||||
|
||||
current_table = self.advanced_table if self.tab_widget.currentIndex() == 1 else self.settings_table
|
||||
current_table = self._get_current_settings_table()
|
||||
if current_table and current_table.currentRow() >= 0 and current_table.currentColumn() >= 0:
|
||||
row = current_table.currentRow()
|
||||
col = current_table.currentColumn()
|
||||
@@ -1072,8 +1388,8 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
|
||||
def get_current_description(self):
|
||||
"""Get the description text for the currently selected row."""
|
||||
current_table = self.advanced_table if self.tab_widget.currentIndex() == 1 else self.settings_table
|
||||
if self.tab_widget.currentIndex() == 2:
|
||||
current_table = self._get_current_settings_table()
|
||||
if current_table is None:
|
||||
return ""
|
||||
current_row = current_table.currentRow()
|
||||
if current_row >= 0:
|
||||
@@ -1115,11 +1431,11 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
|
||||
def on_table_selection_changed(self):
|
||||
"""Called when table selection changes to update the gamepad tooltip."""
|
||||
if self.tab_widget.currentIndex() == 2:
|
||||
current_table = self._get_current_settings_table()
|
||||
if current_table is None:
|
||||
self.show_gamepad_tooltip(show=False)
|
||||
return
|
||||
|
||||
current_table = self.advanced_table if self.tab_widget.currentIndex() == 1 else self.settings_table
|
||||
current_column = current_table.currentColumn() if current_table else -1
|
||||
if current_column != 2:
|
||||
self.show_gamepad_tooltip(show=False)
|
||||
@@ -1138,7 +1454,7 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting
|
||||
|
||||
def on_table_cell_hovered(self, row, column):
|
||||
"""Show custom tooltip on hover for description cells."""
|
||||
if self.tab_widget.currentIndex() == 2 or column != 2:
|
||||
if column != 2:
|
||||
self.show_gamepad_tooltip(show=False)
|
||||
return
|
||||
|
||||
|
||||
@@ -563,7 +563,7 @@ class GamescopeSettingsMixin:
|
||||
self.gamescope_actions_group = group
|
||||
|
||||
# Toggle button for PW_GAMESCOPE
|
||||
self.gamescope_enable_button = QPushButton(_("Enable Gamescope"))
|
||||
self.gamescope_enable_button = QPushButton(_("Enable {0}").format("Gamescope"))
|
||||
self.gamescope_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
self.gamescope_enable_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.gamescope_enable_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
@@ -765,10 +765,10 @@ class GamescopeSettingsMixin:
|
||||
visible = gamescope_enabled
|
||||
|
||||
if gamescope_enabled:
|
||||
self.gamescope_enable_button.setText(_("Disable Gamescope"))
|
||||
self.gamescope_enable_button.setText(_("Disable {0}").format("Gamescope"))
|
||||
self.gamescope_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_ACTIVE_STYLE)
|
||||
else:
|
||||
self.gamescope_enable_button.setText(_("Enable Gamescope"))
|
||||
self.gamescope_enable_button.setText(_("Enable {0}").format("Gamescope"))
|
||||
self.gamescope_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
|
||||
if self.gamescope_toggle_group is not None:
|
||||
|
||||
@@ -492,7 +492,7 @@ class MangoHudSettingsMixin:
|
||||
self.mangohud_actions_group = actions_group
|
||||
|
||||
# Toggle buttons for PW_MANGOHUD and PW_MANGOHUD_USER_CONF
|
||||
self.mangohud_enable_button = QPushButton(_("Enable MangoHud"))
|
||||
self.mangohud_enable_button = QPushButton(_("Enable {0}").format("MangoHud"))
|
||||
self.mangohud_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
self.mangohud_enable_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.mangohud_enable_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
@@ -790,7 +790,12 @@ class MangoHudSettingsMixin:
|
||||
"""Track focused MangoHud toggle checkbox and show tooltip."""
|
||||
if isinstance(new, QCheckBox) and self.show_registered_gamepad_tooltip(new):
|
||||
return
|
||||
if self.tab_widget.currentIndex() == 2:
|
||||
current_tab = self.tab_widget.currentWidget()
|
||||
if current_tab in (
|
||||
self.mangohud_tab,
|
||||
getattr(self, "vkbasalt_tab", None),
|
||||
getattr(self, "gamescope_tab", None),
|
||||
):
|
||||
self.show_gamepad_tooltip(show=False)
|
||||
|
||||
def _update_mangohud_category_stack_height(self):
|
||||
@@ -840,10 +845,10 @@ class MangoHudSettingsMixin:
|
||||
config_visible = mangohud_enabled and not mangohud_user_conf_enabled
|
||||
|
||||
if mangohud_enabled:
|
||||
self.mangohud_enable_button.setText(_("Disable MangoHud"))
|
||||
self.mangohud_enable_button.setText(_("Disable {0}").format("MangoHud"))
|
||||
self.mangohud_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_ACTIVE_STYLE)
|
||||
else:
|
||||
self.mangohud_enable_button.setText(_("Enable MangoHud"))
|
||||
self.mangohud_enable_button.setText(_("Enable {0}").format("MangoHud"))
|
||||
self.mangohud_enable_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
|
||||
self.mangohud_user_conf_button.setVisible(visible)
|
||||
|
||||
@@ -0,0 +1,372 @@
|
||||
"""vkBasalt settings support for executable settings dialog."""
|
||||
|
||||
import os
|
||||
from typing import Any, cast
|
||||
|
||||
from PySide6.QtCore import QEvent, Qt
|
||||
from PySide6.QtGui import QKeyEvent, QKeySequence
|
||||
from PySide6.QtWidgets import (
|
||||
QCheckBox,
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
QScrollArea,
|
||||
QSizePolicy,
|
||||
QSlider,
|
||||
QVBoxLayout,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.logger import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
VKBASALT_ENV_KEYS = [
|
||||
'PW_PLUGINS_VER',
|
||||
'PW_VKBASALT_EFFECTS',
|
||||
'PW_VKBASALT_FFX_CAS',
|
||||
'PW_VKBASALT_TOOGLE_KEY',
|
||||
]
|
||||
|
||||
|
||||
class VkBasaltSettingsMixin:
|
||||
"""Mixin with vkBasalt settings UI and serialization logic."""
|
||||
theme: Any
|
||||
current_settings: dict[str, str]
|
||||
original_values: dict[str, str]
|
||||
portproton_path: str | None
|
||||
vkbasalt_tab: QWidget
|
||||
vkbasalt_tab_layout: QVBoxLayout
|
||||
input_manager: Any
|
||||
sender: Any
|
||||
|
||||
def init_vkbasalt_state(self) -> None:
|
||||
self.vkbasalt_shader_widgets = {}
|
||||
self.vkbasalt_original_values = {}
|
||||
self.vkbasalt_actions_group = None
|
||||
self.vkbasalt_actions_layout = None
|
||||
self.vkbasalt_shaders_group = None
|
||||
self.vkbasalt_shaders_layout = None
|
||||
self.vkbasalt_cas_group = None
|
||||
self.vkbasalt_cas_label = None
|
||||
self.vkbasalt_toggle_key_label = None
|
||||
self.vkbasalt_toggle_key_button = None
|
||||
self.vkbasalt_toggle_key_waiting = False
|
||||
|
||||
def setup_vkbasalt_tab(self) -> None:
|
||||
"""Create vkBasalt tab widgets."""
|
||||
scroll = QScrollArea()
|
||||
scroll.setWidgetResizable(True)
|
||||
scroll.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
scroll.setStyleSheet(self.theme.SCROLL_STYLE + self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
container = QWidget()
|
||||
container.setStyleSheet(self.theme.TRANSPARENT_BACKGROUND_STYLE)
|
||||
layout = QVBoxLayout(container)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setSpacing(self.theme.exeSettingsGroupBoxBlockSpacing)
|
||||
|
||||
self._add_vkbasalt_actions_group(layout)
|
||||
self._add_vkbasalt_cas_group(layout)
|
||||
self._add_vkbasalt_shaders_group(layout)
|
||||
layout.addStretch()
|
||||
|
||||
scroll.setWidget(container)
|
||||
self.vkbasalt_tab_layout.addWidget(scroll)
|
||||
|
||||
def _add_vkbasalt_actions_group(self, parent_layout: QVBoxLayout) -> None:
|
||||
group = QGroupBox(_("Actions"))
|
||||
group.setStyleSheet(self.theme.QGROUP_BOX_STYLE)
|
||||
layout = QGridLayout(group)
|
||||
layout.setVerticalSpacing(self.theme.exeSettingsGroupBoxElementVerticalSpacing)
|
||||
layout.setHorizontalSpacing(self.theme.exeSettingsGroupBoxElementHorizontalSpacing)
|
||||
self.vkbasalt_actions_group = group
|
||||
self.vkbasalt_actions_layout = layout
|
||||
|
||||
self.vkbasalt_enable_button = self._create_vkbasalt_button(_("Enable {0}").format("vkBasalt"))
|
||||
self.vkbasalt_enable_button.clicked.connect(self.toggle_vkbasalt_enable)
|
||||
self.vkbasalt_user_conf_button = self._create_vkbasalt_button(_("Use system config"))
|
||||
self.vkbasalt_user_conf_button.clicked.connect(self.toggle_vkbasalt_user_conf)
|
||||
self.vkbasalt_toggle_key_button = self._create_vkbasalt_button("")
|
||||
self.vkbasalt_toggle_key_button.clicked.connect(self._start_vkbasalt_toggle_key_capture)
|
||||
self.vkbasalt_toggle_key_button.installEventFilter(cast(QWidget, self))
|
||||
self.vkbasalt_clear_button = self._create_vkbasalt_button(_("Clear"))
|
||||
self.vkbasalt_clear_button.clicked.connect(self.clear_vkbasalt_settings)
|
||||
layout.addWidget(self.vkbasalt_enable_button, 0, 0)
|
||||
layout.addWidget(self.vkbasalt_user_conf_button, 0, 1)
|
||||
layout.addWidget(self.vkbasalt_toggle_key_button, 1, 0)
|
||||
layout.addWidget(self.vkbasalt_clear_button, 1, 1)
|
||||
|
||||
parent_layout.addWidget(group)
|
||||
|
||||
def _add_vkbasalt_shaders_group(self, parent_layout: QVBoxLayout) -> None:
|
||||
group = QGroupBox(_("Shaders"))
|
||||
group.setStyleSheet(self.theme.QGROUP_BOX_STYLE)
|
||||
self.vkbasalt_shaders_layout = QGridLayout(group)
|
||||
self.vkbasalt_shaders_layout.setContentsMargins(0, 8, 0, 8)
|
||||
self.vkbasalt_shaders_layout.setHorizontalSpacing(0)
|
||||
self.vkbasalt_shaders_layout.setVerticalSpacing(self.theme.mangoHudSwitchesVerticalSpacing)
|
||||
self.vkbasalt_shaders_group = group
|
||||
|
||||
columns = self.theme.mangoHudSwitchesColumns
|
||||
for col in range(columns * 2 + 1):
|
||||
self.vkbasalt_shaders_layout.setColumnStretch(col, 1 if col % 2 == 0 else 0)
|
||||
|
||||
parent_layout.addWidget(group)
|
||||
|
||||
def _add_vkbasalt_cas_group(self, parent_layout: QVBoxLayout) -> None:
|
||||
group = QGroupBox(_("AMD FidelityFX - Contrast Adaptive Sharpening"))
|
||||
group.setStyleSheet(self.theme.QGROUP_BOX_STYLE)
|
||||
layout = QVBoxLayout(group)
|
||||
layout.setSpacing(self.theme.exeSettingsGroupBoxElementHorizontalSpacing)
|
||||
self.vkbasalt_cas_group = group
|
||||
self.vkbasalt_cas_label = QLabel()
|
||||
self.vkbasalt_cas_label.setWordWrap(True)
|
||||
layout.addWidget(self.vkbasalt_cas_label)
|
||||
|
||||
self.vkbasalt_cas_slider = QSlider(Qt.Orientation.Horizontal)
|
||||
self.vkbasalt_cas_slider.setRange(0, 100)
|
||||
self.vkbasalt_cas_slider.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.vkbasalt_cas_slider.setStyleSheet(self.theme.SLIDER_SIZE_STYLE)
|
||||
self.vkbasalt_cas_slider.valueChanged.connect(self._update_vkbasalt_cas_label)
|
||||
layout.addWidget(self.vkbasalt_cas_slider)
|
||||
|
||||
parent_layout.addWidget(group)
|
||||
|
||||
def _create_vkbasalt_button(self, label: str) -> QPushButton:
|
||||
button = QPushButton(label)
|
||||
button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
return button
|
||||
|
||||
def _create_vkbasalt_checkbox(self, label: str) -> QCheckBox:
|
||||
checkbox = QCheckBox(label)
|
||||
checkbox.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
checkbox.installEventFilter(cast(QWidget, self))
|
||||
checkbox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
return checkbox
|
||||
|
||||
def _get_vkbasalt_shader_names(self) -> list[str]:
|
||||
shaders = self._get_vkbasalt_plugins_shader_names()
|
||||
if shaders:
|
||||
return shaders
|
||||
logger.warning("vkBasalt ReShade shaders not found for PW_PLUGINS_VER")
|
||||
return []
|
||||
|
||||
def _get_vkbasalt_plugins_shader_names(self) -> list[str]:
|
||||
if not self.portproton_path:
|
||||
return []
|
||||
|
||||
tmp_path = os.path.join(self.portproton_path, "data", "tmp")
|
||||
plugins_ver = self.current_settings.get('PW_PLUGINS_VER', '').strip()
|
||||
if not plugins_ver:
|
||||
return []
|
||||
|
||||
shader_dirs = [os.path.join(tmp_path, f"plugins{plugins_ver}", "reshade", "shaders")]
|
||||
for shader_dir in shader_dirs:
|
||||
shaders = self._read_vkbasalt_shader_dir(shader_dir)
|
||||
if shaders:
|
||||
return shaders
|
||||
return []
|
||||
|
||||
def _read_vkbasalt_shader_dir(self, shader_dir: str) -> list[str]:
|
||||
try:
|
||||
shader_files = os.listdir(shader_dir)
|
||||
except OSError:
|
||||
return []
|
||||
shaders = [
|
||||
os.path.splitext(name)[0]
|
||||
for name in shader_files
|
||||
if name.endswith(".fx") and os.path.isfile(os.path.join(shader_dir, name))
|
||||
]
|
||||
return sorted(shaders, key=str.casefold)
|
||||
|
||||
def populate_vkbasalt(self) -> None:
|
||||
"""Populate vkBasalt tab from current settings."""
|
||||
self._populate_vkbasalt_shader_widgets()
|
||||
effects = self._parse_vkbasalt_effects(
|
||||
self.current_settings.get('PW_VKBASALT_EFFECTS', 'Curves:cas')
|
||||
)
|
||||
for shader, checkbox in self.vkbasalt_shader_widgets.items():
|
||||
checkbox.setChecked(shader in effects)
|
||||
|
||||
cas_value = self._parse_vkbasalt_cas(self.current_settings.get('PW_VKBASALT_FFX_CAS', '0.50'))
|
||||
self.vkbasalt_cas_slider.setValue(cas_value)
|
||||
self._update_vkbasalt_cas_label()
|
||||
toggle_key = self.current_settings.get('PW_VKBASALT_TOOGLE_KEY', 'Home')
|
||||
self._set_vkbasalt_toggle_key(toggle_key)
|
||||
self._update_vkbasalt_toggle_key_visibility()
|
||||
self.vkbasalt_original_values = {
|
||||
'PW_VKBASALT_EFFECTS': self.current_settings.get('PW_VKBASALT_EFFECTS', 'Curves:cas'),
|
||||
'PW_VKBASALT_FFX_CAS': self.current_settings.get('PW_VKBASALT_FFX_CAS', '0.50'),
|
||||
'PW_VKBASALT_TOOGLE_KEY': toggle_key,
|
||||
}
|
||||
self._update_vkbasalt_toggle_buttons()
|
||||
|
||||
def _populate_vkbasalt_shader_widgets(self) -> None:
|
||||
if self.vkbasalt_shader_widgets or self.vkbasalt_shaders_layout is None:
|
||||
return
|
||||
|
||||
columns = self.theme.mangoHudSwitchesColumns
|
||||
shader_names = self._get_vkbasalt_shader_names()
|
||||
for index, shader in enumerate(shader_names):
|
||||
checkbox = self._create_vkbasalt_checkbox(shader)
|
||||
row = index // columns
|
||||
real_col = (index % columns) * 2 + 1
|
||||
self.vkbasalt_shaders_layout.addWidget(checkbox, row, real_col)
|
||||
self.vkbasalt_shader_widgets[shader] = checkbox
|
||||
|
||||
def _parse_vkbasalt_effects(self, effects_text: str) -> set[str]:
|
||||
return {effect.strip() for effect in effects_text.split(':') if effect.strip()}
|
||||
|
||||
def _parse_vkbasalt_cas(self, value: str) -> int:
|
||||
try:
|
||||
return max(0, min(100, round(float(value) * 100)))
|
||||
except ValueError:
|
||||
return 50
|
||||
|
||||
def _update_vkbasalt_cas_label(self) -> None:
|
||||
if self.vkbasalt_cas_label is None:
|
||||
return
|
||||
self.vkbasalt_cas_label.setText(_("Sharpness: {0}").format(self._get_vkbasalt_cas_percent()))
|
||||
|
||||
def _get_vkbasalt_cas_percent(self) -> int:
|
||||
return self.vkbasalt_cas_slider.value()
|
||||
|
||||
def _update_vkbasalt_toggle_buttons(self) -> None:
|
||||
vkbasalt_enabled = self.current_settings.get('PW_VKBASALT') == '1'
|
||||
user_conf_enabled = self.current_settings.get('PW_VKBASALT_USER_CONF') == '1'
|
||||
config_visible = vkbasalt_enabled and not user_conf_enabled
|
||||
|
||||
self._update_vkbasalt_button(self.vkbasalt_enable_button, vkbasalt_enabled)
|
||||
self.vkbasalt_enable_button.setText(
|
||||
_("Disable {0}").format("vkBasalt") if vkbasalt_enabled else _("Enable {0}").format("vkBasalt")
|
||||
)
|
||||
self.vkbasalt_user_conf_button.setVisible(vkbasalt_enabled)
|
||||
self._update_vkbasalt_button(self.vkbasalt_user_conf_button, user_conf_enabled)
|
||||
self.vkbasalt_user_conf_button.setText(
|
||||
_("Don't use system config") if user_conf_enabled else _("Use system config")
|
||||
)
|
||||
self.vkbasalt_clear_button.setVisible(vkbasalt_enabled)
|
||||
self._update_vkbasalt_toggle_key_visibility()
|
||||
for group in (self.vkbasalt_shaders_group, self.vkbasalt_cas_group):
|
||||
if group is not None:
|
||||
group.setVisible(config_visible)
|
||||
|
||||
def _update_vkbasalt_button(self, button: QPushButton, active: bool) -> None:
|
||||
style = self.theme.ACTION_BUTTON_ACTIVE_STYLE if active else self.theme.ACTION_BUTTON_STYLE
|
||||
button.setStyleSheet(style)
|
||||
|
||||
def _start_vkbasalt_toggle_key_capture(self) -> None:
|
||||
self.vkbasalt_toggle_key_waiting = True
|
||||
if self.vkbasalt_toggle_key_button is None:
|
||||
return
|
||||
self.vkbasalt_toggle_key_button.setText(_("Press a button to choose"))
|
||||
self.vkbasalt_toggle_key_button.grabKeyboard()
|
||||
|
||||
def _set_vkbasalt_toggle_key(self, key_name: str) -> None:
|
||||
self.current_settings['PW_VKBASALT_TOOGLE_KEY'] = key_name or 'Home'
|
||||
if self.vkbasalt_toggle_key_button is not None:
|
||||
self.vkbasalt_toggle_key_button.setText(
|
||||
_("Toggle key: {0}").format(self.current_settings['PW_VKBASALT_TOOGLE_KEY'])
|
||||
)
|
||||
|
||||
def _update_vkbasalt_toggle_key_visibility(self, _action: str | None = None) -> None:
|
||||
input_manager = getattr(self, 'input_manager', None)
|
||||
vkbasalt_enabled = self.current_settings.get('PW_VKBASALT') == '1'
|
||||
visible = vkbasalt_enabled and not (input_manager and getattr(input_manager, 'gamepad', None) is not None)
|
||||
if self.vkbasalt_toggle_key_label is not None:
|
||||
self.vkbasalt_toggle_key_label.setVisible(visible)
|
||||
if self.vkbasalt_toggle_key_button is None:
|
||||
return
|
||||
self.vkbasalt_toggle_key_button.setVisible(visible)
|
||||
if self.vkbasalt_actions_layout is not None:
|
||||
clear_column = 1 if visible else 0
|
||||
self.vkbasalt_actions_layout.addWidget(self.vkbasalt_clear_button, 1, clear_column)
|
||||
focus_policy = Qt.FocusPolicy.StrongFocus if visible else Qt.FocusPolicy.NoFocus
|
||||
self.vkbasalt_toggle_key_button.setFocusPolicy(focus_policy)
|
||||
if not visible and self.vkbasalt_toggle_key_waiting:
|
||||
self.vkbasalt_toggle_key_waiting = False
|
||||
self.vkbasalt_toggle_key_button.releaseKeyboard()
|
||||
|
||||
def _handle_vkbasalt_key_button_event(self, obj: QWidget, event: QEvent) -> bool:
|
||||
button = self.vkbasalt_toggle_key_button
|
||||
if button is None or obj is not button:
|
||||
return False
|
||||
if event.type() != QEvent.Type.KeyPress or not self.vkbasalt_toggle_key_waiting:
|
||||
return False
|
||||
|
||||
key_event = cast(QKeyEvent, event)
|
||||
key_name = QKeySequence(key_event.key()).toString()
|
||||
if key_name:
|
||||
self._set_vkbasalt_toggle_key(key_name)
|
||||
self.vkbasalt_toggle_key_waiting = False
|
||||
button.releaseKeyboard()
|
||||
return True
|
||||
|
||||
def toggle_vkbasalt_enable(self) -> None:
|
||||
current_val = self.current_settings.get('PW_VKBASALT', '0')
|
||||
self.current_settings['PW_VKBASALT'] = '0' if current_val == '1' else '1'
|
||||
self._update_vkbasalt_toggle_buttons()
|
||||
|
||||
def toggle_vkbasalt_user_conf(self) -> None:
|
||||
current_val = self.current_settings.get('PW_VKBASALT_USER_CONF', '0')
|
||||
self.current_settings['PW_VKBASALT_USER_CONF'] = '0' if current_val == '1' else '1'
|
||||
self._update_vkbasalt_toggle_buttons()
|
||||
|
||||
def _build_vkbasalt_effects(self) -> str:
|
||||
effects = [
|
||||
shader for shader, checkbox in self.vkbasalt_shader_widgets.items()
|
||||
if checkbox.isChecked()
|
||||
]
|
||||
if self._get_vkbasalt_cas_percent() > 0:
|
||||
effects.append('cas')
|
||||
return ':'.join(effects)
|
||||
|
||||
def clear_vkbasalt_settings(self) -> None:
|
||||
for checkbox in self.vkbasalt_shader_widgets.values():
|
||||
checkbox.setChecked(False)
|
||||
self.vkbasalt_cas_slider.setValue(0)
|
||||
self._update_vkbasalt_cas_label()
|
||||
self._set_vkbasalt_toggle_key('Home')
|
||||
|
||||
def _collect_vkbasalt_changes(self) -> list[str]:
|
||||
changes = []
|
||||
original_values = cast(dict[str, str], getattr(self, 'original_values', {}))
|
||||
for key in ('PW_VKBASALT', 'PW_VKBASALT_USER_CONF'):
|
||||
new_val = '1' if self.current_settings.get(key) == '1' else '0'
|
||||
orig_val = '1' if original_values.get(key) == '1' else '0'
|
||||
if new_val != orig_val:
|
||||
changes.append(f"{key}={new_val}")
|
||||
|
||||
effects = self._build_vkbasalt_effects()
|
||||
if effects != self.vkbasalt_original_values.get('PW_VKBASALT_EFFECTS', ''):
|
||||
changes.append(f"PW_VKBASALT_EFFECTS={effects}")
|
||||
cas_value = f"{self._get_vkbasalt_cas_percent() / 100:.2f}"
|
||||
if cas_value != self.vkbasalt_original_values.get('PW_VKBASALT_FFX_CAS', ''):
|
||||
changes.append(f"PW_VKBASALT_FFX_CAS={cas_value}")
|
||||
toggle_key = self.current_settings.get('PW_VKBASALT_TOOGLE_KEY', 'Home')
|
||||
if toggle_key != self.vkbasalt_original_values.get('PW_VKBASALT_TOOGLE_KEY', ''):
|
||||
changes.append(f"PW_VKBASALT_TOOGLE_KEY={toggle_key}")
|
||||
return changes
|
||||
|
||||
def _filter_vkbasalt_settings(self, search_text: str) -> None:
|
||||
vkbasalt_enabled = self.current_settings.get('PW_VKBASALT') == '1'
|
||||
user_conf_enabled = self.current_settings.get('PW_VKBASALT_USER_CONF') == '1'
|
||||
config_visible = vkbasalt_enabled and not user_conf_enabled
|
||||
for group_box in self.vkbasalt_tab.findChildren(QGroupBox):
|
||||
if not config_visible:
|
||||
group_box.setVisible(group_box is self.vkbasalt_actions_group)
|
||||
continue
|
||||
if not search_text:
|
||||
group_box.setVisible(True)
|
||||
continue
|
||||
content_text = self._get_vkbasalt_group_text(group_box)
|
||||
group_box.setVisible(search_text in group_box.title().lower() or search_text in content_text)
|
||||
|
||||
def _get_vkbasalt_group_text(self, group_box: QGroupBox) -> str:
|
||||
label_text = ' '.join(widget.text().lower() for widget in group_box.findChildren(QLabel))
|
||||
checkbox_text = ' '.join(widget.text().lower() for widget in group_box.findChildren(QCheckBox))
|
||||
return f"{label_text} {checkbox_text}"
|
||||
@@ -20,7 +20,6 @@ from portprotonqt.logger import get_logger
|
||||
from portprotonqt.theme_manager import ThemeManager
|
||||
from portprotonqt.custom_widgets import AutoSizeButton
|
||||
from portprotonqt.dialogs.base import DraggableDialog
|
||||
from portprotonqt.downloader import Downloader
|
||||
from portprotonqt.preloader import Preloader
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.dialogs.dialog_utils import create_dialog_hints_widget, update_dialog_hints
|
||||
@@ -37,13 +36,11 @@ class WinetricksDialog(DraggableDialog):
|
||||
self.theme = theme if theme else theme_manager.apply_theme(ui_config.get_theme())
|
||||
self.prefix_path: str | None = prefix_path
|
||||
self.wine_use: str | None = wine_use
|
||||
self.start_sh: list[str] | None = None
|
||||
self.portproton_path = get_portproton_location()
|
||||
if self.portproton_path is None:
|
||||
logger.error("PortProton location not found")
|
||||
return
|
||||
self.tmp_path = os.path.join(self.portproton_path, "data", "tmp")
|
||||
os.makedirs(self.tmp_path, exist_ok=True)
|
||||
self.winetricks_path = os.path.join(self.tmp_path, "winetricks")
|
||||
if self.prefix_path is None:
|
||||
logger.error("Prefix path not provided")
|
||||
return
|
||||
@@ -52,15 +49,20 @@ class WinetricksDialog(DraggableDialog):
|
||||
if not os.path.exists(self.log_path):
|
||||
open(self.log_path, 'a').close()
|
||||
|
||||
self.downloader = Downloader(max_workers=4)
|
||||
self.apply_process: QProcess | None = None
|
||||
self.list_processes: dict[str, QProcess] = {}
|
||||
parent_obj = self.parent()
|
||||
while parent_obj:
|
||||
if hasattr(parent_obj, 'start_sh'):
|
||||
self.start_sh = cast("MainWindow", parent_obj).start_sh
|
||||
break
|
||||
parent_obj = parent_obj.parent()
|
||||
|
||||
self.setWindowTitle(_("Prefix Manager"))
|
||||
self.setModal(True)
|
||||
self.resize(700, 700)
|
||||
self.setStyleSheet(self.theme.MAIN_WINDOW_STYLE + self.theme.MESSAGE_BOX_STYLE)
|
||||
|
||||
self.update_winetricks()
|
||||
self.setup_ui()
|
||||
self.load_lists()
|
||||
|
||||
@@ -92,75 +94,6 @@ class WinetricksDialog(DraggableDialog):
|
||||
)
|
||||
update_dialog_hints(self.hints_labels, self.main_window, self.input_manager, theme_manager, self.current_theme_name)
|
||||
|
||||
def update_winetricks(self):
|
||||
"""Update the winetricks script."""
|
||||
url = "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
|
||||
temp_path = os.path.join(self.tmp_path, "winetricks_temp")
|
||||
|
||||
try:
|
||||
if not self.downloader.download(url, temp_path):
|
||||
logger.warning("Failed to download external winetricks version")
|
||||
if os.path.exists(temp_path):
|
||||
os.remove(temp_path)
|
||||
return
|
||||
with open(temp_path) as f:
|
||||
ext_content = f.read()
|
||||
ext_ver_match = re.search(r'WINETRICKS_VERSION\s*=\s*[\'"]?([^\'"\s]+)', ext_content)
|
||||
ext_ver = ext_ver_match.group(1) if ext_ver_match else None
|
||||
logger.info(f"External winetricks version: {ext_ver}")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to get external version: {e}")
|
||||
ext_ver = None
|
||||
if os.path.exists(temp_path):
|
||||
os.remove(temp_path)
|
||||
return
|
||||
|
||||
int_ver = None
|
||||
if os.path.exists(self.winetricks_path):
|
||||
try:
|
||||
with open(self.winetricks_path) as f:
|
||||
int_content = f.read()
|
||||
int_ver_match = re.search(r'WINETRICKS_VERSION\s*=\s*[\'"]?([^\'"\s]+)', int_content)
|
||||
int_ver = int_ver_match.group(1) if int_ver_match else None
|
||||
logger.info(f"Internal winetricks version: {int_ver}")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to read internal winetricks version: {e}")
|
||||
|
||||
update_needed = not os.path.exists(self.winetricks_path) or (int_ver != ext_ver and ext_ver)
|
||||
|
||||
if update_needed:
|
||||
try:
|
||||
self.downloader.download(url, self.winetricks_path)
|
||||
os.chmod(self.winetricks_path, 0o755)
|
||||
logger.info(f"Winetricks updated to version {ext_ver}")
|
||||
self.apply_modifications(self.winetricks_path)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to update winetricks: {e}")
|
||||
elif os.path.exists(self.winetricks_path):
|
||||
self.apply_modifications(self.winetricks_path)
|
||||
|
||||
if os.path.exists(temp_path):
|
||||
os.remove(temp_path)
|
||||
|
||||
def apply_modifications(self, file_path):
|
||||
"""Apply custom modifications to the winetricks script."""
|
||||
if not os.path.exists(file_path):
|
||||
return
|
||||
try:
|
||||
with open(file_path) as f:
|
||||
content = f.read()
|
||||
|
||||
content = re.sub(r'w_metadata vcrun2015 dlls \\', r'w_metadata !dont_use_2015! dlls \\', content)
|
||||
content = re.sub(r'w_metadata vcrun2017 dlls \\', r'w_metadata !dont_use_2017! dlls \\', content)
|
||||
content = re.sub(r'w_metadata vcrun2019 dlls \\', r'w_metadata !dont_use_2019! dlls \\', content)
|
||||
content = re.sub(r'w_set_winver win2k3', r'w_set_winver win7', content)
|
||||
|
||||
with open(file_path, 'w') as f:
|
||||
f.write(content)
|
||||
logger.info("Winetricks modifications applied")
|
||||
except Exception as e:
|
||||
logger.error(f"Error applying modifications to winetricks: {e}")
|
||||
|
||||
def setup_ui(self):
|
||||
"""Set up the user interface with tabs and tables."""
|
||||
self.main_layout = QVBoxLayout(self)
|
||||
@@ -301,56 +234,84 @@ class WinetricksDialog(DraggableDialog):
|
||||
|
||||
def load_lists(self):
|
||||
"""Load and populate the lists for DLLs, Fonts, and Settings."""
|
||||
if not os.path.exists(self.winetricks_path):
|
||||
if self.start_sh is None or self.wine_use is None:
|
||||
QMessageBox.warning(self, _("Error"), _("Winetricks not found. Please try again."))
|
||||
self.reject()
|
||||
return
|
||||
|
||||
assert self.prefix_path is not None
|
||||
env = QProcessEnvironment.systemEnvironment()
|
||||
env.insert("WINEPREFIX", self.prefix_path)
|
||||
env.insert("WINETRICKS_DOWNLOADER", "curl")
|
||||
if self.wine_use is not None:
|
||||
env.insert("WINE", self.wine_use)
|
||||
|
||||
cwd = os.path.dirname(self.winetricks_path)
|
||||
|
||||
self.containers["dlls"].setCurrentIndex(0)
|
||||
self._start_list_process("dlls", self.dll_table, self.get_dll_exclusions(), env, cwd)
|
||||
|
||||
self.containers["fonts"].setCurrentIndex(0)
|
||||
self._start_list_process("fonts", self.fonts_table, self.get_fonts_exclusions(), env, cwd)
|
||||
|
||||
self.containers["settings"].setCurrentIndex(0)
|
||||
self._start_list_process("settings", self.settings_table, self.get_settings_exclusions(), env, cwd)
|
||||
self._start_list_all_process(env)
|
||||
|
||||
def _start_list_process(self, category, table, exclusion_pattern, env, cwd):
|
||||
"""Start QProcess for list."""
|
||||
def _start_list_all_process(self, env: QProcessEnvironment) -> None:
|
||||
"""Start QProcess for all winetricks lists."""
|
||||
assert self.prefix_path is not None
|
||||
assert self.start_sh is not None
|
||||
assert self.wine_use is not None
|
||||
process = QProcess(self)
|
||||
process.setProcessChannelMode(QProcess.ProcessChannelMode.MergedChannels)
|
||||
process.setProcessEnvironment(env)
|
||||
process.finished.connect(
|
||||
lambda exit_code, exit_status: self._on_list_finished(category, table, exclusion_pattern, process, exit_code, exit_status)
|
||||
lambda exit_code, exit_status: self._on_list_all_finished(process, exit_code, exit_status)
|
||||
)
|
||||
process.start(self.winetricks_path, [category, "list"])
|
||||
prefix_name = os.path.basename(self.prefix_path.rstrip(os.sep))
|
||||
args = self.start_sh[1:] + ["cli", "--winetricks-list-all", self.wine_use, prefix_name]
|
||||
self.list_processes["all"] = process
|
||||
process.start(self.start_sh[0], args)
|
||||
|
||||
def _on_list_finished(self, category, table, exclusion_pattern, process: QProcess | None, exit_code, exit_status):
|
||||
"""Handle list completion."""
|
||||
if process is None:
|
||||
logger.error(f"Process is None for {category}")
|
||||
self.containers[category].setCurrentIndex(1)
|
||||
return
|
||||
def _on_list_all_finished(
|
||||
self, process: QProcess, exit_code: int, exit_status: QProcess.ExitStatus
|
||||
) -> None:
|
||||
"""Handle all lists completion."""
|
||||
output = bytes(process.readAllStandardOutput().data()).decode('utf-8', 'ignore')
|
||||
error_output = bytes(process.readAllStandardError().data()).decode('utf-8', 'ignore')
|
||||
if exit_code == 0 and exit_status == QProcess.ExitStatus.NormalExit:
|
||||
self.populate_table(table, output, exclusion_pattern, self.log_path)
|
||||
if table.rowCount() > 0:
|
||||
table.setCurrentCell(0, 0)
|
||||
table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
self._log_process_warnings(error_output)
|
||||
sections = self._split_list_output(output)
|
||||
self.populate_table(
|
||||
self.dll_table, sections.get("dlls", ""), self.get_dll_exclusions(), self.log_path
|
||||
)
|
||||
self.populate_table(
|
||||
self.fonts_table, sections.get("fonts", ""), self.get_fonts_exclusions(), self.log_path
|
||||
)
|
||||
self.populate_table(
|
||||
self.settings_table, sections.get("settings", ""), self.get_settings_exclusions(), self.log_path
|
||||
)
|
||||
for table in [self.dll_table, self.fonts_table, self.settings_table]:
|
||||
if table.rowCount() > 0:
|
||||
table.setCurrentCell(0, 0)
|
||||
else:
|
||||
error_output = bytes(process.readAllStandardError().data()).decode('utf-8', 'ignore')
|
||||
logger.error(f"Failed to list {category}: {error_output}")
|
||||
logger.error(f"Failed to list winetricks: {error_output}")
|
||||
|
||||
self.containers[category].setCurrentIndex(1)
|
||||
self.list_processes.pop("all", None)
|
||||
process.deleteLater()
|
||||
for category in ["dlls", "fonts", "settings"]:
|
||||
self.containers[category].setCurrentIndex(1)
|
||||
|
||||
def _log_process_warnings(self, error_output: str) -> None:
|
||||
"""Log suspicious stderr lines from helper scripts."""
|
||||
patterns = ("error", "failed", "syntax", "ошибка", "синтакс")
|
||||
for line in error_output.splitlines():
|
||||
clean_line = line.strip()
|
||||
if not clean_line:
|
||||
continue
|
||||
if any(pattern in clean_line.lower() for pattern in patterns):
|
||||
logger.warning("Winetricks list warning: %s", clean_line)
|
||||
|
||||
def _split_list_output(self, output: str) -> dict[str, str]:
|
||||
"""Split combined winetricks output by category markers."""
|
||||
sections: dict[str, list[str]] = {}
|
||||
category = ""
|
||||
for line in output.splitlines():
|
||||
if line.startswith("__PORTPROTONQT_WINETRICKS_SECTION__:"):
|
||||
category = line.rsplit(":", 1)[1]
|
||||
sections[category] = []
|
||||
continue
|
||||
if category:
|
||||
sections[category].append(line)
|
||||
return {key: "\n".join(lines) for key, lines in sections.items()}
|
||||
|
||||
def get_dll_exclusions(self):
|
||||
"""Get regex pattern for DLL exclusions."""
|
||||
@@ -379,6 +340,7 @@ class WinetricksDialog(DraggableDialog):
|
||||
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
line = re.sub(r'(?:\x1b|\033)?\[[0-9;]*m', '', line).strip()
|
||||
if not line or re.search(exclusion_pattern, line, re.I):
|
||||
continue
|
||||
|
||||
@@ -446,10 +408,9 @@ class WinetricksDialog(DraggableDialog):
|
||||
def _start_install_process(self, selected, force):
|
||||
"""Start QProcess for install."""
|
||||
assert self.prefix_path is not None
|
||||
if self.start_sh is None or self.wine_use is None:
|
||||
return
|
||||
env = QProcessEnvironment.systemEnvironment()
|
||||
env.insert("WINEPREFIX", self.prefix_path)
|
||||
if self.wine_use is not None:
|
||||
env.insert("WINE", self.wine_use)
|
||||
|
||||
self.apply_process = QProcess(self)
|
||||
self.apply_process.setProcessChannelMode(QProcess.ProcessChannelMode.MergedChannels)
|
||||
@@ -458,8 +419,16 @@ class WinetricksDialog(DraggableDialog):
|
||||
self.apply_process.finished.connect(
|
||||
lambda exit_code, exit_status: self._on_install_finished(exit_code, exit_status, selected)
|
||||
)
|
||||
args = ["--unattended"] + (["--force"] if force else []) + selected
|
||||
self.apply_process.start(self.winetricks_path, args)
|
||||
prefix_name = os.path.basename(self.prefix_path.rstrip(os.sep))
|
||||
force_arg = "--force" if force else "--no-force"
|
||||
args = self.start_sh[1:] + [
|
||||
"cli",
|
||||
"--winetricks-install",
|
||||
self.wine_use,
|
||||
prefix_name,
|
||||
force_arg,
|
||||
] + selected
|
||||
self.apply_process.start(self.start_sh[0], args)
|
||||
|
||||
def _on_ready_read(self):
|
||||
"""Handle ready read for install process."""
|
||||
@@ -506,14 +475,30 @@ class WinetricksDialog(DraggableDialog):
|
||||
self.log_output.append(message)
|
||||
self.log_output.moveCursor(QTextCursor.MoveOperation.End)
|
||||
|
||||
def _stop_processes(self):
|
||||
"""Stop running child processes."""
|
||||
processes = list(self.list_processes.values())
|
||||
if self.apply_process is not None:
|
||||
processes.append(self.apply_process)
|
||||
|
||||
for process in processes:
|
||||
if process.state() == QProcess.ProcessState.NotRunning:
|
||||
continue
|
||||
process.terminate()
|
||||
if not process.waitForFinished(1000):
|
||||
process.kill()
|
||||
self.list_processes.clear()
|
||||
|
||||
def closeEvent(self, event):
|
||||
"""Disable mode on close."""
|
||||
self._stop_processes()
|
||||
if self.input_manager:
|
||||
self.input_manager.disable_winetricks_mode()
|
||||
super().closeEvent(event)
|
||||
|
||||
def reject(self):
|
||||
"""Disable mode on reject."""
|
||||
self._stop_processes()
|
||||
if self.input_manager:
|
||||
self.input_manager.disable_winetricks_mode()
|
||||
super().reject()
|
||||
@@ -21,6 +21,7 @@ SVCD_SUB_HEADERS = (
|
||||
b"\x00\x00\x89\x00\x00\x00\x89\x00",
|
||||
)
|
||||
UDF_SIGNATURES = (b"BEA01", b"BOOT2", b"CD001", b"CDW02", b"NSR02", b"NSR03", b"TEA01")
|
||||
CONVERTIBLE_DISC_EXTENSIONS = (".mdf", ".nrg")
|
||||
|
||||
|
||||
class DiscImageManager:
|
||||
@@ -300,7 +301,10 @@ class DiscImageManager:
|
||||
logger.error("7zz or 7z is required to extract MDF set %s", mdf_path)
|
||||
return None
|
||||
|
||||
mdf_sources = self._get_mdf_sources(normalized_mdf)
|
||||
if normalized_mdf.lower().endswith(".mdf"):
|
||||
mdf_sources = self._get_mdf_sources(normalized_mdf)
|
||||
else:
|
||||
mdf_sources = [normalized_mdf]
|
||||
source_stamp = self._get_disc_source_stamp(mdf_sources)
|
||||
if not source_stamp:
|
||||
return None
|
||||
@@ -338,7 +342,7 @@ class DiscImageManager:
|
||||
def sync_iso_to_rw(self, iso_path: str) -> str | None:
|
||||
"""Extract disc image content to writable runtime directory if source changed."""
|
||||
normalized_iso = os.path.abspath(os.path.expanduser(iso_path))
|
||||
if normalized_iso.lower().endswith(".mdf"):
|
||||
if normalized_iso.lower().endswith(CONVERTIBLE_DISC_EXTENSIONS):
|
||||
return self._sync_mdf_set_to_rw(normalized_iso)
|
||||
rw_root = self._iso_rw_paths.get(normalized_iso, self._get_iso_rw_root(normalized_iso))
|
||||
os.makedirs(rw_root, exist_ok=True)
|
||||
|
||||
@@ -67,6 +67,7 @@ class GameCard(QFrame):
|
||||
self.anticheat_status = anticheat_status
|
||||
self.anticheat_slug = anticheat_slug or ""
|
||||
self.game_source = game_source
|
||||
self.autoinstall_exe_name = ""
|
||||
self.last_launch_ts = last_launch_ts
|
||||
self.playtime_seconds = playtime_seconds
|
||||
self.base_card_width = card_width
|
||||
@@ -779,6 +780,7 @@ class GameCard(QFrame):
|
||||
"game_source": self.game_source,
|
||||
"anticheat_status": self.anticheat_status,
|
||||
"anticheat_slug": self.anticheat_slug,
|
||||
"autoinstall_exe_name": getattr(self, "autoinstall_exe_name", ""),
|
||||
}
|
||||
self.select_callback(game_data)
|
||||
super().mousePressEvent(event)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import Protocol
|
||||
from portprotonqt.game_card import GameCard
|
||||
from portprotonqt.search_utils import SearchOptimizer, ThreadedSearch
|
||||
from PySide6.QtWidgets import QAbstractButton
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QScrollArea, QSlider, QScroller, QStackedWidget
|
||||
from PySide6.QtCore import Qt, QTimer
|
||||
from PySide6.QtGui import QRegion
|
||||
@@ -19,6 +20,8 @@ class MainWindowProtocol(Protocol):
|
||||
|
||||
def on_slider_released(self) -> None: ...
|
||||
|
||||
def _register_gamepad_tooltip(self, widget: QWidget, text: str) -> None: ...
|
||||
|
||||
# Required attributes
|
||||
searchEdit: CustomLineEdit
|
||||
card_width: int
|
||||
@@ -26,6 +29,7 @@ class MainWindowProtocol(Protocol):
|
||||
current_focused_card: GameCard | None
|
||||
gamesListWidget: QWidget | None
|
||||
stackedWidget: QStackedWidget
|
||||
_gamepad_tooltip_map: dict[QWidget, str]
|
||||
|
||||
class GameLibraryManager:
|
||||
def __init__(self, main_window: MainWindowProtocol, theme, context_menu_manager: ContextMenuManager | None):
|
||||
@@ -93,8 +97,9 @@ class GameLibraryManager:
|
||||
self.sizeSlider.setValue(self.card_width)
|
||||
self.sizeSlider.setTickInterval(10)
|
||||
self.sizeSlider.setFixedWidth(150)
|
||||
self.sizeSlider.setToolTip(f"{self.card_width} px")
|
||||
self.sizeSlider.setStyleSheet(self.theme.SLIDER_SIZE_STYLE)
|
||||
if hasattr(self.main_window, "_register_gamepad_tooltip"):
|
||||
self.main_window._register_gamepad_tooltip(self.sizeSlider, f"{self.card_width} px")
|
||||
self.sizeSlider.sliderReleased.connect(self.main_window.on_slider_released)
|
||||
sliderLayout.addWidget(self.sizeSlider)
|
||||
if self.layout_mode == "list":
|
||||
@@ -136,7 +141,8 @@ class GameLibraryManager:
|
||||
if self.sizeSlider is None:
|
||||
return
|
||||
self._set_card_width_from_slider()
|
||||
self.sizeSlider.setToolTip(f"{self.card_width} px")
|
||||
if hasattr(self.main_window, "_gamepad_tooltip_map"):
|
||||
self.main_window._gamepad_tooltip_map[self.sizeSlider] = f"{self.card_width} px"
|
||||
if self.layout_mode != "list":
|
||||
ui_config.set_card_width(self.card_width)
|
||||
self.main_window.card_width = self.card_width
|
||||
@@ -197,6 +203,7 @@ class GameLibraryManager:
|
||||
card = self.game_card_cache[card_key]
|
||||
|
||||
if is_focused:
|
||||
self._collapse_library_filter_controls()
|
||||
if self.main_window.current_hovered_card and self.main_window.current_hovered_card != card:
|
||||
try:
|
||||
self.main_window.current_hovered_card._hovered = False
|
||||
@@ -215,6 +222,17 @@ class GameLibraryManager:
|
||||
if self.main_window.current_focused_card == card:
|
||||
self.main_window.current_focused_card = None
|
||||
|
||||
def _collapse_library_filter_controls(self) -> None:
|
||||
if getattr(self.main_window, "_library_controls_hover_close_delayed", False):
|
||||
return
|
||||
controls_button = getattr(self.main_window, "libraryControlsButton", None)
|
||||
if not isinstance(controls_button, QAbstractButton) or not controls_button.isChecked():
|
||||
return
|
||||
controls_button.setChecked(False)
|
||||
toggle_controls = getattr(self.main_window, "_toggle_library_controls", None)
|
||||
if callable(toggle_controls):
|
||||
toggle_controls()
|
||||
|
||||
def _on_card_hovered(self, game_name: str, is_hovered: bool):
|
||||
"""Handles card hover events."""
|
||||
card_key = None
|
||||
@@ -229,6 +247,7 @@ class GameLibraryManager:
|
||||
card = self.game_card_cache[card_key]
|
||||
|
||||
if is_hovered:
|
||||
self._collapse_library_filter_controls()
|
||||
if self.main_window.current_focused_card and self.main_window.current_focused_card != card:
|
||||
try:
|
||||
if self.main_window.current_focused_card:
|
||||
@@ -255,8 +274,15 @@ class GameLibraryManager:
|
||||
self._pending_update = False
|
||||
self._update_game_grid_immediate()
|
||||
|
||||
def update_game_grid(self, games_list: list[tuple] | None = None, is_filter: bool = False):
|
||||
def update_game_grid(
|
||||
self,
|
||||
games_list: list[tuple] | None = None,
|
||||
is_filter: bool = False,
|
||||
focus_first_card: bool | None = None,
|
||||
):
|
||||
"""Schedules a game grid update with debouncing."""
|
||||
if focus_first_card is not None:
|
||||
self._focus_first_card_after_update = focus_first_card
|
||||
self.layout_mode = str(getattr(self.theme, "LIBRARY_LAYOUT_MODE", "grid")).lower()
|
||||
if self.sizeSlider is not None:
|
||||
self.sizeSlider.setVisible(self.layout_mode != "list")
|
||||
@@ -666,11 +692,11 @@ class GameLibraryManager:
|
||||
self.game_card_cache.clear()
|
||||
self.pending_images.clear()
|
||||
|
||||
def set_games(self, games: list[tuple]):
|
||||
def set_games(self, games: list[tuple], focus_first_card: bool = True):
|
||||
"""Sets the games list and updates the filtered games."""
|
||||
self.games = games
|
||||
self.filtered_games = self.games
|
||||
self._focus_first_card_after_update = bool(games)
|
||||
self._focus_first_card_after_update = bool(games) and focus_first_card
|
||||
|
||||
# Build search indices for fast searching
|
||||
self._build_search_indices(games)
|
||||
|
||||
@@ -738,7 +738,6 @@ class ClickablePixmapItem(QGraphicsPixmapItem):
|
||||
self.index = index
|
||||
self.carousel = carousel
|
||||
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
self.setToolTip("")
|
||||
self._click_start_position = None
|
||||
self.setAcceptedMouseButtons(Qt.MouseButton.LeftButton)
|
||||
self.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsSelectable)
|
||||
|
||||
+372
-69
@@ -2,6 +2,9 @@ import time
|
||||
import threading
|
||||
import os
|
||||
import math
|
||||
import ctypes
|
||||
import ctypes.util
|
||||
from functools import lru_cache
|
||||
from dataclasses import dataclass
|
||||
from typing import Protocol, cast, Any
|
||||
os.environ.setdefault("PYGAME_HIDE_SUPPORT_PROMPT", "1")
|
||||
@@ -18,7 +21,7 @@ from portprotonqt.logger import get_logger
|
||||
from portprotonqt.image_utils import FullscreenDialog
|
||||
from portprotonqt.custom_widgets import NavLabel, AutoSizeButton
|
||||
from portprotonqt.game_card import GameCard
|
||||
from portprotonqt.config import display_config, window_config
|
||||
from portprotonqt.config import display_config, gamepad_config, window_config
|
||||
from portprotonqt.dialogs import AddGameDialog
|
||||
from portprotonqt.virtual_keyboard import VirtualKeyboard
|
||||
|
||||
@@ -94,6 +97,125 @@ class GamepadType(Enum):
|
||||
PLAYSTATION = "PlayStation"
|
||||
UNKNOWN = "Unknown"
|
||||
|
||||
SDL_INIT_GAMEPAD = 0x00002000
|
||||
SDL_GAMEPAD_TYPE_STANDARD = 1
|
||||
SDL_GAMEPAD_TYPE_XBOX360 = 2
|
||||
SDL_GAMEPAD_TYPE_XBOXONE = 3
|
||||
SDL_GAMEPAD_TYPE_PS3 = 4
|
||||
SDL_GAMEPAD_TYPE_PS4 = 5
|
||||
SDL_GAMEPAD_TYPE_PS5 = 6
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO = 7
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = 8
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = 9
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = 10
|
||||
SDL_GAMEPAD_TYPE_GAMECUBE = 11
|
||||
SDL_GAMEPAD_TYPE_STEAM = 12
|
||||
SDL3_XBOX_LIKE_TYPES = {
|
||||
SDL_GAMEPAD_TYPE_STANDARD,
|
||||
SDL_GAMEPAD_TYPE_XBOX360,
|
||||
SDL_GAMEPAD_TYPE_XBOXONE,
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO,
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
|
||||
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
|
||||
SDL_GAMEPAD_TYPE_GAMECUBE,
|
||||
SDL_GAMEPAD_TYPE_STEAM,
|
||||
}
|
||||
SDL3_PLAYSTATION_TYPES = {
|
||||
SDL_GAMEPAD_TYPE_PS3,
|
||||
SDL_GAMEPAD_TYPE_PS4,
|
||||
SDL_GAMEPAD_TYPE_PS5,
|
||||
}
|
||||
|
||||
|
||||
def _get_sdl3_error(sdl: ctypes.CDLL) -> str:
|
||||
"""Return the current SDL3 error message."""
|
||||
error = sdl.SDL_GetError()
|
||||
if not error:
|
||||
return ""
|
||||
return error.decode(errors="replace")
|
||||
|
||||
|
||||
def _configure_sdl3_gamepad_api(sdl: ctypes.CDLL) -> None:
|
||||
"""Configure ctypes signatures for the SDL3 gamepad calls used here."""
|
||||
sdl.SDL_InitSubSystem.argtypes = [ctypes.c_uint32]
|
||||
sdl.SDL_InitSubSystem.restype = ctypes.c_bool
|
||||
sdl.SDL_GetGamepads.argtypes = [ctypes.POINTER(ctypes.c_int)]
|
||||
sdl.SDL_GetGamepads.restype = ctypes.POINTER(ctypes.c_uint32)
|
||||
sdl.SDL_GetGamepadTypeForID.argtypes = [ctypes.c_uint32]
|
||||
sdl.SDL_GetGamepadTypeForID.restype = ctypes.c_int
|
||||
sdl.SDL_GetGamepadNameForID.argtypes = [ctypes.c_uint32]
|
||||
sdl.SDL_GetGamepadNameForID.restype = ctypes.c_char_p
|
||||
sdl.SDL_GetError.argtypes = []
|
||||
sdl.SDL_GetError.restype = ctypes.c_char_p
|
||||
sdl.SDL_free.argtypes = [ctypes.c_void_p]
|
||||
sdl.SDL_free.restype = None
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def _load_sdl3() -> ctypes.CDLL | None:
|
||||
"""Load SDL3 and initialize its gamepad subsystem when available."""
|
||||
library_names = (
|
||||
ctypes.util.find_library("SDL3"),
|
||||
"libSDL3.so.0",
|
||||
"libSDL3.so",
|
||||
)
|
||||
for library_name in library_names:
|
||||
if not library_name:
|
||||
continue
|
||||
try:
|
||||
sdl = ctypes.CDLL(library_name)
|
||||
_configure_sdl3_gamepad_api(sdl)
|
||||
except (AttributeError, OSError) as e:
|
||||
logger.debug("Failed to load SDL3 from %s: %s", library_name, e)
|
||||
continue
|
||||
if sdl.SDL_InitSubSystem(SDL_INIT_GAMEPAD):
|
||||
return sdl
|
||||
logger.debug("Failed to initialize SDL3 gamepad subsystem: %s", _get_sdl3_error(sdl))
|
||||
return None
|
||||
|
||||
|
||||
def _decode_sdl3_name(name: bytes | None) -> str:
|
||||
"""Decode a SDL3 device name."""
|
||||
if not name:
|
||||
return ""
|
||||
return name.decode(errors="replace")
|
||||
|
||||
|
||||
def _gamepad_type_from_sdl3_value(sdl_type: int) -> GamepadType | None:
|
||||
"""Map SDL_GamepadType to the existing UI icon families."""
|
||||
if sdl_type in SDL3_PLAYSTATION_TYPES:
|
||||
return GamepadType.PLAYSTATION
|
||||
if sdl_type in SDL3_XBOX_LIKE_TYPES:
|
||||
return GamepadType.XBOX
|
||||
return None
|
||||
|
||||
|
||||
def _get_sdl3_gamepad_type(gamepad: "PygameGamepad") -> GamepadType | None:
|
||||
"""Read SDL_GamepadType from SDL3 for the current pygame controller."""
|
||||
sdl = _load_sdl3()
|
||||
if sdl is None:
|
||||
return None
|
||||
|
||||
count = ctypes.c_int()
|
||||
gamepads = sdl.SDL_GetGamepads(ctypes.byref(count))
|
||||
if not gamepads:
|
||||
return None
|
||||
|
||||
try:
|
||||
target_name = gamepad.name.casefold()
|
||||
for index in range(count.value):
|
||||
gamepad_id = gamepads[index]
|
||||
sdl_name = _decode_sdl3_name(sdl.SDL_GetGamepadNameForID(gamepad_id))
|
||||
if count.value > 1 and sdl_name.casefold() != target_name:
|
||||
continue
|
||||
gamepad_type = _gamepad_type_from_sdl3_value(sdl.SDL_GetGamepadTypeForID(gamepad_id))
|
||||
if gamepad_type is not None:
|
||||
return gamepad_type
|
||||
finally:
|
||||
sdl.SDL_free(gamepads)
|
||||
return None
|
||||
|
||||
|
||||
@dataclass
|
||||
class PygameGamepad:
|
||||
@@ -196,7 +318,7 @@ class InputManager(QObject):
|
||||
super().__init__(cast(QObject, main_window))
|
||||
self._parent = main_window
|
||||
self._gamepad_handling_enabled = True
|
||||
self.gamepad_type = GamepadType.UNKNOWN
|
||||
self.gamepad_type = self._get_configured_gamepad_type()
|
||||
self._parent.currentDetailPage = getattr(self._parent, 'currentDetailPage', None)
|
||||
self._parent.current_exec_line = getattr(self._parent, 'current_exec_line', None)
|
||||
self._parent.current_add_game_dialog = getattr(self._parent, 'current_add_game_dialog', None)
|
||||
@@ -235,7 +357,7 @@ class InputManager(QObject):
|
||||
self.scroll_max_value = self.max_value
|
||||
self.scroll_deadzone_value = self.deadzone_value
|
||||
|
||||
self.sensitivity = 8.0
|
||||
self.sensitivity = 20.0
|
||||
|
||||
# Dynamic attributes for different modes (declared here to satisfy type checkers)
|
||||
self.winetricks_dialog = None
|
||||
@@ -681,8 +803,19 @@ class InputManager(QObject):
|
||||
if code in (PAD_DPAD_X, PAD_AXIS_LEFT_X) and \
|
||||
hasattr(self.file_explorer, 'drive_buttons') and \
|
||||
self.file_explorer.drive_buttons:
|
||||
if code == PAD_DPAD_X and value == 0:
|
||||
return
|
||||
|
||||
if not isinstance(focused_widget, AutoSizeButton) or focused_widget not in self.file_explorer.drive_buttons:
|
||||
is_drive_button = (
|
||||
isinstance(focused_widget, AutoSizeButton) and
|
||||
focused_widget in self.file_explorer.drive_buttons
|
||||
)
|
||||
if code == PAD_AXIS_LEFT_X:
|
||||
if abs(value) < self.dead_zone or not is_drive_button:
|
||||
return
|
||||
value = 1 if value > self.dead_zone else -1
|
||||
|
||||
if not is_drive_button:
|
||||
# Focus first drive button if not currently on one
|
||||
self.file_explorer.drive_buttons[0].setFocus()
|
||||
self.file_explorer.ensure_button_visible(self.file_explorer.drive_buttons[0])
|
||||
@@ -705,7 +838,7 @@ class InputManager(QObject):
|
||||
elif code in (PAD_DPAD_Y, PAD_AXIS_LEFT_Y):
|
||||
# Move from buttons to list
|
||||
if isinstance(focused_widget, AutoSizeButton) and focused_widget in self.file_explorer.drive_buttons:
|
||||
if value > 0 and self.file_explorer.file_list.count() > 0:
|
||||
if code == PAD_DPAD_Y and value > 0 and self.file_explorer.file_list.count() > 0:
|
||||
self.file_explorer.file_list.setFocus()
|
||||
self.file_explorer.file_list.setCurrentRow(0)
|
||||
self.file_explorer.file_list.scrollToItem(self.file_explorer.file_list.currentItem())
|
||||
@@ -1359,6 +1492,11 @@ class InputManager(QObject):
|
||||
self.settings_dialog.reject()
|
||||
return
|
||||
|
||||
if button_code in BUTTONS['context_menu']:
|
||||
handler = getattr(self.settings_dialog, "handle_settings_context_menu", None)
|
||||
if callable(handler) and handler():
|
||||
return
|
||||
|
||||
# A Button - Confirm
|
||||
if button_code in BUTTONS['confirm']:
|
||||
if open_combo:
|
||||
@@ -1411,7 +1549,7 @@ class InputManager(QObject):
|
||||
if isinstance(focused, QLineEdit):
|
||||
self.settings_dialog.show_virtual_keyboard(focused)
|
||||
return
|
||||
if self.settings_dialog.tab_widget.currentIndex() in (2, 3):
|
||||
if self._is_current_settings_tool_tab():
|
||||
if isinstance(focused, QCheckBox):
|
||||
focused.toggle()
|
||||
return
|
||||
@@ -1505,7 +1643,7 @@ class InputManager(QObject):
|
||||
kb.move_focus_up()
|
||||
return
|
||||
|
||||
if self.settings_dialog.tab_widget.currentIndex() in (2, 3):
|
||||
if self._is_current_settings_tool_tab():
|
||||
focused = QApplication.focusWidget()
|
||||
open_combo = self._get_open_settings_combo()
|
||||
if open_combo:
|
||||
@@ -1630,15 +1768,26 @@ class InputManager(QObject):
|
||||
except Exception as e:
|
||||
logger.error(f"Error in handle_settings_dpad: {e}")
|
||||
|
||||
def _get_current_settings_table(self):
|
||||
if self.settings_dialog:
|
||||
idx = self.settings_dialog.tab_widget.currentIndex()
|
||||
if idx == 0:
|
||||
return self.settings_dialog.settings_table
|
||||
elif idx == 1:
|
||||
return self.settings_dialog.advanced_table
|
||||
def _get_current_settings_table(self) -> QTableWidget | None:
|
||||
if not self.settings_dialog:
|
||||
return None
|
||||
getter = getattr(self.settings_dialog, "_get_current_settings_table", None)
|
||||
if callable(getter):
|
||||
table = getter()
|
||||
if isinstance(table, QTableWidget):
|
||||
return table
|
||||
return None
|
||||
|
||||
def _is_current_settings_tool_tab(self):
|
||||
if not self.settings_dialog:
|
||||
return False
|
||||
current_tab = self.settings_dialog.tab_widget.currentWidget()
|
||||
return current_tab in (
|
||||
getattr(self.settings_dialog, "mangohud_tab", None),
|
||||
getattr(self.settings_dialog, "vkbasalt_tab", None),
|
||||
getattr(self.settings_dialog, "gamescope_tab", None),
|
||||
)
|
||||
|
||||
def _get_open_settings_combo(self):
|
||||
"""Return currently opened combo popup in settings dialog if any."""
|
||||
if not self.settings_dialog:
|
||||
@@ -1666,6 +1815,19 @@ class InputManager(QObject):
|
||||
table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
|
||||
if table == getattr(self.settings_dialog, "favorites_table", None):
|
||||
cell_widget = table.cellWidget(row, 1)
|
||||
if isinstance(cell_widget, (QCheckBox, QComboBox, QLineEdit)):
|
||||
cell_widget.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
if cell_widget is not None:
|
||||
checkbox = cell_widget.findChild(QCheckBox)
|
||||
if checkbox and checkbox.isEnabled():
|
||||
checkbox.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
|
||||
if table != self.settings_dialog.advanced_table:
|
||||
table.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return
|
||||
@@ -1720,28 +1882,31 @@ class InputManager(QObject):
|
||||
self._focus_settings_advanced_value_widget(table, 0)
|
||||
return
|
||||
|
||||
if self.settings_dialog and self.settings_dialog.tab_widget.currentIndex() in (2, 3):
|
||||
if self._is_current_settings_tool_tab():
|
||||
sections = self._get_mangohud_nav_sections()
|
||||
if sections and sections[0]:
|
||||
self._focus_mangohud_widget(sections[0][0])
|
||||
|
||||
def _get_mangohud_nav_sections(self):
|
||||
"""Return MangoHud/Gamescope focusable widgets grouped by visual sections."""
|
||||
"""Return settings tool focusable widgets grouped by visual sections."""
|
||||
if not self.settings_dialog:
|
||||
return []
|
||||
tab_index = self.settings_dialog.tab_widget.currentIndex()
|
||||
if tab_index not in (2, 3):
|
||||
current_tab = self.settings_dialog.tab_widget.currentWidget()
|
||||
is_mangohud = current_tab == getattr(self.settings_dialog, "mangohud_tab", None)
|
||||
is_vkbasalt = current_tab == getattr(self.settings_dialog, "vkbasalt_tab", None)
|
||||
is_gamescope = current_tab == getattr(self.settings_dialog, "gamescope_tab", None)
|
||||
if not is_mangohud and not is_vkbasalt and not is_gamescope:
|
||||
return []
|
||||
|
||||
sections = []
|
||||
|
||||
value_widgets = []
|
||||
if tab_index == 2:
|
||||
if is_mangohud:
|
||||
value_widgets = [
|
||||
widget for key, widget in self.settings_dialog.mangohud_widgets.items()
|
||||
if key != 'fps_limit_method' and widget.isVisible() and widget.isEnabled()
|
||||
]
|
||||
elif tab_index == 3:
|
||||
elif is_gamescope:
|
||||
value_widgets = [
|
||||
widget for widget in self.settings_dialog.gamescope_widgets.values()
|
||||
if widget.isVisible() and widget.isEnabled()
|
||||
@@ -1763,26 +1928,32 @@ class InputManager(QObject):
|
||||
preset_section = self._sort_widgets_by_position(preset_buttons) if preset_buttons else []
|
||||
|
||||
toggle_widgets = []
|
||||
category_combo_attr = 'mangohud_category_combo' if tab_index == 2 else 'gamescope_category_combo'
|
||||
category_stack_attr = 'mangohud_category_stack' if tab_index == 2 else 'gamescope_category_stack'
|
||||
category_combo = getattr(self.settings_dialog, category_combo_attr, None)
|
||||
if category_combo and category_combo.isVisible() and category_combo.isEnabled():
|
||||
toggle_widgets.append(category_combo)
|
||||
category_stack = getattr(self.settings_dialog, category_stack_attr, None)
|
||||
if category_stack:
|
||||
category_widget = category_stack.currentWidget()
|
||||
if category_widget:
|
||||
category_checkboxes = [
|
||||
checkbox for checkbox in category_widget.findChildren(
|
||||
QCheckBox, options=Qt.FindChildOption.FindChildrenRecursively
|
||||
)
|
||||
if checkbox.isVisible() and checkbox.isEnabled()
|
||||
]
|
||||
toggle_widgets.extend(self._sort_widgets_by_position(category_checkboxes))
|
||||
if is_vkbasalt:
|
||||
toggle_widgets = [
|
||||
checkbox for checkbox in self.settings_dialog.vkbasalt_shader_widgets.values()
|
||||
if checkbox.isVisible() and checkbox.isEnabled()
|
||||
]
|
||||
else:
|
||||
category_combo_attr = 'mangohud_category_combo' if is_mangohud else 'gamescope_category_combo'
|
||||
category_stack_attr = 'mangohud_category_stack' if is_mangohud else 'gamescope_category_stack'
|
||||
category_combo = getattr(self.settings_dialog, category_combo_attr, None)
|
||||
if category_combo and category_combo.isVisible() and category_combo.isEnabled():
|
||||
toggle_widgets.append(category_combo)
|
||||
category_stack = getattr(self.settings_dialog, category_stack_attr, None)
|
||||
if category_stack:
|
||||
category_widget = category_stack.currentWidget()
|
||||
if category_widget:
|
||||
category_checkboxes = [
|
||||
checkbox for checkbox in category_widget.findChildren(
|
||||
QCheckBox, options=Qt.FindChildOption.FindChildrenRecursively
|
||||
)
|
||||
if checkbox.isVisible() and checkbox.isEnabled()
|
||||
]
|
||||
toggle_widgets.extend(self._sort_widgets_by_position(category_checkboxes))
|
||||
toggle_section = toggle_widgets if toggle_widgets else []
|
||||
|
||||
fps_section = []
|
||||
if tab_index == 2:
|
||||
if is_mangohud:
|
||||
fps_widgets = []
|
||||
fps_limit_method = self.settings_dialog.mangohud_widgets.get('fps_limit_method')
|
||||
if fps_limit_method and fps_limit_method.isVisible() and fps_limit_method.isEnabled():
|
||||
@@ -1795,11 +1966,14 @@ class InputManager(QObject):
|
||||
if fps_widgets:
|
||||
fps_section = self._sort_widgets_by_position(fps_widgets)
|
||||
|
||||
extra_edit_attr = 'mangohud_extra_edit' if tab_index == 2 else 'gamescope_extra_edit'
|
||||
extra_edit = getattr(self.settings_dialog, extra_edit_attr, None)
|
||||
if is_vkbasalt:
|
||||
extra_edit = getattr(self.settings_dialog, 'vkbasalt_cas_slider', None)
|
||||
else:
|
||||
extra_edit_attr = 'mangohud_extra_edit' if is_mangohud else 'gamescope_extra_edit'
|
||||
extra_edit = getattr(self.settings_dialog, extra_edit_attr, None)
|
||||
extra_section = [extra_edit] if extra_edit and extra_edit.isVisible() and extra_edit.isEnabled() else []
|
||||
|
||||
if tab_index == 2:
|
||||
if is_mangohud:
|
||||
if preset_section:
|
||||
sections.append(preset_section)
|
||||
if toggle_section:
|
||||
@@ -1810,7 +1984,7 @@ class InputManager(QObject):
|
||||
sections.append(fps_section)
|
||||
if extra_section:
|
||||
sections.append(extra_section)
|
||||
else:
|
||||
elif is_gamescope:
|
||||
# Gamescope UI order: presets -> toggles -> values -> extra.
|
||||
if preset_section:
|
||||
sections.append(preset_section)
|
||||
@@ -1820,6 +1994,13 @@ class InputManager(QObject):
|
||||
sections.append(self._sort_widgets_by_position(value_widgets))
|
||||
if extra_section:
|
||||
sections.append(extra_section)
|
||||
else:
|
||||
if preset_section:
|
||||
sections.append(preset_section)
|
||||
if extra_section:
|
||||
sections.append(extra_section)
|
||||
if toggle_section:
|
||||
sections.append(self._sort_widgets_by_position(toggle_section))
|
||||
|
||||
return sections
|
||||
|
||||
@@ -1862,6 +2043,9 @@ class InputManager(QObject):
|
||||
position = self._find_widget_in_sections(focused, sections)
|
||||
if not position:
|
||||
return
|
||||
if isinstance(focused, QSlider):
|
||||
focused.setValue(focused.value() + direction)
|
||||
return
|
||||
section_index, _widget_index = position
|
||||
target = self._find_mangohud_grid_horizontal_target(
|
||||
focused, direction, sections[section_index]
|
||||
@@ -1884,7 +2068,16 @@ class InputManager(QObject):
|
||||
if not settings_dialog:
|
||||
return
|
||||
|
||||
current_tab = settings_dialog.tab_widget.currentWidget()
|
||||
is_mangohud = current_tab == getattr(settings_dialog, "mangohud_tab", None)
|
||||
is_vkbasalt = current_tab == getattr(settings_dialog, "vkbasalt_tab", None)
|
||||
section_index, _widget_index = position
|
||||
if is_vkbasalt and isinstance(focused, QSlider) and direction > 0:
|
||||
target = self._find_vkbasalt_first_effect_widget()
|
||||
if target:
|
||||
self._focus_mangohud_widget(target)
|
||||
return
|
||||
|
||||
toggle_boundary_reached = False
|
||||
if self._is_mangohud_fps_widget(focused):
|
||||
fps_target = self._find_mangohud_fps_vertical_target(
|
||||
@@ -1902,11 +2095,10 @@ class InputManager(QObject):
|
||||
return
|
||||
toggle_boundary_reached = True
|
||||
|
||||
tab_index = settings_dialog.tab_widget.currentIndex()
|
||||
fps_limit_method = None
|
||||
if tab_index == 2:
|
||||
if is_mangohud:
|
||||
fps_limit_method = settings_dialog.mangohud_widgets.get('fps_limit_method')
|
||||
if direction > 0 and tab_index == 2 and fps_limit_method and focused is fps_limit_method:
|
||||
if direction > 0 and is_mangohud and fps_limit_method and focused is fps_limit_method:
|
||||
fps_checkboxes = [
|
||||
checkbox for checkbox in settings_dialog.mangohud_fps_widgets.values()
|
||||
if checkbox.isVisible() and checkbox.isEnabled()
|
||||
@@ -1916,10 +2108,13 @@ class InputManager(QObject):
|
||||
self._focus_mangohud_widget(first_fps_checkbox)
|
||||
return
|
||||
|
||||
category_combo_attr = 'mangohud_category_combo' if tab_index == 2 else 'gamescope_category_combo'
|
||||
category_stack_attr = 'mangohud_category_stack' if tab_index == 2 else 'gamescope_category_stack'
|
||||
category_combo = getattr(settings_dialog, category_combo_attr, None)
|
||||
category_stack = getattr(settings_dialog, category_stack_attr, None)
|
||||
category_combo = None
|
||||
category_stack = None
|
||||
if not is_vkbasalt:
|
||||
category_combo_attr = 'mangohud_category_combo' if is_mangohud else 'gamescope_category_combo'
|
||||
category_stack_attr = 'mangohud_category_stack' if is_mangohud else 'gamescope_category_stack'
|
||||
category_combo = getattr(settings_dialog, category_combo_attr, None)
|
||||
category_stack = getattr(settings_dialog, category_stack_attr, None)
|
||||
if direction > 0 and category_combo and focused is category_combo and category_stack:
|
||||
current_category_widget = category_stack.currentWidget()
|
||||
if current_category_widget:
|
||||
@@ -1950,7 +2145,6 @@ class InputManager(QObject):
|
||||
if not target_section:
|
||||
return
|
||||
|
||||
category_combo = getattr(settings_dialog, category_combo_attr, None)
|
||||
if category_combo and category_combo in target_section:
|
||||
self._focus_mangohud_widget(category_combo)
|
||||
return
|
||||
@@ -1960,7 +2154,7 @@ class InputManager(QObject):
|
||||
return
|
||||
|
||||
fps_limit_method = None
|
||||
if tab_index == 2:
|
||||
if is_mangohud:
|
||||
fps_limit_method = settings_dialog.mangohud_widgets.get('fps_limit_method')
|
||||
if fps_limit_method and fps_limit_method in target_section:
|
||||
self._focus_mangohud_widget(fps_limit_method)
|
||||
@@ -2073,10 +2267,14 @@ class InputManager(QObject):
|
||||
"""Check if widget belongs to MangoHud/Gamescope toggle checkbox section."""
|
||||
if not self.settings_dialog:
|
||||
return False
|
||||
tab_index = self.settings_dialog.tab_widget.currentIndex()
|
||||
if tab_index == 2:
|
||||
current_tab = self.settings_dialog.tab_widget.currentWidget()
|
||||
if current_tab == getattr(self.settings_dialog, "mangohud_tab", None):
|
||||
toggle_keys = getattr(self.settings_dialog, 'mangohud_toggle_widget_keys', {})
|
||||
elif tab_index == 3:
|
||||
return isinstance(widget, QCheckBox) and widget in toggle_keys
|
||||
if current_tab == getattr(self.settings_dialog, "vkbasalt_tab", None):
|
||||
toggle_widgets = getattr(self.settings_dialog, 'vkbasalt_shader_widgets', {})
|
||||
return isinstance(widget, QCheckBox) and widget in set(toggle_widgets.values())
|
||||
elif current_tab == getattr(self.settings_dialog, "gamescope_tab", None):
|
||||
toggle_keys = getattr(self.settings_dialog, 'gamescope_toggle_widget_keys', {})
|
||||
else:
|
||||
toggle_keys = {}
|
||||
@@ -2089,8 +2287,41 @@ class InputManager(QObject):
|
||||
toggle_widgets = [widget for widget in section if self._is_mangohud_toggle_widget(widget)]
|
||||
if not toggle_widgets:
|
||||
return None
|
||||
if self._is_current_vkbasalt_tab():
|
||||
return self._find_vkbasalt_effect_vertical_target(focused, direction, toggle_widgets)
|
||||
return self._find_mangohud_vertical_grid_target(focused, direction, toggle_widgets)
|
||||
|
||||
def _is_current_vkbasalt_tab(self) -> bool:
|
||||
if not self.settings_dialog:
|
||||
return False
|
||||
current_tab = self.settings_dialog.tab_widget.currentWidget()
|
||||
return current_tab == getattr(self.settings_dialog, "vkbasalt_tab", None)
|
||||
|
||||
def _find_vkbasalt_first_effect_widget(self) -> QWidget | None:
|
||||
if not self.settings_dialog:
|
||||
return None
|
||||
widgets = [
|
||||
widget for widget in self.settings_dialog.vkbasalt_shader_widgets.values()
|
||||
if widget.isVisible() and widget.isEnabled()
|
||||
]
|
||||
if not widgets:
|
||||
return None
|
||||
return self._sort_widgets_by_position(widgets)[0]
|
||||
|
||||
def _find_vkbasalt_effect_vertical_target(
|
||||
self, focused: QWidget, direction: int, widgets: list[QWidget]
|
||||
) -> QWidget | None:
|
||||
if not self.settings_dialog:
|
||||
return None
|
||||
target = self._find_mangohud_vertical_grid_target(focused, direction, widgets)
|
||||
if direction >= 0 or target is None:
|
||||
return target
|
||||
focused_pos = focused.mapTo(self.settings_dialog, focused.rect().center())
|
||||
target_pos = target.mapTo(self.settings_dialog, target.rect().center())
|
||||
if target_pos.x() < focused_pos.x() and target_pos.y() > focused_pos.y():
|
||||
return None
|
||||
return target
|
||||
|
||||
def _find_mangohud_fps_vertical_target(self, focused, direction, section):
|
||||
"""Navigate FPS widgets down/up with automatic next/prev column jump."""
|
||||
fps_widgets = [widget for widget in section if self._is_mangohud_fps_widget(widget)]
|
||||
@@ -2191,7 +2422,7 @@ class InputManager(QObject):
|
||||
|
||||
def handle_scroll(self, raw_value):
|
||||
"""Handle scrolling from right stick Y"""
|
||||
if not self.mouse_emulation_enabled or not self.emulation_active or not self.ui:
|
||||
if not self._is_mouse_emulation_active() or not self.ui:
|
||||
return
|
||||
|
||||
# Normalize from center
|
||||
@@ -3329,6 +3560,9 @@ class InputManager(QObject):
|
||||
file_explorer = self.file_explorer
|
||||
if not file_explorer:
|
||||
return False
|
||||
focused = self._focused_widget()
|
||||
if isinstance(focused, QLineEdit) or self._focused_editable_combo(focused):
|
||||
return False
|
||||
if key in (pygame.K_RETURN, pygame.K_KP_ENTER):
|
||||
self._activate_file_explorer_focus()
|
||||
return True
|
||||
@@ -3453,12 +3687,44 @@ class InputManager(QObject):
|
||||
|
||||
def _get_library_toolbar_widgets(self) -> list[QWidget]:
|
||||
widgets = []
|
||||
for attr_name in ("quickLaunchButton", "addGameButton", "refreshButton", "searchEdit"):
|
||||
for attr_name in (
|
||||
"quickLaunchButton",
|
||||
"addGameButton",
|
||||
"searchEdit",
|
||||
"refreshButton",
|
||||
"libraryControlsButton",
|
||||
):
|
||||
widget = getattr(self._parent, attr_name, None)
|
||||
if isinstance(widget, QWidget) and widget.isVisible() and widget.isEnabled():
|
||||
widgets.append(widget)
|
||||
return widgets
|
||||
|
||||
def _get_library_filter_widgets(self) -> list[QWidget]:
|
||||
controls_widget = getattr(self._parent, "libraryControlsWidget", None)
|
||||
if not isinstance(controls_widget, QWidget) or not controls_widget.isVisible():
|
||||
return []
|
||||
widgets = []
|
||||
for attr_name in ("gamesSortCombo", "gamesDisplayCombo", "gamesBadgeViewCombo"):
|
||||
widget = getattr(self._parent, attr_name, None)
|
||||
if isinstance(widget, QWidget) and widget.isVisible() and widget.isEnabled():
|
||||
widgets.append(widget)
|
||||
return widgets
|
||||
|
||||
def _focus_library_filter_controls(self) -> bool:
|
||||
controls_button = getattr(self._parent, "libraryControlsButton", None)
|
||||
if not isinstance(controls_button, AutoSizeButton):
|
||||
return False
|
||||
if not controls_button.isChecked():
|
||||
controls_button.setChecked(True)
|
||||
toggle_controls = getattr(self._parent, "_toggle_library_controls", None)
|
||||
if callable(toggle_controls):
|
||||
toggle_controls()
|
||||
filter_widgets = self._get_library_filter_widgets()
|
||||
if not filter_widgets:
|
||||
return False
|
||||
filter_widgets[0].setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return True
|
||||
|
||||
def _focus_first_library_card(self) -> bool:
|
||||
container = getattr(self._parent, "gamesListWidget", None)
|
||||
if container is None:
|
||||
@@ -3478,7 +3744,23 @@ class InputManager(QObject):
|
||||
if value == 0 or self._parent.stackedWidget.currentIndex() != 0:
|
||||
return False
|
||||
toolbar_widgets = self._get_library_toolbar_widgets()
|
||||
filter_widgets = self._get_library_filter_widgets()
|
||||
focused = self._focused_widget()
|
||||
if focused in filter_widgets:
|
||||
if code == PAD_DPAD_X:
|
||||
current_index = filter_widgets.index(cast(QWidget, focused))
|
||||
next_index = current_index + (1 if value > 0 else -1)
|
||||
if 0 <= next_index < len(filter_widgets):
|
||||
filter_widgets[next_index].setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return True
|
||||
if code != PAD_DPAD_Y:
|
||||
return False
|
||||
if value < 0:
|
||||
controls_button = getattr(self._parent, "libraryControlsButton", None)
|
||||
if isinstance(controls_button, QWidget):
|
||||
controls_button.setFocus(Qt.FocusReason.OtherFocusReason)
|
||||
return True
|
||||
return self._focus_first_library_card()
|
||||
if focused not in toolbar_widgets:
|
||||
return False
|
||||
if code == PAD_DPAD_X:
|
||||
@@ -3490,6 +3772,9 @@ class InputManager(QObject):
|
||||
if code != PAD_DPAD_Y:
|
||||
return False
|
||||
if value > 0:
|
||||
controls_button = getattr(self._parent, "libraryControlsButton", None)
|
||||
if focused is controls_button and self._focus_library_filter_controls():
|
||||
return True
|
||||
return self._focus_first_library_card()
|
||||
tab_button = self._parent.tabButtons.get(0)
|
||||
if tab_button is not None and tab_button.isVisible():
|
||||
@@ -3616,7 +3901,7 @@ class InputManager(QObject):
|
||||
logger.info(f"Gamepad connected: {new_gamepad.name} at {new_gamepad.path}")
|
||||
self.gamepad = new_gamepad
|
||||
self._reset_pygame_state()
|
||||
self.gamepad_type = self._detect_gamepad_type(new_gamepad)
|
||||
self.gamepad_type = self._get_effective_gamepad_type(new_gamepad)
|
||||
self._refresh_gamepad_ui()
|
||||
|
||||
if display_config.get_auto_fullscreen_gamepad() and not display_config.get_fullscreen():
|
||||
@@ -3650,20 +3935,36 @@ class InputManager(QObject):
|
||||
self.pending_menu_fullscreen_time = 0.0
|
||||
self.guide_held = False
|
||||
self.emulation_triggered = False
|
||||
self.gamepad_type = GamepadType.UNKNOWN
|
||||
self.gamepad_type = self._get_configured_gamepad_type()
|
||||
|
||||
def _get_configured_gamepad_type(self) -> GamepadType:
|
||||
"""Return manual gamepad type from config or Unknown for auto mode."""
|
||||
value = gamepad_config.get_gamepad_type()
|
||||
if value == "playstation":
|
||||
return GamepadType.PLAYSTATION
|
||||
if value == "xbox":
|
||||
return GamepadType.XBOX
|
||||
return GamepadType.UNKNOWN
|
||||
|
||||
def _get_effective_gamepad_type(self, gamepad: PygameGamepad) -> GamepadType:
|
||||
"""Use manual gamepad type when configured, otherwise auto-detect."""
|
||||
configured_type = self._get_configured_gamepad_type()
|
||||
if configured_type != GamepadType.UNKNOWN:
|
||||
return configured_type
|
||||
return self._detect_gamepad_type(gamepad)
|
||||
|
||||
def apply_gamepad_type_setting(self) -> None:
|
||||
"""Apply configured gamepad type to the current device."""
|
||||
if self.gamepad is None:
|
||||
self.gamepad_type = self._get_configured_gamepad_type()
|
||||
return
|
||||
self.gamepad_type = self._get_effective_gamepad_type(self.gamepad)
|
||||
|
||||
def _detect_gamepad_type(self, gamepad: PygameGamepad) -> GamepadType:
|
||||
"""Infer gamepad type from pygame device metadata."""
|
||||
name = gamepad.name.lower()
|
||||
guid = gamepad.controller.as_joystick().get_guid().lower()
|
||||
if any(keyword in name for keyword in ("playstation", "dualshock", "dualsense", "sony")):
|
||||
return GamepadType.PLAYSTATION
|
||||
if any(keyword in name for keyword in ("xbox", "x-input", "xinput", "microsoft")):
|
||||
return GamepadType.XBOX
|
||||
if guid.startswith(("030000004c05", "030000004c050000")):
|
||||
return GamepadType.PLAYSTATION
|
||||
if guid.startswith(("030000005e04", "030000005e040000")):
|
||||
return GamepadType.XBOX
|
||||
"""Read gamepad type from SDL or fall back to Xbox."""
|
||||
sdl3_type = _get_sdl3_gamepad_type(gamepad)
|
||||
if sdl3_type is not None:
|
||||
return sdl3_type
|
||||
return GamepadType.XBOX
|
||||
|
||||
def _refresh_gamepad_ui(self) -> None:
|
||||
@@ -3849,6 +4150,8 @@ class InputManager(QObject):
|
||||
if axis_code in (PAD_AXIS_LEFT_TRIGGER, PAD_AXIS_RIGHT_TRIGGER):
|
||||
self._emit_trigger_event(axis_code, raw_value, current_time)
|
||||
continue
|
||||
if axis_code not in (PAD_AXIS_LEFT_X, PAD_AXIS_LEFT_Y):
|
||||
continue
|
||||
self.dpad_moved.emit(axis_code, raw_value, current_time)
|
||||
|
||||
def _emit_trigger_event(self, axis_code: int, raw_value: int, current_time: float) -> None:
|
||||
@@ -3944,7 +4247,7 @@ class InputManager(QObject):
|
||||
|
||||
self.gamepad = None
|
||||
self._reset_pygame_state()
|
||||
self.gamepad_type = GamepadType.UNKNOWN
|
||||
self.gamepad_type = self._get_configured_gamepad_type()
|
||||
if self._pygame_ready:
|
||||
controller.quit()
|
||||
pygame.quit()
|
||||
|
||||
+156
-140
@@ -1,4 +1,4 @@
|
||||
# Portuguese translations for PortProtonQt.
|
||||
# Belarusian translations for PortProtonQt.
|
||||
# Copyright (C) 2026 boria138
|
||||
# This file is distributed under the same license as the PortProtonQt
|
||||
# project.
|
||||
@@ -8,23 +8,24 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PortProtonQt 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2026-03-22 13:50+0500\n"
|
||||
"PO-Revision-Date: 2026-01-18 11:09+0500\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language: pt\n"
|
||||
"Language-Team: pt <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"POT-Creation-Date: 2026-05-28 10:08+0500\n"
|
||||
"PO-Revision-Date: 2026-06-05 14:30+0000\n"
|
||||
"Last-Translator: Anonymous <anonymous@noreply.codeberg.org>\n"
|
||||
"Language-Team: Belarusian <https://translate.codeberg.org/projects/"
|
||||
"portprotonqt/portprotonqt/be/>\n"
|
||||
"Language: be\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.17.0\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.5\n"
|
||||
"Generated-By: Babel 2.18.0\n"
|
||||
|
||||
msgid "Stop Game"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"PortProton data folder is not readable and writable. Choose another "
|
||||
"folder for PortProton data."
|
||||
msgid "PortProton data folder is not readable and writable. Choose another folder for PortProton data."
|
||||
msgstr ""
|
||||
|
||||
msgid "Error"
|
||||
@@ -48,6 +49,12 @@ msgstr ""
|
||||
msgid "Delete Folder"
|
||||
msgstr ""
|
||||
|
||||
msgid "Rename File"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete File"
|
||||
msgstr ""
|
||||
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
@@ -82,9 +89,7 @@ msgid "Confirm Deletion"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete folder '{folder_name}'? This action "
|
||||
"cannot be undone."
|
||||
msgid "Are you sure you want to delete folder '{folder_name}'? This action cannot be undone."
|
||||
msgstr ""
|
||||
|
||||
msgid "Yes"
|
||||
@@ -97,6 +102,27 @@ msgstr ""
|
||||
msgid "Failed to delete folder: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "New File Name:"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File already exists: {file_name}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to rename file: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete from PortProton"
|
||||
msgstr ""
|
||||
|
||||
@@ -147,9 +173,7 @@ msgid "No .desktop file found for '{game_name}'"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete '{game_name}'? This will remove the "
|
||||
".desktop file and custom data."
|
||||
msgid "Are you sure you want to delete '{game_name}'? This will remove the .desktop file and custom data."
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
@@ -212,9 +236,7 @@ msgid "Success"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"'{game_name}' was added to Steam. Please restart Steam for changes to "
|
||||
"take effect."
|
||||
msgid "'{game_name}' was added to Steam. Please restart Steam for changes to take effect."
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
@@ -226,9 +248,7 @@ msgid "Failed to add '{game_name}' to Steam: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"'{game_name}' was removed from Steam. Please restart Steam for changes to"
|
||||
" take effect."
|
||||
msgid "'{game_name}' was removed from Steam. Please restart Steam for changes to take effect."
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
@@ -376,6 +396,42 @@ msgstr ""
|
||||
msgid "Search ..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Refreshing..."
|
||||
msgstr ""
|
||||
|
||||
@@ -385,6 +441,18 @@ msgstr ""
|
||||
msgid "Prefix:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr ""
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr ""
|
||||
|
||||
@@ -469,54 +537,24 @@ msgstr ""
|
||||
msgid "PortProton Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Brief"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time Detail Level:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Interface Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Tray Menu Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Gamepad Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Launch Application in Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
@@ -622,9 +660,6 @@ msgstr ""
|
||||
msgid "Light"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Apply Theme"
|
||||
msgstr ""
|
||||
|
||||
@@ -686,30 +721,19 @@ msgstr ""
|
||||
msgid "Choose PortProton data folder"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Selected folder is on an unsupported filesystem. Choose another folder "
|
||||
"for PortProton data."
|
||||
msgid "Selected folder is on an unsupported filesystem. Choose another folder for PortProton data."
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Selected folder is not readable and writable. Choose another folder for "
|
||||
"PortProton data."
|
||||
msgid "Selected folder is not readable and writable. Choose another folder for PortProton data."
|
||||
msgstr ""
|
||||
|
||||
msgid "Select file for PPDB download"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable vkBasalt by default to improve graphics in games running on "
|
||||
"Vulkan. (The HOME hotkey disables vkbasalt)"
|
||||
msgid "Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, DirectDraw 1-7, Direct3D 2-9) on all 3D API."
|
||||
msgstr ""
|
||||
|
||||
msgid "Forced use of VKBASALT system settings (GOverlay, etc.)"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, "
|
||||
"DirectDraw 1-7, Direct3D 2-9) on all 3D API."
|
||||
msgid "Enable SpecialK (injection library for fixing graphics, latency and more)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable OptiScaler (replacement upscaler / frame generator)"
|
||||
@@ -802,9 +826,7 @@ msgstr ""
|
||||
msgid "Use bundled dxvk/vkd3d from Wine/Proton"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Prevent the system from going to sleep and disable the screensaver while "
|
||||
"the game is running"
|
||||
msgid "Prevent the system from going to sleep and disable the screensaver while the game is running"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use container launch mode (recommended default)"
|
||||
@@ -822,33 +844,19 @@ msgstr ""
|
||||
msgid "Specify the Wine prefix to run this game with"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Select the DirectX → Vulkan/OpenGL backend:\n"
|
||||
"\n"
|
||||
"• Newest – latest DXVK + VKD3D (best compatibility/performance, requires "
|
||||
"modern drivers: AMD Mesa 25+, NVIDIA 550.54.14+, Intel Mesa 24.2+)\n"
|
||||
"• Stable – older, well-tested DXVK + VKD3D (works on any Vulkan 1.3+ "
|
||||
"driver)\n"
|
||||
"• Sarek – experimental DXVK-Sarek + VKD3D-Sarek (supports older drivers, "
|
||||
"Vulkan 1.1+)\n"
|
||||
"• Newest – latest DXVK + VKD3D (best compatibility/performance, requires modern drivers: AMD Mesa 25+, NVIDIA 550.54.14+, Intel Mesa 24.2+)\n"
|
||||
"• Stable – older, well-tested DXVK + VKD3D (works on any Vulkan 1.3+ driver)\n"
|
||||
"• Sarek – experimental DXVK-Sarek + VKD3D-Sarek (supports older drivers, Vulkan 1.1+)\n"
|
||||
"• WINED3D – OpenGL fallback (lowest performance, use only if others fail)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Windows version"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Changing the WINDOWS emulation version may be required to run older "
|
||||
"games. WINDOWS versions below 10 do not support new games with DirectX 12"
|
||||
msgid "Changing the WINDOWS emulation version may be required to run older games. WINDOWS versions below 10 do not support new games with DirectX 12"
|
||||
msgstr ""
|
||||
|
||||
msgid "DLL Overrides"
|
||||
@@ -873,32 +881,29 @@ msgid "Launch Arguments"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Adding an argument after the .exe file, just like you would add an "
|
||||
"argument in a shortcut on a WINDOWS system.\n"
|
||||
"Adding an argument after the .exe file, just like you would add an argument in a shortcut on a WINDOWS system.\n"
|
||||
"\n"
|
||||
"Example: -dx11 -skipintro 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Run After Exe"
|
||||
msgid "Run After / Wrapper"
|
||||
msgstr ""
|
||||
|
||||
msgid "Path to a second .exe that should be started after the main executable."
|
||||
msgid ""
|
||||
"Path to a second .exe, script, or wrapper command. Example: systemd-run "
|
||||
"--user --scope --slice=app.slice"
|
||||
msgstr ""
|
||||
|
||||
msgid "CPU Cores Limit"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Limiting the number of CPU cores is useful for Unity games (It is "
|
||||
"recommended to set the value equal to 8)"
|
||||
msgid "Limiting the number of CPU cores is useful for Unity games (It is recommended to set the value equal to 8)"
|
||||
msgstr ""
|
||||
|
||||
msgid "OpenGL Version"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"You can select the required OpenGL version, some games require a forced "
|
||||
"Compatibility Profile (COMP)."
|
||||
msgid "You can select the required OpenGL version, some games require a forced Compatibility Profile (COMP)."
|
||||
msgstr ""
|
||||
|
||||
msgid "VKD3D Feature Level"
|
||||
@@ -921,18 +926,19 @@ msgid ""
|
||||
"fifo - First in, first out. Limits the frame rate + no tearing. (VSync)\n"
|
||||
"immediate - Unlimited frame rate + tearing.\n"
|
||||
"mailbox - Triple buffering. Unlimited frame rate + no tearing.\n"
|
||||
"relaxed - Same as fifo but allows tearing when below the monitors refresh"
|
||||
" rate."
|
||||
"relaxed - Same as fifo but allows tearing when below the monitors refresh rate."
|
||||
msgstr ""
|
||||
|
||||
msgid "NUMA Node"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"NUMA node for CPU affinity. In multi-core systems, CPUs are split into "
|
||||
"NUMA nodes, each with its own local memory and cores. Binding a game to a"
|
||||
" single node reduces memory-access latency and limits costly core-to-core"
|
||||
" switches."
|
||||
msgid "NUMA node for CPU affinity. In multi-core systems, CPUs are split into NUMA nodes, each with its own local memory and cores. Binding a game to a single node reduces memory-access latency and limits costly core-to-core switches."
|
||||
msgstr ""
|
||||
|
||||
msgid "Sound Driver"
|
||||
msgstr ""
|
||||
|
||||
msgid "Force the Wine sound driver for this executable."
|
||||
msgstr ""
|
||||
|
||||
msgid "just now"
|
||||
@@ -1002,9 +1008,15 @@ msgstr ""
|
||||
msgid "Install"
|
||||
msgstr ""
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game not found."
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
@@ -1313,16 +1325,12 @@ msgstr ""
|
||||
msgid "Confirm PPDB Clear"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Are you sure you want to clear settings? This action cannot be undone."
|
||||
msgid "Are you sure you want to clear settings? This action cannot be undone."
|
||||
msgstr ""
|
||||
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "PPDB settings cleared."
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1479,22 +1487,16 @@ msgstr ""
|
||||
msgid "Grab the keyboard"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Force grab cursor: always use relative mouse mode instead of switching "
|
||||
"with cursor visibility"
|
||||
msgid "Force grab cursor: always use relative mouse mode instead of switching with cursor visibility"
|
||||
msgstr ""
|
||||
|
||||
msgid "Support Wayland clients using xdg-shell"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Force windows inside of gamescope to be the size of the nested display "
|
||||
"(fullscreen)"
|
||||
msgid "Force windows inside of gamescope to be the size of the nested display (fullscreen)"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable HDR output (needs Gamescope WSI layer enabled for support from "
|
||||
"clients)"
|
||||
msgid "Enable HDR output (needs Gamescope WSI layer enabled for support from clients)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable SDR->HDR inverse tone mapping. only works for SDR input"
|
||||
@@ -1521,7 +1523,8 @@ msgstr ""
|
||||
msgid "Quick presets"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
@@ -1560,7 +1563,8 @@ msgstr ""
|
||||
msgid "Example: --cursor-scale-height=1080 --force-orientation=left"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Disable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Custom preset is empty. Save one first."
|
||||
@@ -1917,9 +1921,6 @@ msgstr ""
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1941,9 +1942,7 @@ msgstr ""
|
||||
msgid "FPS limit"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Select one or more FPS presets. The values are saved into FPS_LIMIT and "
|
||||
"MangoHud will also show the active FPS limit."
|
||||
msgid "Select one or more FPS presets. The values are saved into FPS_LIMIT and MangoHud will also show the active FPS limit."
|
||||
msgstr ""
|
||||
|
||||
msgid "Additional comma-separated MangoHud options not covered by the GUI."
|
||||
@@ -1955,9 +1954,6 @@ msgstr ""
|
||||
msgid "All GPUs"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Don't use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1973,6 +1969,23 @@ msgstr ""
|
||||
msgid "Failed to run preview."
|
||||
msgstr ""
|
||||
|
||||
msgid "Shaders"
|
||||
msgstr ""
|
||||
|
||||
msgid "AMD FidelityFX - Contrast Adaptive Sharpening"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Sharpness: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press a button to choose"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Toggle key: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Prefix Manager"
|
||||
msgstr ""
|
||||
|
||||
@@ -2140,6 +2153,9 @@ msgstr ""
|
||||
msgid "Output"
|
||||
msgstr ""
|
||||
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr ""
|
||||
|
||||
@@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2026-03-22 13:50+0500\n"
|
||||
"PO-Revision-Date: 2026-05-11 08:58+0000\n"
|
||||
"PO-Revision-Date: 2026-06-06 16:07+0000\n"
|
||||
"Last-Translator: gallegonovato <gallegonovato@noreply.codeberg.org>\n"
|
||||
"Language-Team: Spanish <https://translate.codeberg.org/projects/portprotonqt/"
|
||||
"portprotonqt/es/>\n"
|
||||
@@ -18,7 +18,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 5.17.1\n"
|
||||
"X-Generator: Weblate 2026.5\n"
|
||||
"Generated-By: Babel 2.17.0\n"
|
||||
|
||||
msgid "Stop Game"
|
||||
@@ -28,6 +28,8 @@ msgid ""
|
||||
"PortProton data folder is not readable and writable. Choose another "
|
||||
"folder for PortProton data."
|
||||
msgstr ""
|
||||
"La carpeta de datos de PortProton no tiene permisos de lectura ni escritura. "
|
||||
"Elija otra carpeta para los datos de PortProton."
|
||||
|
||||
msgid "Error"
|
||||
msgstr "Error"
|
||||
@@ -50,6 +52,14 @@ msgstr "Cambiar el nombre de la carpeta"
|
||||
msgid "Delete Folder"
|
||||
msgstr "Borrar la carpeta"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Rename File"
|
||||
msgstr "Cambiar el nombre de la carpeta"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Delete File"
|
||||
msgstr "Borrar la carpeta"
|
||||
|
||||
msgid "OK"
|
||||
msgstr "De acuerdo"
|
||||
|
||||
@@ -92,15 +102,39 @@ msgstr ""
|
||||
"acción no se puede deshacer."
|
||||
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
msgstr "Sí"
|
||||
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
msgstr "No"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete folder: {error}"
|
||||
msgstr "No se ha podido eliminar la carpeta: {error}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr ""
|
||||
"¿Estás seguro de que quieres eliminar la carpeta «{folder_name}»? Esta "
|
||||
"acción no se puede deshacer."
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
msgstr "No se ha podido eliminar la carpeta: {error}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "New File Name:"
|
||||
msgstr "Nombre de la nueva carpeta:"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "File already exists: {file_name}"
|
||||
msgstr "La carpeta ya existe: {folder_name}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Failed to rename file: {error}"
|
||||
msgstr "No se pudo cambiar el nombre de la carpeta: {error}"
|
||||
|
||||
msgid "Delete from PortProton"
|
||||
msgstr "Eliminar de PortProton"
|
||||
|
||||
@@ -140,94 +174,99 @@ msgstr "Sin ningún ejecutable en el archivo .desktop para «{game_name}»"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to parse .desktop file for '{game_name}'"
|
||||
msgstr ""
|
||||
msgstr "Error al analizar el archivo .desktop para ' {game_name} '"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Error reading .desktop file: {error}"
|
||||
msgstr ""
|
||||
msgstr "Error al leer el archivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "No .desktop file found for '{game_name}'"
|
||||
msgstr ""
|
||||
msgstr "No se encontró ningún archivo .desktop para '{game_name}'"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete '{game_name}'? This will remove the .desktop "
|
||||
"file and custom data."
|
||||
msgstr ""
|
||||
"¿Estás seguro de que quieres eliminar «{game_name}»? Esto eliminará el "
|
||||
"archivo .desktop y los datos personalizados."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete .desktop file: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido eliminar el archivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Deleted '{game_name}' successfully"
|
||||
msgstr ""
|
||||
msgstr "Se ha eliminado «{game_name}» correctamente"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete custom data: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se han podido eliminar los datos personalizados: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to add '{game_name}' to {location}: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido añadir «{game_name}» a {location}: {error}"
|
||||
|
||||
msgid "Menu"
|
||||
msgstr ""
|
||||
msgstr "Menú"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to remove '{game_name}' from {location}: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido eliminar «{game_name}» de {location}: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed '{game_name}' from {location}"
|
||||
msgstr ""
|
||||
msgstr "Se ha eliminado «{game_name}» de {location}"
|
||||
|
||||
msgid "Desktop"
|
||||
msgstr ""
|
||||
msgstr "Escritorio"
|
||||
|
||||
msgid "Game name and executable path are required"
|
||||
msgstr ""
|
||||
"Es necesario indicar el nombre del juego y la ruta del archivo ejecutable"
|
||||
|
||||
msgid "Failed to generate .desktop file data"
|
||||
msgstr ""
|
||||
msgstr "No se han podido generar los datos del archivo .desktop"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete old .desktop file: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido eliminar el archivo .desktop antiguo: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed old .desktop file for '{game_name}'"
|
||||
msgstr ""
|
||||
msgstr "Se ha eliminado el antiguo archivo .desktop de «{game_name}»"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to save .desktop file: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido guardar el archivo .desktop: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to copy cover image: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido copiar la imagen de portada: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Unsupported image format: {extension}"
|
||||
msgstr ""
|
||||
msgstr "Formato de imagen no compatible: {extension}"
|
||||
|
||||
msgid "Success"
|
||||
msgstr ""
|
||||
msgstr "Éxito"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"'{game_name}' was added to Steam. Please restart Steam for changes to take "
|
||||
"effect."
|
||||
msgstr ""
|
||||
"Se ha añadido «{game_name}» a Steam. Reinicia Steam para que los cambios "
|
||||
"surtan efecto."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "'{game_name}' was added to Steam."
|
||||
msgstr ""
|
||||
msgstr "«{game_name}» se ha añadido a Steam."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to add '{game_name}' to Steam: {error}"
|
||||
msgstr ""
|
||||
msgstr "No se ha podido añadir «{game_name}» a Steam: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
@@ -381,6 +420,42 @@ msgstr "Editar acceso directo"
|
||||
msgid "Search ..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Refreshing..."
|
||||
msgstr ""
|
||||
|
||||
@@ -390,6 +465,18 @@ msgstr ""
|
||||
msgid "Prefix:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr ""
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr ""
|
||||
|
||||
@@ -474,54 +561,24 @@ msgstr ""
|
||||
msgid "PortProton Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Brief"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time Detail Level:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Interface Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Tray Menu Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Gamepad Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Launch Application in Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
@@ -627,9 +684,6 @@ msgstr ""
|
||||
msgid "Light"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Apply Theme"
|
||||
msgstr ""
|
||||
|
||||
@@ -705,19 +759,14 @@ msgstr ""
|
||||
msgid "Select file for PPDB download"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable vkBasalt by default to improve graphics in games running on Vulkan. (The "
|
||||
"HOME hotkey disables vkbasalt)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Forced use of VKBASALT system settings (GOverlay, etc.)"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, DirectDraw "
|
||||
"1-7, Direct3D 2-9) on all 3D API."
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable SpecialK (injection library for fixing graphics, latency and more)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable OptiScaler (replacement upscaler / frame generator)"
|
||||
msgstr ""
|
||||
|
||||
@@ -828,15 +877,6 @@ msgstr ""
|
||||
msgid "Specify the Wine prefix to run this game with"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Select the DirectX → Vulkan/OpenGL backend:\n"
|
||||
"\n"
|
||||
@@ -884,10 +924,12 @@ msgid ""
|
||||
"Example: -dx11 -skipintro 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Run After Exe"
|
||||
msgid "Run After / Wrapper"
|
||||
msgstr ""
|
||||
|
||||
msgid "Path to a second .exe that should be started after the main executable."
|
||||
msgid ""
|
||||
"Path to a second .exe, script, or wrapper command. Example: systemd-run "
|
||||
"--user --scope --slice=app.slice"
|
||||
msgstr ""
|
||||
|
||||
msgid "CPU Cores Limit"
|
||||
@@ -938,6 +980,12 @@ msgid ""
|
||||
"node reduces memory-access latency and limits costly core-to-core switches."
|
||||
msgstr ""
|
||||
|
||||
msgid "Sound Driver"
|
||||
msgstr ""
|
||||
|
||||
msgid "Force the Wine sound driver for this executable."
|
||||
msgstr ""
|
||||
|
||||
msgid "just now"
|
||||
msgstr ""
|
||||
|
||||
@@ -1005,9 +1053,16 @@ msgstr ""
|
||||
msgid "Install"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Open Card"
|
||||
msgstr "Detener partida"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game not found."
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
@@ -1328,9 +1383,6 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "No se pudo cambiar el nombre de la carpeta: {error}"
|
||||
|
||||
msgid "PPDB settings cleared."
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1528,7 +1580,8 @@ msgstr ""
|
||||
msgid "Quick presets"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
@@ -1567,7 +1620,8 @@ msgstr ""
|
||||
msgid "Example: --cursor-scale-height=1080 --force-orientation=left"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Disable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Custom preset is empty. Save one first."
|
||||
@@ -1924,9 +1978,6 @@ msgstr ""
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1962,9 +2013,6 @@ msgstr ""
|
||||
msgid "All GPUs"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Don't use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1980,6 +2028,23 @@ msgstr ""
|
||||
msgid "Failed to run preview."
|
||||
msgstr ""
|
||||
|
||||
msgid "Shaders"
|
||||
msgstr ""
|
||||
|
||||
msgid "AMD FidelityFX - Contrast Adaptive Sharpening"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Sharpness: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press a button to choose"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Toggle key: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Prefix Manager"
|
||||
msgstr ""
|
||||
|
||||
@@ -2147,6 +2212,9 @@ msgstr ""
|
||||
msgid "Output"
|
||||
msgstr ""
|
||||
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -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-05-26 11:44+0500\n"
|
||||
"POT-Creation-Date: 2026-06-10 10:55+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"
|
||||
@@ -47,6 +47,12 @@ msgstr ""
|
||||
msgid "Delete Folder"
|
||||
msgstr ""
|
||||
|
||||
msgid "Rename File"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete File"
|
||||
msgstr ""
|
||||
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
@@ -96,6 +102,27 @@ msgstr ""
|
||||
msgid "Failed to delete folder: {error}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "New File Name:"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File already exists: {file_name}"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to rename file: {error}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete from PortProton"
|
||||
msgstr ""
|
||||
|
||||
@@ -375,6 +402,42 @@ msgstr ""
|
||||
msgid "Search ..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Refreshing..."
|
||||
msgstr ""
|
||||
|
||||
@@ -384,6 +447,18 @@ msgstr ""
|
||||
msgid "Prefix:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr ""
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr ""
|
||||
|
||||
@@ -468,54 +543,24 @@ msgstr ""
|
||||
msgid "PortProton Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Brief"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time Detail Level:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr ""
|
||||
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Compact"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr ""
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Interface Settings"
|
||||
msgstr ""
|
||||
|
||||
msgid "Tray Menu Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Gamepad Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Launch Application in Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
@@ -621,9 +666,6 @@ msgstr ""
|
||||
msgid "Light"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Apply Theme"
|
||||
msgstr ""
|
||||
|
||||
@@ -698,19 +740,14 @@ msgstr ""
|
||||
msgid "Select file for PPDB download"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable vkBasalt by default to improve graphics in games running on "
|
||||
"Vulkan. (The HOME hotkey disables vkbasalt)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Forced use of VKBASALT system settings (GOverlay, etc.)"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, "
|
||||
"DirectDraw 1-7, Direct3D 2-9) on all 3D API."
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable SpecialK (injection library for fixing graphics, latency and more)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable OptiScaler (replacement upscaler / frame generator)"
|
||||
msgstr ""
|
||||
|
||||
@@ -821,15 +858,6 @@ msgstr ""
|
||||
msgid "Specify the Wine prefix to run this game with"
|
||||
msgstr ""
|
||||
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
msgid "Stable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"Select the DirectX → Vulkan/OpenGL backend:\n"
|
||||
"\n"
|
||||
@@ -878,10 +906,12 @@ msgid ""
|
||||
"Example: -dx11 -skipintro 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Run After Exe"
|
||||
msgid "Run After / Wrapper"
|
||||
msgstr ""
|
||||
|
||||
msgid "Path to a second .exe that should be started after the main executable."
|
||||
msgid ""
|
||||
"Path to a second .exe, script, or wrapper command. Example: systemd-run "
|
||||
"--user --scope --slice=app.slice"
|
||||
msgstr ""
|
||||
|
||||
msgid "CPU Cores Limit"
|
||||
@@ -934,6 +964,12 @@ msgid ""
|
||||
" switches."
|
||||
msgstr ""
|
||||
|
||||
msgid "Sound Driver"
|
||||
msgstr ""
|
||||
|
||||
msgid "Force the Wine sound driver for this executable."
|
||||
msgstr ""
|
||||
|
||||
msgid "just now"
|
||||
msgstr ""
|
||||
|
||||
@@ -1001,9 +1037,15 @@ msgstr ""
|
||||
msgid "Install"
|
||||
msgstr ""
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr ""
|
||||
|
||||
msgid "Game not found."
|
||||
msgstr ""
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr ""
|
||||
|
||||
@@ -1318,9 +1360,6 @@ msgstr ""
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "PPDB settings cleared."
|
||||
msgstr ""
|
||||
|
||||
msgid "disabled"
|
||||
msgstr ""
|
||||
|
||||
@@ -1519,7 +1558,8 @@ msgstr ""
|
||||
msgid "Quick presets"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Enable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Default"
|
||||
@@ -1558,7 +1598,8 @@ msgstr ""
|
||||
msgid "Example: --cursor-scale-height=1080 --force-orientation=left"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Disable {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Custom preset is empty. Save one first."
|
||||
@@ -1915,9 +1956,6 @@ msgstr ""
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1953,9 +1991,6 @@ msgstr ""
|
||||
msgid "All GPUs"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable MangoHud"
|
||||
msgstr ""
|
||||
|
||||
msgid "Don't use system config"
|
||||
msgstr ""
|
||||
|
||||
@@ -1971,6 +2006,23 @@ msgstr ""
|
||||
msgid "Failed to run preview."
|
||||
msgstr ""
|
||||
|
||||
msgid "Shaders"
|
||||
msgstr ""
|
||||
|
||||
msgid "AMD FidelityFX - Contrast Adaptive Sharpening"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Sharpness: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press a button to choose"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Toggle key: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Prefix Manager"
|
||||
msgstr ""
|
||||
|
||||
@@ -2138,6 +2190,9 @@ msgstr ""
|
||||
msgid "Output"
|
||||
msgstr ""
|
||||
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr ""
|
||||
|
||||
|
||||
+461
-327
File diff suppressed because it is too large.
Load diff
@@ -9,7 +9,7 @@ msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2026-03-22 13:50+0500\n"
|
||||
"PO-Revision-Date: 2026-05-26 06:33+0000\n"
|
||||
"PO-Revision-Date: 2026-06-10 05:58+0000\n"
|
||||
"Last-Translator: Boria138 <boria138@noreply.codeberg.org>\n"
|
||||
"Language-Team: Russian <https://translate.codeberg.org/projects/portprotonqt/"
|
||||
"portprotonqt/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.5\n"
|
||||
"X-Generator: Weblate 2026.6.1\n"
|
||||
"Generated-By: Babel 2.18.0\n"
|
||||
|
||||
msgid "Stop Game"
|
||||
@@ -53,6 +53,12 @@ msgstr "Переименовать Папку"
|
||||
msgid "Delete Folder"
|
||||
msgstr "Удалить Папку"
|
||||
|
||||
msgid "Rename File"
|
||||
msgstr "Переименовать файл"
|
||||
|
||||
msgid "Delete File"
|
||||
msgstr "Удалить файл"
|
||||
|
||||
msgid "OK"
|
||||
msgstr "Ок"
|
||||
|
||||
@@ -104,6 +110,29 @@ msgstr "Нет"
|
||||
msgid "Failed to delete folder: {error}"
|
||||
msgstr "Не удалось удалить папку: {error}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr ""
|
||||
"Вы уверены, что хотите удалить файл '{file_name}'? Это действие нельзя "
|
||||
"отменить."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
msgstr "Не удалось удалить файл: {error}"
|
||||
|
||||
msgid "New File Name:"
|
||||
msgstr "Новое имя файла:"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "File already exists: {file_name}"
|
||||
msgstr "Файл уже существует: {file_name}"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Failed to rename file: {error}"
|
||||
msgstr "Не удалось переименовать файл: {error}"
|
||||
|
||||
msgid "Delete from PortProton"
|
||||
msgstr "Удалить из PortProton"
|
||||
|
||||
@@ -158,8 +187,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 delete .desktop file: {error}"
|
||||
@@ -241,8 +270,8 @@ msgid ""
|
||||
"'{game_name}' was removed from Steam. Please restart Steam for changes to take "
|
||||
"effect."
|
||||
msgstr ""
|
||||
"'{game_name}' был(а) удалён(а) из Steam. Пожалуйста, перезапустите Steam, чтобы "
|
||||
"изменения вступили в силу."
|
||||
"'{game_name}' был(а) удалён(а) из Steam. Пожалуйста, перезапустите Steam, "
|
||||
"чтобы изменения вступили в силу."
|
||||
|
||||
#, python-brace-format
|
||||
msgid "'{game_name}' was removed from Steam."
|
||||
@@ -389,6 +418,42 @@ msgstr "Добавить ярлык"
|
||||
msgid "Search ..."
|
||||
msgstr "Поиск ..."
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr "Настройки Библиотеки"
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr "Последний запуск"
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr "Проведенное время"
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr "Алфавитный"
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr "Метод сортировки:"
|
||||
|
||||
msgid "All"
|
||||
msgstr "Все"
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr "Избранное"
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr "Фильтр:"
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr "Детальный"
|
||||
|
||||
msgid "Compact"
|
||||
msgstr "Компактный"
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr "Скрытый"
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr "Тип отображения бейджей:"
|
||||
|
||||
msgid "Refreshing..."
|
||||
msgstr "Обновление..."
|
||||
|
||||
@@ -398,6 +463,18 @@ msgstr "Введите имя префикса"
|
||||
msgid "Prefix:"
|
||||
msgstr "Префикс:"
|
||||
|
||||
msgid "Newest"
|
||||
msgstr "Новейший"
|
||||
|
||||
msgid "Stable"
|
||||
msgstr "Стабильный"
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr "Vulkan рендеринг"
|
||||
|
||||
msgid "Use by default"
|
||||
msgstr "Использовать по умолчанию"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Конфигурация Wine"
|
||||
|
||||
@@ -482,54 +559,24 @@ msgstr "Не удалось удалить префикс: {}"
|
||||
msgid "PortProton Settings"
|
||||
msgstr "Настройки PortProtonQt"
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr "Настройки Библиотеки"
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr "Детальный"
|
||||
|
||||
msgid "Brief"
|
||||
msgstr "Упрощённый"
|
||||
|
||||
msgid "Time Detail Level:"
|
||||
msgstr "Уровень детализации вывода времени:"
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr "Последний запуск"
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr "Проведенное время"
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr "Алфавитный"
|
||||
|
||||
msgid "Sort Method:"
|
||||
msgstr "Метод сортировки:"
|
||||
|
||||
msgid "All"
|
||||
msgstr "Все"
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr "Избранное"
|
||||
|
||||
msgid "Display Filter:"
|
||||
msgstr "Фильтр:"
|
||||
|
||||
msgid "Compact"
|
||||
msgstr "Компактный"
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr "Скрытый"
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr "Тип отображения бейджей:"
|
||||
|
||||
msgid "Interface Settings"
|
||||
msgstr "Настройки интерфейса"
|
||||
|
||||
msgid "Tray Menu Type:"
|
||||
msgstr "Тип области уведомления:"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "Авто"
|
||||
|
||||
msgid "Gamepad Type:"
|
||||
msgstr "Тип геймпада:"
|
||||
|
||||
msgid "Launch Application in Fullscreen"
|
||||
msgstr "Запуск приложения в полноэкранном режиме"
|
||||
|
||||
@@ -636,9 +683,6 @@ msgstr "Тёмная"
|
||||
msgid "Light"
|
||||
msgstr "Светлая"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "Авто"
|
||||
|
||||
msgid "Apply Theme"
|
||||
msgstr "Применить тему"
|
||||
|
||||
@@ -704,8 +748,8 @@ msgid ""
|
||||
"Selected folder is on an unsupported filesystem. Choose another folder for "
|
||||
"PortProton data."
|
||||
msgstr ""
|
||||
"Выбранная папка находится на неподдерживаемой файловой системе. Выберите другую "
|
||||
"папку для данных PortProton."
|
||||
"Выбранная папка находится на неподдерживаемой файловой системе. Выберите "
|
||||
"другую папку для данных PortProton."
|
||||
|
||||
msgid ""
|
||||
"Selected folder is not readable and writable. Choose another folder for "
|
||||
@@ -717,22 +761,17 @@ msgstr ""
|
||||
msgid "Select file for PPDB download"
|
||||
msgstr "Выберите файл для загрузки PPDB"
|
||||
|
||||
msgid ""
|
||||
"Enable vkBasalt by default to improve graphics in games running on Vulkan. (The "
|
||||
"HOME hotkey disables vkbasalt)"
|
||||
msgstr ""
|
||||
"Включить vkBasalt по умолчанию, для улучшения графики в играх на Vulkan. "
|
||||
"(Горячая клавиша HOME отключает vkbasalt)"
|
||||
|
||||
msgid "Forced use of VKBASALT system settings (GOverlay, etc.)"
|
||||
msgstr "Принудительное использование системных настроек vkBasalt (GOverlay и т.д.)"
|
||||
|
||||
msgid ""
|
||||
"Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, DirectDraw 1-7, "
|
||||
"Direct3D 2-9) on all 3D API."
|
||||
msgstr ""
|
||||
"Включить dgVoodoo2. Принудительное использование всех библиотек dgVoodoo2 (Glide "
|
||||
"2.11-3.1, DirectDraw 1-7, Direct3D 2-9) на всех 3D API."
|
||||
"Включить dgVoodoo2. Принудительное использование всех библиотек dgVoodoo2 "
|
||||
"(Glide 2.11-3.1, DirectDraw 1-7, Direct3D 2-9) на всех 3D API."
|
||||
|
||||
msgid "Enable SpecialK (injection library for fixing graphics, latency and more)"
|
||||
msgstr ""
|
||||
"Включить SpecialK (библиотека для оптимизации графики, снижения задержек и "
|
||||
"других улучшений)"
|
||||
|
||||
msgid "Enable OptiScaler (replacement upscaler / frame generator)"
|
||||
msgstr "Включить OptiScaler (замена апскейлера / генератора кадров)"
|
||||
@@ -741,7 +780,8 @@ msgid "Enable Lossless Scaling frame generation (experimental)"
|
||||
msgstr "Включить генерацию кадров Lossless Scaling + lsfg-vk (экспериментально)"
|
||||
|
||||
msgid "FSR upscaling in fullscreen with ProtonGE below native resolution"
|
||||
msgstr "Апскейлинг FSR в полноэкранном режиме с ProtonGE ниже родного разрешения"
|
||||
msgstr ""
|
||||
"Апскейлинг FSR в полноэкранном режиме с ProtonGE ниже родного разрешения"
|
||||
|
||||
msgid "Enable vkd3d support - Ray Tracing"
|
||||
msgstr "Включить поддержку vkd3d — трассировка лучей"
|
||||
@@ -828,7 +868,8 @@ msgid ""
|
||||
"Prevent the system from going to sleep and disable the screensaver while the "
|
||||
"game is running"
|
||||
msgstr ""
|
||||
"Предотвратите переход системы в спящий режим и отключите заставку во время игры"
|
||||
"Предотвратите переход системы в спящий режим и отключите заставку во время "
|
||||
"игры"
|
||||
|
||||
msgid "Use container launch mode (recommended default)"
|
||||
msgstr "Использовать режим запуска в контейнере (рекомендуемый по умолчанию)"
|
||||
@@ -837,7 +878,8 @@ msgid "Wine Version"
|
||||
msgstr "Версия Wine"
|
||||
|
||||
msgid "Select the Wine or Proton version to use for this executable."
|
||||
msgstr "Выбор версии Wine или Proton для использования с этим исполняемым файлом."
|
||||
msgstr ""
|
||||
"Выбор версии Wine или Proton для использования с этим исполняемым файлом."
|
||||
|
||||
msgid "Prefix Name"
|
||||
msgstr "Имя префикса"
|
||||
@@ -845,15 +887,6 @@ msgstr "Имя префикса"
|
||||
msgid "Specify the Wine prefix to run this game with"
|
||||
msgstr "Укажите префикс Wine для запуска этой игры"
|
||||
|
||||
msgid "Newest"
|
||||
msgstr "Новейший"
|
||||
|
||||
msgid "Stable"
|
||||
msgstr "Стабильный"
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr "Vulkan рендеринг"
|
||||
|
||||
msgid ""
|
||||
"Select the DirectX → Vulkan/OpenGL backend:\n"
|
||||
"\n"
|
||||
@@ -871,10 +904,10 @@ msgstr ""
|
||||
"550.54.14+, Intel Mesa 24.2+)\n"
|
||||
"• Стабильный — более старая, хорошо протестированная версия DXVK + VKD3D "
|
||||
"(работает с любыми драйверами Vulkan 1.3+)\n"
|
||||
"• Sarek — экспериментальная версия DXVK-Sarek + VKD3D-Sarek (поддерживает более "
|
||||
"старые драйверы, Vulkan 1.1+)\n"
|
||||
"• WINED3D — резервный вариант OpenGL (наименьшая производительность, используйте "
|
||||
"только в случае сбоя других вариантов)"
|
||||
"• Sarek — экспериментальная версия DXVK-Sarek + VKD3D-Sarek (поддерживает "
|
||||
"более старые драйверы, Vulkan 1.1+)\n"
|
||||
"• WINED3D — резервный вариант OpenGL (наименьшая производительность, "
|
||||
"используйте только в случае сбоя других вариантов)"
|
||||
|
||||
msgid "Windows version"
|
||||
msgstr "Версия Windows"
|
||||
@@ -883,8 +916,8 @@ msgid ""
|
||||
"Changing the WINDOWS emulation version may be required to run older games. "
|
||||
"WINDOWS versions below 10 do not support new games with DirectX 12"
|
||||
msgstr ""
|
||||
"Изменение версии эмуляции WINDOWS может потребоваться для запуска старых игр. "
|
||||
"Версии WINDOWS ниже 10 не поддерживают новые игры с DirectX 12"
|
||||
"Изменение версии эмуляции WINDOWS может потребоваться для запуска старых "
|
||||
"игр. Версии WINDOWS ниже 10 не поддерживают новые игры с DirectX 12"
|
||||
|
||||
msgid "DLL Overrides"
|
||||
msgstr "Переопределения DLL"
|
||||
@@ -926,16 +959,20 @@ msgid ""
|
||||
"\n"
|
||||
"Example: -dx11 -skipintro 1"
|
||||
msgstr ""
|
||||
"Добавление аргумента после файла .exe, как вы бы добавили аргумент в ярлыке на "
|
||||
"системе WINDOWS.\n"
|
||||
"Добавление аргумента после файла .exe, как вы бы добавили аргумент в ярлыке "
|
||||
"на системе WINDOWS.\n"
|
||||
"\n"
|
||||
"Пример: -dx11 -skipintro 1"
|
||||
|
||||
msgid "Run After Exe"
|
||||
msgstr "Запустить после Exe"
|
||||
msgid "Run After / Wrapper"
|
||||
msgstr "Запустить после"
|
||||
|
||||
msgid "Path to a second .exe that should be started after the main executable."
|
||||
msgstr "Путь к второму файлу .exe, который должен запускаться после основного."
|
||||
msgid ""
|
||||
"Path to a second .exe, script, or wrapper command. Example: systemd-run "
|
||||
"--user --scope --slice=app.slice"
|
||||
msgstr ""
|
||||
"Путь к второму файлу .exe, скрипту или команде-обёртке. Пример: systemd-"
|
||||
"run --user --scope --slice=app.slice"
|
||||
|
||||
msgid "CPU Cores Limit"
|
||||
msgstr "Ограничение ядер CPU"
|
||||
@@ -970,8 +1007,8 @@ msgstr "Локаль"
|
||||
|
||||
msgid "Force certain locale for an app. Fixes encoding issues in legacy software"
|
||||
msgstr ""
|
||||
"Принудительно установить определённую локаль для приложения. Исправляет проблемы "
|
||||
"с кодировкой в устаревшем ПО"
|
||||
"Принудительно установить определённую локаль для приложения. Исправляет "
|
||||
"проблемы с кодировкой в устаревшем ПО"
|
||||
|
||||
msgid "Window Mode"
|
||||
msgstr "Режим окна"
|
||||
@@ -984,8 +1021,8 @@ msgid ""
|
||||
"relaxed - Same as fifo but allows tearing when below the monitors refresh rate."
|
||||
msgstr ""
|
||||
"Режим окна (для Vulkan и OpenGL):\n"
|
||||
"fifo — Первый вошёл, первый вышел. Ограничивает частоту кадров + без разрывов. "
|
||||
"(VSync)\n"
|
||||
"fifo — Первый вошёл, первый вышел. Ограничивает частоту кадров + без "
|
||||
"разрывов. (VSync)\n"
|
||||
"immediate — Неограниченная частота кадров + разрывы.\n"
|
||||
"mailbox — Трёхбуферная. Неограниченная частота кадров + без разрывов.\n"
|
||||
"relaxed — То же, что fifo, но позволяет разрывы при частоте ниже частоты "
|
||||
@@ -1000,9 +1037,16 @@ msgid ""
|
||||
"reduces memory-access latency and limits costly core-to-core switches."
|
||||
msgstr ""
|
||||
"Узел NUMA для аффинности CPU. В многоядерных системах CPU разделены на узлы "
|
||||
"NUMA, каждый со своей локальной памятью и ядрами. Привязка игры к одному узлу "
|
||||
"уменьшает задержку доступа к памяти и ограничивает дорогостоящие переключения "
|
||||
"между ядрами."
|
||||
"NUMA, каждый со своей локальной памятью и ядрами. Привязка игры к одному "
|
||||
"узлу уменьшает задержку доступа к памяти и ограничивает дорогостоящие "
|
||||
"переключения между ядрами."
|
||||
|
||||
msgid "Sound Driver"
|
||||
msgstr "Драйвер звуковой карты"
|
||||
|
||||
msgid "Force the Wine sound driver for this executable."
|
||||
msgstr ""
|
||||
"Принудительно использовать драйвер звука Wine для этого исполняемого файла."
|
||||
|
||||
msgid "just now"
|
||||
msgstr "только что"
|
||||
@@ -1071,9 +1115,15 @@ msgstr "Создать лог"
|
||||
msgid "Install"
|
||||
msgstr "Установить"
|
||||
|
||||
msgid "Open Card"
|
||||
msgstr "Открыть карточку"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "Переустановить"
|
||||
|
||||
msgid "Game not found."
|
||||
msgstr "Игра не найдена"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "Остановить лог"
|
||||
|
||||
@@ -1390,14 +1440,12 @@ 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 "PPDB settings cleared."
|
||||
msgstr "Настройки PPDB сброшенны."
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "отключено"
|
||||
|
||||
@@ -1597,8 +1645,8 @@ msgstr "Запуск с включенным mangoapp (mangohud)"
|
||||
|
||||
msgid "Enable adaptive sync if available (variable rate refresh)"
|
||||
msgstr ""
|
||||
"Включает адаптивную синхронизацию, если она доступна (обновление с переменной "
|
||||
"частотой)"
|
||||
"Включает адаптивную синхронизацию, если она доступна (обновление с "
|
||||
"переменной частотой)"
|
||||
|
||||
msgid "Resolution and scaling"
|
||||
msgstr "Разрешение и масштабирование"
|
||||
@@ -1606,8 +1654,9 @@ msgstr "Разрешение и масштабирование"
|
||||
msgid "Quick presets"
|
||||
msgstr "Профили"
|
||||
|
||||
msgid "Enable Gamescope"
|
||||
msgstr "Включить Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Enable {0}"
|
||||
msgstr "Включить {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "Стандартный"
|
||||
@@ -1640,13 +1689,15 @@ msgid "Extra args"
|
||||
msgstr "Расширенные настройки"
|
||||
|
||||
msgid "Additional Gamescope options not covered by the GUI."
|
||||
msgstr "Дополнительные параметры Gamescope (через запятую), отсутствующие в GUI."
|
||||
msgstr ""
|
||||
"Дополнительные параметры Gamescope (через запятую), отсутствующие в GUI."
|
||||
|
||||
msgid "Example: --cursor-scale-height=1080 --force-orientation=left"
|
||||
msgstr "Например: --cursor-scale-height=1080 --force-orientation=left"
|
||||
|
||||
msgid "Disable Gamescope"
|
||||
msgstr "Отключить Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Disable {0}"
|
||||
msgstr "Отключить {0}"
|
||||
|
||||
msgid "Custom preset is empty. Save one first."
|
||||
msgstr "Пользовательские настройки пусты. Сначала сохраните их."
|
||||
@@ -2002,9 +2053,6 @@ msgstr "Профили"
|
||||
msgid "Actions"
|
||||
msgstr "Действия"
|
||||
|
||||
msgid "Enable MangoHud"
|
||||
msgstr "Включить MangoHud"
|
||||
|
||||
msgid "Use system config"
|
||||
msgstr "Использовать системный конфиг"
|
||||
|
||||
@@ -2042,9 +2090,6 @@ msgstr "Пример: battery,gpu_junction_temp,fps_color=39f900"
|
||||
msgid "All GPUs"
|
||||
msgstr "Все ГП"
|
||||
|
||||
msgid "Disable MangoHud"
|
||||
msgstr "Отключить MangoHud"
|
||||
|
||||
msgid "Don't use system config"
|
||||
msgstr "Не использовать системный конфиг"
|
||||
|
||||
@@ -2060,6 +2105,23 @@ msgstr "Ошибка при записи конфигурации MangoHud."
|
||||
msgid "Failed to run preview."
|
||||
msgstr "Ошибка при запуске предпросмотра."
|
||||
|
||||
msgid "Shaders"
|
||||
msgstr "Шейдеры"
|
||||
|
||||
msgid "AMD FidelityFX - Contrast Adaptive Sharpening"
|
||||
msgstr "AMD FidelityFX — адаптивная резкость с учетом контрастности"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Sharpness: {0}"
|
||||
msgstr "Резкость: {0}"
|
||||
|
||||
msgid "Press a button to choose"
|
||||
msgstr "Нажмите кнопку для выбора"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Toggle key: {0}"
|
||||
msgstr "Клавиша переключения: {0}"
|
||||
|
||||
msgid "Prefix Manager"
|
||||
msgstr "Менеджер префиксов"
|
||||
|
||||
@@ -2227,6 +2289,9 @@ msgstr "Устройства воспроизведения"
|
||||
msgid "Output"
|
||||
msgstr "Вывод"
|
||||
|
||||
msgid "Logout"
|
||||
msgstr "Выйти"
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr "Перезагрузить"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Chinese (Simplified) translations for PortProtonQt.
|
||||
# Chinese (Simplified, China) translations for PortProtonQt.
|
||||
# Copyright (C) 2026 boria138
|
||||
# This file is distributed under the same license as the PortProtonQt
|
||||
# project.
|
||||
@@ -9,11 +9,11 @@ msgstr ""
|
||||
"Project-Id-Version: PortProtonQt 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2026-05-22 18:01+0500\n"
|
||||
"PO-Revision-Date: 2026-05-22 17:46+0000\n"
|
||||
"Last-Translator: Poesty Li <poesty7450@gmail.com>\n"
|
||||
"PO-Revision-Date: 2026-06-05 14:30+0000\n"
|
||||
"Last-Translator: Anonymous <anonymous@noreply.codeberg.org>\n"
|
||||
"Language-Team: Chinese (Simplified Han script) <https://"
|
||||
"translate.codeberg.org/projects/portprotonqt/portprotonqt/zh_Hans/>\n"
|
||||
"Language: zh_Hans\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -51,6 +51,14 @@ msgstr "重命名文件夹"
|
||||
msgid "Delete Folder"
|
||||
msgstr "删除文件夹"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Rename File"
|
||||
msgstr "重命名文件夹"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Delete File"
|
||||
msgstr "删除文件夹"
|
||||
|
||||
msgid "OK"
|
||||
msgstr "确定"
|
||||
|
||||
@@ -100,6 +108,28 @@ msgstr "否"
|
||||
msgid "Failed to delete folder: {error}"
|
||||
msgstr "删除文件夹失败:{error}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid ""
|
||||
"Are you sure you want to delete file '{file_name}'? This action cannot be"
|
||||
" undone."
|
||||
msgstr "确定要删除文件夹“{folder_name}”吗?此操作无法撤销。"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Failed to delete file: {error}"
|
||||
msgstr "删除文件夹失败:{error}"
|
||||
|
||||
#, fuzzy
|
||||
msgid "New File Name:"
|
||||
msgstr "新文件夹名称:"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "File already exists: {file_name}"
|
||||
msgstr "文件夹已存在:{folder_name}"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Failed to rename file: {error}"
|
||||
msgstr "重命名文件夹失败:{error}"
|
||||
|
||||
msgid "Delete from PortProton"
|
||||
msgstr "从 PortProton 中删除"
|
||||
|
||||
@@ -382,6 +412,44 @@ msgstr "添加快捷方式到:"
|
||||
msgid "Search ..."
|
||||
msgstr "搜索"
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr "库设置"
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr "上次启动"
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr "按字母顺序"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Sort Method:"
|
||||
msgstr "游戏排序方式:"
|
||||
|
||||
msgid "All"
|
||||
msgstr "全部"
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr "收藏夹"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Display Filter:"
|
||||
msgstr "游戏显示筛选:"
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr "详细"
|
||||
|
||||
msgid "Compact"
|
||||
msgstr "紧凑"
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr "隐藏"
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr "徽章视图类型:"
|
||||
|
||||
msgid "Refreshing..."
|
||||
msgstr "正在刷新…"
|
||||
|
||||
@@ -391,6 +459,19 @@ msgstr "输入前缀名称"
|
||||
msgid "Prefix:"
|
||||
msgstr "前缀:"
|
||||
|
||||
msgid "Newest"
|
||||
msgstr "最新"
|
||||
|
||||
msgid "Stable"
|
||||
msgstr "稳定"
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr "Vulkan 后端"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Use by default"
|
||||
msgstr "默认隐藏 HUD"
|
||||
|
||||
msgid "Wine Configuration"
|
||||
msgstr "Wine 配置"
|
||||
|
||||
@@ -475,56 +556,25 @@ msgstr "删除前缀失败:{}"
|
||||
msgid "PortProton Settings"
|
||||
msgstr "PortProton 设置"
|
||||
|
||||
msgid "Library Settings"
|
||||
msgstr "库设置"
|
||||
|
||||
msgid "Detailed"
|
||||
msgstr "详细"
|
||||
|
||||
msgid "Brief"
|
||||
msgstr "简要"
|
||||
|
||||
msgid "Time Detail Level:"
|
||||
msgstr "时间详细程度:"
|
||||
|
||||
msgid "Last launch"
|
||||
msgstr "上次启动"
|
||||
|
||||
msgid "Time spent"
|
||||
msgstr ""
|
||||
|
||||
msgid "Alphabetical"
|
||||
msgstr "按字母顺序"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Sort Method:"
|
||||
msgstr "游戏排序方式:"
|
||||
|
||||
msgid "All"
|
||||
msgstr "全部"
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr "收藏夹"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Display Filter:"
|
||||
msgstr "游戏显示筛选:"
|
||||
|
||||
msgid "Compact"
|
||||
msgstr "紧凑"
|
||||
|
||||
msgid "Hidden"
|
||||
msgstr "隐藏"
|
||||
|
||||
msgid "Badge View Type:"
|
||||
msgstr "徽章视图类型:"
|
||||
|
||||
msgid "Interface Settings"
|
||||
msgstr "界面设置"
|
||||
|
||||
msgid "Tray Menu Type:"
|
||||
msgstr "托盘菜单类型:"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "自动"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Gamepad Type:"
|
||||
msgstr "游戏手柄"
|
||||
|
||||
msgid "Launch Application in Fullscreen"
|
||||
msgstr "全屏启动应用程序"
|
||||
|
||||
@@ -630,9 +680,6 @@ msgstr "深色"
|
||||
msgid "Light"
|
||||
msgstr "浅色"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "自动"
|
||||
|
||||
msgid "Apply Theme"
|
||||
msgstr "应用主题"
|
||||
|
||||
@@ -710,16 +757,6 @@ msgstr "所选文件夹位于不支持的文件系统上。请为 PortProton 数
|
||||
msgid "Select file for PPDB download"
|
||||
msgstr "选择用于 PPDB 下载的文件"
|
||||
|
||||
msgid ""
|
||||
"Enable vkBasalt by default to improve graphics in games running on "
|
||||
"Vulkan. (The HOME hotkey disables vkbasalt)"
|
||||
msgstr ""
|
||||
"默认启用 vkBasalt 以改善运行在 Vulkan 上的游戏的图形效果。(HOME 热键禁用 "
|
||||
"vkbasalt)"
|
||||
|
||||
msgid "Forced use of VKBASALT system settings (GOverlay, etc.)"
|
||||
msgstr "强制使用 VKBASALT 系统设置(GOverlay 等)"
|
||||
|
||||
msgid ""
|
||||
"Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, "
|
||||
"DirectDraw 1-7, Direct3D 2-9) on all 3D API."
|
||||
@@ -727,6 +764,9 @@ msgstr ""
|
||||
"启用 dgVoodoo2。在所有 3D API 上强制使用所有 dgVoodoo2 库(Glide 2.11-3.1、"
|
||||
"DirectDraw 1-7、Direct3D 2-9)。"
|
||||
|
||||
msgid "Enable SpecialK (injection library for fixing graphics, latency and more)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable OptiScaler (replacement upscaler / frame generator)"
|
||||
msgstr "启用 OptiScaler(替代性升频器/帧生成器)"
|
||||
|
||||
@@ -837,15 +877,6 @@ msgstr "前缀名称"
|
||||
msgid "Specify the Wine prefix to run this game with"
|
||||
msgstr "指定用于运行此游戏的 Wine 前缀"
|
||||
|
||||
msgid "Newest"
|
||||
msgstr "最新"
|
||||
|
||||
msgid "Stable"
|
||||
msgstr "稳定"
|
||||
|
||||
msgid "Vulkan Backend"
|
||||
msgstr "Vulkan 后端"
|
||||
|
||||
msgid ""
|
||||
"Select the DirectX → Vulkan/OpenGL backend:\n"
|
||||
"\n"
|
||||
@@ -920,11 +951,14 @@ msgstr ""
|
||||
"\n"
|
||||
"示例:-dx11 -skipintro 1"
|
||||
|
||||
msgid "Run After Exe"
|
||||
#, fuzzy
|
||||
msgid "Run After / Wrapper"
|
||||
msgstr "在 Exe 后运行"
|
||||
|
||||
msgid "Path to a second .exe that should be started after the main executable."
|
||||
msgstr "应在主可执行文件之后启动的第二个 .exe 的路径。"
|
||||
msgid ""
|
||||
"Path to a second .exe, script, or wrapper command. Example: systemd-run "
|
||||
"--user --scope --slice=app.slice"
|
||||
msgstr ""
|
||||
|
||||
msgid "CPU Cores Limit"
|
||||
msgstr "CPU 核心限制"
|
||||
@@ -984,6 +1018,13 @@ msgstr ""
|
||||
"有自己的本地内存和核心。将游戏绑定到单个节点可降低内存访问延迟,并减少开销较"
|
||||
"大的核心间切换。"
|
||||
|
||||
msgid "Sound Driver"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Force the Wine sound driver for this executable."
|
||||
msgstr "选择用于此可执行文件的 Wine 或 Proton 版本。"
|
||||
|
||||
msgid "just now"
|
||||
msgstr "刚刚"
|
||||
|
||||
@@ -1051,9 +1092,17 @@ msgstr "创建日志"
|
||||
msgid "Install"
|
||||
msgstr "安装"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Open Card"
|
||||
msgstr "打开 PPDB"
|
||||
|
||||
msgid "Reinstall"
|
||||
msgstr "重新安装"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Game not found."
|
||||
msgstr "未找到前缀"
|
||||
|
||||
msgid "Stop Log"
|
||||
msgstr "停止日志"
|
||||
|
||||
@@ -1377,9 +1426,6 @@ msgstr "确定要清除设置吗?此操作无法撤销。"
|
||||
msgid "Failed to remove PPDB file:\n"
|
||||
msgstr "移除 PPDB 文件失败:\n"
|
||||
|
||||
msgid "PPDB settings cleared."
|
||||
msgstr "PPDB 设置已清除。"
|
||||
|
||||
msgid "disabled"
|
||||
msgstr "已禁用"
|
||||
|
||||
@@ -1578,8 +1624,9 @@ msgstr "分辨率与缩放"
|
||||
msgid "Quick presets"
|
||||
msgstr "快速预设"
|
||||
|
||||
msgid "Enable Gamescope"
|
||||
msgstr "启用 Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Enable {0}"
|
||||
msgstr "启用 {0}"
|
||||
|
||||
msgid "Default"
|
||||
msgstr "默认"
|
||||
@@ -1617,8 +1664,9 @@ msgstr "图形界面未覆盖的其他 Gamescope 选项。"
|
||||
msgid "Example: --cursor-scale-height=1080 --force-orientation=left"
|
||||
msgstr "示例:--cursor-scale-height=1080 --force-orientation=left"
|
||||
|
||||
msgid "Disable Gamescope"
|
||||
msgstr "禁用 Gamescope"
|
||||
#, python-brace-format
|
||||
msgid "Disable {0}"
|
||||
msgstr "禁用 {0}"
|
||||
|
||||
msgid "Custom preset is empty. Save one first."
|
||||
msgstr "自定义预设为空。请先保存一个。"
|
||||
@@ -1974,9 +2022,6 @@ msgstr "预设"
|
||||
msgid "Actions"
|
||||
msgstr "操作"
|
||||
|
||||
msgid "Enable MangoHud"
|
||||
msgstr "启用 MangoHud"
|
||||
|
||||
msgid "Use system config"
|
||||
msgstr "使用系统配置"
|
||||
|
||||
@@ -2014,9 +2059,6 @@ msgstr "示例:battery,gpu_junction_temp,fps_color=39f900"
|
||||
msgid "All GPUs"
|
||||
msgstr "所有 GPU"
|
||||
|
||||
msgid "Disable MangoHud"
|
||||
msgstr "禁用 MangoHud"
|
||||
|
||||
msgid "Don't use system config"
|
||||
msgstr "不使用系统配置"
|
||||
|
||||
@@ -2032,6 +2074,24 @@ msgstr "写入系统 MangoHud 配置失败。"
|
||||
msgid "Failed to run preview."
|
||||
msgstr "运行预览失败。"
|
||||
|
||||
#, fuzzy
|
||||
msgid "Shaders"
|
||||
msgstr "分享"
|
||||
|
||||
msgid "AMD FidelityFX - Contrast Adaptive Sharpening"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Sharpness: {0}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press a button to choose"
|
||||
msgstr "按下按钮进行选择"
|
||||
|
||||
#, fuzzy, python-brace-format
|
||||
msgid "Toggle key: {0}"
|
||||
msgstr "切换键"
|
||||
|
||||
msgid "Prefix Manager"
|
||||
msgstr "前缀管理器"
|
||||
|
||||
@@ -2199,6 +2259,9 @@ msgstr "播放设备"
|
||||
msgid "Output"
|
||||
msgstr "输出"
|
||||
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr "重启"
|
||||
|
||||
|
||||
+477
-181
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
import shlex
|
||||
import shutil
|
||||
@@ -11,7 +12,7 @@ from portprotonqt.logger import get_logger
|
||||
from portprotonqt.icon_extractor import generate_thumbnail
|
||||
from portprotonqt.dialogs import AddGameDialog, FileExplorer, WinetricksDialog, ExeSettingsDialog
|
||||
from portprotonqt.game_card import GameCard
|
||||
from portprotonqt.animations import DetailPageAnimations
|
||||
from portprotonqt.animations import DetailPageAnimations, ExpandingSearchAnimation, LibraryControlsAnimation
|
||||
from portprotonqt.custom_widgets import ClickableLabel, AutoSizeButton, NavLabel, FlowLayout
|
||||
from portprotonqt.detail_pages import DetailPageManager
|
||||
from portprotonqt.portproton_api import PortProtonAPI, get_user_conf_setting, set_user_conf_setting
|
||||
@@ -26,7 +27,7 @@ from portprotonqt.image_utils import (
|
||||
load_pixmap_async,
|
||||
set_all_animated_covers_suspended,
|
||||
)
|
||||
from portprotonqt.steam_api import get_steam_game_info_async, get_full_steam_game_info_async, get_cached_steam_game_info, get_steam_installed_games, is_game_in_steam, fetch_sgdb_cover_async, get_steam_compatibilitytools_dir
|
||||
from portprotonqt.steam_api import get_steam_game_info_async, get_full_steam_game_info_async, get_cached_steam_game_info, get_steam_installed_games, is_game_in_steam, fetch_sgdb_cover_async, get_steam_compatibilitytools_dir, get_steam_launch_commands
|
||||
from portprotonqt.theme_manager import ThemeManager, load_theme_screenshots
|
||||
from portprotonqt.time_utils import save_last_launch, get_last_launch, get_playtime_for_exe, format_playtime, get_last_launch_timestamp, format_last_launch
|
||||
from portprotonqt.config import (
|
||||
@@ -35,6 +36,7 @@ from portprotonqt.config import (
|
||||
parse_desktop_entry,
|
||||
load_theme_metainfo,
|
||||
game_config,
|
||||
gamepad_config,
|
||||
favorites_config,
|
||||
proxy_config,
|
||||
display_config,
|
||||
@@ -58,7 +60,6 @@ from portprotonqt.cli import (
|
||||
)
|
||||
|
||||
from portprotonqt.tray_manager import restart_application_process
|
||||
from portprotonqt.version_utils import include_pinned_prefixes, version_sort_key
|
||||
from portprotonqt.localization import _, get_metadata_language, read_metadata_translations
|
||||
from portprotonqt.downloader import Downloader
|
||||
from portprotonqt.tray_manager import TrayManager
|
||||
@@ -67,22 +68,23 @@ from portprotonqt.virtual_keyboard import VirtualKeyboard
|
||||
from portprotonqt.disc_image_utils import DiscImageManager
|
||||
from portprotonqt.dialogs.proton_manager import show_proton_manager
|
||||
from portprotonqt.dialogs.prefix_backup import PrefixBackupDialog, PrefixBackupJob, PrefixBackupThread
|
||||
from portprotonqt.scripts_utils.prefix_backup import is_legacy_squashfs_backup
|
||||
from portprotonqt.scripts_utils.prefix_backup import BACKUP_EXTENSION, is_legacy_squashfs_backup
|
||||
from portprotonqt.tabs.control_hints import MainWindowControlHintsMixin
|
||||
from portprotonqt.tabs.system_tab import MainWindowSystemTabMixin
|
||||
from portprotonqt.tabs.workers import MainWindowWorkersMixin
|
||||
from portprotonqt.settings_manager import get_available_prefix_options, get_available_wine_options
|
||||
|
||||
from PySide6.QtWidgets import (QLineEdit, QMainWindow, QWidget, QVBoxLayout, QLabel, QHBoxLayout, QStackedWidget, QComboBox,
|
||||
QDialog, QFormLayout, QMessageBox, QApplication, QPushButton, QProgressBar, QCheckBox, QSizePolicy, QGridLayout, QScrollArea, QScroller, QSlider, QFrame)
|
||||
from PySide6.QtCore import Qt, QAbstractAnimation, QEvent, QUrl, Signal, QTimer, Slot, QProcess, QProcessEnvironment, QFileSystemWatcher, QStandardPaths
|
||||
from PySide6.QtGui import QIcon, QColor, QDesktopServices, QHideEvent, QShowEvent
|
||||
QDialog, QFormLayout, QMessageBox, QApplication, QPushButton, QProgressBar, QCheckBox, QSizePolicy, QGridLayout, QScrollArea, QScroller, QSlider, QFrame, QToolButton)
|
||||
from PySide6.QtCore import Qt, QAbstractAnimation, QEvent, QUrl, Signal, QTimer, Slot, QProcess, QProcessEnvironment, QFileSystemWatcher, QStandardPaths, QObject
|
||||
from PySide6.QtGui import QIcon, QColor, QDesktopServices, QHideEvent, QShowEvent, QGuiApplication
|
||||
from typing import cast
|
||||
from collections.abc import Callable
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from datetime import datetime
|
||||
|
||||
logger = get_logger(__name__)
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf")
|
||||
DISC_IMAGE_EXTENSIONS = (".iso", ".mdf", ".nrg")
|
||||
|
||||
class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWindowWorkersMixin, QMainWindow):
|
||||
games_loaded = Signal(list)
|
||||
@@ -141,31 +143,88 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if hasattr(self, "game_library_manager") and suspended:
|
||||
self.game_library_manager.stop_background_activity()
|
||||
|
||||
def _get_lg_versions_from_var(self) -> list[str]:
|
||||
"""Read Proton/Wine LG versions from scripts/var."""
|
||||
def _init_gamepad_tooltip(self) -> None:
|
||||
self._gamepad_tooltip_map: dict[QWidget, str] = {}
|
||||
self.gamepad_tooltip = QLabel()
|
||||
self.gamepad_tooltip.setWordWrap(True)
|
||||
self.gamepad_tooltip.setStyleSheet(self.theme.TOOLTIP_STYLE)
|
||||
self.gamepad_tooltip.setVisible(False)
|
||||
self.gamepad_tooltip.setParent(self)
|
||||
self.gamepad_tooltip.setWindowFlags(Qt.WindowType.ToolTip)
|
||||
self.gamepad_tooltip.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
|
||||
self.gamepad_tooltip.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
|
||||
self.gamepad_tooltip_timer = QTimer(self)
|
||||
self.gamepad_tooltip_timer.setSingleShot(True)
|
||||
self.gamepad_tooltip_timer.timeout.connect(lambda: self.gamepad_tooltip.setVisible(False))
|
||||
|
||||
def _register_gamepad_tooltip(self, widget: QWidget, text: str) -> None:
|
||||
self._gamepad_tooltip_map[widget] = text
|
||||
widget.installEventFilter(self)
|
||||
|
||||
def _show_gamepad_tooltip(self, show: bool, text: str = "", anchor_widget: QWidget | None = None) -> None:
|
||||
if not show or not text or anchor_widget is None or not anchor_widget.isVisible():
|
||||
self.gamepad_tooltip_timer.stop()
|
||||
self.gamepad_tooltip.setVisible(False)
|
||||
return
|
||||
|
||||
self.gamepad_tooltip.setText(text)
|
||||
self.gamepad_tooltip.setFixedSize(500, 300)
|
||||
font_metrics = self.gamepad_tooltip.fontMetrics()
|
||||
text_rect = font_metrics.boundingRect(
|
||||
0, 0, 480, 1000,
|
||||
Qt.TextFlag.TextWordWrap | Qt.TextFlag.TextExpandTabs,
|
||||
text,
|
||||
)
|
||||
required_width = min(500, text_rect.width() + 25)
|
||||
required_height = min(300, text_rect.height() + 25)
|
||||
anchor_pos = anchor_widget.mapToGlobal(anchor_widget.rect().bottomLeft())
|
||||
x = anchor_pos.x() + self.theme.settings_tooltip_offset_x
|
||||
y = anchor_pos.y() + self.theme.settings_tooltip_offset_y
|
||||
screen = QGuiApplication.screenAt(anchor_pos) or QGuiApplication.primaryScreen()
|
||||
if screen:
|
||||
available_rect = screen.availableGeometry()
|
||||
x = max(available_rect.left(), min(x, available_rect.right() - required_width))
|
||||
y = max(available_rect.top(), min(y, available_rect.bottom() - required_height))
|
||||
self.gamepad_tooltip.setFixedSize(required_width, required_height)
|
||||
self.gamepad_tooltip.move(x, y)
|
||||
self.gamepad_tooltip.setVisible(True)
|
||||
self.gamepad_tooltip_timer.start(max(2500, min(12000, 1500 + len(text) * 30)))
|
||||
|
||||
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
|
||||
if isinstance(obj, QWidget) and obj in getattr(self, "_gamepad_tooltip_map", {}):
|
||||
if event.type() in (QEvent.Type.Enter, QEvent.Type.FocusIn):
|
||||
self._show_gamepad_tooltip(True, self._gamepad_tooltip_map[obj], obj)
|
||||
elif event.type() in (QEvent.Type.Leave, QEvent.Type.FocusOut, QEvent.Type.MouseButtonPress):
|
||||
self._show_gamepad_tooltip(False)
|
||||
return super().eventFilter(obj, event)
|
||||
|
||||
def _get_var_default_setting(self, key: str, fallback: str) -> str:
|
||||
scripts_path = get_portproton_scripts_path()
|
||||
if not scripts_path:
|
||||
return []
|
||||
return fallback
|
||||
|
||||
var_path = os.path.join(scripts_path, "var")
|
||||
if not os.path.exists(var_path):
|
||||
return []
|
||||
return fallback
|
||||
|
||||
versions: list[str] = []
|
||||
target_keys = ("PW_PROTON_LG_VER", "PW_WINE_LG_VER")
|
||||
try:
|
||||
with open(var_path, encoding="utf-8") as var_file:
|
||||
for line in var_file:
|
||||
line_stripped = line.strip()
|
||||
for key in target_keys:
|
||||
prefix = f"export {key}="
|
||||
if line_stripped.startswith(prefix):
|
||||
value = line_stripped[len(prefix):].strip().strip('"\'')
|
||||
if value and value not in versions:
|
||||
versions.append(value)
|
||||
match = re.match(rf'^\s*check_variables\s+{key}\s+["\']?([^"\']+)', line)
|
||||
if match:
|
||||
return match.group(1)
|
||||
except OSError as exc:
|
||||
logger.warning("Failed to read LG versions from %s: %s", var_path, exc)
|
||||
return versions
|
||||
logger.warning("Failed to read default %s from %s: %s", key, var_path, exc)
|
||||
return fallback
|
||||
|
||||
def _set_combo_current_data(self, combo: QComboBox, value: str) -> None:
|
||||
for index in range(combo.count()):
|
||||
if combo.itemData(index) == value:
|
||||
combo.setCurrentIndex(index)
|
||||
return
|
||||
if value:
|
||||
combo.addItem(value, value)
|
||||
combo.setCurrentIndex(combo.count() - 1)
|
||||
|
||||
def __init__(self, app_name: str, version: str, launch_exe: str | None = None, resolution: tuple[int, int] | None = None, show_system_tab: bool = False):
|
||||
super().__init__()
|
||||
@@ -210,11 +269,13 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
QApplication.setStyle("Fusion")
|
||||
self.setStyleSheet(self.theme.MAIN_WINDOW_STYLE + self.theme.MESSAGE_BOX_STYLE)
|
||||
self.setAcceptDrops(True)
|
||||
self._init_gamepad_tooltip()
|
||||
self.current_exec_line = None
|
||||
self.currentDetailPage = None
|
||||
self.current_play_button = None
|
||||
self.current_focused_card: GameCard | None = None
|
||||
self.current_hovered_card: GameCard | None = None
|
||||
self._library_controls_hover_close_delayed = False
|
||||
self.pending_games = []
|
||||
self.total_games = 0
|
||||
self._loading_games = False
|
||||
@@ -540,6 +601,21 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
button.setIcon(icon)
|
||||
button.setText(_("Stop"))
|
||||
|
||||
def detach_install_button(self, page: QWidget) -> None:
|
||||
"""Detach install button before its detail page is deleted."""
|
||||
button = self.current_install_button
|
||||
if button is None:
|
||||
return
|
||||
try:
|
||||
if page.isAncestorOf(button):
|
||||
self.current_install_button = None
|
||||
self.current_install_button_text = None
|
||||
self.current_install_button_icon = None
|
||||
except RuntimeError:
|
||||
self.current_install_button = None
|
||||
self.current_install_button_text = None
|
||||
self.current_install_button_icon = None
|
||||
|
||||
def _set_install_button_progress_text(
|
||||
self, status: str | None = None, percent: float | None = None
|
||||
) -> None:
|
||||
@@ -567,6 +643,8 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
data = bytes(self.install_process.readAllStandardOutput().data()).decode(
|
||||
"utf-8", "ignore"
|
||||
)
|
||||
sys.stdout.write(data)
|
||||
sys.stdout.flush()
|
||||
self.install_output_buffer += data
|
||||
lines = self.install_output_buffer.splitlines(keepends=True)
|
||||
self.install_output_buffer = ""
|
||||
@@ -716,6 +794,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
@Slot(int, int)
|
||||
def on_install_finished(self, exit_code: int, exit_status: int):
|
||||
"""Handle installation finish."""
|
||||
script_name = self.current_install_script
|
||||
if self.install_stop_requested:
|
||||
if self.install_process:
|
||||
self.install_process.deleteLater()
|
||||
@@ -729,6 +808,8 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.install_process.deleteLater()
|
||||
self.install_process = None
|
||||
self._reset_install_state()
|
||||
if exit_code == 0:
|
||||
self.detail_page_manager.refresh_autoinstall_install_status(script_name)
|
||||
|
||||
def on_install_error(self, error: QProcess.ProcessError):
|
||||
"""Handle installation error."""
|
||||
@@ -745,7 +826,9 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
def on_games_loaded(self, games: list[tuple]):
|
||||
self._loading_games = False
|
||||
self.games = games
|
||||
self.game_library_manager.set_games(games)
|
||||
focus_first_card = not getattr(self, "_preserve_library_focus_after_load", False)
|
||||
self._preserve_library_focus_after_load = False
|
||||
self.game_library_manager.set_games(games, focus_first_card=focus_first_card)
|
||||
self._known_portproton_desktops = self._get_portproton_desktop_files()
|
||||
|
||||
# Clear the refresh in progress flag
|
||||
@@ -755,7 +838,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
# Re-enable the refresh button if it exists
|
||||
if hasattr(self, 'refreshButton'):
|
||||
self.refreshButton.setEnabled(True)
|
||||
self.refreshButton.setText(_("Refresh Grid"))
|
||||
self._gamepad_tooltip_map[self.refreshButton] = _("Refresh Grid")
|
||||
|
||||
def loadGames(self, force_load: bool = False):
|
||||
if self._loading_games:
|
||||
@@ -1196,39 +1279,86 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if index == 0 and self.isVisible() and not self.games:
|
||||
self.loadGames(force_load=True)
|
||||
|
||||
def createSearchWidget(self) -> tuple[QWidget, CustomLineEdit]:
|
||||
self.container = QWidget()
|
||||
self.container.setStyleSheet(self.theme.CONTAINER_STYLE)
|
||||
layout = QHBoxLayout(self.container)
|
||||
layout.setContentsMargins(0, 6, 0, 0)
|
||||
layout.setSpacing(10)
|
||||
def _set_combo_current_key(self, combo: QComboBox, keys: list[str], current: str) -> None:
|
||||
try:
|
||||
idx = keys.index(current)
|
||||
except ValueError:
|
||||
idx = 0
|
||||
combo.setCurrentIndex(idx)
|
||||
|
||||
# Quick Launch button
|
||||
def _create_library_combo(self, labels: list[str], tooltip: str) -> QComboBox:
|
||||
combo = QComboBox()
|
||||
combo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
combo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
combo.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
combo.addItems(labels)
|
||||
combo_style = getattr(self.theme, "LIBRARY_FILTER_COMBOBOX_STYLE", self.theme.COMBOBOX_STYLE)
|
||||
combo.setStyleSheet(combo_style + self.theme.SCROLL_STYLE)
|
||||
combo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self._register_gamepad_tooltip(combo, tooltip)
|
||||
return combo
|
||||
|
||||
def _on_library_sort_changed(self, index: int) -> None:
|
||||
if index < 0 or index >= len(self.sort_keys):
|
||||
return
|
||||
game_config.set_sort_method(self.sort_keys[index])
|
||||
if hasattr(self, "game_library_manager"):
|
||||
self.game_library_manager.update_game_grid(focus_first_card=False)
|
||||
|
||||
def _on_library_filter_changed(self, index: int) -> None:
|
||||
if index < 0 or index >= len(self.filter_keys):
|
||||
return
|
||||
game_config.set_display_filter(self.filter_keys[index])
|
||||
self.searchEdit.clear()
|
||||
self.games = []
|
||||
self._preserve_library_focus_after_load = True
|
||||
self.loadGames(force_load=True)
|
||||
|
||||
def _on_library_badge_view_changed(self, index: int) -> None:
|
||||
if index < 0 or index >= len(self.badge_view_keys):
|
||||
return
|
||||
badge_view_mode = self.badge_view_keys[index]
|
||||
if ui_config.get_economy_mode():
|
||||
badge_view_mode = "hidden"
|
||||
ui_config.set_badge_view_mode(badge_view_mode)
|
||||
display_filter = game_config.get_display_filter()
|
||||
for card in self.game_library_manager.game_card_cache.values():
|
||||
card.update_badge_visibility(display_filter)
|
||||
card.update_badge_view_mode(badge_view_mode)
|
||||
|
||||
def _toggle_library_controls(self) -> None:
|
||||
self.libraryControlsAnimation.toggle(self.libraryControlsButton.isChecked())
|
||||
|
||||
def _create_library_controls_widget(self) -> QHBoxLayout:
|
||||
self.libraryControlsWidget = QWidget()
|
||||
controls_layout = QHBoxLayout(self.libraryControlsWidget)
|
||||
controls_layout.setContentsMargins(0, 0, 0, 0)
|
||||
controls_layout.setSpacing(10)
|
||||
return controls_layout
|
||||
|
||||
def _add_library_action_buttons(self, buttons_layout: QHBoxLayout) -> None:
|
||||
self.quickLaunchButton = AutoSizeButton(_("Quick Launch"), icon=self.theme_manager.get_icon("play", as_path=True))
|
||||
self.quickLaunchButton.setStyleSheet(self.theme.ADDGAME_BACK_BUTTON_STYLE)
|
||||
self.quickLaunchButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.quickLaunchButton.clicked.connect(self.quickLaunch)
|
||||
layout.addWidget(self.quickLaunchButton)
|
||||
buttons_layout.addWidget(self.quickLaunchButton)
|
||||
|
||||
self.addGameButton = AutoSizeButton(_("Add a shortcut"), icon=self.theme_manager.get_icon("addgame", as_path=True))
|
||||
self.addGameButton.setStyleSheet(self.theme.ADDGAME_BACK_BUTTON_STYLE)
|
||||
self.addGameButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.addGameButton.clicked.connect(self.openAddGameDialog)
|
||||
layout.addWidget(self.addGameButton)
|
||||
|
||||
# Refresh button
|
||||
self.refreshButton = AutoSizeButton(_("Refresh Grid"), icon=self.theme_manager.get_icon("update", as_path=True))
|
||||
self.refreshButton.setStyleSheet(self.theme.ADDGAME_BACK_BUTTON_STYLE)
|
||||
self.refreshButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.refreshButton.clicked.connect(self.refreshGames)
|
||||
layout.addWidget(self.refreshButton)
|
||||
|
||||
layout.addStretch() # Add stretch to push search to the right
|
||||
buttons_layout.addWidget(self.addGameButton)
|
||||
buttons_layout.addStretch()
|
||||
|
||||
def _add_library_search(self, buttons_layout: QHBoxLayout) -> None:
|
||||
self.searchEdit = CustomLineEdit(self, theme=self.theme)
|
||||
icon: QIcon = cast(QIcon, self.theme_manager.get_icon("search"))
|
||||
action_pos = cast(QLineEdit.ActionPosition, QLineEdit.ActionPosition.LeadingPosition)
|
||||
self.searchEdit.addAction(icon, action_pos)
|
||||
self.searchIconAction = self.searchEdit.addAction(icon, action_pos)
|
||||
self.searchEdit.setMaximumWidth(200)
|
||||
self.searchEdit.setPlaceholderText(_("Search ..."))
|
||||
self.searchEdit.setClearButtonEnabled(True)
|
||||
@@ -1239,8 +1369,160 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.searchDebounceTimer.setSingleShot(True)
|
||||
self.searchDebounceTimer.setInterval(150) # Reduced debounce time for better responsiveness
|
||||
self.searchDebounceTimer.timeout.connect(self.on_search_changed)
|
||||
self.searchEdit.focusInEvent = self._wrap_search_focus_event(
|
||||
self.searchEdit.focusInEvent,
|
||||
True,
|
||||
)
|
||||
self.searchEdit.focusOutEvent = self._wrap_search_focus_event(
|
||||
self.searchEdit.focusOutEvent,
|
||||
False,
|
||||
)
|
||||
self.searchEdit.resizeEvent = self._wrap_search_resize_event(self.searchEdit.resizeEvent)
|
||||
buttons_layout.addWidget(self.searchEdit)
|
||||
|
||||
layout.addWidget(self.searchEdit)
|
||||
def _add_library_refresh_button(self, buttons_layout: QHBoxLayout) -> None:
|
||||
self.refreshButton = AutoSizeButton(icon=self.theme_manager.get_icon("update", as_path=True))
|
||||
button_style = getattr(
|
||||
self.theme,
|
||||
"LIBRARY_CONTROLS_BUTTON_STYLE",
|
||||
self.theme.ADDGAME_BACK_BUTTON_STYLE,
|
||||
)
|
||||
self.refreshButton.setStyleSheet(button_style)
|
||||
self.refreshButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.refreshButton.clicked.connect(self.refreshGames)
|
||||
self._register_gamepad_tooltip(self.refreshButton, _("Refresh Grid"))
|
||||
buttons_layout.addWidget(self.refreshButton)
|
||||
|
||||
def _add_library_controls_button(self, buttons_layout: QHBoxLayout) -> None:
|
||||
self.libraryControlsButton = AutoSizeButton(
|
||||
icon=self.theme_manager.get_icon("menu", as_path=True)
|
||||
)
|
||||
button_style = getattr(
|
||||
self.theme,
|
||||
"LIBRARY_CONTROLS_BUTTON_STYLE",
|
||||
self.theme.ADDGAME_BACK_BUTTON_STYLE,
|
||||
)
|
||||
self.libraryControlsButton.setStyleSheet(button_style)
|
||||
self.libraryControlsButton.setCheckable(True)
|
||||
self.libraryControlsButton.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.libraryControlsButton.clicked.connect(self._toggle_library_controls)
|
||||
self._register_gamepad_tooltip(self.libraryControlsButton, _("Library Settings"))
|
||||
buttons_layout.addWidget(self.libraryControlsButton)
|
||||
|
||||
def _setup_library_search_animation(self) -> None:
|
||||
self.searchAnimation = ExpandingSearchAnimation(
|
||||
self.searchEdit,
|
||||
self.theme,
|
||||
self.searchDebounceTimer.interval(),
|
||||
)
|
||||
collapsed_width = self.libraryControlsButton.sizeHint().width()
|
||||
expanded_width = self.searchEdit.maximumWidth()
|
||||
self.searchAnimation.setup(collapsed_width, expanded_width)
|
||||
QTimer.singleShot(0, self._center_collapsed_search_icon)
|
||||
|
||||
def _wrap_search_focus_event(self, original_event: Callable, expand: bool) -> Callable:
|
||||
def handle_focus_event(event):
|
||||
original_event(event)
|
||||
if not hasattr(self, "searchAnimation"):
|
||||
return
|
||||
if expand:
|
||||
self.searchAnimation.expand()
|
||||
else:
|
||||
self.searchAnimation.collapse()
|
||||
QTimer.singleShot(0, self._center_collapsed_search_icon)
|
||||
return handle_focus_event
|
||||
|
||||
def _wrap_search_resize_event(self, original_event: Callable) -> Callable:
|
||||
def handle_resize_event(event):
|
||||
original_event(event)
|
||||
self._center_collapsed_search_icon()
|
||||
return handle_resize_event
|
||||
|
||||
def _center_collapsed_search_icon(self) -> None:
|
||||
animation = getattr(self, "searchAnimation", None)
|
||||
if animation is None or self.searchEdit.maximumWidth() != animation.collapsed_width:
|
||||
return
|
||||
for button in self.searchEdit.findChildren(QToolButton):
|
||||
if button.defaultAction() is self.searchIconAction:
|
||||
size = button.sizeHint()
|
||||
x = (self.searchEdit.width() - size.width()) // 2
|
||||
y = (self.searchEdit.height() - size.height()) // 2
|
||||
button.setGeometry(x, y, size.width(), size.height())
|
||||
return
|
||||
|
||||
def _add_library_filter_controls(self, controls_layout: QHBoxLayout) -> None:
|
||||
self.sort_keys = ["last_launch", "playtime", "alphabetical"]
|
||||
self.sort_labels = [_("Last launch"), _("Time spent"), _("Alphabetical")]
|
||||
self.gamesSortCombo = self._create_library_combo(self.sort_labels, _("Sort Method:"))
|
||||
self._set_combo_current_key(
|
||||
self.gamesSortCombo,
|
||||
self.sort_keys,
|
||||
game_config.get_sort_method(),
|
||||
)
|
||||
self.gamesSortCombo.currentIndexChanged.connect(self._on_library_sort_changed)
|
||||
self.gamesSortCombo.activated.connect(self._delay_library_controls_hover_close)
|
||||
controls_layout.addStretch()
|
||||
controls_layout.addWidget(self.gamesSortCombo)
|
||||
|
||||
self.filter_keys = ["all", "steam", "portproton", "favorites"]
|
||||
self.filter_labels = [_("All"), "Steam", "PortProton", _("Favorites")]
|
||||
self.gamesDisplayCombo = self._create_library_combo(self.filter_labels, _("Display Filter:"))
|
||||
self._set_combo_current_key(
|
||||
self.gamesDisplayCombo,
|
||||
self.filter_keys,
|
||||
game_config.get_display_filter(),
|
||||
)
|
||||
self.gamesDisplayCombo.currentIndexChanged.connect(self._on_library_filter_changed)
|
||||
self.gamesDisplayCombo.activated.connect(self._delay_library_controls_hover_close)
|
||||
controls_layout.addWidget(self.gamesDisplayCombo)
|
||||
|
||||
self.badge_view_keys = ["detailed", "compact", "hidden"]
|
||||
self.badge_view_labels = [_("Detailed"), _("Compact"), _("Hidden")]
|
||||
self.gamesBadgeViewCombo = self._create_library_combo(self.badge_view_labels, _("Badge View Type:"))
|
||||
self._set_combo_current_key(
|
||||
self.gamesBadgeViewCombo,
|
||||
self.badge_view_keys,
|
||||
ui_config.get_badge_view_mode(),
|
||||
)
|
||||
if ui_config.get_economy_mode():
|
||||
self.gamesBadgeViewCombo.setCurrentIndex(self.badge_view_keys.index("hidden"))
|
||||
self.gamesBadgeViewCombo.setEnabled(False)
|
||||
self.gamesBadgeViewCombo.currentIndexChanged.connect(self._on_library_badge_view_changed)
|
||||
self.gamesBadgeViewCombo.activated.connect(self._delay_library_controls_hover_close)
|
||||
controls_layout.addWidget(self.gamesBadgeViewCombo)
|
||||
|
||||
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)
|
||||
|
||||
def _allow_library_controls_hover_close(self) -> None:
|
||||
self._library_controls_hover_close_delayed = False
|
||||
|
||||
def createSearchWidget(self) -> tuple[QWidget, CustomLineEdit]:
|
||||
self.container = QWidget()
|
||||
self.container.setStyleSheet(self.theme.CONTAINER_STYLE)
|
||||
layout = QVBoxLayout(self.container)
|
||||
layout.setContentsMargins(0, 6, 0, 0)
|
||||
layout.setSpacing(10)
|
||||
buttons_layout = QHBoxLayout()
|
||||
buttons_layout.setContentsMargins(0, 0, 0, 0)
|
||||
buttons_layout.setSpacing(10)
|
||||
controls_layout = self._create_library_controls_widget()
|
||||
|
||||
self._add_library_action_buttons(buttons_layout)
|
||||
self._add_library_search(buttons_layout)
|
||||
self._add_library_refresh_button(buttons_layout)
|
||||
self.libraryControlsAnimation = LibraryControlsAnimation(
|
||||
self.libraryControlsWidget,
|
||||
self.theme,
|
||||
self.searchDebounceTimer.interval(),
|
||||
)
|
||||
self._add_library_controls_button(buttons_layout)
|
||||
self._setup_library_search_animation()
|
||||
self._add_library_filter_controls(controls_layout)
|
||||
self.libraryControlsAnimation.setup_hidden()
|
||||
layout.addLayout(buttons_layout)
|
||||
layout.addWidget(self.libraryControlsWidget)
|
||||
return self.container, self.searchEdit
|
||||
|
||||
def refreshGames(self):
|
||||
@@ -1257,7 +1539,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
|
||||
# Disable the refresh button during refresh to prevent multiple clicks
|
||||
self.refreshButton.setEnabled(False)
|
||||
self.refreshButton.setText(_("Refreshing..."))
|
||||
self._gamepad_tooltip_map[self.refreshButton] = _("Refreshing...")
|
||||
|
||||
# Clear the game card cache and layout to force reload of custom data
|
||||
if hasattr(self, 'game_library_manager') and self.game_library_manager:
|
||||
@@ -1339,7 +1621,8 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
def dragEnterEvent(self, event):
|
||||
if event.mimeData().hasUrls():
|
||||
for url in event.mimeData().urls():
|
||||
if url.toLocalFile().lower().endswith(LAUNCH_FILE_EXTENSIONS):
|
||||
path = url.toLocalFile().lower()
|
||||
if path.endswith(LAUNCH_FILE_EXTENSIONS) or path.endswith(BACKUP_EXTENSION):
|
||||
event.acceptProposedAction()
|
||||
return
|
||||
event.ignore()
|
||||
@@ -1347,8 +1630,14 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
def dropEvent(self, event):
|
||||
for url in event.mimeData().urls():
|
||||
path = url.toLocalFile()
|
||||
if path.lower().endswith(LAUNCH_FILE_EXTENSIONS):
|
||||
path_lower = path.lower()
|
||||
if path_lower.endswith(BACKUP_EXTENSION):
|
||||
self._perform_restore(path)
|
||||
event.acceptProposedAction()
|
||||
break
|
||||
if path_lower.endswith(LAUNCH_FILE_EXTENSIONS):
|
||||
self.openAddGameDialog(path)
|
||||
event.acceptProposedAction()
|
||||
break
|
||||
|
||||
def openAddGameDialog(self, exe_path=None):
|
||||
@@ -1570,8 +1859,8 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.auto_size_slider.setValue(self.auto_card_width)
|
||||
self.auto_size_slider.setTickInterval(10)
|
||||
self.auto_size_slider.setFixedWidth(150)
|
||||
self.auto_size_slider.setToolTip(f"{self.auto_card_width} px")
|
||||
self.auto_size_slider.setStyleSheet(self.theme.SLIDER_SIZE_STYLE)
|
||||
self._register_gamepad_tooltip(self.auto_size_slider, f"{self.auto_card_width} px")
|
||||
self.auto_size_slider.sliderReleased.connect(self.on_auto_slider_released)
|
||||
|
||||
sliderLayout = QHBoxLayout()
|
||||
@@ -1584,7 +1873,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if auto_layout_mode == "list":
|
||||
self.auto_card_width = self.auto_size_slider.maximum()
|
||||
self.auto_size_slider.setValue(self.auto_card_width)
|
||||
self.auto_size_slider.setToolTip(f"{self.auto_card_width} px")
|
||||
self._gamepad_tooltip_map[self.auto_size_slider] = f"{self.auto_card_width} px"
|
||||
|
||||
# Store cards
|
||||
self.autoInstallGameCards = {}
|
||||
@@ -1663,6 +1952,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
card_width=self.auto_card_width,
|
||||
parent=self.autoInstallContainer,
|
||||
)
|
||||
card.autoinstall_exe_name = exe_name
|
||||
|
||||
# Hide badges and favorite button
|
||||
if hasattr(card, 'steamLabel'):
|
||||
@@ -1740,7 +2030,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if hasattr(self, 'auto_size_slider') and self.auto_size_slider:
|
||||
if auto_layout_mode != "list":
|
||||
self.auto_card_width = self.auto_size_slider.value()
|
||||
self.auto_size_slider.setToolTip(f"{self.auto_card_width} px")
|
||||
self._gamepad_tooltip_map[self.auto_size_slider] = f"{self.auto_card_width} px"
|
||||
if auto_layout_mode != "list":
|
||||
ui_config.set_auto_card_width(self.auto_card_width)
|
||||
if not hasattr(self, 'allAutoInstallCards'):
|
||||
@@ -1782,22 +2072,14 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if self.portproton_location is None:
|
||||
return
|
||||
|
||||
dist_path = os.path.join(self.portproton_location, "data", "dist")
|
||||
prefixes_path = os.path.join(self.portproton_location, "data", "prefixes")
|
||||
self._normalize_prefix_directories(prefixes_path)
|
||||
|
||||
formLayout = QFormLayout()
|
||||
formLayout.setContentsMargins(0, 10, 0, 0)
|
||||
formLayout.setSpacing(self.theme.wineSettingsSetSpacing)
|
||||
formLayout.setLabelAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||
|
||||
self.wine_versions = []
|
||||
if os.path.exists(dist_path):
|
||||
self.wine_versions = sorted([d for d in os.listdir(dist_path) if os.path.isdir(os.path.join(dist_path, d))], key=version_sort_key)
|
||||
for version in self._get_lg_versions_from_var():
|
||||
if version not in self.wine_versions:
|
||||
self.wine_versions.append(version)
|
||||
self.wine_versions.sort(key=version_sort_key)
|
||||
self.wine_versions = get_available_wine_options(
|
||||
self.portproton_location, include_lg_aliases=True
|
||||
)
|
||||
self.wineCombo = QComboBox()
|
||||
self.wineCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
@@ -1814,13 +2096,14 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.wineTitleLabel.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
if self.wine_versions:
|
||||
self.wineCombo.setCurrentIndex(0)
|
||||
default_wine = get_user_conf_setting('PW_DEFAULT_WINE_USE')
|
||||
if default_wine:
|
||||
if self.wineCombo.findText(default_wine) == -1:
|
||||
self.wineCombo.addItem(default_wine)
|
||||
self.wineCombo.setCurrentText(default_wine)
|
||||
formLayout.addRow(self.wineTitleLabel, self.wineCombo)
|
||||
|
||||
prefixes = [
|
||||
d for d in os.listdir(prefixes_path)
|
||||
if os.path.isdir(os.path.join(prefixes_path, d))
|
||||
] if os.path.exists(prefixes_path) else []
|
||||
self.prefixes = include_pinned_prefixes(prefixes)
|
||||
self.prefixes = get_available_prefix_options(self.portproton_location)
|
||||
self.prefixCombo = QComboBox()
|
||||
self.prefixCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
@@ -1842,8 +2125,45 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.prefixTitleLabel.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
if self.prefixes:
|
||||
self.prefixCombo.setCurrentIndex(0)
|
||||
default_prefix = get_user_conf_setting('PW_DEFAULT_PREFIX_NAME')
|
||||
if default_prefix:
|
||||
self.prefixCombo.setCurrentText(default_prefix)
|
||||
formLayout.addRow(self.prefixTitleLabel, self.prefixCombo)
|
||||
|
||||
self.defaultVulkanCombo = QComboBox()
|
||||
self.defaultVulkanCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
self.defaultVulkanCombo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.defaultVulkanCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.defaultVulkanCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.defaultVulkanCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
default_vulkan_from_var = self._get_var_default_setting("PW_VULKAN_USE", "6")
|
||||
vulkan_options = [
|
||||
(_("Newest"), "6"),
|
||||
(_("Stable"), "2"),
|
||||
("Sarek", "1"),
|
||||
("WINED3D - OpenGL", "0"),
|
||||
]
|
||||
for vulkan_name, vulkan_value in vulkan_options:
|
||||
if vulkan_value == default_vulkan_from_var:
|
||||
self.defaultVulkanCombo.addItem(vulkan_name, "")
|
||||
break
|
||||
if self.defaultVulkanCombo.count() == 0:
|
||||
self.defaultVulkanCombo.addItem(default_vulkan_from_var, "")
|
||||
for vulkan_name, vulkan_value in vulkan_options:
|
||||
if vulkan_value != default_vulkan_from_var:
|
||||
self.defaultVulkanCombo.addItem(vulkan_name, vulkan_value)
|
||||
self._set_combo_current_data(
|
||||
self.defaultVulkanCombo, get_user_conf_setting('PW_DEFAULT_VULKAN_USE') or ""
|
||||
)
|
||||
self.defaultVulkanTitleLabel = QLabel(_("Vulkan Backend") + ":")
|
||||
self.defaultVulkanTitleLabel.setStyleSheet(self.theme.PARAMS_TITLE_STYLE)
|
||||
self.defaultVulkanTitleLabel.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
formLayout.addRow(self.defaultVulkanTitleLabel, self.defaultVulkanCombo)
|
||||
|
||||
layout.addLayout(formLayout)
|
||||
|
||||
# --- Wine Tools ---
|
||||
@@ -1851,6 +2171,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
tools_grid.setSpacing(6)
|
||||
|
||||
tools = [
|
||||
("default", _("Use by default")),
|
||||
("--winecfg", _("Wine Configuration")),
|
||||
("--winereg", _("Registry Editor")),
|
||||
("--winefile", _("File Explorer")),
|
||||
@@ -1864,7 +2185,10 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
btn = AutoSizeButton(tool_name, update_size=False)
|
||||
btn.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
btn.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
btn.clicked.connect(lambda checked, t=tool_cmd: self.launch_generic_tool(t))
|
||||
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))
|
||||
tools_grid.addWidget(btn, row, col)
|
||||
|
||||
for col in range(3):
|
||||
@@ -1915,6 +2239,16 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
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()
|
||||
@@ -2148,16 +2482,9 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if not self.portproton_location:
|
||||
return
|
||||
|
||||
dist_path = os.path.join(self.portproton_location, "data", "dist")
|
||||
if not os.path.exists(dist_path):
|
||||
return
|
||||
|
||||
# Update the wine versions list with sorting
|
||||
self.wine_versions = sorted([d for d in os.listdir(dist_path) if os.path.isdir(os.path.join(dist_path, d))], key=version_sort_key)
|
||||
for version in self._get_lg_versions_from_var():
|
||||
if version not in self.wine_versions:
|
||||
self.wine_versions.append(version)
|
||||
self.wine_versions.sort(key=version_sort_key)
|
||||
self.wine_versions = get_available_wine_options(
|
||||
self.portproton_location, include_lg_aliases=True
|
||||
)
|
||||
self.wineCombo.clear()
|
||||
self.wineCombo.addItems(self.wine_versions)
|
||||
|
||||
@@ -2172,12 +2499,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if os.path.exists(prefixes_path):
|
||||
self._normalize_prefix_directories(prefixes_path)
|
||||
|
||||
# Update the prefixes list with sorting
|
||||
prefixes = [
|
||||
d for d in os.listdir(prefixes_path)
|
||||
if os.path.isdir(os.path.join(prefixes_path, d))
|
||||
] if os.path.exists(prefixes_path) else []
|
||||
self.prefixes = include_pinned_prefixes(prefixes)
|
||||
self.prefixes = get_available_prefix_options(self.portproton_location)
|
||||
self.prefixCombo.clear()
|
||||
self.prefixCombo.addItems(self.prefixes)
|
||||
if normalized_current_prefix:
|
||||
@@ -2222,10 +2544,9 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
|
||||
assert self.portproton_location is not None
|
||||
prefix_path = os.path.join(self.portproton_location, "data", "prefixes", selected_prefix)
|
||||
wine_path = os.path.join(self.portproton_location, "data", "dist", selected_wine, "bin", "wine")
|
||||
|
||||
# Open Winetricks dialog
|
||||
dialog = WinetricksDialog(self, self.theme, prefix_path, wine_path)
|
||||
dialog = WinetricksDialog(self, self.theme, prefix_path, selected_wine)
|
||||
dialog.exec()
|
||||
|
||||
def createPortProtonTab(self):
|
||||
@@ -2297,8 +2618,8 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.timeDetailCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.time_keys = ["detailed", "brief"]
|
||||
self.time_labels = [_("Detailed"), _("Brief")]
|
||||
self.time_keys = ["detailed", "brief", "hidden"]
|
||||
self.time_labels = [_("Detailed"), _("Brief"), _("Hidden")]
|
||||
self.timeDetailCombo.addItems(self.time_labels)
|
||||
self.timeDetailCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.timeDetailCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
@@ -2314,84 +2635,6 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.timeDetailCombo.setCurrentIndex(idx)
|
||||
genForm.addRow(self.timeDetailTitle, self.timeDetailCombo)
|
||||
|
||||
self.gamesSortCombo = QComboBox()
|
||||
self.gamesSortCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
self.gamesSortCombo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.gamesSortCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.sort_keys = ["last_launch", "playtime", "alphabetical"]
|
||||
self.sort_labels = [_("Last launch"), _("Time spent"), _("Alphabetical")]
|
||||
self.gamesSortCombo.addItems(self.sort_labels)
|
||||
self.gamesSortCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.gamesSortCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.gamesSortTitle = QLabel(_("Sort Method:"))
|
||||
self.gamesSortTitle.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
self.gamesSortTitle.setStyleSheet(self.theme.SETTINGS_TITLE_STYLE)
|
||||
self.gamesSortTitle.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
current = game_config.get_sort_method()
|
||||
try:
|
||||
idx = self.sort_keys.index(current)
|
||||
except ValueError:
|
||||
idx = 0
|
||||
self.gamesSortCombo.setCurrentIndex(idx)
|
||||
genForm.addRow(self.gamesSortTitle, self.gamesSortCombo)
|
||||
|
||||
self.filter_keys = ["all", "steam", "portproton", "favorites"]
|
||||
self.filter_labels = [_("All"), "Steam", "PortProton", _("Favorites")]
|
||||
self.gamesDisplayCombo = QComboBox()
|
||||
self.gamesDisplayCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
self.gamesDisplayCombo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.gamesDisplayCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.gamesDisplayCombo.addItems(self.filter_labels)
|
||||
self.gamesDisplayCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.gamesDisplayCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.gamesDisplayTitle = QLabel(_("Display Filter:"))
|
||||
self.gamesDisplayTitle.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
self.gamesDisplayTitle.setStyleSheet(self.theme.SETTINGS_TITLE_STYLE)
|
||||
self.gamesDisplayTitle.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
current = game_config.get_display_filter()
|
||||
try:
|
||||
idx = self.filter_keys.index(current)
|
||||
except ValueError:
|
||||
idx = 0
|
||||
self.gamesDisplayCombo.setCurrentIndex(idx)
|
||||
genForm.addRow(self.gamesDisplayTitle, self.gamesDisplayCombo)
|
||||
|
||||
self.badge_view_keys = ["detailed", "compact", "hidden"]
|
||||
self.badge_view_labels = [_("Detailed"), _("Compact"), _("Hidden")]
|
||||
self.badgeViewCombo = QComboBox()
|
||||
self.badgeViewCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
self.badgeViewCombo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.badgeViewCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.badgeViewCombo.addItems(self.badge_view_labels)
|
||||
self.badgeViewCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.badgeViewCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.badgeViewTitle = QLabel(_("Badge View Type:"))
|
||||
self.badgeViewTitle.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
self.badgeViewTitle.setStyleSheet(self.theme.SETTINGS_TITLE_STYLE)
|
||||
self.badgeViewTitle.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
current = ui_config.get_badge_view_mode()
|
||||
try:
|
||||
idx = self.badge_view_keys.index(current)
|
||||
except ValueError:
|
||||
idx = 0
|
||||
self.badgeViewCombo.setCurrentIndex(idx)
|
||||
if ui_config.get_economy_mode():
|
||||
self.badgeViewCombo.setCurrentIndex(self.badge_view_keys.index("hidden"))
|
||||
self.badgeViewCombo.setEnabled(False)
|
||||
genForm.addRow(self.badgeViewTitle, self.badgeViewCombo)
|
||||
|
||||
# 2. Interface Settings Section
|
||||
uiFrame, uiForm = create_section(_("Interface Settings"), self.theme)
|
||||
uiForm.setRowWrapPolicy(QFormLayout.RowWrapPolicy.DontWrapRows)
|
||||
@@ -2422,6 +2665,31 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.trayMenuModeCombo.setCurrentIndex(idx)
|
||||
uiForm.addRow(self.trayMenuModeTitle, self.trayMenuModeCombo)
|
||||
|
||||
self.gamepad_type_keys = ["auto", "xbox", "playstation"]
|
||||
self.gamepad_type_labels = [_("Auto"), "Xbox", "PlayStation"]
|
||||
self.gamepadTypeCombo = QComboBox()
|
||||
self.gamepadTypeCombo.view().window().setWindowFlags(
|
||||
Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint
|
||||
)
|
||||
self.gamepadTypeCombo.view().window().setAttribute(
|
||||
Qt.WidgetAttribute.WA_TranslucentBackground
|
||||
)
|
||||
self.gamepadTypeCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.gamepadTypeCombo.addItems(self.gamepad_type_labels)
|
||||
self.gamepadTypeCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
|
||||
self.gamepadTypeCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.gamepadTypeTitle = QLabel(_("Gamepad Type:"))
|
||||
self.gamepadTypeTitle.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
self.gamepadTypeTitle.setStyleSheet(self.theme.SETTINGS_TITLE_STYLE)
|
||||
self.gamepadTypeTitle.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
current_gamepad_type = gamepad_config.get_gamepad_type()
|
||||
try:
|
||||
idx = self.gamepad_type_keys.index(current_gamepad_type)
|
||||
except ValueError:
|
||||
idx = 0
|
||||
self.gamepadTypeCombo.setCurrentIndex(idx)
|
||||
uiForm.addRow(self.gamepadTypeTitle, self.gamepadTypeCombo)
|
||||
|
||||
self.fullscreenCheckBox = QCheckBox()
|
||||
self.fullscreenCheckBox.setStyleSheet(self.theme.CHECKBOX_STYLE)
|
||||
self.fullscreenCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
@@ -2448,7 +2716,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
current_auto_fullscreen = display_config.get_auto_fullscreen_gamepad()
|
||||
self.autoFullscreenGamepadCheckBox.setChecked(current_auto_fullscreen)
|
||||
auto_fullscreen_layout = QHBoxLayout()
|
||||
auto_fullscreen_layout.setContentsMargins(self.theme.portProtonPageHorizontalSpacing, 0, 0, 0)
|
||||
auto_fullscreen_layout.setContentsMargins(0, 0, 0, 0)
|
||||
auto_fullscreen_layout.addWidget(self.autoFullscreenGamepadCheckBox)
|
||||
auto_fullscreen_layout.addWidget(self.autoFullscreenGamepadTitle)
|
||||
auto_fullscreen_layout.addStretch()
|
||||
@@ -2576,10 +2844,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
self.economyModeCheckBox.setChecked(ui_config.get_economy_mode())
|
||||
def update_economy_controls(enabled: bool):
|
||||
if enabled:
|
||||
self.badgeViewCombo.setCurrentIndex(self.badge_view_keys.index("hidden"))
|
||||
self.badgeViewCombo.setEnabled(False)
|
||||
if hasattr(self, "gamesBadgeViewCombo"):
|
||||
self.gamesBadgeViewCombo.setCurrentIndex(self.badge_view_keys.index("hidden"))
|
||||
self.gamesBadgeViewCombo.setEnabled(False)
|
||||
return
|
||||
self.badgeViewCombo.setEnabled(True)
|
||||
if hasattr(self, "gamesBadgeViewCombo"):
|
||||
self.gamesBadgeViewCombo.setEnabled(True)
|
||||
|
||||
self.economyModeCheckBox.toggled.connect(update_economy_controls)
|
||||
update_economy_controls(self.economyModeCheckBox.isChecked())
|
||||
@@ -2816,21 +3086,19 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
time_key = self.time_keys[time_idx]
|
||||
ui_config.set_time_detail_level(time_key)
|
||||
|
||||
sort_idx = self.gamesSortCombo.currentIndex()
|
||||
sort_key = self.sort_keys[sort_idx]
|
||||
game_config.set_sort_method(sort_key)
|
||||
|
||||
filter_idx = self.gamesDisplayCombo.currentIndex()
|
||||
filter_key = self.filter_keys[filter_idx]
|
||||
economy_mode = self.economyModeCheckBox.isChecked()
|
||||
ui_config.set_economy_mode(economy_mode)
|
||||
economy_mode_changed = previous_economy_mode != economy_mode
|
||||
game_config.set_display_filter(filter_key)
|
||||
badge_view_idx = self.badgeViewCombo.currentIndex()
|
||||
badge_view_idx = self.gamesBadgeViewCombo.currentIndex()
|
||||
badge_view_mode = self.badge_view_keys[badge_view_idx]
|
||||
if economy_mode:
|
||||
badge_view_mode = "hidden"
|
||||
ui_config.set_badge_view_mode(badge_view_mode)
|
||||
library_badge_index = self.badge_view_keys.index(badge_view_mode)
|
||||
if self.gamesBadgeViewCombo.currentIndex() != library_badge_index:
|
||||
self.gamesBadgeViewCombo.blockSignals(True)
|
||||
self.gamesBadgeViewCombo.setCurrentIndex(library_badge_index)
|
||||
self.gamesBadgeViewCombo.blockSignals(False)
|
||||
|
||||
proxy_url = self.proxyUrlEdit.text().strip()
|
||||
proxy_user = self.proxyUserEdit.text().strip()
|
||||
@@ -2843,6 +3111,10 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
auto_fullscreen_gamepad = self.autoFullscreenGamepadCheckBox.isChecked()
|
||||
display_config.set_auto_fullscreen_gamepad(auto_fullscreen_gamepad)
|
||||
|
||||
gamepad_type_idx = self.gamepadTypeCombo.currentIndex()
|
||||
gamepad_type = self.gamepad_type_keys[gamepad_type_idx]
|
||||
gamepad_config.set_gamepad_type(gamepad_type)
|
||||
|
||||
autostart_enabled = self.autostartCheckBox.isChecked()
|
||||
display_config.set_autostart_enabled(autostart_enabled)
|
||||
if not apply_xdg_autostart(autostart_enabled):
|
||||
@@ -2888,6 +3160,7 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
hide_autoinstall = self.hideAutoInstallTabCheckBox.isChecked()
|
||||
|
||||
if hasattr(self, 'input_manager'):
|
||||
self._apply_gamepad_type_setting()
|
||||
self.updateControlHints()
|
||||
if hasattr(self, 'keyboard'):
|
||||
self.keyboard.update_keyboard()
|
||||
@@ -2896,8 +3169,9 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
if self.game_library_manager.gamesListLayout is not None:
|
||||
self.game_library_manager.clear_layout(self.game_library_manager.gamesListLayout)
|
||||
else:
|
||||
display_filter = game_config.get_display_filter()
|
||||
for card in self.game_library_manager.game_card_cache.values():
|
||||
card.update_badge_visibility(filter_key)
|
||||
card.update_badge_visibility(display_filter)
|
||||
card.update_badge_view_mode(badge_view_mode)
|
||||
|
||||
if (
|
||||
@@ -2969,6 +3243,13 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
# Save the hide auto-install tab setting to config
|
||||
ui_config.set_hide_autoinstall_tab(hide_autoinstall)
|
||||
|
||||
def _apply_gamepad_type_setting(self) -> None:
|
||||
"""Apply configured gamepad type to current input manager."""
|
||||
input_manager = getattr(self, "input_manager", None)
|
||||
if input_manager is None:
|
||||
return
|
||||
input_manager.apply_gamepad_type_setting()
|
||||
|
||||
def createThemeTab(self):
|
||||
"""Themes tab"""
|
||||
self.themeTabWidget = QWidget()
|
||||
@@ -3744,11 +4025,26 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind
|
||||
return str(game[0])
|
||||
return ""
|
||||
|
||||
def _launch_steam_game(self, exec_line: str) -> None:
|
||||
appid = exec_line.rsplit("/", 1)[-1]
|
||||
if not appid.isdigit():
|
||||
logger.warning("Invalid Steam URI: %s", exec_line)
|
||||
return
|
||||
|
||||
for command in get_steam_launch_commands(appid):
|
||||
try:
|
||||
subprocess.Popen(command)
|
||||
return
|
||||
except OSError as e:
|
||||
logger.warning("Failed to launch Steam app %s with %s: %s", appid, command[0], e)
|
||||
|
||||
if not QDesktopServices.openUrl(QUrl(exec_line)):
|
||||
logger.warning("Failed to open Steam URI: %s", exec_line)
|
||||
|
||||
def toggleGame(self, exec_line, button=None, game_name=None):
|
||||
# Handle Steam games
|
||||
if exec_line.startswith("steam://"):
|
||||
url = QUrl(exec_line)
|
||||
QDesktopServices.openUrl(url)
|
||||
self._launch_steam_game(exec_line)
|
||||
return
|
||||
|
||||
# Handle PortProton games
|
||||
|
||||
@@ -38,6 +38,7 @@ install_data(
|
||||
['animations/__init__.py',
|
||||
'animations/detail_page.py',
|
||||
'animations/game_card.py',
|
||||
'animations/library_controls.py',
|
||||
'animations/virtual_keyboard.py',
|
||||
],
|
||||
install_dir: pythondir / meson.project_name() / 'animations',
|
||||
@@ -64,6 +65,7 @@ install_data(
|
||||
'dialogs/settings_dialog.py',
|
||||
'dialogs/settings_mangohud.py',
|
||||
'dialogs/settings_gamescope.py',
|
||||
'dialogs/settings_vkbasalt.py',
|
||||
'dialogs/proton_manager.py',
|
||||
'dialogs/prefix_backup.py',
|
||||
'dialogs/wine_loader.py',
|
||||
@@ -123,7 +125,9 @@ install_data(
|
||||
['scripts_utils/__init__.py',
|
||||
'scripts_utils/dbus_tools.py',
|
||||
'scripts_utils/easyterm.py',
|
||||
'scripts_utils/graphics_detector.py',
|
||||
'scripts_utils/idle_inhibit.py',
|
||||
'scripts_utils/mount_points.py',
|
||||
'scripts_utils/prefix_backup.py',
|
||||
'scripts_utils/power_profiles.py',
|
||||
'scripts_utils/shortcut_tools.py',
|
||||
@@ -165,7 +169,7 @@ install_subdir(
|
||||
|
||||
# Compile and install locales from .po files
|
||||
msgfmt = find_program('msgfmt', required: true)
|
||||
foreach lang : ['de', 'es', 'pt', 'ru', 'zh_CN']
|
||||
foreach lang : ['be', 'ru', 'es', 'pt_BR', 'zh_CN']
|
||||
mo_target = configure_file(
|
||||
input: 'locales' / lang / 'LC_MESSAGES' / 'portprotonqt.po',
|
||||
output: lang + '_portprotonqt.mo',
|
||||
|
||||
@@ -932,12 +932,12 @@ def get_user_conf_setting(variable_name):
|
||||
|
||||
clean_lines = []
|
||||
for line in result.stdout.splitlines():
|
||||
stripped_line = line.strip()
|
||||
stripped_line = re.sub(r'\x1b\[[0-9;]*[A-Za-z]', '', line).strip()
|
||||
if not stripped_line:
|
||||
continue
|
||||
if any(char in stripped_line for char in "█░▄▀╔╗╚╝║"):
|
||||
continue
|
||||
if stripped_line.startswith(("Warning:", "Info:")):
|
||||
if re.match(r'^\[?[0-9;]*m?\s*(Info|Warning|Error|OK):', stripped_line):
|
||||
continue
|
||||
if "must use subscript when assigning associative array" in stripped_line:
|
||||
continue
|
||||
|
||||
@@ -43,9 +43,11 @@ CONF_RENDER_INTERVAL_MS = 16
|
||||
XDG_DATA_HOME = os.getenv(
|
||||
"XDG_DATA_HOME", os.path.join(os.path.expanduser("~"), ".local", "share")
|
||||
)
|
||||
|
||||
PACKAGE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
SCHEME_DIRS = [
|
||||
os.path.join(XDG_DATA_HOME, "PortProtonQt", "terminal_schemes"),
|
||||
os.path.join(os.path.dirname(os.path.abspath(__file__)), "terminal_schemes"),
|
||||
os.path.join(PACKAGE_DIR, "terminal_schemes"),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
DIRECTX_IMPORTS = {
|
||||
"ddraw.dll": "DirectDraw",
|
||||
"d3d8.dll": "DirectX 8",
|
||||
"d3d9.dll": "DirectX 9",
|
||||
"d3d10.dll": "DirectX 10",
|
||||
"d3d10_1.dll": "DirectX 10",
|
||||
"d3d11.dll": "DirectX 11",
|
||||
"d3d12.dll": "DirectX 12",
|
||||
}
|
||||
|
||||
DIRECTX_SIGNATURES = {
|
||||
"DirectDraw": (b"ddraw.dll", b"DirectDrawCreate"),
|
||||
"DirectX 8": (b"d3d8.dll", b"Direct3DCreate8"),
|
||||
"DirectX 9": (b"d3d9.dll", b"Direct3DCreate9"),
|
||||
"DirectX 10": (b"d3d10.dll", b"D3D10CreateDevice"),
|
||||
"DirectX 11": (b"d3d11.dll", b"D3D11CreateDevice"),
|
||||
"DirectX 12": (b"d3d12.dll", b"D3D12CreateDevice", b"D3D12Core.dll"),
|
||||
}
|
||||
|
||||
DIRECTX_ORDER = {
|
||||
"DirectDraw": 7,
|
||||
"DirectX 8": 8,
|
||||
"DirectX 9": 9,
|
||||
"DirectX 10": 10,
|
||||
"DirectX 11": 11,
|
||||
"DirectX 12": 12,
|
||||
}
|
||||
|
||||
OPENGL_IMPORTS = {
|
||||
"opengl32.dll": "OpenGL",
|
||||
"glu32.dll": "OpenGL Utility Library",
|
||||
}
|
||||
|
||||
OPENGL_SIGNATURES = {
|
||||
"OpenGL": (
|
||||
b"opengl32.dll",
|
||||
b"wglCreateContext",
|
||||
b"wglGetProcAddress",
|
||||
b"glGetString",
|
||||
b"OpenGL context",
|
||||
b"OpenGL Error",
|
||||
),
|
||||
"OpenGL Utility Library": (b"glu32.dll", b"gluPerspective", b"gluLookAt"),
|
||||
}
|
||||
|
||||
|
||||
def analyze_executable(file_path: str) -> dict[str, Any]:
|
||||
"""Detect graphics API usage in a Windows executable."""
|
||||
path = Path(file_path).expanduser().resolve()
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"File not found: {path}")
|
||||
|
||||
directx = set()
|
||||
opengl = set()
|
||||
|
||||
if path.suffix.lower() in {".exe", ".dll"}:
|
||||
_add_pe_imports(path, directx, opengl)
|
||||
_add_file_signatures(path, directx, opengl)
|
||||
|
||||
return {
|
||||
"highest_directx": _highest_directx(list(directx)),
|
||||
"uses_opengl": bool(opengl),
|
||||
}
|
||||
|
||||
|
||||
def _add_pe_imports(path: Path, directx: set[str], opengl: set[str]) -> None:
|
||||
try:
|
||||
import pefile
|
||||
except ImportError:
|
||||
return
|
||||
|
||||
try:
|
||||
pe = pefile.PE(str(path), fast_load=True)
|
||||
pe.parse_data_directories(
|
||||
directories=[
|
||||
pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_IMPORT"],
|
||||
pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT"],
|
||||
]
|
||||
)
|
||||
for attr_name in ["DIRECTORY_ENTRY_IMPORT", "DIRECTORY_ENTRY_DELAY_IMPORT"]:
|
||||
for entry in getattr(pe, attr_name, []):
|
||||
dll = entry.dll.decode("utf-8", errors="ignore").lower()
|
||||
if dll in DIRECTX_IMPORTS:
|
||||
directx.add(DIRECTX_IMPORTS[dll])
|
||||
elif dll in OPENGL_IMPORTS:
|
||||
opengl.add(OPENGL_IMPORTS[dll])
|
||||
except (pefile.PEFormatError, ValueError):
|
||||
return
|
||||
|
||||
|
||||
def _add_file_signatures(path: Path, directx: set[str], opengl: set[str]) -> None:
|
||||
try:
|
||||
with path.open("rb") as f:
|
||||
data = f.read(67108864).lower()
|
||||
except OSError:
|
||||
return
|
||||
|
||||
for name, patterns in DIRECTX_SIGNATURES.items():
|
||||
if any(p.lower() in data for p in patterns):
|
||||
directx.add(name)
|
||||
|
||||
for name, patterns in OPENGL_SIGNATURES.items():
|
||||
if any(p.lower() in data for p in patterns):
|
||||
opengl.add(name)
|
||||
|
||||
|
||||
def _highest_directx(directx: list[str]) -> str:
|
||||
if not directx:
|
||||
return "None"
|
||||
return max(directx, key=lambda n: DIRECTX_ORDER[n])
|
||||
|
||||
|
||||
def _main(argv: list[str]) -> int:
|
||||
if len(argv) != 2:
|
||||
print("Usage: python3 -m portprotonqt.graphics_detector FILE")
|
||||
return 2
|
||||
|
||||
try:
|
||||
result = analyze_executable(argv[1])
|
||||
print(f"HIGHEST_DX={result['highest_directx']}")
|
||||
print(f"USES_OGL={'true' if result['uses_opengl'] else 'false'}")
|
||||
return 0
|
||||
except Exception as e:
|
||||
print(f"Error: {e}", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(_main(sys.argv))
|
||||
@@ -0,0 +1,89 @@
|
||||
"""Print mounted drive paths for PortProton scripts."""
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from portprotonqt.logger import get_logger
|
||||
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
MOUNT_PARENT_PATHS = ("/run/media/", "/media/", "/mnt/")
|
||||
MOUNT_ROOT_PATHS = {"/media", "/mnt", "/run/media"}
|
||||
NETWORK_MOUNT_TYPES = {"cifs", "nfs", "nfs4", "smb3", "smbfs"}
|
||||
VIRTUAL_MOUNT_TYPES = {"autofs"}
|
||||
MOUNT_ESCAPE_PATTERN = re.compile(r"\\([0-7]{3})")
|
||||
|
||||
|
||||
def list_mounted_drive_paths(mounts_path: str = "/proc/mounts") -> list[str]:
|
||||
"""Return local mounted drive paths available to the user."""
|
||||
try:
|
||||
mounts = _read_mounts(mounts_path)
|
||||
mounted_drives = set()
|
||||
for source, mount_point, fs_type in mounts:
|
||||
if fs_type in VIRTUAL_MOUNT_TYPES:
|
||||
continue
|
||||
if _is_network_mount(source, fs_type):
|
||||
continue
|
||||
if not _is_block_device_source(source):
|
||||
continue
|
||||
if not _is_local_drive_mount(mount_point):
|
||||
continue
|
||||
if os.path.isdir(mount_point) and os.access(mount_point, os.R_OK):
|
||||
mounted_drives.add(mount_point)
|
||||
except OSError as error:
|
||||
logger.error("Error retrieving mounted drives: %s", error)
|
||||
return []
|
||||
return sorted(mounted_drives)
|
||||
|
||||
|
||||
def _read_mounts(mounts_path: str) -> list[tuple[str, str, str]]:
|
||||
mounts = []
|
||||
with open(mounts_path) as mounts_file:
|
||||
for line in mounts_file:
|
||||
parts = line.strip().split()
|
||||
if len(parts) < 3:
|
||||
continue
|
||||
mounts.append((
|
||||
_decode_mount_field(parts[0]),
|
||||
_decode_mount_field(parts[1]),
|
||||
parts[2],
|
||||
))
|
||||
return mounts
|
||||
|
||||
|
||||
def _decode_mount_field(value: str) -> str:
|
||||
return MOUNT_ESCAPE_PATTERN.sub(
|
||||
lambda match: chr(int(match.group(1), 8)),
|
||||
value,
|
||||
)
|
||||
|
||||
|
||||
def _is_network_mount(source: str, fs_type: str) -> bool:
|
||||
return (
|
||||
fs_type in NETWORK_MOUNT_TYPES
|
||||
or source.startswith(("//", "\\\\"))
|
||||
or (":/" in source and not source.startswith("/"))
|
||||
)
|
||||
|
||||
|
||||
def _is_block_device_source(source: str) -> bool:
|
||||
return source.startswith("/dev/")
|
||||
|
||||
|
||||
def _is_local_drive_mount(mount_point: str) -> bool:
|
||||
if mount_point == "/" or mount_point in MOUNT_ROOT_PATHS:
|
||||
return False
|
||||
return mount_point.startswith(MOUNT_PARENT_PATHS)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
paths = list_mounted_drive_paths()
|
||||
if paths:
|
||||
sys.stdout.write("\n".join(paths) + "\n")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -1,7 +1,11 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from portprotonqt.logger import get_logger
|
||||
from portprotonqt.version_utils import include_pinned_prefixes
|
||||
from portprotonqt.version_utils import version_sort_key
|
||||
|
||||
logger = get_logger(__name__)
|
||||
LG_WINE_ALIASES = (
|
||||
@@ -40,6 +44,61 @@ def resolve_lg_wine_alias(wine_version: str, env_vars: dict[str, str]) -> str:
|
||||
return wine_version
|
||||
|
||||
|
||||
def get_available_wine_options(
|
||||
portproton_path: str,
|
||||
system_wine_label: str = "",
|
||||
steam_only: bool = False,
|
||||
include_lg_aliases: bool = False
|
||||
) -> list[str]:
|
||||
dist_dir = os.path.join(portproton_path, "data", "dist")
|
||||
options = []
|
||||
if os.path.exists(dist_dir):
|
||||
options = sorted(
|
||||
[f for f in os.listdir(dist_dir) if os.path.isdir(os.path.join(dist_dir, f))],
|
||||
key=version_sort_key
|
||||
)
|
||||
|
||||
from portprotonqt.config import get_portproton_scripts_path
|
||||
scripts_path = get_portproton_scripts_path()
|
||||
if scripts_path:
|
||||
var_path = os.path.join(scripts_path, "var")
|
||||
for wine_alias, version in read_lg_dist_versions_from_var(var_path).items():
|
||||
if include_lg_aliases and wine_alias not in options:
|
||||
options.append(wine_alias)
|
||||
if version not in options:
|
||||
options.append(version)
|
||||
|
||||
from portprotonqt.steam_api import get_steam_proton_versions
|
||||
from portprotonqt.steam_api.utils import _is_steam_proton_dir
|
||||
for version in get_steam_proton_versions():
|
||||
if version not in options:
|
||||
options.append(version)
|
||||
|
||||
if steam_only:
|
||||
options = [
|
||||
version for version in options
|
||||
if _is_steam_proton_dir(
|
||||
Path(version) if os.path.isabs(version) else Path(dist_dir, version)
|
||||
)
|
||||
]
|
||||
elif system_wine_label and shutil.which('wine') and system_wine_label not in options:
|
||||
options.append(system_wine_label)
|
||||
|
||||
options.sort(key=version_sort_key)
|
||||
return options
|
||||
|
||||
|
||||
def get_available_prefix_options(portproton_path: str) -> list[str]:
|
||||
prefixes_dir = os.path.join(portproton_path, "data", "prefixes")
|
||||
prefixes = []
|
||||
if os.path.exists(prefixes_dir):
|
||||
prefixes = [
|
||||
name for name in os.listdir(prefixes_dir)
|
||||
if os.path.isdir(os.path.join(prefixes_dir, name))
|
||||
]
|
||||
return include_pinned_prefixes(prefixes)
|
||||
|
||||
|
||||
def get_available_locale_options() -> list[str]:
|
||||
"""Get locale options based on locales available in the system."""
|
||||
target_locales = ("ru_RU", "en_US", "zh_CN", "ja_JP", "ko_KR")
|
||||
@@ -86,9 +145,8 @@ def get_toggle_settings():
|
||||
|
||||
return {
|
||||
# Graphics enhancements
|
||||
'PW_VKBASALT': _("Enable vkBasalt by default to improve graphics in games running on Vulkan. (The HOME hotkey disables vkbasalt)"),
|
||||
'PW_VKBASALT_USER_CONF': _("Forced use of VKBASALT system settings (GOverlay, etc.)"),
|
||||
'PW_DGVOODOO2': _("Enable dgVoodoo2. Forced use all dgVoodoo2 libs (Glide 2.11-3.1, DirectDraw 1-7, Direct3D 2-9) on all 3D API."),
|
||||
'PW_USE_SPECIALK': _("Enable SpecialK (injection library for fixing graphics, latency and more)"),
|
||||
# Upscalers and Frame Generation
|
||||
'PW_USE_OPTISCALER': _("Enable OptiScaler (replacement upscaler / frame generator)"),
|
||||
'PW_USE_LS_FRAME_GEN': _("Enable Lossless Scaling frame generation (experimental)"),
|
||||
@@ -253,11 +311,11 @@ def get_advanced_settings(disabled_text, logical_core_options=None, locale_optio
|
||||
'default': ''
|
||||
})
|
||||
|
||||
# 7. Run second executable after launch
|
||||
# 7. Run second executable or wrapper command
|
||||
advanced_settings.append({
|
||||
'key': 'PW_RUN_AFTER_EXE',
|
||||
'name': _("Run After Exe"),
|
||||
'description': _("Path to a second .exe that should be started after the main executable."),
|
||||
'name': _("Run After / Wrapper"),
|
||||
'description': _("Path to a second .exe, script, or wrapper command. Example: systemd-run --user --scope --slice=app.slice"),
|
||||
'type': 'text',
|
||||
'default': ''
|
||||
})
|
||||
@@ -325,6 +383,16 @@ def get_advanced_settings(disabled_text, logical_core_options=None, locale_optio
|
||||
'default': disabled_text
|
||||
})
|
||||
|
||||
# 14. Sound driver
|
||||
advanced_settings.append({
|
||||
'key': 'PW_SOUND_DRIVER_USE',
|
||||
'name': _("Sound Driver"),
|
||||
'description': _("Force the Wine sound driver for this executable."),
|
||||
'type': 'combo',
|
||||
'options': [disabled_text, 'oss', 'pulse', 'alsa'],
|
||||
'default': disabled_text
|
||||
})
|
||||
|
||||
return advanced_settings
|
||||
|
||||
# Keys that should be recognized as advanced settings
|
||||
@@ -342,4 +410,5 @@ ADVANCED_SETTING_KEYS = [
|
||||
'PW_LOCALE_SELECT',
|
||||
'PW_MESA_VK_WSI_PRESENT_MODE',
|
||||
'PW_CPU_NUMA_NODE_INDEX',
|
||||
'PW_SOUND_DRIVER_USE',
|
||||
]
|
||||
@@ -4,6 +4,7 @@ from portprotonqt.steam_api.utils import (
|
||||
safe_vdf_load,
|
||||
decode_text,
|
||||
get_steam_home,
|
||||
get_steam_launch_commands,
|
||||
get_steam_compatibilitytools_dir,
|
||||
get_steam_compat_tool,
|
||||
get_steam_libs,
|
||||
@@ -55,6 +56,7 @@ __all__ = [
|
||||
"safe_vdf_load",
|
||||
"decode_text",
|
||||
"get_steam_home",
|
||||
"get_steam_launch_commands",
|
||||
"get_steam_compatibilitytools_dir",
|
||||
"get_steam_compat_tool",
|
||||
"get_steam_libs",
|
||||
|
||||
@@ -530,12 +530,12 @@ def get_steam_game_info_async(
|
||||
|
||||
is_autoinstall = exec_line.startswith("autoinstall:")
|
||||
|
||||
if game_exe.lower().endswith('.bat'):
|
||||
if game_exe.lower().endswith(('.bat', '.cmd')):
|
||||
if os.path.exists(game_exe):
|
||||
try:
|
||||
with open(game_exe, encoding='utf-8') as f:
|
||||
bat_lines = f.readlines()
|
||||
for line in bat_lines:
|
||||
cmd_lines = f.readlines()
|
||||
for line in cmd_lines:
|
||||
line = line.strip()
|
||||
if '.exe' in line.lower():
|
||||
tokens = shlex.split(line)
|
||||
@@ -546,9 +546,9 @@ def get_steam_game_info_async(
|
||||
if game_exe.lower().endswith('.exe'):
|
||||
break
|
||||
except Exception as e:
|
||||
logger.error("Failed to process bat file %s: %s", game_exe, e)
|
||||
logger.error("Failed to process command file %s: %s", game_exe, e)
|
||||
else:
|
||||
logger.error("Bat file not found: %s", game_exe)
|
||||
logger.error("Command file not found: %s", game_exe)
|
||||
|
||||
if not game_exe.lower().endswith('.exe'):
|
||||
logger.error("Invalid executable path: %s. Expected .exe", game_exe)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
import time
|
||||
@@ -31,6 +32,9 @@ def get_exiftool_data(game_exe: str) -> dict:
|
||||
if not os.path.isfile(game_exe):
|
||||
logger.debug("Skipping exiftool for missing executable: %s", game_exe)
|
||||
return {}
|
||||
if shutil.which("exiftool") is None:
|
||||
logger.debug("Skipping exiftool for %s: executable not found", game_exe)
|
||||
return {}
|
||||
|
||||
if len(_EXIFTOOL_CACHE) > _CACHE_MAX_ENTRIES // 2:
|
||||
expired_keys = [
|
||||
|
||||
@@ -4,6 +4,7 @@ import base64
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shlex
|
||||
import shutil
|
||||
import zlib
|
||||
from pathlib import Path
|
||||
@@ -186,23 +187,33 @@ def _create_launch_script(
|
||||
|
||||
safe_game_name = re.sub(r'[<>:"/\\|?*]', '_', game_name.strip())
|
||||
script_path = os.path.join(steam_scripts_dir, f"{safe_game_name}.sh")
|
||||
|
||||
if not os.path.exists(script_path):
|
||||
start_cmd = " ".join(start_sh)
|
||||
script_content = f"""#!/usr/bin/env bash
|
||||
export LD_PRELOAD=
|
||||
"{start_cmd}" "{exe_path}" "$@"
|
||||
"""
|
||||
try:
|
||||
with open(script_path, "w", encoding="utf-8") as f:
|
||||
f.write(script_content)
|
||||
os.chmod(script_path, 0o755)
|
||||
logger.info(f"Created launch script: {script_path}")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to create launch script {script_path}: {e}")
|
||||
return "", f"Failed to create launch script: {e}"
|
||||
appimage_path = os.getenv("APPIMAGE", "").strip()
|
||||
flatpak_id = os.getenv("FLATPAK_ID", "").strip()
|
||||
if flatpak_id:
|
||||
launch_command = shlex.join(["flatpak", "run", flatpak_id, "--silent", exe_path])
|
||||
elif appimage_path and os.path.isfile(appimage_path):
|
||||
launch_command = shlex.join([appimage_path, "--silent", exe_path])
|
||||
else:
|
||||
logger.info(f"Launch script already exists: {script_path}")
|
||||
launch_command = shlex.join(["portprotonqt", "--silent", exe_path])
|
||||
|
||||
script_content = f"""#!/usr/bin/env bash
|
||||
export LD_PRELOAD=
|
||||
{launch_command} "$@"
|
||||
"""
|
||||
try:
|
||||
if os.path.exists(script_path):
|
||||
with open(script_path, encoding="utf-8") as f:
|
||||
if f.read() == script_content:
|
||||
logger.info(f"Launch script already exists: {script_path}")
|
||||
return script_path, ""
|
||||
|
||||
with open(script_path, "w", encoding="utf-8") as f:
|
||||
f.write(script_content)
|
||||
os.chmod(script_path, 0o755)
|
||||
logger.info(f"Created launch script: {script_path}")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to create launch script {script_path}: {e}")
|
||||
return "", f"Failed to create launch script: {e}"
|
||||
|
||||
return script_path, ""
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Utility functions for Steam API module."""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image, UnidentifiedImageError
|
||||
@@ -12,7 +13,7 @@ from portprotonqt.image_utils import COVER_IMAGE_EXTENSIONS
|
||||
logger = get_logger(__name__)
|
||||
|
||||
STEAM_DATA_DIRS = (
|
||||
"~/.local/share/Steam",
|
||||
"~/.steam/steam",
|
||||
"~/snap/steam/common/.local/share/Steam",
|
||||
"~/.var/app/com.valvesoftware.Steam/data/Steam",
|
||||
"/usr/share/steam",
|
||||
@@ -54,15 +55,61 @@ def decode_text(text: str) -> str:
|
||||
return html.unescape(text)
|
||||
|
||||
|
||||
def get_steam_home() -> Path | None:
|
||||
"""Return path to Steam directory."""
|
||||
def _iter_existing_steam_data_dirs() -> list[Path]:
|
||||
"""Return existing Steam data dirs with symlinks resolved."""
|
||||
steam_dirs = []
|
||||
seen_dirs = set()
|
||||
for dir_path in STEAM_DATA_DIRS:
|
||||
expanded_path = Path(os.path.expanduser(dir_path))
|
||||
if expanded_path.exists():
|
||||
return expanded_path
|
||||
if not expanded_path.exists():
|
||||
continue
|
||||
try:
|
||||
steam_path = expanded_path.resolve()
|
||||
except (OSError, RuntimeError) as e:
|
||||
logger.debug("Failed to resolve Steam directory %s: %s", expanded_path, e)
|
||||
steam_path = expanded_path
|
||||
if steam_path in seen_dirs:
|
||||
continue
|
||||
seen_dirs.add(steam_path)
|
||||
steam_dirs.append(steam_path)
|
||||
return steam_dirs
|
||||
|
||||
|
||||
def get_steam_home() -> Path | None:
|
||||
"""Return path to Steam directory."""
|
||||
for steam_path in _iter_existing_steam_data_dirs():
|
||||
return steam_path
|
||||
return None
|
||||
|
||||
|
||||
def get_steam_launch_commands(appid: str) -> list[list[str]]:
|
||||
"""Return Steam launch commands based on detected Steam data dir."""
|
||||
steam_home = get_steam_home()
|
||||
if steam_home is None:
|
||||
return []
|
||||
|
||||
steam_home_str = str(steam_home)
|
||||
if "/.var/app/com.valvesoftware.Steam/" in steam_home_str:
|
||||
flatpak_cmd = shutil.which("flatpak")
|
||||
if flatpak_cmd:
|
||||
return [[flatpak_cmd, "run", "com.valvesoftware.Steam", "-applaunch", appid]]
|
||||
return []
|
||||
|
||||
if "/snap/steam/" in steam_home_str:
|
||||
steam_cmd = shutil.which("steam")
|
||||
if steam_cmd:
|
||||
return [[steam_cmd, "-applaunch", appid]]
|
||||
snap_cmd = shutil.which("snap")
|
||||
if snap_cmd:
|
||||
return [[snap_cmd, "run", "steam", "-applaunch", appid]]
|
||||
return []
|
||||
|
||||
steam_cmd = shutil.which("steam")
|
||||
if steam_cmd:
|
||||
return [[steam_cmd, "-applaunch", appid]]
|
||||
return []
|
||||
|
||||
|
||||
def get_steam_compatibilitytools_dir() -> Path | None:
|
||||
"""Return writable Steam compatibility tools directory."""
|
||||
steam_home = get_steam_home()
|
||||
@@ -249,10 +296,7 @@ def _is_steam_proton_dir(path: Path) -> bool:
|
||||
def get_steam_proton_versions() -> list[str]:
|
||||
"""Return Steam Proton install directories usable by PortProton."""
|
||||
roots = set()
|
||||
steam_homes = [Path(os.path.expanduser(path)) for path in STEAM_DATA_DIRS]
|
||||
for steam_home in steam_homes:
|
||||
if not steam_home.exists():
|
||||
continue
|
||||
for steam_home in _iter_existing_steam_data_dirs():
|
||||
roots.add(steam_home / "compatibilitytools.d")
|
||||
for steam_lib in get_steam_libs(steam_home):
|
||||
roots.add(steam_lib / "steamapps" / "common")
|
||||
|
||||
@@ -867,6 +867,11 @@ class MainWindowSystemTabMixin(_MainWindowTypingBase):
|
||||
def _setupSystemPowerActionButtons(self, layout) -> None:
|
||||
buttons_layout = QHBoxLayout()
|
||||
|
||||
self.systemLogoutButton = AutoSizeButton(_("Logout"), icon=self.theme_manager.get_icon("exit", as_path=True))
|
||||
self.systemLogoutButton.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
self.systemLogoutButton.clicked.connect(self.logoutSystem)
|
||||
buttons_layout.addWidget(self.systemLogoutButton)
|
||||
|
||||
self.systemRebootButton = AutoSizeButton(_("Reboot"), icon=self.theme_manager.get_icon("reboot", as_path=True))
|
||||
self.systemRebootButton.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
|
||||
self.systemRebootButton.clicked.connect(self.rebootSystem)
|
||||
@@ -886,19 +891,25 @@ class MainWindowSystemTabMixin(_MainWindowTypingBase):
|
||||
layout.addLayout(buttons_layout)
|
||||
layout.addStretch()
|
||||
|
||||
def _runSystemctlAction(self, action: str) -> None:
|
||||
if QProcess.startDetached("systemctl", [action]):
|
||||
def _runLoginctlAction(self, action: str) -> None:
|
||||
args = [action]
|
||||
if action == "terminate-session":
|
||||
args.append("self")
|
||||
if QProcess.startDetached("loginctl", args):
|
||||
return
|
||||
logger.error("Failed to execute systemctl %s", action)
|
||||
logger.error("Failed to execute loginctl %s", " ".join(args))
|
||||
|
||||
def rebootSystem(self) -> None:
|
||||
self._runSystemctlAction("reboot")
|
||||
self._runLoginctlAction("reboot")
|
||||
|
||||
def shutdownSystem(self) -> None:
|
||||
self._runSystemctlAction("poweroff")
|
||||
self._runLoginctlAction("poweroff")
|
||||
|
||||
def suspendSystem(self) -> None:
|
||||
self._runSystemctlAction("suspend")
|
||||
self._runLoginctlAction("suspend")
|
||||
|
||||
def logoutSystem(self) -> None:
|
||||
self._runLoginctlAction("terminate-session")
|
||||
|
||||
def loadSystemNetworks(self) -> None:
|
||||
self.runNetworkOperation("load")
|
||||
|
||||
@@ -271,6 +271,106 @@ ADDGAME_BACK_BUTTON_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_CONTROLS_BUTTON_STYLE = f"""
|
||||
QPushButton {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #E9ECEF,
|
||||
stop:1 {color_j}
|
||||
);
|
||||
border: {border_b} {color_f};
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_l};
|
||||
font-size: {font_size_a};
|
||||
font-family: '{font_family}';
|
||||
padding: 5px 10px;
|
||||
min-width: 24px;
|
||||
min-height: 25px;
|
||||
}}
|
||||
QPushButton:hover,
|
||||
QPushButton:pressed,
|
||||
QPushButton:focus,
|
||||
QPushButton:checked {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #E9ECEF,
|
||||
stop:1 {color_j}
|
||||
);
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
|
||||
QComboBox {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_f};
|
||||
border-radius: {border_radius_a};
|
||||
padding-left: 12px;
|
||||
height: 30px;
|
||||
color: {color_l};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_a};
|
||||
min-width: 120px;
|
||||
combobox-popup: 0;
|
||||
}}
|
||||
QComboBox:hover,
|
||||
QComboBox:focus{{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
QComboBox:on {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_a};
|
||||
border-bottom-style: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}}
|
||||
QComboBox::drop-down {{
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center right;
|
||||
border-left: {border_b} rgba(255, 255, 255, 0.05);
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow {{
|
||||
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}}
|
||||
QComboBox::down-arrow:on {{
|
||||
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView {{
|
||||
outline: none;
|
||||
background: {color_c};
|
||||
border: {border_b} {color_a};
|
||||
border-top-style: none;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView::item {{
|
||||
padding: 3px 3px 3px 6px;
|
||||
margin: 1px;
|
||||
min-height: 24px;
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
QComboBox QAbstractItemView::item:hover,
|
||||
QComboBox QAbstractItemView::item:selected {{
|
||||
background: {color_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
"""
|
||||
|
||||
# SEARCH FIELD STYLE
|
||||
SEARCH_EDIT_STYLE = f"""
|
||||
QLineEdit {{
|
||||
@@ -359,6 +459,10 @@ QTableWidget::item:selected:focus {{
|
||||
QTableWidget::item:hover {{
|
||||
background: {color_h};
|
||||
}}
|
||||
QTableWidget::item:selected:hover {{
|
||||
background: {color_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
"""
|
||||
|
||||
# COMBOBOX
|
||||
@@ -462,6 +566,14 @@ COMBOBOX_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
SETTINGS_TABLE_COMBOBOX_STYLE = f"""
|
||||
QComboBox#settingsTableCombo:hover,
|
||||
QComboBox#settingsTableCombo:focus {{
|
||||
background: {color_c};
|
||||
border: {border_c} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LINE_EDIT_STYLE = f"""
|
||||
QLineEdit {{
|
||||
background: {color_c};
|
||||
|
||||
@@ -201,6 +201,106 @@ ADDGAME_BACK_BUTTON_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_CONTROLS_BUTTON_STYLE = f"""
|
||||
QPushButton {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #404554,
|
||||
stop:1 #30323d
|
||||
);
|
||||
border: {border_a};
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_f};
|
||||
font-size: {font_size_a};
|
||||
font-family: '{font_family}';
|
||||
padding: 5px 10px;
|
||||
min-width: 24px;
|
||||
min-height: 25px;
|
||||
}}
|
||||
QPushButton:hover,
|
||||
QPushButton:pressed,
|
||||
QPushButton:focus,
|
||||
QPushButton:checked {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #404554,
|
||||
stop:1 #30323d
|
||||
);
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
|
||||
QComboBox {{
|
||||
background: {color_d};
|
||||
border: {border_b} {color_h};
|
||||
border-radius: {border_radius_a};
|
||||
padding-left: 12px;
|
||||
height: 30px;
|
||||
color: {color_f};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_a};
|
||||
min-width: 120px;
|
||||
combobox-popup: 0;
|
||||
}}
|
||||
QComboBox:hover,
|
||||
QComboBox:focus {{
|
||||
background: {color_a};
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
QComboBox:on {{
|
||||
background: {color_d};
|
||||
border: {border_b} {color_a};
|
||||
border-bottom-style: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}}
|
||||
QComboBox::drop-down {{
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center right;
|
||||
border-left: {border_b} rgba(255, 255, 255, 0.05);
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow {{
|
||||
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}}
|
||||
QComboBox::down-arrow:on {{
|
||||
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView {{
|
||||
outline: none;
|
||||
background: {color_c};
|
||||
border: {border_b} {color_a};
|
||||
border-top-style: none;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView::item {{
|
||||
padding: 3px 3px 3px 6px;
|
||||
margin: 1px;
|
||||
min-height: 24px;
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
QComboBox QAbstractItemView::item:hover,
|
||||
QComboBox QAbstractItemView::item:selected {{
|
||||
background: {color_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
"""
|
||||
|
||||
# SEARCH FIELD STYLE
|
||||
SEARCH_EDIT_STYLE = f"""
|
||||
QLineEdit {{
|
||||
@@ -288,6 +388,10 @@ QTableWidget::item:selected:focus {{
|
||||
QTableWidget::item:hover {{
|
||||
background: {color_h};
|
||||
}}
|
||||
QTableWidget::item:selected:hover {{
|
||||
background: {color_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
"""
|
||||
|
||||
# COMBOBOX
|
||||
@@ -391,6 +495,14 @@ COMBOBOX_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
SETTINGS_TABLE_COMBOBOX_STYLE = f"""
|
||||
QComboBox#settingsTableCombo:hover,
|
||||
QComboBox#settingsTableCombo:focus {{
|
||||
background: {color_c};
|
||||
border: {border_c} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LINE_EDIT_STYLE = f"""
|
||||
QLineEdit {{
|
||||
background: {color_c};
|
||||
|
||||
@@ -788,6 +788,106 @@ ADDGAME_BACK_BUTTON_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_CONTROLS_BUTTON_STYLE = f"""
|
||||
QPushButton {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #E9ECEF,
|
||||
stop:1 {color_j}
|
||||
);
|
||||
border: {border_b} {color_f};
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_l};
|
||||
font-size: {font_size_a};
|
||||
font-family: '{font_family}';
|
||||
padding: 5px 10px;
|
||||
min-width: 24px;
|
||||
min-height: 25px;
|
||||
}}
|
||||
QPushButton:hover,
|
||||
QPushButton:pressed,
|
||||
QPushButton:focus,
|
||||
QPushButton:checked {{
|
||||
background: qradialgradient(
|
||||
cx:0.5, cy:0.5, radius:0.8,
|
||||
stop:0 #E9ECEF,
|
||||
stop:1 {color_j}
|
||||
);
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
|
||||
QComboBox {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_f};
|
||||
border-radius: {border_radius_a};
|
||||
padding-left: 12px;
|
||||
height: 34px;
|
||||
color: {color_l};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_a};
|
||||
min-width: 120px;
|
||||
combobox-popup: 0;
|
||||
}}
|
||||
QComboBox:hover,
|
||||
QComboBox:focus {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
QComboBox:on {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_a};
|
||||
border-bottom-style: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}}
|
||||
QComboBox::drop-down {{
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center right;
|
||||
border-left: {border_b} rgba(255, 255, 255, 0.05);
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow {{
|
||||
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow:on {{
|
||||
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox QAbstractItemView {{
|
||||
outline: none;
|
||||
background: {color_c};
|
||||
border: {border_b} {color_a};
|
||||
border-top-style: none;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView::item {{
|
||||
padding: 7px 7px 7px 12px;
|
||||
margin: 3px;
|
||||
min-height: 24px;
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
QComboBox QAbstractItemView::item:hover,
|
||||
QComboBox QAbstractItemView::item:selected {{
|
||||
background: {color_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
"""
|
||||
|
||||
# SEARCH FIELD STYLE
|
||||
SEARCH_EDIT_STYLE = f"""
|
||||
QLineEdit {{
|
||||
@@ -916,6 +1016,10 @@ QTableWidget::item:selected:focus {{
|
||||
QTableWidget::item:hover {{
|
||||
background: {color_h};
|
||||
}}
|
||||
QTableWidget::item:selected:hover {{
|
||||
background: {color_a};
|
||||
color: {color_l};
|
||||
}}
|
||||
"""
|
||||
|
||||
SCROLL_STYLE = f"""
|
||||
@@ -1072,6 +1176,14 @@ COMBOBOX_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
SETTINGS_TABLE_COMBOBOX_STYLE = f"""
|
||||
QComboBox#settingsTableCombo:hover,
|
||||
QComboBox#settingsTableCombo:focus {{
|
||||
background: {color_c};
|
||||
border: {border_c} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
CHECKBOX_STYLE = f"""
|
||||
QCheckBox {{
|
||||
height: 34px;
|
||||
@@ -1480,7 +1592,6 @@ TOOLTIP_STYLE = f"""
|
||||
QLabel {{
|
||||
background-color: {color_b};
|
||||
border: {border_b} {color_c};
|
||||
border-radius: {border_radius_a};
|
||||
padding: 8px;
|
||||
color: {color_l};
|
||||
font-family: '{font_family}';
|
||||
|
||||
@@ -574,6 +574,14 @@ SCROLL_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
SETTINGS_TABLE_COMBOBOX_STYLE = f"""
|
||||
QComboBox#settingsTableCombo:hover,
|
||||
QComboBox#settingsTableCombo:focus {{
|
||||
background: {color_c};
|
||||
border: {border_c} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
CHECKBOX_STYLE = f"""
|
||||
QCheckBox {{
|
||||
height: 34px;
|
||||
@@ -667,9 +675,8 @@ LINE_EDIT_STYLE = f"""
|
||||
|
||||
TOOLTIP_STYLE = f"""
|
||||
QLabel {{
|
||||
background-color: {color_b};
|
||||
border: {border_b} {color_c};
|
||||
border-radius: {border_radius_a};
|
||||
background: {color_b};
|
||||
border: {border_b} {color_e};
|
||||
padding: 8px;
|
||||
color: {color_f};
|
||||
font-family: '{font_family}';
|
||||
|
||||
@@ -26,6 +26,97 @@ ADDGAME_BACK_BUTTON_STYLE = f"""
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_CONTROLS_BUTTON_STYLE = f"""
|
||||
QPushButton {{
|
||||
background: rgba(20, 20, 20, 0.40);
|
||||
border: {border_b} rgba(255, 255, 255, 0.5);
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_f};
|
||||
font-size: {font_size_a};
|
||||
font-family: '{font_family}';
|
||||
padding: 8px 12px;
|
||||
min-width: 24px;
|
||||
}}
|
||||
QPushButton:hover,
|
||||
QPushButton:pressed,
|
||||
QPushButton:focus,
|
||||
QPushButton:checked {{
|
||||
background: rgba(20, 20, 20, 0.40);
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
"""
|
||||
|
||||
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
|
||||
QComboBox {{
|
||||
background: rgba(20, 20, 20, 0.40);
|
||||
border: {border_b} rgba(255, 255, 255, 0.5);
|
||||
border-radius: {border_radius_a};
|
||||
padding-left: 12px;
|
||||
height: 34px;
|
||||
color: {color_f};
|
||||
font-family: '{font_family}';
|
||||
font-size: {font_size_a};
|
||||
min-width: 120px;
|
||||
combobox-popup: 0;
|
||||
}}
|
||||
QComboBox:hover,
|
||||
QComboBox:focus {{
|
||||
background: rgba(20, 20, 20, 0.40);
|
||||
border: {border_b} {color_a};
|
||||
}}
|
||||
QComboBox:on {{
|
||||
background: {color_b};
|
||||
border: {border_b} {color_a};
|
||||
border-bottom-style: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}}
|
||||
QComboBox::drop-down {{
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: center right;
|
||||
border-left: {border_b} rgba(255, 255, 255, 0.05);
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow {{
|
||||
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox::down-arrow:on {{
|
||||
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
|
||||
padding: 12px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
}}
|
||||
QComboBox QAbstractItemView {{
|
||||
outline: none;
|
||||
background: {color_c};
|
||||
border: {border_b} {color_a};
|
||||
border-top-style: none;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}}
|
||||
QComboBox QAbstractItemView::item {{
|
||||
padding: 7px 7px 7px 12px;
|
||||
margin: 3px;
|
||||
min-height: 24px;
|
||||
border-radius: {border_radius_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
QComboBox QAbstractItemView::item:hover,
|
||||
QComboBox QAbstractItemView::item:selected {{
|
||||
background: {color_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
"""
|
||||
|
||||
# MAIN FRAME FOR GAME DETAILS
|
||||
DETAIL_CONTENT_FRAME_STYLE = f"""
|
||||
QFrame {{
|
||||
|
||||
@@ -35,4 +35,8 @@ QTableWidget::item:selected:focus {{
|
||||
QTableWidget::item:hover {{
|
||||
background: {color_h};
|
||||
}}
|
||||
QTableWidget::item:selected:hover {{
|
||||
background: {color_a};
|
||||
color: {color_f};
|
||||
}}
|
||||
"""
|
||||
@@ -13,6 +13,12 @@ def get_cache_file_path():
|
||||
cache_home = os.getenv("XDG_CACHE_HOME", os.path.join(os.path.expanduser("~"), ".cache"))
|
||||
return os.path.join(cache_home, "PortProtonQt", "last_launch")
|
||||
|
||||
def _parse_last_launch_line(line: str) -> tuple[str, str] | None:
|
||||
parts = line.strip().rsplit(maxsplit=1)
|
||||
if len(parts) != 2:
|
||||
return None
|
||||
return parts[0], parts[1]
|
||||
|
||||
def save_last_launch(exe_name, launch_time):
|
||||
"""
|
||||
Save launch time for exe.
|
||||
@@ -23,9 +29,9 @@ def save_last_launch(exe_name, launch_time):
|
||||
if os.path.exists(file_path):
|
||||
with open(file_path, encoding="utf-8") as f:
|
||||
for line in f:
|
||||
parts = line.strip().split(maxsplit=1)
|
||||
if len(parts) == 2:
|
||||
data[parts[0]] = parts[1]
|
||||
parsed_line = _parse_last_launch_line(line)
|
||||
if parsed_line:
|
||||
data[parsed_line[0]] = parsed_line[1]
|
||||
data[exe_name] = launch_time.isoformat()
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
with open(file_path, "w", encoding="utf-8") as f:
|
||||
@@ -62,9 +68,9 @@ def get_last_launch(exe_name):
|
||||
return _("Never")
|
||||
with open(file_path, encoding="utf-8") as f:
|
||||
for line in f:
|
||||
parts = line.strip().split(maxsplit=1)
|
||||
if len(parts) == 2 and parts[0] == exe_name:
|
||||
iso_time = parts[1]
|
||||
parsed_line = _parse_last_launch_line(line)
|
||||
if parsed_line and parsed_line[0] == exe_name:
|
||||
iso_time = parsed_line[1]
|
||||
launch_time = datetime.fromisoformat(iso_time)
|
||||
return format_last_launch(launch_time)
|
||||
return _("Never")
|
||||
@@ -230,9 +236,9 @@ def get_last_launch_timestamp(exe_name):
|
||||
return 0
|
||||
with open(file_path, encoding="utf-8") as f:
|
||||
for line in f:
|
||||
parts = line.strip().split(maxsplit=1)
|
||||
if len(parts) == 2 and parts[0] == exe_name:
|
||||
iso_time = parts[1]
|
||||
parsed_line = _parse_last_launch_line(line)
|
||||
if parsed_line and parsed_line[0] == exe_name:
|
||||
iso_time = parsed_line[1]
|
||||
dt = datetime.fromisoformat(iso_time)
|
||||
return dt.timestamp()
|
||||
return 0
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "portprotonqt"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
description = "A project to rewrite PortProton (PortWINE) using PySide"
|
||||
requires-python = ">=3.10"
|
||||
readme = "README.md"
|
||||
|
||||
Reference in new issue
Block a user