Compare commits
32 commits
1.10.11.20
...
main
Author | SHA1 | Date | |
---|---|---|---|
94c2f765f3 | |||
71348dbf23 | |||
2396f0fb83 | |||
6dd5d2f546 | |||
a4db64082f | |||
50ff2ae4fd | |||
0ac4cf5a7c | |||
259bc98eb9 | |||
6594d65be1 | |||
42341d5c81 | |||
4dea963154 | |||
87b0ae0540 | |||
9b476afe8c | |||
95e760791b | |||
fec4e3c0e1 | |||
fb736fa47b | |||
3b721fdd13 | |||
f9cc1b48f1 | |||
9017826b16 | |||
4bb1fb10ee | |||
beb4f6c310 | |||
337d753d0c | |||
4497a1c712 | |||
07fa7890cf | |||
1d8ae15ea9 | |||
b9d034eef7 | |||
9f67f930a9 | |||
8ebcc3a700 | |||
0ddd5a0674 | |||
0c848c41b0 | |||
8f018cb162 | |||
34abca2a4e |
3
.github/workflows/checks.yml
vendored
3
.github/workflows/checks.yml
vendored
|
@ -23,6 +23,7 @@ on:
|
|||
jobs:
|
||||
pylint:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ['macos-latest', 'windows-latest', 'ubuntu-latest']
|
||||
version: ['3.9', '3.10', '3.11', '3.12']
|
||||
|
@ -47,4 +48,4 @@ jobs:
|
|||
pip3 install qstylizer
|
||||
- name: Analysis with pylint
|
||||
run: |
|
||||
python3 -m pylint -E rare --jobs=3 --disable=E0611,E1123,E1120 --ignore=ui,singleton.py --extension-pkg-whitelist=PyQt5 --generated-members=PyQt5.*,orjson.*
|
||||
python3 -m pylint rare
|
||||
|
|
93
.github/workflows/codeql.yml
vendored
Normal file
93
.github/workflows/codeql.yml
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
schedule:
|
||||
- cron: '37 11 * * 3'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: python
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
2
.github/workflows/job_cx-freeze-msi.yml
vendored
2
.github/workflows/job_cx-freeze-msi.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
cache: pip
|
||||
python-version: '3.11'
|
||||
python-version: '3.12'
|
||||
check-latest: true
|
||||
architecture: x64
|
||||
- name: Install Build Dependencies
|
||||
|
|
2
.github/workflows/job_cx-freeze-zip.yml
vendored
2
.github/workflows/job_cx-freeze-zip.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
cache: pip
|
||||
python-version: '3.11'
|
||||
python-version: '3.12'
|
||||
check-latest: true
|
||||
architecture: x64
|
||||
- name: Install build dependencies
|
||||
|
|
4
.github/workflows/job_version.yml
vendored
4
.github/workflows/job_version.yml
vendored
|
@ -4,9 +4,9 @@ on:
|
|||
workflow_call:
|
||||
outputs:
|
||||
version:
|
||||
value: ${{ jobs.version.outputs.tag_abbrev }}.${{ jobs.version.outputs.tag_offset }}
|
||||
value: "${{ jobs.version.outputs.tag_abbrev }}.${{ jobs.version.outputs.tag_offset }}"
|
||||
branch:
|
||||
value: ${{ jobs.version.outputs.branch }}
|
||||
value: "${{ jobs.version.outputs.branch }}"
|
||||
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -23,7 +23,7 @@ Rare is a graphical interface for Legendary, a command line alternative to Epic
|
|||
- Packages, packages everywhere
|
||||
|
||||
|
||||
## Reporing issues
|
||||
## Reporting issues
|
||||
|
||||
If you run into any issues, you can report them by creating an issue on GitHub: https://github.com/RareDevs/Rare/issues/new/choose
|
||||
|
||||
|
|
643
pylintrc
Normal file
643
pylintrc
Normal file
|
@ -0,0 +1,643 @@
|
|||
[MAIN]
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Clear in-memory caches upon conclusion of linting. Useful if running pylint
|
||||
# in a server-like mode.
|
||||
clear-cache-post-run=no
|
||||
|
||||
# Load and enable all available extensions. Use --list-extensions to see a list
|
||||
# all available extensions.
|
||||
#enable-all-extensions=
|
||||
|
||||
# In error mode, messages with a category besides ERROR or FATAL are
|
||||
# suppressed, and no reports are done by default. Error mode is compatible with
|
||||
# disabling specific errors.
|
||||
errors-only=yes
|
||||
|
||||
# Always return a 0 (non-error) status code, even if lint errors are found.
|
||||
# This is primarily useful in continuous integration scripts.
|
||||
#exit-zero=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code.
|
||||
extension-pkg-allow-list=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
|
||||
# for backward compatibility.)
|
||||
extension-pkg-whitelist=PyQt5
|
||||
|
||||
# Return non-zero exit code if any of these messages/categories are detected,
|
||||
# even if score is above --fail-under value. Syntax same as enable. Messages
|
||||
# specified are enabled, while categories only check already-enabled messages.
|
||||
fail-on=
|
||||
|
||||
# Specify a score threshold under which the program will exit with error.
|
||||
fail-under=10
|
||||
|
||||
# Interpret the stdin as a python script, whose filename needs to be passed as
|
||||
# the module_or_package argument.
|
||||
#from-stdin=
|
||||
|
||||
# Files or directories to be skipped. They should be base names, not paths.
|
||||
ignore=ui,singleton.py
|
||||
|
||||
# Add files or directories matching the regular expressions patterns to the
|
||||
# ignore-list. The regex matches against paths and can be in Posix or Windows
|
||||
# format. Because '\\' represents the directory delimiter on Windows systems,
|
||||
# it can't be used as an escape character.
|
||||
ignore-paths=
|
||||
|
||||
# Files or directories matching the regular expression patterns are skipped.
|
||||
# The regex matches against base names, not paths. The default value ignores
|
||||
# Emacs file locks
|
||||
ignore-patterns=^\.#
|
||||
|
||||
# List of module names for which member attributes should not be checked and
|
||||
# will not be imported (useful for modules/projects where namespaces are
|
||||
# manipulated during runtime and thus existing member attributes cannot be
|
||||
# deduced by static analysis). It supports qualified module names, as well as
|
||||
# Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
|
||||
# number of processors available to use, and will cap the count on Windows to
|
||||
# avoid hangs.
|
||||
jobs=3
|
||||
|
||||
# Control the amount of potential inferred values when inferring a single
|
||||
# object. This can help the performance when dealing with large functions or
|
||||
# complex, nested conditions.
|
||||
limit-inference-results=100
|
||||
|
||||
# List of plugins (as comma separated values of python module names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# Minimum Python version to use for version dependent checks. Will default to
|
||||
# the version used to run pylint.
|
||||
py-version=3.9
|
||||
|
||||
# Discover python modules and packages in the file system subtree.
|
||||
recursive=yes
|
||||
|
||||
# Add paths to the list of the source roots. Supports globbing patterns. The
|
||||
# source root is an absolute path or a path relative to the current working
|
||||
# directory used to determine a package namespace for modules located under the
|
||||
# source root.
|
||||
source-roots=
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages.
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
# In verbose mode, extra non-checker-related info will be displayed.
|
||||
#verbose=
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names.
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style. If left empty, argument names will be checked with the set
|
||||
# naming style.
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names.
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style. If left empty, attribute names will be checked with the set naming
|
||||
# style.
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma.
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Bad variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be refused
|
||||
bad-names-rgxs=
|
||||
|
||||
# Naming style matching correct class attribute names.
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style. If left empty, class attribute names will be checked
|
||||
# with the set naming style.
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class constant names.
|
||||
class-const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct class constant names. Overrides class-
|
||||
# const-naming-style. If left empty, class constant names will be checked with
|
||||
# the set naming style.
|
||||
#class-const-rgx=
|
||||
|
||||
# Naming style matching correct class names.
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-
|
||||
# style. If left empty, class names will be checked with the set naming style.
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names.
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style. If left empty, constant names will be checked with the set naming
|
||||
# style.
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style. If left empty, function names will be checked with the set
|
||||
# naming style.
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Good variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be accepted
|
||||
good-names-rgxs=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name.
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names.
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style. If left empty, inline iteration names will be checked
|
||||
# with the set naming style.
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names.
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style. If left empty, method names will be checked with the set naming style.
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names.
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style. If left empty, module names will be checked with the set naming style.
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
# These decorators are taken in consideration only for invalid-name.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Regular expression matching correct type alias names. If left empty, type
|
||||
# alias names will be checked with the set naming style.
|
||||
#typealias-rgx=
|
||||
|
||||
# Regular expression matching correct type variable names. If left empty, type
|
||||
# variable names will be checked with the set naming style.
|
||||
#typevar-rgx=
|
||||
|
||||
# Naming style matching correct variable names.
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style. If left empty, variable names will be checked with the set
|
||||
# naming style.
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# Warn about protected attribute access inside special methods
|
||||
check-protected-access-in-special-methods=no
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp,
|
||||
asyncSetUp,
|
||||
__post_init__
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# List of regular expressions of class ancestor names to ignore when counting
|
||||
# public methods (see R0903)
|
||||
exclude-too-few-public-methods=
|
||||
|
||||
# List of qualified class names to ignore when counting class parents (see
|
||||
# R0901)
|
||||
ignored-parents=
|
||||
|
||||
# Maximum number of arguments for function / method.
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body.
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body.
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body.
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body.
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when caught.
|
||||
overgeneral-exceptions=builtins.BaseException,builtins.Exception
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=100
|
||||
|
||||
# Maximum number of lines in a module.
|
||||
max-module-lines=1000
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# List of modules that can be imported at any level, not just the top level
|
||||
# one.
|
||||
allow-any-import-level=
|
||||
|
||||
# Allow explicit reexports by alias from a package __init__.
|
||||
allow-reexport-from-package=no
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of external dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
ext-import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of all (i.e. internal and
|
||||
# external) dependencies to the given file (report RP0402 must not be
|
||||
# disabled).
|
||||
import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of internal dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
# Couples of modules and preferred modules, separated by a comma.
|
||||
preferred-modules=
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# The type of string formatting that logging methods do. `old` means using %
|
||||
# formatting, `new` is for `{}` formatting.
|
||||
logging-format-style=old
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format.
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
|
||||
# UNDEFINED.
|
||||
confidence=HIGH,
|
||||
CONTROL_FLOW,
|
||||
INFERENCE,
|
||||
INFERENCE_FAILURE,
|
||||
UNDEFINED
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once). You can also use "--disable=all" to
|
||||
# disable everything first and then re-enable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use "--disable=all --enable=classes
|
||||
# --disable=W".
|
||||
disable=raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
use-symbolic-message-instead,
|
||||
use-implicit-booleaness-not-comparison-to-string,
|
||||
use-implicit-booleaness-not-comparison-to-zero,
|
||||
no-name-in-module,
|
||||
unexpected-keyword-arg,
|
||||
no-value-for-parameter
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=
|
||||
|
||||
|
||||
[METHOD_ARGS]
|
||||
|
||||
# List of qualified names (i.e., library.method) which require a timeout
|
||||
# parameter e.g. 'requests.api.get,requests.api.post'
|
||||
timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
# Regular expression of note tags to take in consideration.
|
||||
notes-rgx=
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=sys.exit,argparse.parse_error
|
||||
|
||||
# Let 'consider-using-join' be raised when the separator to join on would be
|
||||
# non-empty (resulting in expected fixes of the type: ``"- " + " -
|
||||
# ".join(items)``)
|
||||
suggest-join-with-non-empty-separator=yes
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a score less than or equal to 10. You
|
||||
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
|
||||
# 'convention', and 'info' which contain the number of messages in each
|
||||
# category, as well as 'statement' which is the total number of statements
|
||||
# analyzed. This score is used by the global evaluation report (RP0004).
|
||||
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details.
|
||||
msg-template=
|
||||
|
||||
# Set the output format. Available formats are: text, parseable, colorized,
|
||||
# json2 (improved json format), json (old json format) and msvs (visual
|
||||
# studio). You can also give a reporter class, e.g.
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
#output-format=
|
||||
|
||||
# Tells whether to display a full report or only the messages.
|
||||
reports=no
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Comments are removed from the similarity computation
|
||||
ignore-comments=yes
|
||||
|
||||
# Docstrings are removed from the similarity computation
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Imports are removed from the similarity computation
|
||||
ignore-imports=yes
|
||||
|
||||
# Signatures are removed from the similarity computation
|
||||
ignore-signatures=yes
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes.
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. No available dictionaries : You need to install
|
||||
# both the python package and the system dependency for enchant to work.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should be considered directives if they
|
||||
# appear at the beginning of a comment and should not be checked.
|
||||
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains the private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to the private dictionary (see the
|
||||
# --spelling-private-dict-file option) instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=no
|
||||
|
||||
# This flag controls whether the implicit-str-concat should generate a warning
|
||||
# on implicit string concatenation in sequences defined over several lines.
|
||||
check-str-concat-over-line-jumps=no
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=PyQt5.*,orjson.*
|
||||
|
||||
# Tells whether to warn about missing members when the owner of the attribute
|
||||
# is inferred to be None.
|
||||
ignore-none=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of symbolic message names to ignore for Mixin members.
|
||||
ignored-checks-for-mixins=no-member,
|
||||
not-async-context-manager,
|
||||
not-context-manager,
|
||||
attribute-defined-outside-init
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
# Regex pattern to define which classes are considered mixins.
|
||||
mixin-class-rgx=.*[Mm]ixin
|
||||
|
||||
# List of decorators that change the signature of a decorated function.
|
||||
signature-mutators=
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid defining new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of names allowed to shadow builtins
|
||||
allowed-redefined-builtins=
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expected to
|
||||
# not be used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored.
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
|
|
@ -1,5 +1,6 @@
|
|||
import json
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import time
|
||||
import traceback
|
||||
|
@ -34,15 +35,15 @@ DETACHED_APP_NAMES = {
|
|||
}
|
||||
|
||||
|
||||
class PreLaunchThread(QRunnable):
|
||||
class PreLaunch(QRunnable):
|
||||
class Signals(QObject):
|
||||
ready_to_launch = pyqtSignal(LaunchArgs)
|
||||
started_pre_launch_command = pyqtSignal()
|
||||
pre_launch_command_started = pyqtSignal()
|
||||
pre_launch_command_finished = pyqtSignal(int) # exit_code
|
||||
error_occurred = pyqtSignal(str)
|
||||
|
||||
def __init__(self, args: InitArgs, rgame: RareGameSlim, sync_action=None):
|
||||
super(PreLaunchThread, self).__init__()
|
||||
super(PreLaunch, self).__init__()
|
||||
self.signals = self.Signals()
|
||||
self.logger = getLogger(type(self).__name__)
|
||||
self.args = args
|
||||
|
@ -75,8 +76,10 @@ class PreLaunchThread(QRunnable):
|
|||
if launch_args.pre_launch_command:
|
||||
proc = get_configured_process()
|
||||
proc.setProcessEnvironment(launch_args.environment)
|
||||
self.signals.started_pre_launch_command.emit()
|
||||
proc.start(launch_args.pre_launch_command[0], launch_args.pre_launch_command[1:])
|
||||
self.signals.pre_launch_command_started.emit()
|
||||
pre_launch_command = shlex.split(launch_args.pre_launch_command)
|
||||
# self.logger.debug("Executing prelaunch command %s, %s", pre_launch_command[0], pre_launch_command[1:])
|
||||
proc.start(pre_launch_command[0], pre_launch_command[1:])
|
||||
if launch_args.pre_launch_wait:
|
||||
proc.waitForFinished(-1)
|
||||
return launch_args
|
||||
|
@ -171,13 +174,13 @@ class RareLauncher(RareApp):
|
|||
|
||||
@pyqtSlot()
|
||||
def __proc_log_stdout(self):
|
||||
self.console.log(
|
||||
self.console.log_stdout(
|
||||
self.game_process.readAllStandardOutput().data().decode("utf-8", "ignore")
|
||||
)
|
||||
|
||||
@pyqtSlot()
|
||||
def __proc_log_stderr(self):
|
||||
self.console.error(
|
||||
self.console.log_stderr(
|
||||
self.game_process.readAllStandardError().data().decode("utf-8", "ignore")
|
||||
)
|
||||
|
||||
|
@ -310,6 +313,7 @@ class RareLauncher(RareApp):
|
|||
print(args.executable, " ".join(args.arguments))
|
||||
self.stop()
|
||||
return
|
||||
# self.logger.debug("Executing prelaunch command %s, %s", args.executable, args.arguments)
|
||||
self.game_process.start(args.executable, args.arguments)
|
||||
|
||||
def error_occurred(self, error_str: str):
|
||||
|
@ -323,7 +327,7 @@ class RareLauncher(RareApp):
|
|||
self.stop()
|
||||
|
||||
def start_prepare(self, sync_action=None):
|
||||
worker = PreLaunchThread(self.args, self.rgame, sync_action)
|
||||
worker = PreLaunch(self.args, self.rgame, sync_action)
|
||||
worker.signals.ready_to_launch.connect(self.launch_game)
|
||||
worker.signals.error_occurred.connect(self.error_occurred)
|
||||
# worker.signals.started_pre_launch_command(None)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
from typing import Union
|
||||
|
||||
from PyQt5.QtCore import QProcessEnvironment, pyqtSignal, QSize, Qt
|
||||
|
@ -31,8 +32,8 @@ class ConsoleDialog(QDialog):
|
|||
self.setGeometry(0, 0, 640, 480)
|
||||
layout = QVBoxLayout()
|
||||
|
||||
self.console = ConsoleEdit(self)
|
||||
layout.addWidget(self.console)
|
||||
self.console_edit = ConsoleEdit(self)
|
||||
layout.addWidget(self.console_edit)
|
||||
|
||||
button_layout = QHBoxLayout()
|
||||
|
||||
|
@ -46,7 +47,7 @@ class ConsoleDialog(QDialog):
|
|||
|
||||
self.clear_button = QPushButton(self.tr("Clear console"))
|
||||
button_layout.addWidget(self.clear_button)
|
||||
self.clear_button.clicked.connect(self.console.clear)
|
||||
self.clear_button.clicked.connect(self.console_edit.clear)
|
||||
|
||||
button_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Fixed))
|
||||
|
||||
|
@ -102,7 +103,7 @@ class ConsoleDialog(QDialog):
|
|||
if "." not in file:
|
||||
file += ".log"
|
||||
with open(file, "w") as f:
|
||||
f.write(self.console.toPlainText())
|
||||
f.write(self.console_edit.toPlainText())
|
||||
f.close()
|
||||
self.save_button.setText(self.tr("Saved"))
|
||||
|
||||
|
@ -113,15 +114,21 @@ class ConsoleDialog(QDialog):
|
|||
self.env_variables.setTable(self.env)
|
||||
self.env_variables.show()
|
||||
|
||||
def log(self, text: str, end: str = "\n"):
|
||||
self.console.log(text + end)
|
||||
def log(self, text: str):
|
||||
self.console_edit.log(f"Rare: {text}")
|
||||
|
||||
def error(self, text, end: str = "\n"):
|
||||
self.console.error(text + end)
|
||||
def log_stdout(self, text: str):
|
||||
self.console_edit.log(text)
|
||||
|
||||
def error(self, text):
|
||||
self.console_edit.error(f"Rare: {text}")
|
||||
|
||||
def log_stderr(self, text):
|
||||
self.console_edit.error(text)
|
||||
|
||||
def on_process_exit(self, app_title: str, status: Union[int, str]):
|
||||
self.error(
|
||||
self.tr("Application \"{}\" finished with \"{}\"\n").format(app_title, status)
|
||||
self.tr("Application finished with exit code \"{}\"").format(status)
|
||||
)
|
||||
self.accept_close = True
|
||||
|
||||
|
@ -170,17 +177,6 @@ class ConsoleEdit(QPlainTextEdit):
|
|||
font = QFont("Monospace")
|
||||
font.setStyleHint(QFont.Monospace)
|
||||
self.setFont(font)
|
||||
self._cursor_output = self.textCursor()
|
||||
|
||||
def log(self, text):
|
||||
html = f"<p style=\"color:#aaa;white-space:pre\">{text}</p>"
|
||||
self._cursor_output.insertHtml(html)
|
||||
self.scroll_to_last_line()
|
||||
|
||||
def error(self, text):
|
||||
html = f"<p style=\"color:#a33;white-space:pre\">{text}</p>"
|
||||
self._cursor_output.insertHtml(html)
|
||||
self.scroll_to_last_line()
|
||||
|
||||
def scroll_to_last_line(self):
|
||||
cursor = self.textCursor()
|
||||
|
@ -189,3 +185,14 @@ class ConsoleEdit(QPlainTextEdit):
|
|||
QTextCursor.Up if cursor.atBlockStart() else QTextCursor.StartOfLine
|
||||
)
|
||||
self.setTextCursor(cursor)
|
||||
|
||||
def print_to_console(self, text: str, color: str):
|
||||
html = f"<p style=\"color:{color};white-space:pre\">{text}</p>"
|
||||
self.appendHtml(html)
|
||||
self.scroll_to_last_line()
|
||||
|
||||
def log(self, text):
|
||||
self.print_to_console(text, "#aaa")
|
||||
|
||||
def error(self, text):
|
||||
self.print_to_console(text, "#a33")
|
||||
|
|
|
@ -11,7 +11,7 @@ from legendary.models.game import LaunchParameters
|
|||
|
||||
from rare.models.base_game import RareGameSlim
|
||||
|
||||
logger = getLogger("Helper")
|
||||
logger = getLogger("RareLauncherHelper")
|
||||
|
||||
|
||||
class GameArgsError(Exception):
|
||||
|
@ -156,7 +156,7 @@ def get_launch_args(rgame: RareGameSlim, init_args: InitArgs = None) -> LaunchAr
|
|||
if not rgame.is_installed:
|
||||
raise GameArgsError("Game is not installed or has unsupported format")
|
||||
|
||||
if rgame.is_dlc:
|
||||
if rgame.is_dlc and not rgame.is_launchable_addon:
|
||||
raise GameArgsError("Game is a DLC")
|
||||
if not os.path.exists(rgame.install_path):
|
||||
raise GameArgsError("Game path does not exist")
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
from logging import getLogger
|
||||
|
||||
from PyQt5.QtCore import Qt, QSettings, QTimer, QSize, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtGui import QCloseEvent, QCursor, QShowEvent
|
||||
from PyQt5.QtGui import QCloseEvent, QCursor
|
||||
from PyQt5.QtWidgets import (
|
||||
QMainWindow,
|
||||
QApplication,
|
||||
|
|
|
@ -8,9 +8,9 @@ from rare.models.game import RareGame
|
|||
from rare.shared import LegendaryCoreSingleton, GlobalSignalsSingleton, ArgumentsSingleton
|
||||
from rare.utils.json_formatter import QJsonModel
|
||||
from rare.widgets.side_tab import SideTabWidget, SideTabContents
|
||||
from .game_dlc import GameDlc
|
||||
from .game_info import GameInfo
|
||||
from .game_settings import GameSettings
|
||||
from .dlcs import GameDlcs
|
||||
from .details import GameDetails
|
||||
from .settings import GameSettings
|
||||
from .cloud_saves import CloudSaves
|
||||
|
||||
|
||||
|
@ -24,9 +24,9 @@ class GameInfoTabs(SideTabWidget):
|
|||
self.signals = GlobalSignalsSingleton()
|
||||
self.args = ArgumentsSingleton()
|
||||
|
||||
self.info_tab = GameInfo(self)
|
||||
self.info_tab.import_clicked.connect(self.import_clicked)
|
||||
self.info_index = self.addTab(self.info_tab, self.tr("Information"))
|
||||
self.details_tab = GameDetails(self)
|
||||
self.details_tab.import_clicked.connect(self.import_clicked)
|
||||
self.details_index = self.addTab(self.details_tab, self.tr("Information"))
|
||||
|
||||
self.settings_tab = GameSettings(self)
|
||||
self.settings_index = self.addTab(self.settings_tab, self.tr("Settings"))
|
||||
|
@ -34,8 +34,8 @@ class GameInfoTabs(SideTabWidget):
|
|||
self.cloud_saves_tab = CloudSaves(self)
|
||||
self.cloud_saves_index = self.addTab(self.cloud_saves_tab, self.tr("Cloud Saves"))
|
||||
|
||||
self.dlc_tab = GameDlc(self)
|
||||
self.dlc_index = self.addTab(self.dlc_tab, self.tr("Downloadable Content"))
|
||||
self.dlcs_tab = GameDlcs(self)
|
||||
self.dlcs_index = self.addTab(self.dlcs_tab, self.tr("Downloadable Content"))
|
||||
|
||||
# FIXME: Hiding didn't work, so don't add these tabs in normal mode. Fix this properly later
|
||||
if self.args.debug:
|
||||
|
@ -43,17 +43,19 @@ class GameInfoTabs(SideTabWidget):
|
|||
self.game_meta_index = self.addTab(self.game_meta_view, self.tr("Game Metadata"))
|
||||
self.igame_meta_view = GameMetadataView(self)
|
||||
self.igame_meta_index = self.addTab(self.igame_meta_view, self.tr("InstalledGame Metadata"))
|
||||
self.rgame_meta_view = GameMetadataView(self)
|
||||
self.rgame_meta_index = self.addTab(self.rgame_meta_view, self.tr("RareGame Metadata"))
|
||||
|
||||
self.setCurrentIndex(self.info_index)
|
||||
self.setCurrentIndex(self.details_index)
|
||||
|
||||
def update_game(self, rgame: RareGame):
|
||||
self.info_tab.update_game(rgame)
|
||||
self.details_tab.update_game(rgame)
|
||||
|
||||
self.settings_tab.load_settings(rgame)
|
||||
self.settings_tab.setEnabled(rgame.is_installed or rgame.is_origin)
|
||||
|
||||
self.dlc_tab.update_dlcs(rgame)
|
||||
self.dlc_tab.setEnabled(rgame.is_installed and bool(rgame.owned_dlcs))
|
||||
self.dlcs_tab.update_dlcs(rgame)
|
||||
self.dlcs_tab.setEnabled(rgame.is_installed and bool(rgame.owned_dlcs))
|
||||
|
||||
self.cloud_saves_tab.update_game(rgame)
|
||||
# self.cloud_saves_tab.setEnabled(rgame.game.supports_cloud_saves or rgame.game.supports_mac_cloud_saves)
|
||||
|
@ -61,8 +63,9 @@ class GameInfoTabs(SideTabWidget):
|
|||
if self.args.debug:
|
||||
self.game_meta_view.update_game(rgame, rgame.game)
|
||||
self.igame_meta_view.update_game(rgame, rgame.igame)
|
||||
self.rgame_meta_view.update_game(rgame, rgame.metadata)
|
||||
|
||||
self.setCurrentIndex(self.info_index)
|
||||
self.setCurrentIndex(self.details_index)
|
||||
|
||||
def keyPressEvent(self, a0: QKeyEvent):
|
||||
if a0.key() == Qt.Key_Escape:
|
||||
|
@ -75,6 +78,7 @@ class GameMetadataView(QTreeView, SideTabContents):
|
|||
self.implements_scrollarea = True
|
||||
self.setColumnWidth(0, 300)
|
||||
self.setWordWrap(True)
|
||||
self.setEditTriggers(QTreeView.NoEditTriggers)
|
||||
self.model = QJsonModel()
|
||||
self.setModel(self.model)
|
||||
self.rgame: Optional[RareGame] = None
|
||||
|
|
|
@ -19,7 +19,7 @@ from rare.components.dialogs.selective_dialog import SelectiveDialog
|
|||
from rare.models.game import RareGame
|
||||
from rare.shared import RareCore
|
||||
from rare.shared.workers import VerifyWorker, MoveWorker
|
||||
from rare.ui.components.tabs.games.game_info.game_info import Ui_GameInfo
|
||||
from rare.ui.components.tabs.games.game_info.details import Ui_GameDetails
|
||||
from rare.utils.misc import format_size, qta_icon, style_hyperlink
|
||||
from rare.widgets.image_widget import ImageWidget, ImageSize
|
||||
from rare.widgets.side_tab import SideTabContents
|
||||
|
@ -28,13 +28,13 @@ from rare.components.dialogs.move_dialog import MoveDialog, is_game_dir
|
|||
logger = getLogger("GameInfo")
|
||||
|
||||
|
||||
class GameInfo(QWidget, SideTabContents):
|
||||
class GameDetails(QWidget, SideTabContents):
|
||||
# str: app_name
|
||||
import_clicked = pyqtSignal(str)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(GameInfo, self).__init__(parent=parent)
|
||||
self.ui = Ui_GameInfo()
|
||||
super(GameDetails, self).__init__(parent=parent)
|
||||
self.ui = Ui_GameDetails()
|
||||
self.ui.setupUi(self)
|
||||
# lk: set object names for CSS properties
|
||||
self.ui.install_button.setObjectName("InstallButton")
|
|
@ -6,8 +6,8 @@ from PyQt5.QtWidgets import QFrame, QMessageBox, QToolBox
|
|||
|
||||
from rare.models.game import RareGame
|
||||
from rare.shared import LegendaryCoreSingleton, GlobalSignalsSingleton
|
||||
from rare.ui.components.tabs.games.game_info.game_dlc import Ui_GameDlc
|
||||
from rare.ui.components.tabs.games.game_info.game_dlc_widget import Ui_GameDlcWidget
|
||||
from rare.ui.components.tabs.games.game_info.dlcs import Ui_GameDlcs
|
||||
from rare.ui.components.tabs.games.game_info.dlc_widget import Ui_GameDlcWidget
|
||||
from rare.widgets.image_widget import ImageWidget, ImageSize
|
||||
from rare.widgets.side_tab import SideTabContents
|
||||
from rare.utils.misc import widget_object_name, qta_icon
|
||||
|
@ -98,12 +98,12 @@ class AvailableGameDlcWidget(GameDlcWidget):
|
|||
self.rdlc.install()
|
||||
|
||||
|
||||
class GameDlc(QToolBox, SideTabContents):
|
||||
class GameDlcs(QToolBox, SideTabContents):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(GameDlc, self).__init__(parent=parent)
|
||||
super(GameDlcs, self).__init__(parent=parent)
|
||||
self.implements_scrollarea = True
|
||||
self.ui = Ui_GameDlc()
|
||||
self.ui = Ui_GameDlcs()
|
||||
self.ui.setupUi(self)
|
||||
self.core = LegendaryCoreSingleton()
|
||||
self.signals = GlobalSignalsSingleton()
|
|
@ -19,10 +19,9 @@ from rare.widgets.indicator_edit import PathEdit, IndicatorReasonsCommon
|
|||
|
||||
if pf.system() != "Windows":
|
||||
from rare.components.tabs.settings.widgets.wine import WineSettings
|
||||
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from rare.components.tabs.settings.widgets.proton import ProtonSettings
|
||||
from rare.components.tabs.settings.widgets.overlay import MangoHudSettings
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from rare.components.tabs.settings.widgets.proton import ProtonSettings
|
||||
from rare.components.tabs.settings.widgets.overlay import MangoHudSettings
|
||||
|
||||
logger = getLogger("GameSettings")
|
||||
|
||||
|
@ -140,21 +139,18 @@ class GameLaunchSettings(LaunchSettingsBase):
|
|||
|
||||
|
||||
if pf.system() != "Windows":
|
||||
|
||||
class GameWineSettings(WineSettings):
|
||||
def load_settings(self, app_name):
|
||||
self.app_name = app_name
|
||||
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
class GameProtonSettings(ProtonSettings):
|
||||
def load_settings(self, app_name: str):
|
||||
self.app_name = app_name
|
||||
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
|
||||
class GameProtonSettings(ProtonSettings):
|
||||
def load_settings(self, app_name: str):
|
||||
self.app_name = app_name
|
||||
|
||||
class GameMangoHudSettings(MangoHudSettings):
|
||||
def load_settings(self, app_name: str):
|
||||
self.app_name = app_name
|
||||
class GameMangoHudSettings(MangoHudSettings):
|
||||
def load_settings(self, app_name: str):
|
||||
self.app_name = app_name
|
||||
|
||||
|
||||
class GameDxvkSettings(DxvkSettings):
|
||||
|
@ -169,18 +165,19 @@ class GameEnvVars(EnvVars):
|
|||
|
||||
class GameSettings(GameSettingsBase):
|
||||
def __init__(self, parent=None):
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
GameWineSettings, GameProtonSettings, GameMangoHudSettings,
|
||||
parent=parent
|
||||
)
|
||||
elif pf.system() != "Windows":
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
GameWineSettings,
|
||||
parent=parent
|
||||
)
|
||||
if pf.system() != "Windows":
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
GameWineSettings, GameProtonSettings, GameMangoHudSettings,
|
||||
parent=parent
|
||||
)
|
||||
else:
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
GameWineSettings,
|
||||
parent=parent
|
||||
)
|
||||
else:
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
|
@ -193,8 +190,8 @@ class GameSettings(GameSettingsBase):
|
|||
self.launch.load_settings(rgame)
|
||||
if pf.system() != "Windows":
|
||||
self.wine.load_settings(rgame.app_name)
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.proton_tool.load_settings(rgame.app_name)
|
||||
self.mangohud.load_settings(rgame.app_name)
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.proton_tool.load_settings(rgame.app_name)
|
||||
self.mangohud.load_settings(rgame.app_name)
|
||||
self.dxvk.load_settings(rgame.app_name)
|
||||
self.env_vars.load_settings(rgame.app_name)
|
|
@ -111,7 +111,6 @@ class GameWidget(LibraryWidget):
|
|||
self.startTimer(random.randrange(42, 2361, 129), Qt.CoarseTimer)
|
||||
# self.startTimer(random.randrange(42, 2361, 363), Qt.VeryCoarseTimer)
|
||||
# self.rgame.load_pixmap()
|
||||
# QTimer.singleShot(random.randrange(42, 2361, 7), Qt.VeryCoarseTimer, self.rgame.load_pixmap)
|
||||
super().paintEvent(a0)
|
||||
|
||||
def timerEvent(self, a0):
|
||||
|
|
|
@ -9,10 +9,9 @@ from .widgets.wrappers import WrapperSettings
|
|||
|
||||
if pf.system() != "Windows":
|
||||
from .widgets.wine import WineSettings
|
||||
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from .widgets.proton import ProtonSettings
|
||||
from .widgets.overlay import MangoHudSettings
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from .widgets.proton import ProtonSettings
|
||||
from .widgets.overlay import MangoHudSettings
|
||||
|
||||
logger = getLogger("GameSettings")
|
||||
|
||||
|
@ -24,18 +23,19 @@ class LaunchSettings(LaunchSettingsBase):
|
|||
|
||||
class GameSettings(GameSettingsBase):
|
||||
def __init__(self, parent=None):
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
WineSettings, ProtonSettings, MangoHudSettings,
|
||||
parent=parent
|
||||
)
|
||||
elif pf.system() != "Windows":
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
WineSettings,
|
||||
parent=parent
|
||||
)
|
||||
if pf.system() != "Windows":
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
WineSettings, ProtonSettings, MangoHudSettings,
|
||||
parent=parent
|
||||
)
|
||||
else:
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
WineSettings,
|
||||
parent=parent
|
||||
)
|
||||
else:
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
from typing import Tuple, Type, TypeVar
|
||||
|
||||
|
@ -73,7 +74,11 @@ class LaunchSettingsBase(QGroupBox):
|
|||
def __prelaunch_edit_callback(text: str) -> Tuple[bool, str, int]:
|
||||
if not text.strip():
|
||||
return True, text, IndicatorReasonsCommon.VALID
|
||||
if not os.path.isfile(text.split()[0]) and not shutil.which(text.split()[0]):
|
||||
try:
|
||||
command = shlex.split(text)[0]
|
||||
except ValueError:
|
||||
return False, text, IndicatorReasonsCommon.WRONG_FORMAT
|
||||
if not os.path.isfile(command) and not shutil.which(command):
|
||||
return False, text, IndicatorReasonsCommon.FILE_NOT_EXISTS
|
||||
else:
|
||||
return True, text, IndicatorReasonsCommon.VALID
|
||||
|
|
|
@ -6,7 +6,6 @@ from .api.models.response import CatalogOfferModel
|
|||
from .landing import LandingWidget, LandingPage
|
||||
from .search import SearchPage
|
||||
from .store_api import StoreAPI
|
||||
from .widgets.details import DetailsWidget
|
||||
from .wishlist import WishlistPage
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ from rare.widgets.flow_layout import FlowLayout
|
|||
from rare.widgets.side_tab import SideTabContents
|
||||
from rare.widgets.sliding_stack import SlidingStackedWidget
|
||||
from .store_api import StoreAPI
|
||||
from .widgets.details import DetailsWidget
|
||||
from .widgets.details import StoreDetailsWidget
|
||||
from .widgets.groups import StoreGroup
|
||||
from .widgets.items import StoreItemWidget
|
||||
|
||||
|
@ -44,7 +44,7 @@ class LandingPage(SlidingStackedWidget, SideTabContents):
|
|||
self.landing_scroll.widget().setAutoFillBackground(False)
|
||||
self.landing_scroll.viewport().setAutoFillBackground(False)
|
||||
|
||||
self.details_widget = DetailsWidget([], store_api, parent=self)
|
||||
self.details_widget = StoreDetailsWidget([], store_api, parent=self)
|
||||
self.details_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||
self.details_widget.set_title.connect(self.set_title)
|
||||
self.details_widget.back_clicked.connect(self.show_main)
|
||||
|
|
|
@ -20,7 +20,7 @@ from .api.models.response import CatalogOfferModel
|
|||
from .constants import Constants
|
||||
from .results import ResultsWidget
|
||||
from .store_api import StoreAPI
|
||||
from .widgets.details import DetailsWidget
|
||||
from .widgets.details import StoreDetailsWidget
|
||||
|
||||
logger = logging.getLogger("Shop")
|
||||
|
||||
|
@ -35,7 +35,7 @@ class SearchPage(SlidingStackedWidget, SideTabContents):
|
|||
self.search_widget.set_title.connect(self.set_title)
|
||||
self.search_widget.show_details.connect(self.show_details)
|
||||
|
||||
self.details_widget = DetailsWidget([], store_api, parent=self)
|
||||
self.details_widget = StoreDetailsWidget([], store_api, parent=self)
|
||||
self.details_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||
self.details_widget.set_title.connect(self.set_title)
|
||||
self.details_widget.back_clicked.connect(self.show_main)
|
||||
|
|
|
@ -97,13 +97,13 @@ class StoreAPI(QObject):
|
|||
except KeyError as e:
|
||||
if DEBUG():
|
||||
raise e
|
||||
logger.error("Free games Api request failed")
|
||||
logger.exception("Free games API request failed")
|
||||
handle_func(["error", "Key error"])
|
||||
return
|
||||
except Exception as e:
|
||||
if DEBUG():
|
||||
raise e
|
||||
logger.error(f"Free games Api request failed: {e}")
|
||||
logger.exception(f"Free games API request failed")
|
||||
handle_func(["error", e])
|
||||
return
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from rare.components.tabs.store.api.models.diesel import DieselProduct, DieselPr
|
|||
from rare.components.tabs.store.api.models.response import CatalogOfferModel
|
||||
from rare.components.tabs.store.store_api import StoreAPI
|
||||
from rare.models.image import ImageSize
|
||||
from rare.ui.components.tabs.store.details import Ui_DetailsWidget
|
||||
from rare.ui.components.tabs.store.details import Ui_StoreDetailsWidget
|
||||
from rare.utils.misc import qta_icon
|
||||
from rare.widgets.elide_label import ElideLabel
|
||||
from rare.widgets.side_tab import SideTabWidget, SideTabContents
|
||||
|
@ -24,15 +24,15 @@ from .image import LoadingImageWidget
|
|||
logger = logging.getLogger("StoreDetails")
|
||||
|
||||
|
||||
class DetailsWidget(QWidget, SideTabContents):
|
||||
class StoreDetailsWidget(QWidget, SideTabContents):
|
||||
back_clicked: pyqtSignal = pyqtSignal()
|
||||
|
||||
# TODO Design
|
||||
def __init__(self, installed: List, store_api: StoreAPI, parent=None):
|
||||
super(DetailsWidget, self).__init__(parent=parent)
|
||||
super(StoreDetailsWidget, self).__init__(parent=parent)
|
||||
self.implements_scrollarea = True
|
||||
|
||||
self.ui = Ui_DetailsWidget()
|
||||
self.ui = Ui_StoreDetailsWidget()
|
||||
self.ui.setupUi(self)
|
||||
self.ui.main_layout.setContentsMargins(0, 0, 3, 0)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from rare.widgets.side_tab import SideTabContents
|
|||
from rare.widgets.sliding_stack import SlidingStackedWidget
|
||||
from .api.models.response import WishlistItemModel, CatalogOfferModel
|
||||
from .store_api import StoreAPI
|
||||
from .widgets.details import DetailsWidget
|
||||
from .widgets.details import StoreDetailsWidget
|
||||
from .widgets.items import WishlistItemWidget
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ class WishlistPage(SlidingStackedWidget, SideTabContents):
|
|||
self.wishlist_widget.set_title.connect(self.set_title)
|
||||
self.wishlist_widget.show_details.connect(self.show_details)
|
||||
|
||||
self.details_widget = DetailsWidget([], api, parent=self)
|
||||
self.details_widget = StoreDetailsWidget([], api, parent=self)
|
||||
self.details_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||
self.details_widget.set_title.connect(self.set_title)
|
||||
self.details_widget.back_clicked.connect(self.show_main)
|
||||
|
|
|
@ -41,11 +41,11 @@ class RareGame(RareGameSlim):
|
|||
return cls(
|
||||
queued=data.get("queued", False),
|
||||
queue_pos=data.get("queue_pos", None),
|
||||
last_played=datetime.fromisoformat(x) if (x := data.get("last_played", None)) else datetime.min,
|
||||
grant_date=datetime.fromisoformat(x) if (x := data.get("grant_date", None)) else datetime.min,
|
||||
last_played=datetime.fromisoformat(x) if (x := data.get("last_played", "")) else datetime.min,
|
||||
grant_date=datetime.fromisoformat(x) if (x := data.get("grant_date", "")) else datetime.min,
|
||||
steam_appid=data.get("steam_appid", None),
|
||||
steam_grade=data.get("steam_grade", None),
|
||||
steam_date=datetime.fromisoformat(x) if (x := data.get("steam_date", None)) else datetime.min,
|
||||
steam_date=datetime.fromisoformat(x) if (x := data.get("steam_date", "")) else datetime.min,
|
||||
tags=data.get("tags", []),
|
||||
)
|
||||
|
||||
|
@ -432,10 +432,13 @@ class RareGame(RareGameSlim):
|
|||
if self.metadata.steam_grade != "pending":
|
||||
elapsed_time = abs(datetime.utcnow() - self.metadata.steam_date)
|
||||
|
||||
if elapsed_time.days > 3 and (self.metadata.steam_grade is None or self.metadata.steam_appid is None):
|
||||
if elapsed_time.days > 3:
|
||||
logger.info("Refreshing ProtonDB grade for %s", self.app_title)
|
||||
|
||||
def _set_steam_grade():
|
||||
appid, rating = get_rating(self.core, self.app_name)
|
||||
self.set_steam_grade(appid, rating)
|
||||
|
||||
worker = QRunnable.create(_set_steam_grade)
|
||||
QThreadPool.globalInstance().start(worker)
|
||||
self.metadata.steam_grade = "pending"
|
||||
|
@ -445,12 +448,15 @@ class RareGame(RareGameSlim):
|
|||
def steam_appid(self) -> Optional[int]:
|
||||
return self.metadata.steam_appid
|
||||
|
||||
def set_steam_appid(self, appid: int):
|
||||
set_envvar(self.app_name, "SteamAppId", str(appid))
|
||||
set_envvar(self.app_name, "SteamGameId", str(appid))
|
||||
set_envvar(self.app_name, "STEAM_COMPAT_APP_ID", str(appid))
|
||||
self.metadata.steam_appid = appid
|
||||
|
||||
def set_steam_grade(self, appid: int, grade: str) -> None:
|
||||
if appid and self.steam_appid is None:
|
||||
set_envvar(self.app_name, "SteamAppId", str(appid))
|
||||
set_envvar(self.app_name, "SteamGameId", str(appid))
|
||||
set_envvar(self.app_name, "STEAM_COMPAT_APP_ID", str(appid))
|
||||
self.metadata.steam_appid = appid
|
||||
self.set_steam_appid(appid)
|
||||
self.metadata.steam_grade = grade
|
||||
self.metadata.steam_date = datetime.utcnow()
|
||||
self.__save_metadata()
|
||||
|
@ -565,8 +571,8 @@ class RareGame(RareGameSlim):
|
|||
if wine_pfx:
|
||||
args.extend(["--wine-prefix", wine_pfx])
|
||||
|
||||
logger.info(f"Starting game process: ({executable} {' '.join(args)})")
|
||||
QProcess.startDetached(executable, args)
|
||||
logger.info(f"Start new Process: ({executable} {' '.join(args)})")
|
||||
self.game_process.connect_to_server(on_startup=False)
|
||||
return True
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ class WinePathResolver(Worker):
|
|||
disable_wine=config.get_boolean(app_name, "no_wine")
|
||||
)
|
||||
env = core.get_app_environment(app_name, disable_wine=config.get_boolean(app_name, "no_wine"))
|
||||
# pylint: disable=E0606
|
||||
env = compat_utils.get_host_environment(env, silent=True)
|
||||
|
||||
return cmd, env
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/game_info.ui'
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/details.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.10
|
||||
#
|
||||
|
@ -11,15 +11,16 @@
|
|||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GameInfo(object):
|
||||
def setupUi(self, GameInfo):
|
||||
GameInfo.setObjectName("GameInfo")
|
||||
GameInfo.resize(600, 404)
|
||||
self.main_layout = QtWidgets.QHBoxLayout(GameInfo)
|
||||
class Ui_GameDetails(object):
|
||||
def setupUi(self, GameDetails):
|
||||
GameDetails.setObjectName("GameDetails")
|
||||
GameDetails.resize(814, 470)
|
||||
GameDetails.setWindowTitle("GameDetails")
|
||||
self.main_layout = QtWidgets.QHBoxLayout(GameDetails)
|
||||
self.main_layout.setObjectName("main_layout")
|
||||
self.left_layout = QtWidgets.QVBoxLayout()
|
||||
self.left_layout.setObjectName("left_layout")
|
||||
self.tags_group = QtWidgets.QGroupBox(GameInfo)
|
||||
self.tags_group = QtWidgets.QGroupBox(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -59,12 +60,14 @@ class Ui_GameInfo(object):
|
|||
self.main_layout.addLayout(self.left_layout)
|
||||
self.right_layout = QtWidgets.QVBoxLayout()
|
||||
self.right_layout.setObjectName("right_layout")
|
||||
self.info_layout = QtWidgets.QFormLayout()
|
||||
self.info_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.info_layout.setContentsMargins(6, 6, 6, 6)
|
||||
self.info_layout.setSpacing(12)
|
||||
self.info_layout.setObjectName("info_layout")
|
||||
self.lbl_dev = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout = QtWidgets.QFormLayout()
|
||||
self.details_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
||||
self.details_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
|
||||
self.details_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.details_layout.setContentsMargins(6, 6, 6, 6)
|
||||
self.details_layout.setSpacing(12)
|
||||
self.details_layout.setObjectName("details_layout")
|
||||
self.lbl_dev = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -76,13 +79,13 @@ class Ui_GameInfo(object):
|
|||
self.lbl_dev.setFont(font)
|
||||
self.lbl_dev.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_dev.setObjectName("lbl_dev")
|
||||
self.info_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.lbl_dev)
|
||||
self.dev = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.lbl_dev)
|
||||
self.dev = QtWidgets.QLabel(GameDetails)
|
||||
self.dev.setText("error")
|
||||
self.dev.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.dev.setObjectName("dev")
|
||||
self.info_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.dev)
|
||||
self.lbl_app_name = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.dev)
|
||||
self.lbl_app_name = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -94,13 +97,13 @@ class Ui_GameInfo(object):
|
|||
self.lbl_app_name.setFont(font)
|
||||
self.lbl_app_name.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_app_name.setObjectName("lbl_app_name")
|
||||
self.info_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.lbl_app_name)
|
||||
self.app_name = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.lbl_app_name)
|
||||
self.app_name = QtWidgets.QLabel(GameDetails)
|
||||
self.app_name.setText("error")
|
||||
self.app_name.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.app_name.setObjectName("app_name")
|
||||
self.info_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.app_name)
|
||||
self.lbl_version = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.app_name)
|
||||
self.lbl_version = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -112,13 +115,13 @@ class Ui_GameInfo(object):
|
|||
self.lbl_version.setFont(font)
|
||||
self.lbl_version.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_version.setObjectName("lbl_version")
|
||||
self.info_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.lbl_version)
|
||||
self.version = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.lbl_version)
|
||||
self.version = QtWidgets.QLabel(GameDetails)
|
||||
self.version.setText("error")
|
||||
self.version.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.version.setObjectName("version")
|
||||
self.info_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.version)
|
||||
self.lbl_grade = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.version)
|
||||
self.lbl_grade = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -130,14 +133,14 @@ class Ui_GameInfo(object):
|
|||
self.lbl_grade.setFont(font)
|
||||
self.lbl_grade.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_grade.setObjectName("lbl_grade")
|
||||
self.info_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.lbl_grade)
|
||||
self.grade = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.lbl_grade)
|
||||
self.grade = QtWidgets.QLabel(GameDetails)
|
||||
self.grade.setText("error")
|
||||
self.grade.setOpenExternalLinks(True)
|
||||
self.grade.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.grade.setObjectName("grade")
|
||||
self.info_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.grade)
|
||||
self.lbl_install_size = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.grade)
|
||||
self.lbl_install_size = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -149,13 +152,13 @@ class Ui_GameInfo(object):
|
|||
self.lbl_install_size.setFont(font)
|
||||
self.lbl_install_size.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_install_size.setObjectName("lbl_install_size")
|
||||
self.info_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.lbl_install_size)
|
||||
self.install_size = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.lbl_install_size)
|
||||
self.install_size = QtWidgets.QLabel(GameDetails)
|
||||
self.install_size.setText("error")
|
||||
self.install_size.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.install_size.setObjectName("install_size")
|
||||
self.info_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.install_size)
|
||||
self.lbl_install_path = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.install_size)
|
||||
self.lbl_install_path = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -167,14 +170,14 @@ class Ui_GameInfo(object):
|
|||
self.lbl_install_path.setFont(font)
|
||||
self.lbl_install_path.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_install_path.setObjectName("lbl_install_path")
|
||||
self.info_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.lbl_install_path)
|
||||
self.install_path = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.lbl_install_path)
|
||||
self.install_path = QtWidgets.QLabel(GameDetails)
|
||||
self.install_path.setText("error")
|
||||
self.install_path.setWordWrap(True)
|
||||
self.install_path.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.install_path.setObjectName("install_path")
|
||||
self.info_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.install_path)
|
||||
self.lbl_platform = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.install_path)
|
||||
self.lbl_platform = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -186,12 +189,12 @@ class Ui_GameInfo(object):
|
|||
self.lbl_platform.setFont(font)
|
||||
self.lbl_platform.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_platform.setObjectName("lbl_platform")
|
||||
self.info_layout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.lbl_platform)
|
||||
self.platform = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.lbl_platform)
|
||||
self.platform = QtWidgets.QLabel(GameDetails)
|
||||
self.platform.setText("error")
|
||||
self.platform.setObjectName("platform")
|
||||
self.info_layout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.platform)
|
||||
self.lbl_game_actions = QtWidgets.QLabel(GameInfo)
|
||||
self.details_layout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.platform)
|
||||
self.lbl_game_actions = QtWidgets.QLabel(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -203,8 +206,8 @@ class Ui_GameInfo(object):
|
|||
self.lbl_game_actions.setFont(font)
|
||||
self.lbl_game_actions.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.lbl_game_actions.setObjectName("lbl_game_actions")
|
||||
self.info_layout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.lbl_game_actions)
|
||||
self.game_actions_stack = QtWidgets.QStackedWidget(GameInfo)
|
||||
self.details_layout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.lbl_game_actions)
|
||||
self.game_actions_stack = QtWidgets.QStackedWidget(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -295,9 +298,9 @@ class Ui_GameInfo(object):
|
|||
spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uninstalled_layout.addItem(spacerItem)
|
||||
self.game_actions_stack.addWidget(self.uninstalled_page)
|
||||
self.info_layout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.game_actions_stack)
|
||||
self.right_layout.addLayout(self.info_layout)
|
||||
self.requirements_group = QtWidgets.QFrame(GameInfo)
|
||||
self.details_layout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.game_actions_stack)
|
||||
self.right_layout.addLayout(self.details_layout)
|
||||
self.requirements_group = QtWidgets.QFrame(GameDetails)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -313,41 +316,40 @@ class Ui_GameInfo(object):
|
|||
self.main_layout.addLayout(self.right_layout)
|
||||
self.main_layout.setStretch(1, 1)
|
||||
|
||||
self.retranslateUi(GameInfo)
|
||||
self.retranslateUi(GameDetails)
|
||||
self.game_actions_stack.setCurrentIndex(0)
|
||||
self.verify_stack.setCurrentIndex(0)
|
||||
self.move_stack.setCurrentIndex(0)
|
||||
|
||||
def retranslateUi(self, GameInfo):
|
||||
def retranslateUi(self, GameDetails):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
GameInfo.setWindowTitle(_translate("GameInfo", "Game Info"))
|
||||
self.tags_group.setTitle(_translate("GameInfo", "Tags"))
|
||||
self.completed_check.setText(_translate("GameInfo", "Completed"))
|
||||
self.hidden_check.setText(_translate("GameInfo", "Hidden"))
|
||||
self.favorites_check.setText(_translate("GameInfo", "Favorites"))
|
||||
self.backlog_check.setText(_translate("GameInfo", "Backlog"))
|
||||
self.lbl_dev.setText(_translate("GameInfo", "Developer"))
|
||||
self.lbl_app_name.setText(_translate("GameInfo", "Application Name"))
|
||||
self.lbl_version.setText(_translate("GameInfo", "Version"))
|
||||
self.lbl_grade.setText(_translate("GameInfo", "ProtonDB Grade"))
|
||||
self.lbl_install_size.setText(_translate("GameInfo", "Installation Size"))
|
||||
self.lbl_install_path.setText(_translate("GameInfo", "Installation Path"))
|
||||
self.lbl_platform.setText(_translate("GameInfo", "Platform"))
|
||||
self.lbl_game_actions.setText(_translate("GameInfo", "Actions"))
|
||||
self.modify_button.setText(_translate("GameInfo", "Modify"))
|
||||
self.verify_button.setText(_translate("GameInfo", "Verify"))
|
||||
self.repair_button.setText(_translate("GameInfo", "Repair"))
|
||||
self.move_button.setText(_translate("GameInfo", "Move"))
|
||||
self.uninstall_button.setText(_translate("GameInfo", "Uninstall"))
|
||||
self.install_button.setText(_translate("GameInfo", "Install"))
|
||||
self.import_button.setText(_translate("GameInfo", "Import"))
|
||||
self.tags_group.setTitle(_translate("GameDetails", "Tags"))
|
||||
self.completed_check.setText(_translate("GameDetails", "Completed"))
|
||||
self.hidden_check.setText(_translate("GameDetails", "Hidden"))
|
||||
self.favorites_check.setText(_translate("GameDetails", "Favorites"))
|
||||
self.backlog_check.setText(_translate("GameDetails", "Backlog"))
|
||||
self.lbl_dev.setText(_translate("GameDetails", "Developer"))
|
||||
self.lbl_app_name.setText(_translate("GameDetails", "Application name"))
|
||||
self.lbl_version.setText(_translate("GameDetails", "Version"))
|
||||
self.lbl_grade.setText(_translate("GameDetails", "ProtonDB grade"))
|
||||
self.lbl_install_size.setText(_translate("GameDetails", "Installation size"))
|
||||
self.lbl_install_path.setText(_translate("GameDetails", "Installation path"))
|
||||
self.lbl_platform.setText(_translate("GameDetails", "Platform"))
|
||||
self.lbl_game_actions.setText(_translate("GameDetails", "Actions"))
|
||||
self.modify_button.setText(_translate("GameDetails", "Modify"))
|
||||
self.verify_button.setText(_translate("GameDetails", "Verify"))
|
||||
self.repair_button.setText(_translate("GameDetails", "Repair"))
|
||||
self.move_button.setText(_translate("GameDetails", "Move"))
|
||||
self.uninstall_button.setText(_translate("GameDetails", "Uninstall"))
|
||||
self.install_button.setText(_translate("GameDetails", "Install"))
|
||||
self.import_button.setText(_translate("GameDetails", "Import"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
GameInfo = QtWidgets.QWidget()
|
||||
ui = Ui_GameInfo()
|
||||
ui.setupUi(GameInfo)
|
||||
GameInfo.show()
|
||||
GameDetails = QtWidgets.QWidget()
|
||||
ui = Ui_GameDetails()
|
||||
ui.setupUi(GameDetails)
|
||||
GameDetails.show()
|
||||
sys.exit(app.exec_())
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GameInfo</class>
|
||||
<widget class="QWidget" name="GameInfo">
|
||||
<class>GameDetails</class>
|
||||
<widget class="QWidget" name="GameDetails">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>404</height>
|
||||
<width>814</width>
|
||||
<height>470</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Game Info</string>
|
||||
<string notr="true">GameDetails</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="main_layout" stretch="0,1">
|
||||
<item>
|
||||
|
@ -87,7 +87,13 @@
|
|||
<item>
|
||||
<layout class="QVBoxLayout" name="right_layout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="info_layout">
|
||||
<layout class="QFormLayout" name="details_layout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
|
@ -156,7 +162,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Application Name</string>
|
||||
<string>Application name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@ -220,7 +226,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ProtonDB Grade</string>
|
||||
<string>ProtonDB grade</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@ -255,7 +261,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Installation Size</string>
|
||||
<string>Installation size</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@ -287,7 +293,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Installation Path</string>
|
||||
<string>Installation path</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/game_dlc_widget.ui'
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/dlc_widget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.9
|
||||
# Created by: PyQt5 UI code generator 5.15.10
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/game_dlc.ui'
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/game_info/dlcs.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
# Created by: PyQt5 UI code generator 5.15.10
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
@ -11,16 +11,16 @@
|
|||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GameDlc(object):
|
||||
def setupUi(self, GameDlc):
|
||||
GameDlc.setObjectName("GameDlc")
|
||||
GameDlc.resize(271, 139)
|
||||
GameDlc.setWindowTitle("GameDlc")
|
||||
GameDlc.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
GameDlc.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
GameDlc.setLineWidth(0)
|
||||
class Ui_GameDlcs(object):
|
||||
def setupUi(self, GameDlcs):
|
||||
GameDlcs.setObjectName("GameDlcs")
|
||||
GameDlcs.resize(271, 141)
|
||||
GameDlcs.setWindowTitle("GameDlcs")
|
||||
GameDlcs.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
GameDlcs.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
GameDlcs.setLineWidth(0)
|
||||
self.installed_dlc_page = QtWidgets.QWidget()
|
||||
self.installed_dlc_page.setGeometry(QtCore.QRect(0, 0, 267, 79))
|
||||
self.installed_dlc_page.setGeometry(QtCore.QRect(0, 0, 287, 62))
|
||||
self.installed_dlc_page.setObjectName("installed_dlc_page")
|
||||
self.installed_dlc_page_layout = QtWidgets.QVBoxLayout(self.installed_dlc_page)
|
||||
self.installed_dlc_page_layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
@ -35,9 +35,9 @@ class Ui_GameDlc(object):
|
|||
self.installed_dlc_container_layout.setObjectName("installed_dlc_container_layout")
|
||||
self.installed_dlc_page_layout.addWidget(self.installed_dlc_container, 0, QtCore.Qt.AlignTop)
|
||||
self.installed_dlc_page_layout.setStretch(1, 1)
|
||||
GameDlc.addItem(self.installed_dlc_page, "")
|
||||
GameDlcs.addItem(self.installed_dlc_page, "")
|
||||
self.available_dlc_page = QtWidgets.QWidget()
|
||||
self.available_dlc_page.setGeometry(QtCore.QRect(0, 0, 267, 79))
|
||||
self.available_dlc_page.setGeometry(QtCore.QRect(0, 0, 271, 83))
|
||||
self.available_dlc_page.setObjectName("available_dlc_page")
|
||||
self.available_dlc_page_layou = QtWidgets.QVBoxLayout(self.available_dlc_page)
|
||||
self.available_dlc_page_layou.setContentsMargins(0, 0, 0, 0)
|
||||
|
@ -52,23 +52,23 @@ class Ui_GameDlc(object):
|
|||
self.available_dlc_container_layout.setObjectName("available_dlc_container_layout")
|
||||
self.available_dlc_page_layou.addWidget(self.available_dlc_container, 0, QtCore.Qt.AlignTop)
|
||||
self.available_dlc_page_layou.setStretch(1, 1)
|
||||
GameDlc.addItem(self.available_dlc_page, "")
|
||||
GameDlcs.addItem(self.available_dlc_page, "")
|
||||
|
||||
self.retranslateUi(GameDlc)
|
||||
self.retranslateUi(GameDlcs)
|
||||
|
||||
def retranslateUi(self, GameDlc):
|
||||
def retranslateUi(self, GameDlcs):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.installed_dlc_label.setText(_translate("GameDlc", "No Downloadable Content has been installed."))
|
||||
GameDlc.setItemText(GameDlc.indexOf(self.installed_dlc_page), _translate("GameDlc", "Installed DLCs"))
|
||||
self.available_dlc_label.setText(_translate("GameDlc", "No Downloadable Content is available"))
|
||||
GameDlc.setItemText(GameDlc.indexOf(self.available_dlc_page), _translate("GameDlc", "Available DLCs"))
|
||||
self.installed_dlc_label.setText(_translate("GameDlcs", "No Downloadable Content has been installed."))
|
||||
GameDlcs.setItemText(GameDlcs.indexOf(self.installed_dlc_page), _translate("GameDlcs", "Installed DLCs"))
|
||||
self.available_dlc_label.setText(_translate("GameDlcs", "No Downloadable Content is available"))
|
||||
GameDlcs.setItemText(GameDlcs.indexOf(self.available_dlc_page), _translate("GameDlcs", "Available DLCs"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
GameDlc = QtWidgets.QToolBox()
|
||||
ui = Ui_GameDlc()
|
||||
ui.setupUi(GameDlc)
|
||||
GameDlc.show()
|
||||
GameDlcs = QtWidgets.QToolBox()
|
||||
ui = Ui_GameDlcs()
|
||||
ui.setupUi(GameDlcs)
|
||||
GameDlcs.show()
|
||||
sys.exit(app.exec_())
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GameDlc</class>
|
||||
<widget class="QToolBox" name="GameDlc">
|
||||
<class>GameDlcs</class>
|
||||
<widget class="QToolBox" name="GameDlcs">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>271</width>
|
||||
<height>139</height>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">GameDlc</string>
|
||||
<string notr="true">GameDlcs</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
|
@ -27,8 +27,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>267</width>
|
||||
<height>79</height>
|
||||
<width>287</width>
|
||||
<height>62</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
|
@ -79,8 +79,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>267</width>
|
||||
<height>79</height>
|
||||
<width>271</width>
|
||||
<height>83</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
|
@ -11,16 +11,16 @@
|
|||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_DetailsWidget(object):
|
||||
def setupUi(self, DetailsWidget):
|
||||
DetailsWidget.setObjectName("DetailsWidget")
|
||||
DetailsWidget.resize(630, 371)
|
||||
DetailsWidget.setWindowTitle("DetailsWidget")
|
||||
self.main_layout = QtWidgets.QHBoxLayout(DetailsWidget)
|
||||
class Ui_StoreDetailsWidget(object):
|
||||
def setupUi(self, StoreDetailsWidget):
|
||||
StoreDetailsWidget.setObjectName("StoreDetailsWidget")
|
||||
StoreDetailsWidget.resize(630, 382)
|
||||
StoreDetailsWidget.setWindowTitle("StoreDetailsWidget")
|
||||
self.main_layout = QtWidgets.QHBoxLayout(StoreDetailsWidget)
|
||||
self.main_layout.setObjectName("main_layout")
|
||||
self.left_layout = QtWidgets.QVBoxLayout()
|
||||
self.left_layout.setObjectName("left_layout")
|
||||
self.back_button = QtWidgets.QPushButton(DetailsWidget)
|
||||
self.back_button = QtWidgets.QPushButton(StoreDetailsWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -36,12 +36,12 @@ class Ui_DetailsWidget(object):
|
|||
self.right_layout.setObjectName("right_layout")
|
||||
self.details_layout = QtWidgets.QFormLayout()
|
||||
self.details_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
||||
self.details_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldsStayAtSizeHint)
|
||||
self.details_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
|
||||
self.details_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.details_layout.setContentsMargins(6, 6, 6, 6)
|
||||
self.details_layout.setSpacing(12)
|
||||
self.details_layout.setObjectName("details_layout")
|
||||
self.title_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.title_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -49,12 +49,12 @@ class Ui_DetailsWidget(object):
|
|||
self.title_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.title_label.setObjectName("title_label")
|
||||
self.details_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.title_label)
|
||||
self.title = QtWidgets.QLabel(DetailsWidget)
|
||||
self.title = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
self.title.setText("title")
|
||||
self.title.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.title.setObjectName("title")
|
||||
self.details_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.title)
|
||||
self.developer_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.developer_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -62,12 +62,12 @@ class Ui_DetailsWidget(object):
|
|||
self.developer_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.developer_label.setObjectName("developer_label")
|
||||
self.details_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.developer_label)
|
||||
self.developer = QtWidgets.QLabel(DetailsWidget)
|
||||
self.developer = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
self.developer.setText("developer")
|
||||
self.developer.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.developer.setObjectName("developer")
|
||||
self.details_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.developer)
|
||||
self.publisher_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.publisher_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -75,12 +75,12 @@ class Ui_DetailsWidget(object):
|
|||
self.publisher_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.publisher_label.setObjectName("publisher_label")
|
||||
self.details_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.publisher_label)
|
||||
self.publisher = QtWidgets.QLabel(DetailsWidget)
|
||||
self.publisher = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
self.publisher.setText("publisher")
|
||||
self.publisher.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
|
||||
self.publisher.setObjectName("publisher")
|
||||
self.details_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.publisher)
|
||||
self.status_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.status_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -88,10 +88,10 @@ class Ui_DetailsWidget(object):
|
|||
self.status_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.status_label.setObjectName("status_label")
|
||||
self.details_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.status_label)
|
||||
self.status = QtWidgets.QLabel(DetailsWidget)
|
||||
self.status = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
self.status.setObjectName("status")
|
||||
self.details_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.status)
|
||||
self.price_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.price_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -99,7 +99,7 @@ class Ui_DetailsWidget(object):
|
|||
self.price_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.price_label.setObjectName("price_label")
|
||||
self.details_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.price_label)
|
||||
self.tags_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.tags_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -107,11 +107,11 @@ class Ui_DetailsWidget(object):
|
|||
self.tags_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.tags_label.setObjectName("tags_label")
|
||||
self.details_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.tags_label)
|
||||
self.tags = QtWidgets.QLabel(DetailsWidget)
|
||||
self.tags = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
self.tags.setText("tags")
|
||||
self.tags.setObjectName("tags")
|
||||
self.details_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.tags)
|
||||
self.social_links_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.social_links_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -119,7 +119,7 @@ class Ui_DetailsWidget(object):
|
|||
self.social_links_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.social_links_label.setObjectName("social_links_label")
|
||||
self.details_layout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.social_links_label)
|
||||
self.actions_label = QtWidgets.QLabel(DetailsWidget)
|
||||
self.actions_label = QtWidgets.QLabel(StoreDetailsWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
|
@ -127,14 +127,14 @@ class Ui_DetailsWidget(object):
|
|||
self.actions_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.actions_label.setObjectName("actions_label")
|
||||
self.details_layout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.actions_label)
|
||||
self.social_links = QtWidgets.QWidget(DetailsWidget)
|
||||
self.social_links = QtWidgets.QWidget(StoreDetailsWidget)
|
||||
self.social_links.setObjectName("social_links")
|
||||
self.social_links_layout = QtWidgets.QHBoxLayout(self.social_links)
|
||||
self.social_links_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
||||
self.social_links_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.social_links_layout.setObjectName("social_links_layout")
|
||||
self.details_layout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.social_links)
|
||||
self.actions = QtWidgets.QWidget(DetailsWidget)
|
||||
self.actions = QtWidgets.QWidget(StoreDetailsWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -152,7 +152,12 @@ class Ui_DetailsWidget(object):
|
|||
self.wishlist_button.setObjectName("wishlist_button")
|
||||
self.actions_layout.addWidget(self.wishlist_button)
|
||||
self.details_layout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.actions)
|
||||
self.price = QtWidgets.QWidget(DetailsWidget)
|
||||
self.price = QtWidgets.QWidget(StoreDetailsWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.price.sizePolicy().hasHeightForWidth())
|
||||
self.price.setSizePolicy(sizePolicy)
|
||||
self.price.setObjectName("price")
|
||||
self.price_layout = QtWidgets.QHBoxLayout(self.price)
|
||||
self.price_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
||||
|
@ -169,7 +174,7 @@ class Ui_DetailsWidget(object):
|
|||
self.price_layout.addWidget(self.discount_price)
|
||||
self.details_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.price)
|
||||
self.right_layout.addLayout(self.details_layout)
|
||||
self.requirements_frame = QtWidgets.QFrame(DetailsWidget)
|
||||
self.requirements_frame = QtWidgets.QFrame(StoreDetailsWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
|
@ -182,35 +187,35 @@ class Ui_DetailsWidget(object):
|
|||
self.requirements_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.requirements_layout.setObjectName("requirements_layout")
|
||||
self.right_layout.addWidget(self.requirements_frame)
|
||||
self.description_label = QtWidgets.QTextBrowser(DetailsWidget)
|
||||
self.description_label = QtWidgets.QTextBrowser(StoreDetailsWidget)
|
||||
self.description_label.setOpenExternalLinks(True)
|
||||
self.description_label.setObjectName("description_label")
|
||||
self.right_layout.addWidget(self.description_label)
|
||||
self.main_layout.addLayout(self.right_layout)
|
||||
self.main_layout.setStretch(1, 1)
|
||||
|
||||
self.retranslateUi(DetailsWidget)
|
||||
self.retranslateUi(StoreDetailsWidget)
|
||||
|
||||
def retranslateUi(self, DetailsWidget):
|
||||
def retranslateUi(self, StoreDetailsWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.title_label.setText(_translate("DetailsWidget", "Title"))
|
||||
self.developer_label.setText(_translate("DetailsWidget", "Developer"))
|
||||
self.publisher_label.setText(_translate("DetailsWidget", "Publisher"))
|
||||
self.status_label.setText(_translate("DetailsWidget", "Status"))
|
||||
self.status.setText(_translate("DetailsWidget", "You already own this game"))
|
||||
self.price_label.setText(_translate("DetailsWidget", "Price"))
|
||||
self.tags_label.setText(_translate("DetailsWidget", "Tags"))
|
||||
self.social_links_label.setText(_translate("DetailsWidget", "Links"))
|
||||
self.actions_label.setText(_translate("DetailsWidget", "Actions"))
|
||||
self.store_button.setText(_translate("DetailsWidget", "Buy in Epic Games Store"))
|
||||
self.wishlist_button.setText(_translate("DetailsWidget", "Add to wishlist"))
|
||||
self.title_label.setText(_translate("StoreDetailsWidget", "Title"))
|
||||
self.developer_label.setText(_translate("StoreDetailsWidget", "Developer"))
|
||||
self.publisher_label.setText(_translate("StoreDetailsWidget", "Publisher"))
|
||||
self.status_label.setText(_translate("StoreDetailsWidget", "Status"))
|
||||
self.status.setText(_translate("StoreDetailsWidget", "You already own this game"))
|
||||
self.price_label.setText(_translate("StoreDetailsWidget", "Price"))
|
||||
self.tags_label.setText(_translate("StoreDetailsWidget", "Tags"))
|
||||
self.social_links_label.setText(_translate("StoreDetailsWidget", "Links"))
|
||||
self.actions_label.setText(_translate("StoreDetailsWidget", "Actions"))
|
||||
self.store_button.setText(_translate("StoreDetailsWidget", "Buy in Epic Games Store"))
|
||||
self.wishlist_button.setText(_translate("StoreDetailsWidget", "Add to wishlist"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
DetailsWidget = QtWidgets.QWidget()
|
||||
ui = Ui_DetailsWidget()
|
||||
ui.setupUi(DetailsWidget)
|
||||
DetailsWidget.show()
|
||||
StoreDetailsWidget = QtWidgets.QWidget()
|
||||
ui = Ui_StoreDetailsWidget()
|
||||
ui.setupUi(StoreDetailsWidget)
|
||||
StoreDetailsWidget.show()
|
||||
sys.exit(app.exec_())
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DetailsWidget</class>
|
||||
<widget class="QWidget" name="DetailsWidget">
|
||||
<class>StoreDetailsWidget</class>
|
||||
<widget class="QWidget" name="StoreDetailsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>630</width>
|
||||
<height>371</height>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">DetailsWidget</string>
|
||||
<string notr="true">StoreDetailsWidget</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="main_layout" stretch="0,1">
|
||||
<item>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@ -310,6 +310,12 @@
|
|||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QWidget" name="price" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="price_layout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import platform as pf
|
||||
import os
|
||||
import shlex
|
||||
from dataclasses import dataclass
|
||||
|
@ -7,11 +6,9 @@ from hashlib import md5
|
|||
from logging import getLogger
|
||||
from typing import Optional, Union, List, Dict, Set
|
||||
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
# noinspection PyUnresolvedReferences
|
||||
import vdf # pylint: disable=E0401
|
||||
import vdf
|
||||
|
||||
logger = getLogger("Proton")
|
||||
logger = getLogger("SteamTools")
|
||||
|
||||
steam_compat_client_install_paths = [os.path.expanduser("~/.local/share/Steam")]
|
||||
|
||||
|
@ -149,6 +146,32 @@ def find_appmanifests(library: str) -> List[dict]:
|
|||
return appmanifests
|
||||
|
||||
|
||||
def find_runtimes(steam_path: str, library: str) -> Dict[str, SteamRuntime]:
|
||||
runtimes = {}
|
||||
appmanifests = find_appmanifests(library)
|
||||
common = os.path.join(library, "common")
|
||||
for appmanifest in appmanifests:
|
||||
folder = appmanifest["AppState"]["installdir"]
|
||||
tool_path = os.path.join(common, folder)
|
||||
if os.path.isfile(vdf_file := os.path.join(tool_path, "toolmanifest.vdf")):
|
||||
with open(vdf_file, "r") as f:
|
||||
toolmanifest = vdf.load(f)
|
||||
if toolmanifest["manifest"]["compatmanager_layer_name"] == "container-runtime":
|
||||
print(toolmanifest["manifest"])
|
||||
runtimes.update(
|
||||
{
|
||||
appmanifest["AppState"]["appid"]: SteamRuntime(
|
||||
steam_path=steam_path,
|
||||
steam_library=library,
|
||||
appmanifest=appmanifest,
|
||||
tool_path=tool_path,
|
||||
toolmanifest=toolmanifest["manifest"],
|
||||
)
|
||||
}
|
||||
)
|
||||
return runtimes
|
||||
|
||||
|
||||
def find_protons(steam_path: str, library: str) -> List[ProtonTool]:
|
||||
protons = []
|
||||
appmanifests = find_appmanifests(library)
|
||||
|
@ -225,33 +248,7 @@ def find_compatibility_tools(steam_path: str) -> List[CompatibilityTool]:
|
|||
return tools
|
||||
|
||||
|
||||
def find_runtimes(steam_path: str, library: str) -> Dict[str, SteamRuntime]:
|
||||
runtimes = {}
|
||||
appmanifests = find_appmanifests(library)
|
||||
common = os.path.join(library, "common")
|
||||
for appmanifest in appmanifests:
|
||||
folder = appmanifest["AppState"]["installdir"]
|
||||
tool_path = os.path.join(common, folder)
|
||||
if os.path.isfile(vdf_file := os.path.join(tool_path, "toolmanifest.vdf")):
|
||||
with open(vdf_file, "r") as f:
|
||||
toolmanifest = vdf.load(f)
|
||||
if toolmanifest["manifest"]["compatmanager_layer_name"] == "container-runtime":
|
||||
print(toolmanifest["manifest"])
|
||||
runtimes.update(
|
||||
{
|
||||
appmanifest["AppState"]["appid"]: SteamRuntime(
|
||||
steam_path=steam_path,
|
||||
steam_library=library,
|
||||
appmanifest=appmanifest,
|
||||
tool_path=tool_path,
|
||||
toolmanifest=toolmanifest["manifest"],
|
||||
)
|
||||
}
|
||||
)
|
||||
return runtimes
|
||||
|
||||
|
||||
def find_runtime(
|
||||
def get_runtime(
|
||||
tool: Union[ProtonTool, CompatibilityTool], runtimes: Dict[str, SteamRuntime]
|
||||
) -> Optional[SteamRuntime]:
|
||||
required_tool = tool.required_tool
|
||||
|
@ -305,7 +302,7 @@ def get_steam_environment(
|
|||
return environ
|
||||
|
||||
|
||||
def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
|
||||
def _find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
|
||||
steam_path = find_steam()
|
||||
if steam_path is None:
|
||||
logger.info("Steam could not be found")
|
||||
|
@ -326,7 +323,7 @@ def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
|
|||
tools.extend(find_compatibility_tools(steam_path))
|
||||
|
||||
for tool in tools:
|
||||
runtime = find_runtime(tool, runtimes)
|
||||
runtime = get_runtime(tool, runtimes)
|
||||
tool.runtime = runtime
|
||||
|
||||
tools = list(filter(lambda t: bool(t), tools))
|
||||
|
@ -334,14 +331,34 @@ def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
|
|||
return tools
|
||||
|
||||
|
||||
_tools: Optional[List[Union[ProtonTool, CompatibilityTool]]] = None
|
||||
|
||||
|
||||
def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
|
||||
global _tools
|
||||
if _tools is None:
|
||||
_tools = _find_tools()
|
||||
return list(filter(lambda t: t.layer != "umu-launcher", _tools))
|
||||
|
||||
|
||||
def find_umu_launcher() -> Optional[CompatibilityTool]:
|
||||
global _tools
|
||||
if _tools is None:
|
||||
_tools = _find_tools()
|
||||
_umu = list(filter(lambda t: t.layer == "umu-launcher", _tools))
|
||||
return _umu[0] if _umu else None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from pprint import pprint
|
||||
|
||||
_tools = find_tools()
|
||||
pprint(_tools)
|
||||
tools = find_tools()
|
||||
pprint(tools)
|
||||
umu = find_umu_launcher()
|
||||
pprint(umu)
|
||||
|
||||
for _tool in _tools:
|
||||
print(get_steam_environment(_tool))
|
||||
print(_tool.name)
|
||||
print(_tool.command(SteamVerb.RUN))
|
||||
print(" ".join(_tool.command(SteamVerb.RUN_IN_PREFIX)))
|
||||
for tool in tools:
|
||||
print(get_steam_environment(tool))
|
||||
print(tool.name)
|
||||
print(tool.command(SteamVerb.RUN))
|
||||
print(" ".join(tool.command(SteamVerb.RUN_IN_PREFIX)))
|
||||
|
|
|
@ -61,7 +61,7 @@ def execute_subprocess(command: List[str], arguments: List[str], environment: Ma
|
|||
out, err = out.decode("utf-8", "ignore") if out else "", err.decode("utf-8", "ignore") if err else ""
|
||||
|
||||
# lk: the following is a work-around for wineserver sometimes hanging around after
|
||||
proc = get_configured_subprocess(command + ["wineboot", "-k"], environment)
|
||||
proc = get_configured_subprocess(command + ["wineboot", "-e"], environment)
|
||||
_, _ = proc.communicate()
|
||||
return out, err
|
||||
|
||||
|
@ -77,7 +77,7 @@ def execute_qprocess(command: List[str], arguments: List[str], environment: Mapp
|
|||
proc.deleteLater()
|
||||
|
||||
# lk: the following is a work-around for wineserver sometimes hanging around after
|
||||
proc = get_configured_qprocess(command + ["wineboot", "-k"], environment)
|
||||
proc = get_configured_qprocess(command + ["wineboot", "-e"], environment)
|
||||
proc.start()
|
||||
proc.waitForFinished(-1)
|
||||
proc.deleteLater()
|
||||
|
@ -166,5 +166,5 @@ def get_host_environment(app_environment: Dict, silent: bool = True) -> Dict:
|
|||
_environ["WINEDEBUG"] = "-all"
|
||||
_environ["WINEDLLOVERRIDES"] = "winemenubuilder=d;mscoree=d;mshtml=d;"
|
||||
# lk: pressure-vessel complains about this but it doesn't fail due to it
|
||||
_environ["DISPLAY"] = ""
|
||||
#_environ["DISPLAY"] = ""
|
||||
return _environ
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import difflib
|
||||
import os
|
||||
from datetime import datetime
|
||||
from enum import StrEnum, Enum
|
||||
from enum import Enum
|
||||
from logging import getLogger
|
||||
from typing import Tuple
|
||||
|
||||
import orjson
|
||||
|
@ -10,6 +11,8 @@ import requests
|
|||
from rare.lgndr.core import LegendaryCore
|
||||
from rare.utils.paths import cache_dir
|
||||
|
||||
logger = getLogger("SteamGrades")
|
||||
|
||||
replace_chars = ",;.:-_ "
|
||||
steamapi_url = "https://api.steampowered.com/ISteamApps/GetAppList/v2/"
|
||||
protondb_url = "https://www.protondb.com/api/v1/reports/summaries/"
|
||||
|
@ -51,7 +54,8 @@ def get_rating(core: LegendaryCore, app_name: str) -> Tuple[int, str]:
|
|||
if not steam_id:
|
||||
raise Exception
|
||||
grade = get_grade(steam_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logger.error("Failed to get ProtonDB rating for %s", game.app_title)
|
||||
return 0, "fail"
|
||||
else:
|
||||
return steam_id, grade
|
||||
|
@ -64,28 +68,31 @@ def get_grade(steam_code):
|
|||
steam_code = str(steam_code)
|
||||
res = requests.get(f"{protondb_url}{steam_code}.json")
|
||||
try:
|
||||
lista = orjson.loads(res.text)
|
||||
except orjson.JSONDecodeError:
|
||||
app = orjson.loads(res.text)
|
||||
except orjson.JSONDecodeError as e:
|
||||
logger.error("Failed to get ProtonDB response for %s", steam_code)
|
||||
return "fail"
|
||||
|
||||
return lista["tier"]
|
||||
return app.get("tier", "fail")
|
||||
|
||||
|
||||
def load_json() -> dict:
|
||||
file = os.path.join(cache_dir(), "game_list.json")
|
||||
mod_time = datetime.fromtimestamp(os.path.getmtime(file))
|
||||
elapsed_time = abs(datetime.now() - mod_time)
|
||||
global __active_download
|
||||
if __active_download:
|
||||
return {}
|
||||
if not os.path.exists(file) or elapsed_time.days > 7:
|
||||
file = os.path.join(cache_dir(), "steam_appids.json")
|
||||
elapsed_days = 0
|
||||
if os.path.exists(file):
|
||||
mod_time = datetime.fromtimestamp(os.path.getmtime(file))
|
||||
elapsed_days = abs(datetime.now() - mod_time).days
|
||||
if not os.path.exists(file) or elapsed_days > 7:
|
||||
__active_download = True
|
||||
response = requests.get(steamapi_url)
|
||||
__active_download = False
|
||||
steam_ids = orjson.loads(response.text)["applist"]["apps"]
|
||||
apps = orjson.loads(response.text).get("applist", {}).get("apps", {})
|
||||
ids = {}
|
||||
for game in steam_ids:
|
||||
ids[game["name"]] = game["appid"]
|
||||
for app in apps:
|
||||
ids[app["name"]] = app["appid"]
|
||||
with open(file, "w") as f:
|
||||
f.write(orjson.dumps(ids).decode("utf-8"))
|
||||
return ids
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
from enum import IntEnum
|
||||
from logging import getLogger
|
||||
import shlex
|
||||
from typing import Callable, Tuple, Optional, Dict, List
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
|
@ -336,6 +337,8 @@ class PathEdit(IndicatorLineEdit):
|
|||
if self.__name_filter:
|
||||
dlg.setNameFilter(" ".join(self.__name_filter))
|
||||
if dlg.exec_():
|
||||
names = dlg.selectedFiles()
|
||||
self.line_edit.setText(names[0])
|
||||
self.__completer_model.setRootPath(names[0])
|
||||
name = dlg.selectedFiles()[0]
|
||||
if " " in name:
|
||||
name = shlex.quote(name)
|
||||
self.line_edit.setText(name)
|
||||
self.__completer_model.setRootPath(name)
|
||||
|
|
|
@ -14,8 +14,7 @@ class LoadingWidget(QLabel):
|
|||
self.setMovie(self.movie)
|
||||
if self.parent() is not None:
|
||||
self.parent().installEventFilter(self)
|
||||
if autostart:
|
||||
self.movie.start()
|
||||
self.autostart = autostart
|
||||
|
||||
def __center_on_parent(self):
|
||||
rect = self.rect()
|
||||
|
@ -34,6 +33,9 @@ class LoadingWidget(QLabel):
|
|||
def showEvent(self, a0: QShowEvent) -> None:
|
||||
if a0.spontaneous():
|
||||
return super().showEvent(a0)
|
||||
if self.autostart:
|
||||
self.movie.start()
|
||||
self.autostart = False
|
||||
self.__center_on_parent()
|
||||
super().showEvent(a0)
|
||||
|
||||
|
@ -45,7 +47,8 @@ class LoadingWidget(QLabel):
|
|||
|
||||
def start(self):
|
||||
self.setVisible(True)
|
||||
self.movie.start()
|
||||
if not self.autostart:
|
||||
self.movie.start()
|
||||
|
||||
def stop(self):
|
||||
self.setVisible(False)
|
||||
|
|
|
@ -3,4 +3,5 @@ QtAwesome
|
|||
setuptools
|
||||
legendary-gl>=0.20.34
|
||||
# orjson # needs the binary release, use req2flatpak
|
||||
vdf
|
||||
pypresence
|
||||
|
|
|
@ -5,7 +5,7 @@ setuptools
|
|||
legendary-gl>=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
|
||||
legendary-gl @ git+https://github.com/derrod/legendary@96e07ff ; platform_system == "Windows" or platform_system == "Darwin"
|
||||
orjson
|
||||
vdf; platform_system != "Windows"
|
||||
vdf
|
||||
pywin32; platform_system == "Windows"
|
||||
pywebview[qt]; platform_system == "Linux"
|
||||
pywebview[qt]; platform_system == "FreeBSD"
|
||||
|
|
|
@ -5,6 +5,6 @@ setuptools
|
|||
legendary-gl>=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
|
||||
legendary-gl @ git+https://github.com/derrod/legendary@96e07ff ; platform_system == "Windows" or platform_system == "Darwin"
|
||||
orjson
|
||||
vdf; platform_system == "Linux" or platform_system == "FreeBSD"
|
||||
vdf
|
||||
pywin32; platform_system == "Windows"
|
||||
|
||||
|
|
Loading…
Reference in a new issue