mirror of
https://github.com/aclist/dztui.git
synced 2026-11-23 18:09:30 +01:00
Compare commits
117
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a4bc40cf6 | ||
|
|
4487833d99 | ||
|
|
e528580350 | ||
|
|
e5d94a8c52 | ||
|
|
29c2765732 | ||
|
|
0d946de881 | ||
|
|
abf68b0962 | ||
|
|
47168cd0bf | ||
|
|
5bd4f3502b | ||
|
|
07fb42bab1 | ||
|
|
47eaa74868 | ||
|
|
13bf4f1cdf | ||
|
|
4c4bc22647 | ||
|
|
a83d46d614 | ||
|
|
d9e0151376 | ||
|
|
be37473657 | ||
|
|
8bfa2eeaae | ||
|
|
cb52d2bac2 | ||
|
|
c321a7c02f | ||
|
|
c63007475c | ||
|
|
2d86a83445 | ||
|
|
8c2cf77557 | ||
|
|
17b874f006 | ||
|
|
6582d794a0 | ||
|
|
61fe55dad2 | ||
|
|
aca4fb4cfd | ||
|
|
0533e2c51a | ||
|
|
dabcd85990 | ||
|
|
aa18129e19 | ||
|
|
ffc5f70083 | ||
|
|
78e6ddb4da | ||
|
|
a5529f079a | ||
|
|
5b9f245a51 | ||
|
|
d4c4268eaa | ||
|
|
f2025dd48d | ||
|
|
ca7fea3601 | ||
|
|
30fba4ec10 | ||
|
|
21bc1222da | ||
|
|
9619047147 | ||
|
|
6dd053af8c | ||
|
|
23637dafc9 | ||
|
|
ee18b9c513 | ||
|
|
4c59ba85d7 | ||
|
|
3a9e1c6ff2 | ||
|
|
4cbda4e537 | ||
|
|
417801ac41 | ||
|
|
db2ddca9a5 | ||
|
|
5c81f228b0 | ||
|
|
48d58ba5c9 | ||
|
|
cdfe59ce38 | ||
|
|
3f74e71a10 | ||
|
|
533a77da23 | ||
|
|
b98172e782 | ||
|
|
5febda79ca | ||
|
|
17dedd79a7 | ||
|
|
ede064858e | ||
|
|
a3068324fa | ||
|
|
97c90b435b | ||
|
|
f300786546 | ||
|
|
2a6a8f0cb0 | ||
|
|
da718c684d | ||
|
|
b42be20dc3 | ||
|
|
16578eaeb3 | ||
|
|
1ea9428503 | ||
|
|
8aca23cf76 | ||
|
|
663e57b8cd | ||
|
|
5853e15b8e | ||
|
|
dee566932a | ||
|
|
00741b0b60 | ||
|
|
0f28885e7b | ||
|
|
29223a8a1f | ||
|
|
45c412e1ad | ||
|
|
a32c99b3eb | ||
|
|
dfef2cfd75 | ||
|
|
d47d7075e9 | ||
|
|
ea41503dad | ||
|
|
da474e274f | ||
|
|
d694aa56e8 | ||
|
|
6adecbedaa | ||
|
|
d2208787b4 | ||
|
|
77682cacd4 | ||
|
|
e8d7d9eb15 | ||
|
|
e935276e32 | ||
|
|
047b9dbbf6 | ||
|
|
d5c9f24ad5 | ||
|
|
f486cc506f | ||
|
|
307792ba5b | ||
|
|
f7d95d5407 | ||
|
|
8b09622fe5 | ||
|
|
7f6d61083c | ||
|
|
3e7b49203a | ||
|
|
269ef18a48 | ||
|
|
8aaa806cd3 | ||
|
|
e4dc545038 | ||
|
|
35623b6456 | ||
|
|
b9cb7ec973 | ||
|
|
e29433b388 | ||
|
|
170990ee1d | ||
|
|
1dbbd5977d | ||
|
|
c267b1bbc7 | ||
|
|
439109d11d | ||
|
|
d0b3a723c6 | ||
|
|
535bc505f7 | ||
|
|
f2375feeec | ||
|
|
1b9448735d | ||
|
|
d5693b07fb | ||
|
|
7a6f4a2bb9 | ||
|
|
ba92d15085 | ||
|
|
65e04c2fc4 | ||
|
|
0907f5a474 | ||
|
|
bfa83c3f94 | ||
|
|
aef48e515b | ||
|
|
e6ebeaeb5e | ||
|
|
88c740105a | ||
|
|
b98a6f95a6 | ||
|
|
87d76e83ba | ||
|
|
a5374d1f1a |
No files matched your search
+6
-7
@@ -57,6 +57,8 @@
|
||||
- List timestamp of last DayZ client update
|
||||
- Validate mods via Mod page to pull in updates
|
||||
- Support for Nasdara (Badlands) DLC
|
||||
- Load offline mods
|
||||
- Support Snap package version of Steam
|
||||
|
||||
### Changed
|
||||
- Conform to PEP 440 versioning for beta versions
|
||||
@@ -99,16 +101,13 @@
|
||||
- Current keyword filter not being applied when refreshing table
|
||||
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
||||
- Collisions between native Steam and Steam Flatpak clients
|
||||
|
||||
### Unreleased
|
||||
- Load offline mods
|
||||
- Local documentation
|
||||
- Raw debug command in context menu
|
||||
- Sticky toggle signal on radio buttons when reloading Options
|
||||
- Handle missing mods directory if not installed previously
|
||||
- Filters not blocked by keyboard keys when filters are disabled
|
||||
|
||||
### Developer-facing
|
||||
- Add pyproject.toml file
|
||||
- Show deprecation warnings
|
||||
- Options -> Dev page
|
||||
- Raw debug command in preconnect menu
|
||||
|
||||
## [6.0.5] 2026-05-17
|
||||
### Changed
|
||||
|
||||
+2
-3
@@ -8,7 +8,7 @@ If you are a developer, you can skip to the end.
|
||||
# Requesting help
|
||||
|
||||
If you encounter a problem with DZGUI, you can submit tickets on the GitHub
|
||||
[issue tracker](https://github.com/aclist/dztui/issues) under the
|
||||
[issue tracker](https://github.com/aclist/dzgui/issues) under the
|
||||
`troubleshooting` tag.
|
||||
|
||||
# How can I help the project?
|
||||
@@ -24,7 +24,7 @@ accordingly.
|
||||
|
||||
## Submitting a ticket
|
||||
|
||||
Navigate to the GitHub [issue tracker](https://github.com/aclist/dztui/issues).
|
||||
Navigate to the GitHub [issue tracker](https://github.com/aclist/dzgui/issues).
|
||||
From there, follow the onscreen prompts. You will be asked questions such as:
|
||||
|
||||
- What version are you using?
|
||||
@@ -55,7 +55,6 @@ The following naming conventions apply for PRs:
|
||||
- fix/<your-fix> - patch/hotfix branches
|
||||
- feat/<your-feature> - feature branches
|
||||
- doc/<your-doc-branch> - documentation branches
|
||||
- infra/<your-infra-branch> - infrastructure branches
|
||||
|
||||
Implement your changes and test them locally. If they work, you may
|
||||
open a merge request, and then we review your changes. If everything is OK, it
|
||||
|
||||
+11
-5
@@ -5,7 +5,7 @@
|
||||
### Fetch submodules
|
||||
git submodule update --recursive --init
|
||||
|
||||
### Install with dev dependencies
|
||||
### Install into editable venv with dev dependencies
|
||||
uv pip install -e '.[dev]'
|
||||
|
||||
This includes all dependencies for building, linting, testing, and checking in code.
|
||||
@@ -16,7 +16,7 @@ docs: documentation tools
|
||||
lint: code linting, fixing, and type checking
|
||||
test: unit and integration tests
|
||||
|
||||
## Miscellaneous
|
||||
## Build process
|
||||
|
||||
### Setting up precommit hooks
|
||||
pre-commit install
|
||||
@@ -25,6 +25,12 @@ pre-commit install
|
||||
sphinx-build -M html source build -a
|
||||
|
||||
### Building standalone release binaries
|
||||
1. Set up the build target: `rustup target add x86_64-unknown-linux-musl`
|
||||
2. Run `python3 scripts/release.py`
|
||||
3. Generate a release and tag against the resulting tarfile generated in `dist`
|
||||
1. Install the applicable system package containing the 'musl-gcc' wrapper
|
||||
2. Set up the build target: `rustup target add x86_64-unknown-linux-musl`
|
||||
3. Run `python3 scripts/release.py`
|
||||
4. Generate a release and tag against the resulting tarfile generated in `dist`
|
||||
|
||||
### Running tests
|
||||
|
||||
Some tests are environment specific and require real configuration files.
|
||||
For a generally environment-agnostic test suite, invoke `pytest -m "not realconfig, not flatpak"`
|
||||
@@ -1,11 +1,11 @@
|
||||
Submitting a ticket
|
||||
==========================
|
||||
|
||||
Tickets are tracked at the `DZGUI issue tracker <https://github.com/aclist/dztui/issues>`_.
|
||||
Tickets are tracked at the `DZGUI issue tracker <https://github.com/aclist/dzgui/issues>`_.
|
||||
|
||||
You will need to `register for a GitHub account <https://github.com/signup>`_ in order to submit one.
|
||||
|
||||
If have checked the :doc:`kb` and `closed issues <https://github.com/aclist/dztui/issues?q=is%3Aissue+is%3Aclosed>`_ area and did not find a solution, three ticket types are provided for your
|
||||
If have checked the :doc:`kb` and `closed issues <https://github.com/aclist/dzgui/issues?q=is%3Aissue+is%3Aclosed>`_ area and did not find a solution, three ticket types are provided for your
|
||||
convenience:
|
||||
|
||||
- **Bug report**: for unexpected, breaking behavior in the application
|
||||
@@ -20,18 +20,17 @@ Below are some examples of how to format a constructive report that will ensure
|
||||
A non-actionable report
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Subject: add button
|
||||
Subject: BUG: add button
|
||||
|
||||
hi, you must add a button to show how long I have to wait to join a full server, the app is useless without this...do your job, guys!!! ;-)
|
||||
|
||||
|
||||
This report exhibits a number of problems:
|
||||
|
||||
- Vague title and summary: in addition to being unclear, this will slow down filing the incoming report.
|
||||
- Problem space is poorly defined: it is not clear where the issue lies, where the feature is supposed to be implemented, nor why.
|
||||
- Lack of context: the feature may already exist, but there is not enough information to go on. Alternatively, the feature may be technically impossible to implement, but there is not enough
|
||||
information to go on.
|
||||
- Incorrect report type: this is a feature request filed as a bug report.
|
||||
- Vague title and summary: this will slow down filing the incoming report.
|
||||
- Problem space is poorly defined: it is not clear where the issue lies, where the feature is supposed to be implemented, nor why.
|
||||
- Lack of context: the feature may already exist, but there is not enough information to go on. Alternatively, the feature may be technically impossible to implement.
|
||||
- Unprofessional tone: the message is disrespectful towards project members and inserts the user's subjective opinion.
|
||||
|
||||
An actionable report
|
||||
@@ -42,7 +41,7 @@ An actionable report
|
||||
This occurs specifically on version 5.5.0-beta.2 if the setting ALLOW_MULTI is set to ON. I was able to reproduce it using the following steps:
|
||||
|
||||
Distribution: Fedora
|
||||
|
||||
|
||||
- Ensure that ALLOW_MULTI is set to ON
|
||||
- Open the application and immediately navigate to the Server Browser
|
||||
- Uses the Ctrl-click binding to select multiple rows in the table
|
||||
@@ -56,5 +55,5 @@ This report is actionable because it is objective, specific, and detailed:
|
||||
- The subject is clearly defined: specific details ensure it will be filed in a timely manner.
|
||||
- Scope is explicit: the specific version, settings, and conditions under which the problem occur were given.
|
||||
- Ample context: the user gave steps to reproduce the problem and clarified each one.
|
||||
- Courteous tone: the user interacted with project members in a professional manner.
|
||||
- Supporting information: the user provided a crash dump to expedite resolution of the issue.
|
||||
- Courteous tone: the user interacted with project members in a professional manner.
|
||||
+3
-3
@@ -15,7 +15,7 @@ author = 'aclist'
|
||||
extensions = []
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = []
|
||||
exclude_patterns = [] # type: ignore[var-annotated]
|
||||
|
||||
|
||||
|
||||
@@ -36,5 +36,5 @@ html_show_copyright = False
|
||||
html_show_sourcelink = False
|
||||
|
||||
today_fmt = "%Y-%m-%d"
|
||||
release = "6.x.x - 7.x.x"
|
||||
version = "6.x.x - 7.x.x"
|
||||
release = "7.x.x"
|
||||
version = "7.x.x"
|
||||
@@ -1,19 +1,14 @@
|
||||
Developers
|
||||
===========
|
||||
|
||||
This project is open source under the GPLv3 license. You can find the source code on
|
||||
`GitHub <https://github.com/aclist/dztui>`_. If you wish to contribute to
|
||||
`GitHub <https://github.com/aclist/dzgui>`_. If you wish to contribute to
|
||||
development, you will find further help in the
|
||||
`CONTRIBUTING.md <https://github.com/aclist/dztui/blob/main/CONTRIBUTING.md>`_
|
||||
`CONTRIBUTING.md <https://github.com/aclist/dzgui/blob/dzgui7/CONTRIBUTING.md>`_
|
||||
file.
|
||||
|
||||
All contributors are expected to act in accordance with the project's
|
||||
`code of conduct <https://github.com/aclist/dztui/blob/main/CODE_OF_CONDUCT.md>`_,
|
||||
`code of conduct <https://github.com/aclist/dzgui/blob/dzgui7/CODE_OF_CONDUCT.md>`_,
|
||||
and follow the project's standards and guidelines.
|
||||
|
||||
To install DZGUI and related dependencies for linting, testing, and version control,
|
||||
invoke the command ``uv pip install .[dev]``.
|
||||
|
||||
After this process, install the applicable pre-commit hooks by invoking the command ``pre-commit install``.
|
||||
|
||||
These pre-commit hooks enforce code checks that prevent making commits unless the relevant tests pass.
|
||||
Detailed instructions on setting up a build environment and installing DZGUI from source code
|
||||
can be found in the `DEVELOPERS.md <https://github.com/aclist/dzgui/blob/dzgui7/DEVELOPERS.md>`_ file.
|
||||
@@ -1,110 +0,0 @@
|
||||
Installation (DZGUI 6 legacy)
|
||||
==================
|
||||
|
||||
Basic runtime dependencies
|
||||
---------------------------------
|
||||
|
||||
If not already installed, the below can be found in your system’s package manager.
|
||||
|
||||
If any dependencies are missing when the application starts, it will warn you, so you need not take any preemptive measures here.
|
||||
|
||||
- curl
|
||||
- jq
|
||||
- steam
|
||||
- wmctrl or xdotool
|
||||
- zenity
|
||||
|
||||
.. note::
|
||||
All dependencies are installed out of the box on Steam Deck.
|
||||
|
||||
UI dependencies (Python and PyGObject)
|
||||
---------------------------------------
|
||||
.. important::
|
||||
As of version 6.0.0, you must have a valid Python 3.13 and matching PyGObject environment.
|
||||
Depending on your distribution, this may require additional manual intervention.
|
||||
|
||||
Arch Linux (vanilla variants)
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
You will need the ``python3.13`` package, if it is not already installed.
|
||||
|
||||
Install the following build dependencies:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo pacman -S cmake gcc pkgconf python-cairo
|
||||
|
||||
.. include:: venv.rst
|
||||
|
||||
CachyOS (Arch)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Refer to the build instructions for Arch Linux first.
|
||||
The ``python3.13`` package is not available on CachyOS, so it is recommended to
|
||||
use ``uv`` to manage Python versions.
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo pacman -S uv
|
||||
|
||||
.. include:: venv.rst
|
||||
|
||||
Manjaro 26 (Arch)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
If Python 3.13 is not already available out of the box, refer to the build instructions for :ref:`Arch Linux (vanilla variants)`.
|
||||
|
||||
Debian 13 variants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Python 3.13 and PyGObject are available out of the box. No additional steps are necessary.
|
||||
You can proceed to the :ref:`Installscript`.
|
||||
|
||||
Fedora 43 variants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Fedora 43 ships with a newer version of Python (3.14), so you must set up Python 3.13 in its own
|
||||
virtual environment (venv) to prevent it from conflicting with the system package.
|
||||
|
||||
Install the following build dependencies:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo dnf install cairo cairo-devel cairo-gobject-devel gcc python3.13 python3.13-devel
|
||||
|
||||
.. include:: venv.rst
|
||||
|
||||
Ubuntu 24 variants
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Ubuntu ships with an older version of Python (3.12). You must install additional dependencies.
|
||||
Add the PPA below to add Python 3.13 to your sources:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
|
||||
Install the following build dependencies:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo apt install python3.13 python3.13-venv python3.13-dev build-essential python3-gi-cairo pkg-config libgirepository-2.0-dev libcairo2-dev
|
||||
|
||||
.. include:: venv.rst
|
||||
|
||||
Installscript
|
||||
-----------------------
|
||||
|
||||
Invoke the command below from a terminal. This script fetches the main DZGUI script from the repository,
|
||||
makes it executable, and launches DZGUI's first-time setup. After running this installscript, you will
|
||||
have the file ``dzgui.sh`` wherever you invoked the command.
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -s "https://codeberg.org/aclist/dztui/raw/branch/dzgui/install.sh" | bash
|
||||
|
||||
nixOS installation
|
||||
----------------------
|
||||
Two packages are independently maintained by other contributors. Each takes a slightly different approach.
|
||||
nixOS packages are standalone and do not require cloning the git repository.
|
||||
|
||||
- https://github.com/lelgenio/dzgui-nix
|
||||
- https://github.com/jiriks74/dzgui.flake
|
||||
|
||||
Next steps
|
||||
---------------
|
||||
Proceed to the :doc:`setup` section for setup instructions.
|
||||
@@ -1,33 +0,0 @@
|
||||
Installation (DZGUI 7 beta)
|
||||
==================
|
||||
|
||||
In order to make the first-time setup experience easier for end-users, DZGUI 7 no longer requires
|
||||
the tool to be installed from source code into a working Python environment. All necessary dependencies and the
|
||||
runtime environment are built-in.
|
||||
|
||||
Turnkey installer
|
||||
------------------------
|
||||
|
||||
- Visit the project's `Releases page <https://github.com/aclist/dztui/releases/latest>`_.
|
||||
- Extract the DZGUI tarball from the top of the **Assets** list.
|
||||
- From a terminal, run the command ``./dzgui`` or double click on the extracted file in
|
||||
a file explorer.
|
||||
- Once the setup wizard opens, follow the steps at the bottom of this page.
|
||||
|
||||
UI dependencies (Python and PyGObject)
|
||||
---------------------------------------
|
||||
On most major distributions, GObject introspection libraries should be available by default.
|
||||
|
||||
If you receive an error about a missing ``libgirepository-2.0`` dependency, install it via your system's package manager.
|
||||
|
||||
On Debian-based distributions (Ubuntu, etc.), this package is not explicitly installed on the system.
|
||||
You can install it via the following set of commands:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo apt update
|
||||
sudo apt install libgirepository-2.0-0
|
||||
|
||||
Next steps
|
||||
---------------
|
||||
Proceed to the :doc:`setup` section for setup instructions.
|
||||
@@ -0,0 +1,12 @@
|
||||
Command line launch flags
|
||||
==========================
|
||||
When run from the terminal, DZGUI provides several flags:
|
||||
|
||||
``-d, --debug``: enable developer debugging features. This does not add hidden or extra functionality; it merely enables developers to track deprecation warnings and see values stored in memory.
|
||||
End-users will gain no benefit from using this flag.
|
||||
|
||||
``-m, --map``: check and update system map count value. Unnecessary on most modern systems. If your system does not meet the threshold, the DZGUI setup wizard will prompt you to use this flag.
|
||||
|
||||
``-u, --uninstall``: uninstall: granular selection of which state/configuration files to remove.
|
||||
|
||||
``-v, --version``: displays the DZGUI version.
|
||||
@@ -15,8 +15,8 @@ A DayZ server browser/mod manager for Linux. Used to list official and community
|
||||
|
||||
Source code:
|
||||
|
||||
- `GitHub <https://www.github.com/aclist/dztui>`_
|
||||
- `Codeberg (mirror) <https://codeberg.org/aclist/dztui>`_
|
||||
- `GitHub <https://www.github.com/aclist/dzgui>`_
|
||||
- `Codeberg (mirror) <https://codeberg.org/aclist/dzgui>`_
|
||||
|
||||
Installation
|
||||
-------------
|
||||
@@ -56,8 +56,8 @@ See: :doc:`kb` or :ref:`Submitting a ticket`.
|
||||
:maxdepth: 3
|
||||
:hidden:
|
||||
|
||||
steam
|
||||
locale
|
||||
flags
|
||||
|
||||
.. toctree::
|
||||
:caption: Help
|
||||
|
||||
@@ -1,28 +1,37 @@
|
||||
Installation
|
||||
==================
|
||||
|
||||
As of this writing, you have a choice of two DZGUI versions:
|
||||
.. note::
|
||||
Version 6 of DZGUI 6 has been fully replaced with DZGUI 7.
|
||||
Users on existing DZGUI 6 installations should migrate to the DZGUI 7 build.
|
||||
|
||||
- DZGUI 6: Legacy stable version, more complicated to install
|
||||
- DZGUI 7: Unstable beta version, much easier to install
|
||||
In order to make the first-time setup experience easier for end-users, DZGUI 7 no longer requires
|
||||
the tool to be installed from source code into a working Python environment. All necessary dependencies and the
|
||||
runtime environment are built-in.
|
||||
|
||||
DZGUI 6
|
||||
--------------------
|
||||
This version is no longer receiving feature updates, but will receive security updates until it is replaced by DZGUI 7.
|
||||
Turnkey installer
|
||||
------------------------
|
||||
|
||||
DZGUI 6 must be installed from the source code and has many more package dependencies and prerequisites for it to function correctly.
|
||||
If you are looking for a one-click, self-contained installer, use :ref:`DZGUI 7` instead.
|
||||
- Visit the project's `Releases page <https://github.com/aclist/dzgui/releases/latest>`_.
|
||||
- Download the DZGUI archive from the top of the **Assets** list. This file will be labeled ``dzgui-<VERSION>-x86_64-unknown-linux-musl.tar.gz``.
|
||||
- Extract the archive's contents.
|
||||
- From a terminal, run the command ``./dzgui`` or double click on the extracted file in a file explorer.
|
||||
- Once the setup wizard opens, follow the steps at the bottom of this page.
|
||||
|
||||
To install **DZGUI 6**, visit :doc:`dzgui6`.
|
||||
UI dependencies (Python and PyGObject)
|
||||
---------------------------------------
|
||||
On most major distributions, GObject introspection libraries should be available by default.
|
||||
|
||||
If you receive an error about a missing ``libgirepository-2.0`` dependency, install it via your system's package manager.
|
||||
|
||||
DZGUI 7
|
||||
--------------------
|
||||
This version is currently in beta testing and has all of the features found in DZGUI 6, but may be unstable.
|
||||
On Debian-based distributions (Ubuntu, etc.), this package is not explicitly installed on the system.
|
||||
You can install it via the following set of commands:
|
||||
|
||||
DZGUI 7 has an all-in-one installer and setup wizard, and many new features not found in DZGUI 6.
|
||||
However, this codebase is newer and is provided as a pre-release beta candidate.
|
||||
.. code:: console
|
||||
|
||||
If you want the simplest installer and don't mind experiencing the occasional bug, use this version.
|
||||
sudo apt update
|
||||
sudo apt install libgirepository-2.0-0
|
||||
|
||||
To install **DZGUI 7**, visit :doc:`dzgui7`.
|
||||
Next steps
|
||||
---------------
|
||||
Proceed to the :doc:`setup` section for setup instructions.
|
||||
+15
-2
@@ -98,15 +98,28 @@ tend to have less headroom for simultaneous connections than their wired counter
|
||||
|
||||
DZG-009: Floating dialogs appear maximized on tiling window managers
|
||||
-------------------------------------------------------------------
|
||||
|
||||
The main DZGUI window and its child dialogs are expected to be rendered as floating by your window manager.
|
||||
DZGUI sends window manager hints to this effect, but tiling window managers designed to bisect the screen into quadrants (e.g., i3 window manager)
|
||||
may try to always launch applications in fullscreen.
|
||||
|
||||
To resolve this, set specific exclusions or window hints in your WM's configuration file.
|
||||
For example, for i3, add the following to your `XDG_CONFIG_HOME/i3/config` file (defaults to `$HOME/.config/i3/config`):
|
||||
For example, for i3, add the following to your ``XDG_CONFIG_HOME/i3/config`` file (defaults to ``$HOME/.config/i3/config``):
|
||||
|
||||
.. code:: console
|
||||
|
||||
for_window [instance="DZGUI"] floating enable, move position center
|
||||
for_window [instance="DZGUI - Dialog"] floating enable, move position center
|
||||
|
||||
DZG-010: Maps combobox extends to full height of window when there are many maps to choose from
|
||||
---------------------------------------------------------------------------------------------------
|
||||
This is a limitation of GTK 3. If and when DZGUI is refactored to support the GTK 4 API, this visual glitch is expected to be resolved.
|
||||
|
||||
DZG-011: GTK reports "Failed to load module 'xapp-gtk3-module' when starting DZGUI
|
||||
---------------------------------------------------------------------------------------------------
|
||||
This is a purely cosmetic message that appears when Cinnamon (Xapp) desktop integations are not present.
|
||||
While you can suppress this message by installing the package ``xapp``, if you are not actually using Cinnamon as
|
||||
part of your desktop environment, it will pull in a large number of unnecessary dependencies.
|
||||
|
||||
DZG-012: After adding the DZGUI Steam shortcut via the installer, shortcut icons do not appear in the small library list
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
It can take 1-2 restarts of the Steam client for these icons to synchronize.
|
||||
+14
-5
@@ -19,14 +19,14 @@ You will need at a minimum a :ref:`Steam Web API key<steam_api>` in order to bro
|
||||
|
||||
Steam Web API key
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**This step is required**.
|
||||
|
||||
Register for a `Steam Web API key <https://steamcommunity.com/dev/apikey>`_ (free) using your Steam account. You will be asked for a unique URL for your app when registering.
|
||||
Register for a `Steam Web API key <https://steamcommunity.com/dev/apikey>`_ (free) using your Steam account.
|
||||
|
||||
Since this key is for a personal use application and does not actually call back anywhere, set a generic local identifier here like "127.0.0.1" or some other name that is meaningful to you.
|
||||
You will be asked for a unique URL for your app when registering. Typically, an API would send logs back to your URL in the form of callbacks.
|
||||
However, since these API queries will be used for local consumption by a single user only, you can set a generic local identifier here like ``127.0.0.1`` to have the server discard them.
|
||||
|
||||
Once configured, you can insert this key in the app when launching it for the first time.
|
||||
Once configured, you can insert this API key in the app when launching it for the first time.
|
||||
|
||||
.. note::
|
||||
If you are confused about this requirement, please refer to DZGUI Knowledge Base article :ref:`DZG-007<DZG-007>` for additional information.
|
||||
@@ -36,7 +36,16 @@ Battlemetrics API key
|
||||
.. warning::
|
||||
|
||||
This feature is no longer supported in DZGUI. Battlemetrics has switched to a paid service.
|
||||
Battlemetrics queries are expected to fail in DZGUI 6. In DZGUI 7, this feature has been removed entirely.
|
||||
|
||||
Choosing a Steam client
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
If multiple Steam clients are available (native Steam client/Flatpak Steam client), you will be
|
||||
asked to choose which you want to use. Due to the way Steam's inter-process communication and internal URIs work,
|
||||
if you choose one or the other, you should not run both clients simultaneously. This can lead DZGUI to send requests to the wrong one.
|
||||
|
||||
.. note::
|
||||
If you decide to switch to using a different Steam client with DZGUI, please uninstall fully (``dzgui -u``) and re-run the first time setup.
|
||||
|
||||
|
||||
Next steps
|
||||
--------------
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
Steam integration
|
||||
====================
|
||||
|
||||
.. note::
|
||||
|
||||
In :doc:`DZGUI 7 <dzgui7>`, Steam shortcut creation and cover art setup are handled automatically during setup. You can skip this step unless you are using DZGUI 6.
|
||||
|
||||
DZGUI can be added to Steam as a "non-Steam game" in order to facilitate integration with Steam Deck or desktop environments.
|
||||
|
||||
First, launch Steam in the **Large** (default) view.
|
||||
|
||||
.. attention::
|
||||
Steam Deck users: Gaming Mode has limited support for configuration of custom games. You will need to switch to **Desktop Mode** in order to add a non-Steam game.
|
||||
|
||||
.. figure:: images/01.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
Select **Add a Game** > **Add a Non-Steam Game** from the bottom left corner of the Steam client.
|
||||
|
||||
Navigate to ``$HOME/.local/share/applications`` and select ``dzgui.desktop``.
|
||||
|
||||
Select **Add Selected Programs** to add a shortcut to DZGUI.
|
||||
|
||||
Artwork
|
||||
^^^^^^^^^^
|
||||
|
||||
DZGUI ships with custom artwork that provides various cover/splash images to allow it to integrate with the rest of your games library.
|
||||
|
||||
.. figure:: images/02.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
From the main library view, navigate to the app’s details page and right-click the blank image header at the top.
|
||||
|
||||
.. figure:: images/03.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
|
||||
Select **Set Custom Background**
|
||||
|
||||
Select to display **All Files** from the **File type** dropdown
|
||||
|
||||
Navigate to ``$HOME/.local/share/dzgui`` and select ``hero.png``.
|
||||
|
||||
.. figure:: images/04.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
Next, right-click the image background and select **Set Custom Logo**.
|
||||
|
||||
Navigate to ``$HOME/.local/share/dzgui`` and select ``logo.png``.
|
||||
|
||||
.. figure:: images/05.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
Notice that this removes the redundant app name that occluded the image, as seen above.
|
||||
|
||||
.. figure:: images/06.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
Next, navigate to your Library index (looks like a bookshelf of cover art) and find the DZGUI app.
|
||||
|
||||
Right-click its cover and select **Manage** > **Set custom artwork**.
|
||||
|
||||
Navigate to ``$HOME/.local/share/dzgui`` and select ``grid.png``.
|
||||
|
||||
.. figure:: images/07.png
|
||||
:scale: 70%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
The final result will create box art looking like the above.
|
||||
|
||||
.. figure:: images/08.png
|
||||
:scale: 100%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
Next, right-click the DZGUI entry in your Library and select **Properties** to open the properties dialog. Next to the **Shortcut** field, you will see a small square box which represents the game’s
|
||||
icon. Click this to open a file explorer, navigate to ``$HOME/.local/share/dzgui``, and select ``icon.png``. This will add a small icon to the list view.
|
||||
|
||||
Finally, after you launch DZGUI for the first time, you should quit the application and return to the Library view. Select the **Recent Games** dropdown on the right-hand side.
|
||||
|
||||
Steam shows a collection of box art based on categories like "Play Next", "Recent Games", etc. Look for a **downward-pointing caret icon** and click it, then select the **Recent Games** category.
|
||||
|
||||
.. figure:: images/09.png
|
||||
:scale: 100%
|
||||
:alt: Adding a non-Steam game
|
||||
|
||||
If DZGUI was the last item played, it will be shown with a landscape, rather than portrait, orientation cover, which is initially blank.
|
||||
|
||||
To customize this cover, right click it and select **Manage** > **Set custom artwork**, navigate to ``$HOME/.local/share/dzgui``, then select ``hero.png``.
|
||||
@@ -1,12 +1,8 @@
|
||||
Uninstallation
|
||||
==================
|
||||
To uninstall DZGUI and its associated files, invoke ``./dzgui`` from the terminal with the ``-u`` or ``--uninstall`` flag.
|
||||
|
||||
To uninstall DZGUI and its associated files, invoke ``./dzgui.sh`` with the ``-u`` or ``--uninstall`` flag.
|
||||
|
||||
Follow the prompts to choose from:
|
||||
|
||||
- **Full uninstall** -- removes the application and all user-defined configuration files
|
||||
- **Partial uninstall** -- removes the application, but keeps user-defined configuration files
|
||||
You will be prompted to select atomic files you wish to remove.
|
||||
|
||||
.. tip::
|
||||
If you intend to reinstall DZGUI again, keeping your configuration files is recommended.
|
||||
If you intend to reinstall DZGUI again, keeping your configuration files at a minimum is recommended.
|
||||
+12
-8
@@ -1,25 +1,29 @@
|
||||
Usage
|
||||
=========
|
||||
|
||||
It is always advised to have Steam running in the background. DZGUI is meant to run "on top of" Steam.
|
||||
|
||||
DZGUI can be launched in one of three ways.
|
||||
|
||||
From a terminal
|
||||
------------------
|
||||
|
||||
Invoke the command ``./dzgui.sh`` from wherever you downloaded the DZGUI script to.
|
||||
Invoke the command ``./dzgui`` from wherever you downloaded DZGUI to.
|
||||
|
||||
Launching from a terminal may give more verbose information in the event of a crash, and can be a good way of troubleshooting problems.
|
||||
|
||||
From the shortcut shipped with the application
|
||||
--------------------------------------------------
|
||||
When completing the first-time setup, you will be asked if you want to create additional system shortcuts.
|
||||
If applicable for yourDesktop Environment, these shortcuts can be created.
|
||||
|
||||
On most distributions, if you are using a desktop environment based on the Freedesktop specification, shortcuts will be installed for you.
|
||||
|
||||
- One shortcut is located under the ``Games`` category of your system’s applications list/start menu.
|
||||
- The other is accessed via the ``DZGUI`` desktop icon (Steam Deck only)
|
||||
- One shortcut will be located under the ``Games`` category of your system’s applications list/start menu.
|
||||
- The other is accessed via the ``DZGUI`` shortcut on the desktop
|
||||
|
||||
From Steam
|
||||
--------------
|
||||
See :doc:`steam`.
|
||||
DZGUI will also ask you if you want to add a "non-Steam game" shortcut to Steam.
|
||||
This shortcut will launch DZGUI directly and comes with integrated grid and cover artwork.
|
||||
|
||||
You must restart Steam for this shortcut to take effect in your library.
|
||||
|
||||
.. note::
|
||||
You can also pass DZGUI launch parameter's to the Steam shortcut via Steam's right-click menu. See :doc:`flags`.
|
||||
+5
-1
@@ -3,7 +3,6 @@ import logging
|
||||
import re
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor, wait
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -36,6 +35,10 @@ def get_local_mod_path(steam_path: Path) -> Path:
|
||||
|
||||
|
||||
def get_local_mods(workshop_path: Path) -> list[Path]:
|
||||
# NOTE: user may not have staged mods before
|
||||
if workshop_path.is_dir() is False:
|
||||
logger.debug("Mod directory not yet present, returning empty list")
|
||||
return []
|
||||
mods = [file for file in workshop_path.iterdir() if file.is_dir()]
|
||||
return mods
|
||||
|
||||
@@ -124,6 +127,7 @@ def remove_stale_signatures(
|
||||
|
||||
path = lookup(config, Preferences.DEFAULT)
|
||||
steam_path = Path(path)
|
||||
|
||||
if ids is None:
|
||||
local_ids = get_local_mod_ids(steam_path)
|
||||
|
||||
|
||||
+27
-27
@@ -9,13 +9,13 @@ import subprocess
|
||||
import threading
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Optional, TYPE_CHECKING, Union
|
||||
from typing import Any, TYPE_CHECKING, Union
|
||||
|
||||
from dzgui.const.constants import APP_NAME, REQUEST_TIMEOUT
|
||||
from dzgui.const.endpoints import STEAM_SERVERS
|
||||
from dzgui.model.proxy_model import ServerRow
|
||||
from dzgui.util.format import format_exception
|
||||
from dzgui.util import strings
|
||||
from dzgui.strings import metadata
|
||||
|
||||
import a2s
|
||||
import dayzquery
|
||||
@@ -182,14 +182,14 @@ def parse_json(
|
||||
continue
|
||||
|
||||
if "no3rd" in r:
|
||||
view = strings.filter_1pp
|
||||
view = metadata.filter_1pp
|
||||
else:
|
||||
view = strings.filter_3pp
|
||||
view = metadata.filter_3pp
|
||||
|
||||
if "external" in r:
|
||||
provider = strings.filter_unofficial
|
||||
provider = metadata.filter_unofficial
|
||||
else:
|
||||
provider = strings.filter_official
|
||||
provider = metadata.filter_official
|
||||
|
||||
if "mod" in r:
|
||||
modded = True
|
||||
@@ -209,9 +209,9 @@ def parse_json(
|
||||
if test_time:
|
||||
time = test_time.group(0)
|
||||
else:
|
||||
time = strings.unknown
|
||||
time = metadata.unknown
|
||||
except AttributeError:
|
||||
time = strings.unknown
|
||||
time = metadata.unknown
|
||||
|
||||
try:
|
||||
ip = row["addr"].split(":")[0] + ":" + str(row["gameport"])
|
||||
@@ -290,7 +290,7 @@ def query_direct(ip: str, qport: int, timeout: float = 3.0) -> dict[str, Any] |
|
||||
def get_details(record: Record) -> Details | None:
|
||||
ip = record.ip
|
||||
qport = record.qport
|
||||
default_str = strings.none_provided
|
||||
default_str = metadata.none_provided
|
||||
|
||||
try:
|
||||
info = a2s.info((ip, qport))
|
||||
@@ -300,9 +300,9 @@ def get_details(record: Record) -> Details | None:
|
||||
logger.critical(e)
|
||||
return None
|
||||
|
||||
battleye = strings.disabled
|
||||
battleye = metadata.disabled
|
||||
if "battleye" in keywords:
|
||||
battleye = strings.enabled
|
||||
battleye = metadata.enabled
|
||||
|
||||
name = info.server_name
|
||||
day_accel = 1.0
|
||||
@@ -322,48 +322,48 @@ def get_details(record: Record) -> Details | None:
|
||||
try:
|
||||
password = info.password_protected
|
||||
if password is False:
|
||||
password = strings.disabled
|
||||
password = metadata.disabled
|
||||
else:
|
||||
password = strings.enabled
|
||||
password = metadata.enabled
|
||||
except AttributeError:
|
||||
password = "-"
|
||||
|
||||
try:
|
||||
vac = info.vac_enabled
|
||||
if vac is False:
|
||||
vac = strings.disabled
|
||||
vac = metadata.disabled
|
||||
else:
|
||||
vac = strings.enabled
|
||||
vac = metadata.enabled
|
||||
except AttributeError:
|
||||
vac = strings.null
|
||||
vac = metadata.null
|
||||
|
||||
try:
|
||||
version = info.version
|
||||
except AttributeError:
|
||||
version = strings.null
|
||||
version = metadata.null
|
||||
|
||||
try:
|
||||
dlc = rules.dlc_flags
|
||||
match dlc:
|
||||
case 0:
|
||||
dlc = strings.dlc_none
|
||||
dlc = metadata.dlc_none
|
||||
case 2:
|
||||
dlc = strings.dlc_frostline
|
||||
dlc = metadata.dlc_frostline
|
||||
case 4:
|
||||
dlc = strings.dlc_badlands
|
||||
dlc = metadata.dlc_badlands
|
||||
case _:
|
||||
dlc = strings.unspecified
|
||||
dlc = metadata.unspecified
|
||||
except AttributeError:
|
||||
dlc = strings.unspecified
|
||||
dlc = metadata.unspecified
|
||||
|
||||
try:
|
||||
platform = rules.platform
|
||||
if platform == "win":
|
||||
platform = strings.windows
|
||||
platform = metadata.windows
|
||||
if platform == "?":
|
||||
platform = strings.linux
|
||||
platform = metadata.linux
|
||||
except AttributeError:
|
||||
platform = strings.unspecified
|
||||
platform = metadata.unspecified
|
||||
|
||||
try:
|
||||
description = rules.description.strip()
|
||||
@@ -491,7 +491,7 @@ def query_by_record(record: Record, update_gameport: bool = False) -> A2SInfo:
|
||||
return A2SInfo(record, None)
|
||||
|
||||
|
||||
def short_ip_to_record(addr: str) -> Optional[Record]:
|
||||
def short_ip_to_record(addr: str) -> Record | None:
|
||||
r = addr.split(":")
|
||||
# TODO: raise exceptions instead of Nonetype
|
||||
if len(r) != 2:
|
||||
@@ -499,7 +499,7 @@ def short_ip_to_record(addr: str) -> Optional[Record]:
|
||||
return Record(r[0], 0, int(r[1]))
|
||||
|
||||
|
||||
def fqip_to_record(addr: str) -> Optional[Record]:
|
||||
def fqip_to_record(addr: str) -> Record | None:
|
||||
r = addr.split(":")
|
||||
if len(r) != 3:
|
||||
return None
|
||||
|
||||
@@ -2,7 +2,7 @@ import binascii
|
||||
import ctypes
|
||||
import logging
|
||||
import shutil
|
||||
import vdf # type: ignore
|
||||
import vdf # type: ignore[import-untyped]
|
||||
|
||||
from dataclasses import dataclass
|
||||
from importlib import resources
|
||||
@@ -12,7 +12,7 @@ from typing import Any
|
||||
from dzgui.api.steam import find_user_id_32
|
||||
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, IMAGES_PATH
|
||||
from dzgui.util.dirs import copy_dzgui_to_xdg_data, make_parents
|
||||
from dzgui.util.strings import unknown
|
||||
from dzgui.strings import metadata
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -61,10 +61,10 @@ class Shortcuts:
|
||||
return str(self.shortcuts["shortcuts"][key]["AppName"])
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
return unknown
|
||||
return metadata.unknown
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
return unknown
|
||||
return metadata.unknown
|
||||
|
||||
def get_shortcuts(self) -> Any:
|
||||
return self.shortcuts
|
||||
@@ -114,6 +114,7 @@ class Shortcuts:
|
||||
make_parents(dest)
|
||||
b = images.joinpath(img).with_suffix(".png").read_bytes()
|
||||
dest.write_bytes(b)
|
||||
logger.debug(f"Wrote grid image to '{dest}'")
|
||||
|
||||
# NOTE: legacy Big Picture header
|
||||
b = images.joinpath("_hero.png").read_bytes()
|
||||
@@ -127,6 +128,7 @@ class Shortcuts:
|
||||
except Exception:
|
||||
n = 0
|
||||
self.shortcuts["shortcuts"][str(n)] = entry
|
||||
logger.debug(f"Added shortcut at index {n}")
|
||||
|
||||
@classmethod
|
||||
def _create_entry(cls, meta: ShortcutMetadata) -> dict[str, Any]:
|
||||
|
||||
+24
-12
@@ -4,7 +4,7 @@ import psutil
|
||||
import re
|
||||
import requests
|
||||
import subprocess
|
||||
import vdf # type: ignore
|
||||
import vdf # type: ignore[import-untyped]
|
||||
|
||||
from pathlib import Path
|
||||
from requests.exceptions import HTTPError
|
||||
@@ -12,9 +12,7 @@ from typing import Any, Generator, Union
|
||||
from warnings import deprecated
|
||||
|
||||
from dzgui.api.acf import ACF
|
||||
from dzgui.const.endpoints import VALIDATE
|
||||
from dzgui.init.prereqs import has_any_client
|
||||
from dzgui.init.prereqs import has_flatpak_client, has_steam_client
|
||||
from dzgui.config.xdg import get_real_home
|
||||
from dzgui.const.constants import (
|
||||
APPID_DAYZ,
|
||||
APPID_DAYZ_EXP,
|
||||
@@ -27,6 +25,7 @@ from dzgui.const.constants import (
|
||||
FLATPAK_STEAM_PATH,
|
||||
LIBRARYFOLDERS_PATH,
|
||||
REQUEST_TIMEOUT,
|
||||
SNAP_STEAM_PATH,
|
||||
UBUNTU_STEAM_PATH,
|
||||
VDF_PATH,
|
||||
)
|
||||
@@ -35,7 +34,10 @@ from dzgui.const.endpoints import (
|
||||
STEAM_PUBLISHED_FILES,
|
||||
STEAM_SUB,
|
||||
STEAM_UNSUB,
|
||||
VALIDATE,
|
||||
)
|
||||
from dzgui.init.prereqs import has_any_client
|
||||
from dzgui.init.prereqs import has_flatpak_client, has_steam_client
|
||||
from dzgui.strings import wizard
|
||||
from dzgui.strings.errors import api_validation_error, workshop_endpoint_error
|
||||
from dzgui.util.bash import concat_bash_args
|
||||
@@ -64,26 +66,36 @@ class VDFLoadError(Exception):
|
||||
def get_steam_paths() -> list[tuple[Path, str]]:
|
||||
paths = []
|
||||
if has_any_client():
|
||||
HOME = Path.home()
|
||||
HOME = get_real_home()
|
||||
env = os.environ.get("XDG_DATA_HOME")
|
||||
if env is not None:
|
||||
XDG_DATA_HOME = env
|
||||
XDG_DATA_HOME = Path(env)
|
||||
DEFAULT_PATH = XDG_DATA_HOME.joinpath("Steam")
|
||||
default_label = wizard.desc_custom_path
|
||||
else:
|
||||
XDG_DATA_HOME = DEFAULT_STEAM_PATH
|
||||
DEFAULT_PATH = HOME.joinpath(DEFAULT_STEAM_PATH)
|
||||
default_label = wizard.desc_default_path
|
||||
|
||||
DEFAULT_PATH = HOME.joinpath(XDG_DATA_HOME)
|
||||
FLATPAK_PATH = HOME.joinpath(FLATPAK_STEAM_PATH)
|
||||
UBUNTU_PATH = HOME.joinpath(UBUNTU_STEAM_PATH)
|
||||
DEBIAN_PATH = HOME.joinpath(DEBIAN_STEAM_PATH)
|
||||
SNAP_PATH = HOME.joinpath(SNAP_STEAM_PATH)
|
||||
|
||||
human = {
|
||||
DEFAULT_PATH: wizard.desc_default_path,
|
||||
DEFAULT_PATH: default_label,
|
||||
FLATPAK_PATH: wizard.desc_flatpak_path,
|
||||
UBUNTU_PATH: wizard.desc_ubuntu_path,
|
||||
SNAP_PATH: wizard.desc_snap_path,
|
||||
DEBIAN_PATH: wizard.desc_debian_path,
|
||||
}
|
||||
|
||||
for path in DEFAULT_PATH, FLATPAK_PATH, UBUNTU_PATH, DEBIAN_PATH:
|
||||
for path in (
|
||||
DEFAULT_PATH,
|
||||
FLATPAK_PATH,
|
||||
UBUNTU_PATH,
|
||||
SNAP_PATH,
|
||||
DEBIAN_PATH,
|
||||
):
|
||||
if path is FLATPAK_PATH and has_flatpak_client() is False:
|
||||
continue
|
||||
if path is not FLATPAK_PATH and has_steam_client() is False:
|
||||
@@ -485,11 +497,11 @@ def is_dayz_downloading(steam_path: Path, appid: int) -> bool:
|
||||
|
||||
def get_app_path(folders_path: Path, appid: int) -> Path:
|
||||
app_path = None
|
||||
|
||||
try:
|
||||
with open(folders_path / LIBRARYFOLDERS_PATH) as f:
|
||||
folders = vdf.load(f)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
raise VDFLoadError("Failed to parse libraryfolders")
|
||||
|
||||
for obj in folders["libraryfolders"]:
|
||||
|
||||
+3
-5
@@ -6,7 +6,6 @@ from importlib import resources
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
||||
from dzgui.const.constants import (
|
||||
APP_NAME,
|
||||
APP_NAME_LOWER,
|
||||
@@ -23,14 +22,13 @@ from dzgui.init.migrate import (
|
||||
migrate_cols_file,
|
||||
)
|
||||
from dzgui.init.prereqs import has_flatpak_client, has_steam_client
|
||||
from dzgui.strings import boot
|
||||
from dzgui.strings import boot, errors
|
||||
|
||||
from dzgui.util.deck import is_steam_deck, is_game_mode
|
||||
from dzgui.util.dirs import make_parents
|
||||
from dzgui.util.localize import set_locale
|
||||
from dzgui.util.map_count import test_map_count
|
||||
from dzgui.util.redact import RedactionFilter, REDACTION_PATTERNS
|
||||
from dzgui.util.strings import init
|
||||
|
||||
from dzgui.views.base import App
|
||||
from dzgui.views.dialogs.boot import BootWindow
|
||||
@@ -107,7 +105,7 @@ def load_steam_icon() -> None:
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
try:
|
||||
traversable = resources.files(APP_NAME_LOWER).joinpath(ICONS_PATH)
|
||||
@@ -160,7 +158,7 @@ def build_gui(version: str, is_debug: bool) -> App | None:
|
||||
else:
|
||||
has_client = has_steam_client()
|
||||
if has_client is False:
|
||||
EarlyAlertDialog(init.requires_steam)
|
||||
EarlyAlertDialog(errors.requires_steam)
|
||||
|
||||
bootwin = BootWindow(XDG, version)
|
||||
local_coords, latest_release = bootwin.get_results()
|
||||
|
||||
@@ -3,6 +3,7 @@ import textwrap
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.config.xdg import get_real_home
|
||||
from dzgui.util.dirs import copy_dzgui_to_xdg_data, find_icon_resource, make_parents
|
||||
|
||||
|
||||
@@ -36,7 +37,8 @@ def write_desktop_file(exe_path: Path) -> Path:
|
||||
|
||||
def write_desktop_shortcut(desktop_file: Path) -> None:
|
||||
# NOTE: necessarily depends on the above (UI blocks creation without XDG entry first)
|
||||
link = Path.home().joinpath("Desktop/dzgui.desktop")
|
||||
home = get_real_home()
|
||||
link = home.joinpath("Desktop/dzgui.desktop")
|
||||
make_parents(link)
|
||||
if link.exists():
|
||||
link.unlink()
|
||||
|
||||
+10
-7
@@ -6,13 +6,11 @@ from dataclasses import dataclass
|
||||
from dzgui.const.constants import (
|
||||
APP_NAME_LOWER,
|
||||
DEBUG_LOG,
|
||||
FLATPAK_ROOT_PATH,
|
||||
SYSTEM_LOG,
|
||||
)
|
||||
from dzgui.init.proc import is_sandboxed
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Xdg:
|
||||
config: Path
|
||||
columns: Path
|
||||
@@ -50,9 +48,17 @@ def is_writeable(path_str: str) -> bool:
|
||||
file.unlink()
|
||||
return True
|
||||
|
||||
def get_real_home() -> Path:
|
||||
home = Path.home()
|
||||
if resolved := os.environ.get("SNAP_REAL_HOME"): # Snap
|
||||
home = Path(resolved)
|
||||
elif resolved := os.environ.get("HOME"): # Flatpak
|
||||
home = Path(resolved)
|
||||
return home
|
||||
|
||||
|
||||
def get_xdg_paths() -> dict[str, Path]:
|
||||
home = Path.home()
|
||||
home = get_real_home()
|
||||
xdg_paths = {
|
||||
"XDG_CONFIG_HOME": home / ".config",
|
||||
"XDG_STATE_HOME": home / ".local" / "state",
|
||||
@@ -62,9 +68,6 @@ def get_xdg_paths() -> dict[str, Path]:
|
||||
resolved_paths = {}
|
||||
for path in xdg_paths:
|
||||
real_path = os.environ.get(path)
|
||||
if real_path is not None and is_sandboxed():
|
||||
search_string = FLATPAK_ROOT_PATH + "/"
|
||||
real_path = real_path.replace(search_string, "")
|
||||
if real_path is not None and is_writeable(real_path):
|
||||
new_path = Path(real_path)
|
||||
else:
|
||||
|
||||
@@ -52,6 +52,7 @@ SYSTEM_LOG = f"{APP_NAME}_SYSTEM.LOG"
|
||||
CHANGELOG_PATH = "data/CHANGELOG.md"
|
||||
IMAGES_PATH = "data/images"
|
||||
ICONS_PATH = "data/images/gtk"
|
||||
LOG_DELIMITER = "␞"
|
||||
|
||||
HERO_PATH = "data/images/_hero.png"
|
||||
CSS_PATH = "data/app.css"
|
||||
@@ -60,6 +61,7 @@ DEFAULT_STEAM_PATH = ".local/share/Steam"
|
||||
FLATPAK_ROOT_PATH = ".var/app/com.valvesoftware.Steam"
|
||||
FLATPAK_STEAM_PATH = FLATPAK_ROOT_PATH + "/data/Steam"
|
||||
UBUNTU_STEAM_PATH = ".steam/steam"
|
||||
SNAP_STEAM_PATH = "snap/steam/common/" + DEFAULT_STEAM_PATH
|
||||
DEBIAN_STEAM_PATH = ".steam/debian-installation"
|
||||
|
||||
LOG_FILTERS = ("CRITICAL", "WARNING", "INFO", "DEBUG")
|
||||
|
||||
@@ -8,9 +8,9 @@ STEAM_UNSUB = "https://api.steampowered.com/IPublishedFileService/Unsubscribe/v1
|
||||
STEAM_APP_DETAILS = "https://store.steampowered.com/api/appdetails?"
|
||||
|
||||
GITHUB = "https://github.com/aclist"
|
||||
GITHUB_RELEASES = "https://api.github.com/repos/aclist/dztui/releases/latest"
|
||||
GITHUB_RELEASES = "https://api.github.com/repos/aclist/dzgui/releases/latest"
|
||||
CODEBERG_RELEASES = "https://codeberg.org/api/v1/repos/aclist/dzgui/releases/latest"
|
||||
GITHUB_USER_RELEASES = "https://github.com/aclist/dztui/releases"
|
||||
GITHUB_USER_RELEASES = "https://github.com/aclist/dzgui/releases"
|
||||
DB_IP = "https://db-ip.com/db/download/ip-to-city-lite"
|
||||
IP_ECHO = "https://ipecho.net/plain"
|
||||
COORDS_API = "http://ip-api.com/json"
|
||||
|
||||
+51
-54
@@ -2,8 +2,7 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
|
||||
from dzgui.util import strings
|
||||
from dzgui.strings import rows
|
||||
from dzgui.strings import crumbs, context_menu, mod_panel, rows, side_buttons
|
||||
|
||||
|
||||
class Port(Enum):
|
||||
@@ -84,21 +83,21 @@ class ContextMenuMeta:
|
||||
|
||||
|
||||
class ContextMenuItem(Enum):
|
||||
ADD_NOTE = ContextMenuMeta(strings.add_note)
|
||||
ADD_SERVER = ContextMenuMeta(strings.add)
|
||||
CONNECT = ContextMenuMeta(strings.connect)
|
||||
COPY_LOG_CLIPBOARD = ContextMenuMeta(strings.copy_log)
|
||||
COPY_SERVER_IP = ContextMenuMeta(strings.copy_ip)
|
||||
COPY_SERVER_NAME = ContextMenuMeta(strings.copy_name)
|
||||
UNSUB_MOD = ContextMenuMeta(strings.unsub_mod)
|
||||
VALIDATE_MOD = ContextMenuMeta(strings.validate_mod)
|
||||
OPEN_WORKSHOP = ContextMenuMeta(strings.open_workshop)
|
||||
REFRESH_PLAYERS = ContextMenuMeta(strings.refresh_players)
|
||||
REMOVE_HISTORY = ContextMenuMeta(strings.remove_history)
|
||||
REMOVE_SERVER = ContextMenuMeta(strings.remove)
|
||||
SET_FAV = ContextMenuMeta(strings.add_fav)
|
||||
SHOW_DETAILS = ContextMenuMeta(strings.show_details)
|
||||
SHOW_MODS = ContextMenuMeta(strings.show_mods)
|
||||
ADD_NOTE = ContextMenuMeta(context_menu.add_note)
|
||||
ADD_SERVER = ContextMenuMeta(context_menu.add)
|
||||
CONNECT = ContextMenuMeta(context_menu.connect)
|
||||
COPY_LOG_CLIPBOARD = ContextMenuMeta(context_menu.copy_log)
|
||||
COPY_SERVER_IP = ContextMenuMeta(context_menu.copy_ip)
|
||||
COPY_SERVER_NAME = ContextMenuMeta(context_menu.copy_name)
|
||||
UNSUB_MOD = ContextMenuMeta(context_menu.unsub_mod)
|
||||
VALIDATE_MOD = ContextMenuMeta(context_menu.validate_mod)
|
||||
OPEN_WORKSHOP = ContextMenuMeta(context_menu.open_workshop)
|
||||
REFRESH_PLAYERS = ContextMenuMeta(context_menu.refresh_players)
|
||||
REMOVE_HISTORY = ContextMenuMeta(context_menu.remove_history)
|
||||
REMOVE_SERVER = ContextMenuMeta(context_menu.remove)
|
||||
SET_FAV = ContextMenuMeta(context_menu.set_fav)
|
||||
SHOW_DETAILS = ContextMenuMeta(context_menu.show_details)
|
||||
SHOW_MODS = ContextMenuMeta(context_menu.show_mods)
|
||||
|
||||
@property
|
||||
def label(self) -> str:
|
||||
@@ -182,17 +181,17 @@ class Preferences(Enum):
|
||||
|
||||
|
||||
class NotebookPage(Enum):
|
||||
OFFLINE = NotebookMeta(strings.crumbs.offline, True)
|
||||
CHANGELOG = NotebookMeta(strings.crumbs.changelog, True)
|
||||
DEVELOPERS = NotebookMeta(strings.crumbs.developers, False)
|
||||
HELP = NotebookMeta(strings.crumbs._help, True)
|
||||
KEYS = NotebookMeta(strings.crumbs.keys, True)
|
||||
LOG = NotebookMeta(strings.crumbs.log, True)
|
||||
MODS = NotebookMeta(strings.crumbs.mods, True)
|
||||
OPTIONS = NotebookMeta(strings.crumbs.options, False)
|
||||
SERVERS = NotebookMeta(strings.crumbs.servers, True)
|
||||
THANKS = NotebookMeta(strings.crumbs.thanks, True)
|
||||
CONNECTION = NotebookMeta(strings.crumbs.connect, True)
|
||||
OFFLINE = NotebookMeta(crumbs.offline, True)
|
||||
CHANGELOG = NotebookMeta(crumbs.changelog, True)
|
||||
DEVELOPERS = NotebookMeta(crumbs.developers, False)
|
||||
HELP = NotebookMeta(crumbs._help, True)
|
||||
KEYS = NotebookMeta(crumbs.keys, True)
|
||||
LOG = NotebookMeta(crumbs.log, True)
|
||||
MODS = NotebookMeta(crumbs.mods, True)
|
||||
OPTIONS = NotebookMeta(crumbs.options, False)
|
||||
SERVERS = NotebookMeta(crumbs.servers, True)
|
||||
THANKS = NotebookMeta(crumbs.thanks, True)
|
||||
CONNECTION = NotebookMeta(crumbs.connect, True)
|
||||
|
||||
@property
|
||||
def crumbs(self) -> str:
|
||||
@@ -207,7 +206,8 @@ class RowType(Enum):
|
||||
CHANGELOG = RowMeta(rows.changelog_label, rows.changelog_status)
|
||||
SHOW_LOG = RowMeta(rows.log_label, rows.log_status)
|
||||
SEPARATOR = RowMeta(rows.separator_label, rows.separator_status)
|
||||
DUMP_LOG = RowMeta(rows.system_log_label, rows.system_log_status)
|
||||
DUMP_DIAGNOSTIC = RowMeta(rows.system_log_label, rows.system_log_status)
|
||||
DUMP_DEBUG = RowMeta(rows.debug_log_label, rows.debug_log_status)
|
||||
DOCS = RowMeta(rows.docs_label, rows.docs_status)
|
||||
DOCS_FALLBACK = RowMeta(rows.docs_fallback_label, rows.docs_fallback_status)
|
||||
BUGS = RowMeta(rows.bugs_label, rows.bugs_status)
|
||||
@@ -225,29 +225,25 @@ class RowType(Enum):
|
||||
|
||||
|
||||
class ModButton(Enum):
|
||||
SELECT_ALL = ModButtonMeta(
|
||||
strings.mod_panel.select_all, strings.mod_panel.select_all_tooltip
|
||||
)
|
||||
UNSELECT_ALL = ModButtonMeta(
|
||||
strings.mod_panel.unselect_all, strings.mod_panel.unselect_all_tooltip
|
||||
)
|
||||
SELECT_ALL = ModButtonMeta(mod_panel.select_all, mod_panel.select_all_tooltip)
|
||||
UNSELECT_ALL = ModButtonMeta(mod_panel.unselect_all, mod_panel.unselect_all_tooltip)
|
||||
HIGHLIGHT_STALE = ModButtonMeta(
|
||||
strings.mod_panel.highlight_stale, strings.mod_panel.highlight_stale_tooltip
|
||||
mod_panel.highlight_stale, mod_panel.highlight_stale_tooltip
|
||||
)
|
||||
UNHIGHLIGHT_STALE = ModButtonMeta(
|
||||
strings.mod_panel.unhighlight_stale, strings.mod_panel.unhighlight_stale_tooltip
|
||||
mod_panel.unhighlight_stale, mod_panel.unhighlight_stale_tooltip
|
||||
)
|
||||
UNSUB_SELECTED = ModButtonMeta(
|
||||
strings.mod_panel.unsub_selected,
|
||||
strings.mod_panel.unsub_selected_tooltip,
|
||||
mod_panel.unsub_selected,
|
||||
mod_panel.unsub_selected_tooltip,
|
||||
)
|
||||
SELECT_STALE = ModButtonMeta(
|
||||
strings.mod_panel.select_stale,
|
||||
strings.mod_panel.select_stale_tooltip,
|
||||
mod_panel.select_stale,
|
||||
mod_panel.select_stale_tooltip,
|
||||
)
|
||||
VALIDATE = ModButtonMeta(
|
||||
strings.mod_panel.validate,
|
||||
strings.mod_panel.validate_tooltip,
|
||||
mod_panel.validate,
|
||||
mod_panel.validate_tooltip,
|
||||
)
|
||||
|
||||
@property
|
||||
@@ -261,28 +257,28 @@ class ModButton(Enum):
|
||||
|
||||
class ButtonType(Enum):
|
||||
SERVERS = ButtonTypeMeta(
|
||||
strings.buttons.servers_label,
|
||||
strings.buttons.servers_tooltip,
|
||||
side_buttons.servers_label,
|
||||
side_buttons.servers_tooltip,
|
||||
NotebookPage.SERVERS,
|
||||
)
|
||||
MODS = ButtonTypeMeta(
|
||||
strings.buttons.mods_label,
|
||||
strings.buttons.mods_tooltip,
|
||||
side_buttons.mods_label,
|
||||
side_buttons.mods_tooltip,
|
||||
NotebookPage.MODS,
|
||||
)
|
||||
OPTIONS = ButtonTypeMeta(
|
||||
strings.buttons.options_label,
|
||||
strings.buttons.options_tooltip,
|
||||
side_buttons.options_label,
|
||||
side_buttons.options_tooltip,
|
||||
NotebookPage.OPTIONS,
|
||||
)
|
||||
HELP = ButtonTypeMeta(
|
||||
strings.buttons.help_label,
|
||||
strings.buttons.help_tooltip,
|
||||
side_buttons.help_label,
|
||||
side_buttons.help_tooltip,
|
||||
NotebookPage.HELP,
|
||||
)
|
||||
EXIT = ButtonTypeMeta(
|
||||
strings.buttons.exit_label,
|
||||
strings.buttons.exit_tooltip,
|
||||
side_buttons.exit_label,
|
||||
side_buttons.exit_tooltip,
|
||||
None,
|
||||
)
|
||||
|
||||
@@ -302,7 +298,8 @@ class ButtonType(Enum):
|
||||
HELP_MENU_ROWS = (
|
||||
RowType.CHANGELOG,
|
||||
RowType.SHOW_LOG,
|
||||
RowType.DUMP_LOG,
|
||||
RowType.DUMP_DIAGNOSTIC,
|
||||
RowType.DUMP_DEBUG,
|
||||
RowType.SEPARATOR,
|
||||
RowType.DOCS,
|
||||
RowType.DOCS_FALLBACK,
|
||||
|
||||
+27
-18
@@ -1,11 +1,12 @@
|
||||
import gi
|
||||
import logging
|
||||
import threading
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any, TYPE_CHECKING, Union
|
||||
|
||||
import dzgui.util._json as JSON # noqa
|
||||
|
||||
|
||||
from dzgui.config.userprefs import UserPrefs
|
||||
from dzgui.const.constants import APP_NAME
|
||||
from dzgui.const.enum import (
|
||||
ButtonType,
|
||||
ContextMenuItem,
|
||||
@@ -14,9 +15,6 @@ from dzgui.const.enum import (
|
||||
Preferences,
|
||||
ServerTab,
|
||||
)
|
||||
|
||||
from dzgui.config.userprefs import UserPrefs
|
||||
from dzgui.const.constants import APP_NAME
|
||||
from dzgui.controllers.emitter import Emitter
|
||||
from dzgui.managers.config import ConfigManager
|
||||
from dzgui.managers.connection import ConnectionManager
|
||||
@@ -26,11 +24,9 @@ from dzgui.model.servers import ServerModelManager
|
||||
from dzgui.util.diag import write_diagnostic
|
||||
from dzgui.util.format import format_exception, format_player_count
|
||||
from dzgui.util.open_links import open_user_workshop, open_workshop_page
|
||||
from dzgui.views.dialogs.filepicker import FilePicker
|
||||
from dzgui.views.dialogs.filepicker import DebugLogPicker, DiagnosticLogPicker
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, GObject
|
||||
|
||||
@@ -302,15 +298,29 @@ class Controller(GObject.GObject):
|
||||
return self.get_active_treeview().get_filter_man()
|
||||
|
||||
def dump_diagnostics(self) -> None:
|
||||
picker = FilePicker(self.mediator.window)
|
||||
picker = DiagnosticLogPicker(self.mediator.window)
|
||||
file = picker.pick_file()
|
||||
if file is not None:
|
||||
try:
|
||||
write_diagnostic(self.prefs.paths.config, file)
|
||||
except Exception as e:
|
||||
dialog = ExceptionDialog(self, str(e))
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
if file is None:
|
||||
return
|
||||
try:
|
||||
write_diagnostic(self.prefs.paths.config, file)
|
||||
except Exception as e:
|
||||
dialog = ExceptionDialog(self, str(e))
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
|
||||
def dump_log(self) -> None:
|
||||
picker = DebugLogPicker(self.mediator.window)
|
||||
file = picker.pick_file()
|
||||
if file is None:
|
||||
return
|
||||
try:
|
||||
log = self.prefs.paths.debug.read_text()
|
||||
Path(file).write_text(log)
|
||||
except Exception as e:
|
||||
dialog = ExceptionDialog(self, str(e))
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
|
||||
def update_steam_api_key(self, text: str) -> None:
|
||||
self.config_man.update_steam_api_key(text)
|
||||
@@ -371,7 +381,6 @@ class Controller(GObject.GObject):
|
||||
filter_man = self.get_filter_man()
|
||||
return filter_man.get_filters()
|
||||
|
||||
# FIXME: wipe maps store when changing tabs if model is none
|
||||
def has_server_model(self) -> bool:
|
||||
treeview = self.get_active_treeview()
|
||||
proxy_man = treeview.get_proxy_man()
|
||||
|
||||
+10
-7
@@ -53,6 +53,11 @@
|
||||
- Expand/collapse changelog versions
|
||||
- Support local light/dark mode changes on system theme
|
||||
- Server time calculator
|
||||
- Add "Unmodded" filter to servers
|
||||
- List timestamp of last DayZ client update
|
||||
- Validate mods via Mod page to pull in updates
|
||||
- Support for Nasdara (Badlands) DLC
|
||||
- Load offline mods
|
||||
|
||||
### Changed
|
||||
- Conform to PEP 440 versioning for beta versions
|
||||
@@ -74,6 +79,7 @@
|
||||
- Enable LAN page Empty/Full filters on first run of app
|
||||
- Propagate subscribed mods to Steam client
|
||||
- Make j/k keys in context menus follow same wraparound logic as down arrow/up arrow
|
||||
- Use SQLite DB for geolocation records
|
||||
|
||||
### Dropped
|
||||
- Battlemetrics API support
|
||||
@@ -92,16 +98,13 @@
|
||||
- Moved dialogs out of threads
|
||||
- History table not being in lock-step with state file
|
||||
- Current keyword filter not being applied when refreshing table
|
||||
|
||||
### Unreleased
|
||||
- Load offline mods
|
||||
- Local documentation
|
||||
- Raw debug command in context menu
|
||||
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
||||
- Collisions between native Steam and Steam Flatpak clients
|
||||
- Sticky toggle signal on radio buttons when reloading Options
|
||||
|
||||
### Developer-facing
|
||||
- Add pyproject.toml file
|
||||
- Show deprecation warnings
|
||||
- Options -> Dev page
|
||||
- Raw debug command in preconnect menu
|
||||
|
||||
## [6.0.5] 2026-05-17
|
||||
### Changed
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
from typing import TextIO
|
||||
|
||||
from dzgui.const.constants import LOCK_FILE
|
||||
from dzgui.util.strings import cannot_acquire_lock
|
||||
from dzgui.strings import errors
|
||||
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
||||
|
||||
|
||||
@@ -21,6 +21,6 @@ def lock_acquire() -> TextIO:
|
||||
try:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except OSError:
|
||||
EarlyAlertDialog(cannot_acquire_lock)
|
||||
EarlyAlertDialog(errors.cannot_acquire_lock)
|
||||
sys.exit(1)
|
||||
return lock
|
||||
@@ -12,13 +12,15 @@ from dzgui.const.constants import (
|
||||
LEGACY_IPS_PATH,
|
||||
)
|
||||
from dzgui.config.convert import rc2json
|
||||
from dzgui.config.xdg import get_real_home
|
||||
from dzgui.util._json import read_json, write_json
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
|
||||
def migrate_legacy_conf(config: Path) -> Any:
|
||||
old_conf = Path.home() / LEGACY_CONFIG_PATH
|
||||
home = get_real_home()
|
||||
old_conf = home / LEGACY_CONFIG_PATH
|
||||
j = rc2json(old_conf)
|
||||
return json.loads(j)
|
||||
|
||||
@@ -44,7 +46,8 @@ def convert_cols_file(res: Path) -> Any | None:
|
||||
|
||||
def migrate_cols_file(res: Path) -> None:
|
||||
# NOTE: filename "dzg.columns.json" is API 7 spec
|
||||
old_res = Path.home() / LEGACY_COLS_PATH
|
||||
home = get_real_home()
|
||||
old_res = home / LEGACY_COLS_PATH
|
||||
if old_res.is_file():
|
||||
j = convert_cols_file(old_res)
|
||||
if j is not None:
|
||||
@@ -52,7 +55,7 @@ def migrate_cols_file(res: Path) -> None:
|
||||
|
||||
|
||||
def copy_state_files(state_path: Path) -> None:
|
||||
home = Path.home()
|
||||
home = get_real_home()
|
||||
legacy = home / ".local/state/dzgui"
|
||||
to_copy = [
|
||||
"dzg.res.json",
|
||||
@@ -63,7 +66,7 @@ def copy_state_files(state_path: Path) -> None:
|
||||
".month",
|
||||
]
|
||||
if state_path == legacy:
|
||||
# TODO: log this
|
||||
logger.debug(f"Legacy state path '{legacy}' is identical to current")
|
||||
return
|
||||
for file in legacy.iterdir():
|
||||
if file.name in to_copy:
|
||||
@@ -71,7 +74,7 @@ def copy_state_files(state_path: Path) -> None:
|
||||
|
||||
|
||||
def copy_ipdb(ips_path: Path) -> None:
|
||||
home = Path.home()
|
||||
home = get_real_home()
|
||||
legacy = home / LEGACY_IPS_PATH
|
||||
if ips_path == legacy:
|
||||
return
|
||||
|
||||
@@ -3,13 +3,13 @@ import shutil
|
||||
import subprocess
|
||||
|
||||
from dzgui.const.constants import APP_NAME, FLATPAK_APPID, FLATPAK_CMD, STEAM_CMD
|
||||
from dzgui.init.proc import is_sandboxed
|
||||
from dzgui.init.proc import is_flatpak_sandbox
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
|
||||
def has_flatpak_client() -> bool:
|
||||
if is_sandboxed():
|
||||
if is_flatpak_sandbox():
|
||||
return True
|
||||
try:
|
||||
res = subprocess.run(
|
||||
@@ -23,7 +23,7 @@ def has_flatpak_client() -> bool:
|
||||
else:
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.critical(e)
|
||||
logger.debug(e)
|
||||
return False
|
||||
|
||||
|
||||
|
||||
+27
-6
@@ -27,19 +27,40 @@ def is_steam_running(cmd: str) -> bool:
|
||||
raise TypeError("Not a valid Steam client selection")
|
||||
|
||||
|
||||
def is_sandboxed() -> bool:
|
||||
def is_snap_sandbox() -> bool:
|
||||
return bool(os.environ.get("SNAP"))
|
||||
|
||||
|
||||
def is_flatpak_sandbox() -> bool:
|
||||
return bool(os.environ.get("FLATPAK_ID"))
|
||||
|
||||
|
||||
def is_sandboxed() -> bool:
|
||||
if is_snap_sandbox() or is_flatpak_sandbox():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def get_flatpak_output() -> list[str] | None:
|
||||
try:
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
return lines
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
return None
|
||||
|
||||
|
||||
def is_flatpak_steam_running() -> bool:
|
||||
if is_sandboxed():
|
||||
if is_flatpak_sandbox():
|
||||
return True
|
||||
if has_cmd(FLATPAK_CMD) is False:
|
||||
return False
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
lines = get_flatpak_output()
|
||||
if lines is None:
|
||||
return False
|
||||
if FLATPAK_APPID in lines:
|
||||
return True
|
||||
return False
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ from dzgui.init.libgi import test_libgi_missing
|
||||
from dzgui.init.prefix import get_version
|
||||
from dzgui.util.deck import is_steam_deck
|
||||
from dzgui.util.map_count import set_map_count
|
||||
from dzgui.util.strings import flags
|
||||
from dzgui.strings import flags
|
||||
|
||||
from dzgui.views.dialogs.uninstall import UninstallWizard
|
||||
from dzgui.config.xdg import get_xdg_paths
|
||||
|
||||
@@ -13,7 +13,6 @@ from dzgui.api.probe import test_steam_api
|
||||
from dzgui.const.enum import Preferences
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.util._json import read_json, write_json
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -99,7 +98,7 @@ class ConfigManager:
|
||||
logger.critical(e)
|
||||
raise e
|
||||
|
||||
@call_on_thread(dialogs.checking_api, show_dialog=False)
|
||||
@call_on_thread("", show_dialog=False)
|
||||
def update_steam_api_key(self, text: str) -> None:
|
||||
res = test_steam_api(text)
|
||||
if res is True:
|
||||
|
||||
@@ -42,15 +42,9 @@ from dzgui.api.steam import is_dayz_running
|
||||
from dzgui.const.enum import NotebookPage, Preferences
|
||||
from dzgui.init.proc import is_steam_running
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.strings.dialogs import (
|
||||
waiting_for_launch,
|
||||
waiting_for_mods,
|
||||
waiting_for_directories,
|
||||
)
|
||||
from dzgui.strings import kb
|
||||
from dzgui.strings import dialogs, errors, kb
|
||||
from dzgui.strings.server_mods import checkmark, resync, invalid_mod
|
||||
from dzgui.util.format import format_exception, format_mib
|
||||
from dzgui.util.strings import dialog, server_timeout
|
||||
from dzgui.util.symlink import rebuild_symlinks
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
from dzgui.views.dialogs.servers import ServerDetailsDialog, ServerModDialog
|
||||
@@ -103,12 +97,12 @@ class ConnectionManager:
|
||||
self.remote_mod_ids: list[str] = []
|
||||
self.missing_mods: list[tuple[str, str, int, int]] = []
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def connect_by_ip(self, addr: str) -> None:
|
||||
res = Servers.query_by_ip(addr)
|
||||
self._prepare_connection(res)
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def connect_by_record(self, record: Servers.Record) -> None:
|
||||
res = Servers.query_by_record(record)
|
||||
self._prepare_connection(res)
|
||||
@@ -153,7 +147,7 @@ class ConnectionManager:
|
||||
self.missing_mods = missing_mods
|
||||
self.remote_mod_ids = [mod[1] for mod in remote_mods]
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
||||
return
|
||||
|
||||
@@ -230,7 +224,7 @@ class ConnectionManager:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def query_details(self, record: Servers.Record) -> None:
|
||||
details = Servers.get_details(record)
|
||||
if details is None:
|
||||
@@ -275,7 +269,7 @@ class ConnectionManager:
|
||||
|
||||
return alpha_mods, missing_mods
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def query_modlist_and_present(self, record: Servers.Record) -> None:
|
||||
try:
|
||||
mods, missing_mods = self._query_modlist(record)
|
||||
@@ -303,7 +297,7 @@ class ConnectionManager:
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
|
||||
def _server_timeout(self) -> None:
|
||||
dialog = ExceptionDialog(self.controller, server_timeout)
|
||||
dialog = ExceptionDialog(self.controller, errors.server_timeout)
|
||||
dialog.set_details_buffer(kb.DZG_006)
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
@@ -328,9 +322,8 @@ class ConnectionManager:
|
||||
self.thread_man.set_cleanup_func(func)
|
||||
return
|
||||
|
||||
self.thread_man.update_dialog(waiting_for_launch)
|
||||
self.thread_man.update_dialog(dialogs.waiting_for_launch)
|
||||
while True:
|
||||
# FIXME: cancel should not be visible here per setting above
|
||||
if self.controller.is_cancel_pending():
|
||||
# TODO: some facility to also close spawned steam process
|
||||
return
|
||||
@@ -362,7 +355,7 @@ class ConnectionManager:
|
||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||
return
|
||||
|
||||
self.thread_man.update_dialog(waiting_for_directories)
|
||||
self.thread_man.update_dialog(dialogs.waiting_for_directories)
|
||||
for title, mod, stamp, size in self.missing_mods:
|
||||
mod_path = self.workshop / mod
|
||||
|
||||
@@ -388,7 +381,7 @@ class ConnectionManager:
|
||||
# TODO: just push steam path directly
|
||||
self._connect_steam(menu_only)
|
||||
|
||||
@call_on_thread(waiting_for_mods, show_cancel=True)
|
||||
@call_on_thread(dialogs.waiting_for_mods, show_cancel=True)
|
||||
def update_and_connect(self, menu_only: bool = False) -> None:
|
||||
if len(self.missing_mods) > 0:
|
||||
self._update_mods(menu_only)
|
||||
|
||||
+33
-34
@@ -1,8 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.model.model_factory import ModelFactory
|
||||
from dzgui.util import strings
|
||||
from dzgui.strings.filters import all_maps
|
||||
from dzgui.strings import metadata
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.model.model_factory import FastInsertListStore
|
||||
@@ -13,43 +12,43 @@ class FilterManager:
|
||||
|
||||
self.map_store = ModelFactory().make_map_store()
|
||||
|
||||
# TODO: namespace under own file: strings.filters
|
||||
# TODO: namespace under own file: metadata.filters
|
||||
self.default_filters = {
|
||||
strings.filter_1pp: True,
|
||||
strings.filter_day: True,
|
||||
strings.filter_empty: show_empty,
|
||||
strings.filter_3pp: True,
|
||||
strings.filter_night: True,
|
||||
strings.filter_full: show_full,
|
||||
strings.filter_official: True,
|
||||
strings.filter_modded: True,
|
||||
strings.filter_lowpop: True,
|
||||
strings.filter_unofficial: True,
|
||||
strings.filter_unmodded: True,
|
||||
strings.filter_duplicate: False,
|
||||
strings.filter_nonascii: False,
|
||||
metadata.filter_1pp: True,
|
||||
metadata.filter_day: True,
|
||||
metadata.filter_empty: show_empty,
|
||||
metadata.filter_3pp: True,
|
||||
metadata.filter_night: True,
|
||||
metadata.filter_full: show_full,
|
||||
metadata.filter_official: True,
|
||||
metadata.filter_modded: True,
|
||||
metadata.filter_lowpop: True,
|
||||
metadata.filter_unofficial: True,
|
||||
metadata.filter_unmodded: True,
|
||||
metadata.filter_duplicate: False,
|
||||
metadata.filter_nonascii: False,
|
||||
}
|
||||
|
||||
# TODO: strings
|
||||
self.tooltips = {
|
||||
strings.filter_1pp: "First-person perspective",
|
||||
strings.filter_day: "In-game time between 0600 and 1759",
|
||||
strings.filter_empty: "Servers with no players",
|
||||
strings.filter_3pp: "Third-person perspective",
|
||||
strings.filter_night: "In-game time between 1800 and 0559",
|
||||
strings.filter_full: "Servers with no open slots",
|
||||
strings.filter_official: "Bohemia official servers",
|
||||
strings.filter_nonascii: "Server names using non-standard, complex glyphs",
|
||||
strings.filter_lowpop: "Current population is under 30% of total",
|
||||
strings.filter_unofficial: "Third-party servers",
|
||||
strings.filter_duplicate: "Duplicates of existing servers (usually spoofed)",
|
||||
strings.filter_modded: "Servers with one or more mods",
|
||||
strings.filter_unmodded: "Servers with no mods",
|
||||
metadata.filter_1pp: "First-person perspective",
|
||||
metadata.filter_day: "In-game time between 0600 and 1759",
|
||||
metadata.filter_empty: "Servers with no players",
|
||||
metadata.filter_3pp: "Third-person perspective",
|
||||
metadata.filter_night: "In-game time between 1800 and 0559",
|
||||
metadata.filter_full: "Servers with no open slots",
|
||||
metadata.filter_official: "Bohemia official servers",
|
||||
metadata.filter_nonascii: "Server names using non-standard, complex glyphs",
|
||||
metadata.filter_lowpop: "Current population is under 30% of total",
|
||||
metadata.filter_unofficial: "Third-party servers",
|
||||
metadata.filter_duplicate: "Duplicates of existing servers (usually spoofed)",
|
||||
metadata.filter_modded: "Servers with one or more mods",
|
||||
metadata.filter_unmodded: "Servers with no mods",
|
||||
}
|
||||
|
||||
self.active_keyword = ""
|
||||
self.active_map = (0, all_maps)
|
||||
self.prior_map = all_maps
|
||||
self.active_map = (0, metadata.all_maps)
|
||||
self.prior_map = metadata.all_maps
|
||||
|
||||
self.enabled_filters = dict(self.default_filters)
|
||||
|
||||
@@ -89,9 +88,9 @@ class FilterManager:
|
||||
|
||||
def reinit_map_store(self) -> None:
|
||||
model = ModelFactory().make_map_store()
|
||||
model.append([all_maps])
|
||||
model.append([metadata.all_maps])
|
||||
self.map_store = model
|
||||
self.active_map = (0, all_maps)
|
||||
self.active_map = (0, metadata.all_maps)
|
||||
|
||||
def append_map(self, row: list[str]) -> None:
|
||||
self.map_store.append(row)
|
||||
@@ -105,7 +104,7 @@ class FilterManager:
|
||||
|
||||
self.reinit_map_store()
|
||||
maps.sort()
|
||||
clean = [m for m in maps if m != all_maps]
|
||||
clean = [m for m in maps if m != metadata.all_maps]
|
||||
for m in clean:
|
||||
self.append_map([m])
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class UpdateManager:
|
||||
except Exception as e:
|
||||
func = StoredFunc(self._on_update_failure, str(e))
|
||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
|
||||
def _on_update_success(self) -> None:
|
||||
msg = dialogs.update_success
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Sequence, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.constants import LOG_DELIMITER
|
||||
from dzgui.const.enum import HELP_MENU_ROWS
|
||||
from dzgui.util.strings import delimiter
|
||||
|
||||
import gi
|
||||
|
||||
@@ -131,7 +131,7 @@ class ModelFactory:
|
||||
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
|
||||
store = self.make_log_store()
|
||||
with open(path, "r") as f:
|
||||
lines = [line.split(delimiter) for line in f.read().splitlines()]
|
||||
lines = [line.split(LOG_DELIMITER) for line in f.read().splitlines()]
|
||||
for record in lines:
|
||||
store.append(record)
|
||||
return store
|
||||
|
||||
+27
-23
@@ -6,8 +6,7 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import FilterMode
|
||||
from dzgui.model.model_factory import ModelFactory
|
||||
from dzgui.util import strings
|
||||
from dzgui.strings import filters as str_filters
|
||||
from dzgui.strings import metadata
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.managers.filter import FilterManager
|
||||
@@ -58,37 +57,42 @@ class ServerRow:
|
||||
getter = cls._to_tuple
|
||||
return [getter(row) for row in rows]
|
||||
|
||||
@classmethod
|
||||
def get_index(cls, field: str) -> int:
|
||||
_fields = [f.name for f in fields(cls)]
|
||||
return _fields.index(field)
|
||||
|
||||
|
||||
class FiltrationManager:
|
||||
def __init__(self) -> None:
|
||||
|
||||
self.filter_map = {
|
||||
strings.filter_3pp: self.filter_3pp,
|
||||
strings.filter_1pp: self.filter_1pp,
|
||||
strings.filter_official: self.filter_official,
|
||||
strings.filter_unofficial: self.filter_unofficial,
|
||||
strings.filter_empty: self.filter_empty,
|
||||
strings.filter_full: self.filter_full,
|
||||
strings.filter_duplicate: self.filter_duplicate,
|
||||
strings.filter_day: self.filter_day,
|
||||
strings.filter_night: self.filter_night,
|
||||
strings.filter_nonascii: self.filter_nonascii,
|
||||
strings.filter_lowpop: self.filter_lowpop,
|
||||
strings.filter_modded: self.filter_modded,
|
||||
strings.filter_unmodded: self.filter_unmodded,
|
||||
metadata.filter_3pp: self.filter_3pp,
|
||||
metadata.filter_1pp: self.filter_1pp,
|
||||
metadata.filter_official: self.filter_official,
|
||||
metadata.filter_unofficial: self.filter_unofficial,
|
||||
metadata.filter_empty: self.filter_empty,
|
||||
metadata.filter_full: self.filter_full,
|
||||
metadata.filter_duplicate: self.filter_duplicate,
|
||||
metadata.filter_day: self.filter_day,
|
||||
metadata.filter_night: self.filter_night,
|
||||
metadata.filter_nonascii: self.filter_nonascii,
|
||||
metadata.filter_lowpop: self.filter_lowpop,
|
||||
metadata.filter_modded: self.filter_modded,
|
||||
metadata.filter_unmodded: self.filter_unmodded,
|
||||
}
|
||||
|
||||
def filter_3pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||
return [row for row in rows if row.view != strings.filter_3pp]
|
||||
return [row for row in rows if row.view != metadata.filter_3pp]
|
||||
|
||||
def filter_1pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||
return [row for row in rows if row.view != strings.filter_1pp]
|
||||
return [row for row in rows if row.view != metadata.filter_1pp]
|
||||
|
||||
def filter_official(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||
return [row for row in rows if row.provider != strings.filter_official]
|
||||
return [row for row in rows if row.provider != metadata.filter_official]
|
||||
|
||||
def filter_unofficial(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||
return [row for row in rows if row.provider != strings.filter_unofficial]
|
||||
return [row for row in rows if row.provider != metadata.filter_unofficial]
|
||||
|
||||
def filter_empty(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||
return [row for row in rows if row.players != 0]
|
||||
@@ -287,7 +291,7 @@ class ProxyModelManager:
|
||||
rows = self.filtered
|
||||
sel_map = self.filter_man.get_active_map_name()
|
||||
|
||||
if sel_map == str_filters.all_maps:
|
||||
if sel_map == metadata.all_maps:
|
||||
return rows
|
||||
|
||||
rows = [row for row in rows if row.mapname == sel_map]
|
||||
@@ -316,9 +320,9 @@ class ProxyModelManager:
|
||||
Sub-filtration of the current model
|
||||
"""
|
||||
pairs = {
|
||||
strings.filter_3pp: strings.filter_1pp,
|
||||
strings.filter_day: strings.filter_night,
|
||||
strings.filter_official: strings.filter_unofficial,
|
||||
metadata.filter_3pp: metadata.filter_1pp,
|
||||
metadata.filter_day: metadata.filter_night,
|
||||
metadata.filter_official: metadata.filter_unofficial,
|
||||
}
|
||||
for k, v in pairs.items():
|
||||
if k in filters and v in filters:
|
||||
|
||||
+16
-17
@@ -14,8 +14,7 @@ from dzgui.const.constants import (
|
||||
)
|
||||
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.strings import dialogs, kb
|
||||
from dzgui.util.strings import server_timeout, dialog
|
||||
from dzgui.strings import dialogs, errors, kb
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
|
||||
import gi
|
||||
@@ -34,7 +33,7 @@ LAN_TIMEOUT = 0.5
|
||||
API_TIMEOUT = 3
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class NewPlayerCount:
|
||||
treeiter: Gtk.TreeIter
|
||||
players: int
|
||||
@@ -83,7 +82,7 @@ class ServerModelManager:
|
||||
self.preserve_on_fail = True
|
||||
self.load()
|
||||
|
||||
@call_on_thread(dialog.fetching)
|
||||
@call_on_thread(dialogs.fetching_server)
|
||||
def _dump_api(self) -> None:
|
||||
# TODO: pass api key a priori in .load() call?
|
||||
failure_func = StoredFunc(self._cleanup_on_failure)
|
||||
@@ -126,7 +125,7 @@ class ServerModelManager:
|
||||
parsed = Servers.parse_json(servers)
|
||||
self._push_data(parsed)
|
||||
|
||||
@call_on_thread(dialog.scanning, show_cancel=True)
|
||||
@call_on_thread(dialogs.scanning_lan, show_cancel=True)
|
||||
def dump_lan(self, port: int, early_abort: bool) -> None:
|
||||
self.first_iteration = True
|
||||
|
||||
@@ -159,7 +158,7 @@ class ServerModelManager:
|
||||
parsed = Servers.parse_json(servers)
|
||||
self._push_data(parsed)
|
||||
|
||||
@call_on_thread(dialog.fetching)
|
||||
@call_on_thread(dialogs.fetching_server)
|
||||
def _dump_ips(self, ips: list[str]) -> None:
|
||||
job = Servers.query_direct
|
||||
servers = []
|
||||
@@ -199,20 +198,20 @@ class ServerModelManager:
|
||||
parsed = Servers.parse_json(servers)
|
||||
self._push_data(parsed)
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def add_by_ip(self, addr: str) -> None:
|
||||
self.preserve_on_fail = True
|
||||
try:
|
||||
res = Servers.query_by_ip(addr)
|
||||
self._parse_single_record(res)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
return
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def add_by_record(self, record: Servers.Record) -> None:
|
||||
self.preserve_on_fail = True
|
||||
# NOTE: rationale: a raw Record as shown in server browser may resolve to a different IP
|
||||
@@ -220,20 +219,20 @@ class ServerModelManager:
|
||||
res = Servers.query_by_record(record)
|
||||
self._parse_single_record(res)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
return
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def remove_by_record(self, record: Servers.Record) -> None:
|
||||
self.preserve_on_fail = True
|
||||
try:
|
||||
res = Servers.query_by_record(record)
|
||||
self._parse_single_record(res, delete=True)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
logger.critical(e)
|
||||
self.thread_man.set_cleanup_func(
|
||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||
)
|
||||
@@ -287,7 +286,7 @@ class ServerModelManager:
|
||||
config_man.remove_from_history_file(fqip)
|
||||
self.update_history()
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@call_on_thread(dialogs.querying)
|
||||
def update_playercount(
|
||||
self, treeiter: Gtk.TreeIter, record: Servers.Record
|
||||
) -> None:
|
||||
@@ -341,8 +340,8 @@ class ServerModelManager:
|
||||
return
|
||||
config_man.add_saved_server(fqip)
|
||||
|
||||
# FIXME: this is valid if saved servers tab is already open,
|
||||
# but not if app was just booted; causes single row to appear prematurely
|
||||
# TODO: this is valid if saved servers tab is already open,
|
||||
# but not if tab is unloaded; causes single row to appear prematurely
|
||||
if proxy_man.has_control_model() is False:
|
||||
proxy_man.push(records)
|
||||
else:
|
||||
@@ -448,7 +447,7 @@ class ServerModelManager:
|
||||
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
||||
# customize statusbar and dialog accordingly
|
||||
if show_dialog:
|
||||
dialog = ExceptionDialog(self.controller, server_timeout)
|
||||
dialog = ExceptionDialog(self.controller, errors.server_timeout)
|
||||
dialog.set_details_buffer(kb.DZG_006)
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
@@ -471,7 +470,7 @@ class ServerModelManager:
|
||||
def _get_proxy_man(self) -> "ProxyModelManager":
|
||||
return self.proxy_man
|
||||
|
||||
@call_on_thread(dialog.filtering)
|
||||
@call_on_thread(dialogs.filtering)
|
||||
def refilter(self, mode: FilterMode) -> None:
|
||||
self.first_iteration = False
|
||||
proxy_man = self._get_proxy_man()
|
||||
|
||||
+10
-10
@@ -1,16 +1,16 @@
|
||||
clipboard_button = "Copy to clipboard"
|
||||
clipboard_ip_button = "Copy IP to clipboard"
|
||||
|
||||
copy_button = "Copy"
|
||||
dock_button_collapse = "Collapse the connection panel"
|
||||
dock_button_expand = "Expand the connection panel"
|
||||
|
||||
workshop = "Steam Workshop"
|
||||
workshop_tooltip = "Open your Workshop subscriptions"
|
||||
|
||||
version_notifier = "Copied!"
|
||||
version_tooltip = "Click to copy to clipboard"
|
||||
|
||||
update_button = "Updates available"
|
||||
|
||||
keys_button = "Keys"
|
||||
keys_button_tooltip = "Toggles the keybindings dialog"
|
||||
refresh_button = "Refresh"
|
||||
refresh_tooltip = "Refresh server data"
|
||||
unset_button_label = "Unset"
|
||||
unset_button_tooltip = "Unset this server as favorite"
|
||||
update_button = "Updates available"
|
||||
version_notifier = "Copied!"
|
||||
version_tooltip = "Click to copy to clipboard"
|
||||
workshop = "Steam Workshop"
|
||||
workshop_tooltip = "Open your Workshop subscriptions"
|
||||
@@ -1,2 +1,3 @@
|
||||
collapse_all = "Collapse all"
|
||||
expand_all = "Expand all"
|
||||
missing_changelog = "Error: failed to read changelog"
|
||||
@@ -0,0 +1,16 @@
|
||||
add = "Add to Saved Servers"
|
||||
add_note = "Add note"
|
||||
connect = "Connect"
|
||||
copy_ip = "Copy IP to clipboard"
|
||||
copy_log = "Copy record(s) to clipboard"
|
||||
copy_name = "Copy name to clipboard"
|
||||
edit_note = "Edit note"
|
||||
open_workshop = "Open in Steam Workshop"
|
||||
refresh_players = "Refresh player count"
|
||||
remove = "Remove from Saved Servers"
|
||||
remove_history = "Remove from history"
|
||||
set_fav = "Set as favorite"
|
||||
show_details = "Show server details"
|
||||
show_mods = "Show server-side mods"
|
||||
unsub_mod = "Unsubscribe mod"
|
||||
validate_mod = "Validate mod"
|
||||
@@ -0,0 +1,15 @@
|
||||
_help = "Help"
|
||||
changelog = "Help > Changelog"
|
||||
connect = "Connect"
|
||||
default = "Servers > "
|
||||
developers = "Options > Developers"
|
||||
keys = "Keybindings"
|
||||
log = "Help > Debug log"
|
||||
main_menu = "Main menu"
|
||||
mods = "Mods"
|
||||
offline = "Mods > Play offline"
|
||||
options = "Options"
|
||||
servers = "Servers > Server browser"
|
||||
thanks = "Help > Special thanks"
|
||||
something_wrong = "Something went wrong. See the detailed error below."
|
||||
workshop = "Enter/double click a row to open in Steam Workshop."
|
||||
@@ -0,0 +1,4 @@
|
||||
page_header = "Developers"
|
||||
paths_label = "Resolved XDG paths"
|
||||
prefs_label = "Boot preferences"
|
||||
columns = ["Key", "Value"]
|
||||
+33
-29
@@ -1,33 +1,37 @@
|
||||
waiting_for_launch = "Waiting for DayZ to launch"
|
||||
waiting_for_mods = "Queueing up mods (step 1/2)"
|
||||
waiting_for_directories = "Steam is staging mods (step 2/2)"
|
||||
|
||||
fetching_update = "Fetching update"
|
||||
failed_to_update = "Failed to update DZGUI executable"
|
||||
update_success = "Updated successfully. Please exit and relaunch."
|
||||
|
||||
load_error_lan = "Failed to find any servers on your network.\nCheck the server query port or your firewall settings."
|
||||
fetching_mods = "Fetching mod metadata"
|
||||
deleting_mods = "Unsubscribing mods"
|
||||
validating_mods = "Validating mods"
|
||||
scanning_mods = "Scanning mods"
|
||||
parsing_mods = "Parsing mods"
|
||||
|
||||
checking_api = "Checking API key"
|
||||
|
||||
running = "Running"
|
||||
failed = "FAILED"
|
||||
ok = "OK"
|
||||
|
||||
mission_dialog = "Set a mission folder location"
|
||||
custom_mod_dialog = "Set location to a custom mods folder"
|
||||
|
||||
caught_cancel_signal = "Caught cancel signal, cleaning up"
|
||||
confirm = "Confirmation"
|
||||
custom_mod_dialog = "Set a custom mod location"
|
||||
debug_heading = "Debug"
|
||||
debug_secondary = "Launch arguments"
|
||||
|
||||
toggle_calc = "Toggle calculator"
|
||||
|
||||
default_header = "DZGUI - Dialog"
|
||||
deleting_mods = "Unsubscribing mods"
|
||||
error = "Error"
|
||||
exit_app = "Exit"
|
||||
failed = "FAILED"
|
||||
failed_to_update = "Failed to update DZGUI executable"
|
||||
fetching_server = "Fetching server metadata"
|
||||
fetching_mods = "Fetching mod metadata"
|
||||
fetching_update = "Fetching update"
|
||||
filtering = "Filtering servers"
|
||||
load_error_lan = "Failed to find any servers on your network.\nCheck the server query port or your firewall settings."
|
||||
main_menu = "Return to main menu"
|
||||
mission_dialog = "Set a mission folder location"
|
||||
modlist = "Modlist"
|
||||
notice = "Notice"
|
||||
ok = "OK"
|
||||
parsing_mods = "Parsing mods"
|
||||
querying = "Querying server"
|
||||
restart_required = "App relaunch required"
|
||||
running = "Running"
|
||||
scanning_lan = "Scanning LAN ports"
|
||||
scanning_mods = "Scanning mods"
|
||||
server_details = "Server details"
|
||||
server_message = "Server message"
|
||||
|
||||
caught_cancel_signal = "Caught cancel signal, cleaning up"
|
||||
something_wrong = "Something went wrong. See the detailed error below."
|
||||
toggle_calc = "Toggle calculator"
|
||||
update_success = "Updated successfully. Please exit and relaunch."
|
||||
validating_mods = "Validating mods"
|
||||
wait = "Please wait"
|
||||
waiting_for_directories = "Steam is staging mods (step 2/2)"
|
||||
waiting_for_launch = "Waiting for DayZ to launch"
|
||||
waiting_for_mods = "Queueing up mods (step 1/2)"
|
||||
@@ -1,7 +1,14 @@
|
||||
api_validation_error = (
|
||||
"API key validation error. Key was typed incorrectly or is defunct."
|
||||
)
|
||||
|
||||
api_popover = "API key validation failed."
|
||||
cannot_acquire_lock = "DZGUI is already open."
|
||||
config_not_found = "DZGUI configuration file not found. Please exit and restart."
|
||||
dayz_not_found = "Could not find a valid DayZ installation."
|
||||
no_mods = "No local mods found."
|
||||
no_servers = "No server metadata to list."
|
||||
requires_steam = (
|
||||
"Your chosen client (Steam/Flatpak Steam) must be installed on the system."
|
||||
)
|
||||
server_timeout = "Timed out when querying server(s). Check IP or try again later."
|
||||
workshop_endpoint_error = "Steam Workshop service unavailable, try again later."
|
||||
@@ -0,0 +1,2 @@
|
||||
debug_picker_title = "Save the debug log to a file"
|
||||
diagnostic_picker_title = "Save system diagnostics to a file"
|
||||
@@ -0,0 +1,5 @@
|
||||
description = "DayZ server browser and mod manager"
|
||||
version = "print version information"
|
||||
uninstall = "clean up state/config files"
|
||||
debug = "enable developer debugging features"
|
||||
map_count = "check and update system map count value"
|
||||
@@ -0,0 +1,41 @@
|
||||
navigation = {
|
||||
"Enter/space/double click": "select row item",
|
||||
"Down arrow": "move down a row/scroll down",
|
||||
"Up arrow": "move up a row/scroll up",
|
||||
"Right arrow": "jump to sidebar from main area",
|
||||
"Left arrow": "jump to main area from sidebar",
|
||||
"Tab": "cycle forward through elements",
|
||||
"Shift-tab": "cycle backward through elements",
|
||||
"ESC/Enter": "close dialogs",
|
||||
"?": "show/hide this dialog",
|
||||
"Ctrl-q": "Quit",
|
||||
}
|
||||
servers = {
|
||||
"Enter/space/double-click": "connect to server",
|
||||
"Right-click/Ctrl-l": "additional context menus",
|
||||
"Ctrl-r": "refresh players",
|
||||
"Ctrl-f": "jump to keyword search field",
|
||||
"Ctrl-m": "jump to maps field",
|
||||
"Ctrl-d": "select default LAN port",
|
||||
"Ctrl-n": "select custom LAN port",
|
||||
"Ctrl-u": "connect to server from preconnect dialog",
|
||||
"Ctrl-i": "jump to IP insert field",
|
||||
"n": "navigate to next tab",
|
||||
"p": "navigate to previous tab",
|
||||
"ESC": "return to table",
|
||||
"1-9": "toggle filter 1-9 on/off",
|
||||
"0": "toggle filter 10",
|
||||
"Minus": "toggle filter 11",
|
||||
"Backslash": "toggle filter 12",
|
||||
"Apostrophe": "toggle filter 13",
|
||||
}
|
||||
vim = {
|
||||
"j": "Move down a row/scroll up",
|
||||
"k": "Move up a row/scroll down",
|
||||
"h": "Jump to main area from sidebar",
|
||||
"l": "Jump to sidebar from main area",
|
||||
"g": "Jump to first row/top of page",
|
||||
"G": "Jump to last row/bottom of page",
|
||||
}
|
||||
key_contexts = ["Servers", "Navigation", "Vim-style keys"]
|
||||
key_header = "Keybindings"
|
||||
@@ -0,0 +1,19 @@
|
||||
# TODO: column order is deterministic, these should not be stored here
|
||||
browser_cols = [
|
||||
"Name",
|
||||
"Map",
|
||||
"View",
|
||||
"Gametime",
|
||||
"Players",
|
||||
"Max",
|
||||
"Queue",
|
||||
"IP",
|
||||
"Qport",
|
||||
"Ping",
|
||||
]
|
||||
log_cols = ["Timestamp", "Flag", "Traceback", "Message"]
|
||||
mod_cols = ["Mod", "Symlink", "ID", "Size (MiB)", "Color"]
|
||||
servers_browser = "Server Browser"
|
||||
servers_lan = "LAN"
|
||||
servers_recent = "Recent"
|
||||
servers_saved = "Saved Servers"
|
||||
@@ -0,0 +1,28 @@
|
||||
all_maps = "All maps"
|
||||
disabled = "Disabled"
|
||||
dlc_badlands = "Badlands"
|
||||
dlc_frostline = "Frostline"
|
||||
dlc_none = "None"
|
||||
enabled = "Enabled"
|
||||
filter_1pp = "1PP"
|
||||
filter_3pp = "3PP"
|
||||
filter_day = "Day"
|
||||
filter_duplicate = "Duplicate"
|
||||
filter_empty = "Empty"
|
||||
filter_full = "Full"
|
||||
filter_lowpop = "Low pop"
|
||||
filter_modded = "Modded"
|
||||
filter_night = "Night"
|
||||
filter_nonascii = "Non-ASCII"
|
||||
filter_official = "Official"
|
||||
filter_unmodded = "Unmodded"
|
||||
filter_unofficial = "Unofficial"
|
||||
filters_heading = "Filters"
|
||||
keyword_placeholder = "Filter by keyword"
|
||||
linux = "Linux"
|
||||
map_placeholder = "Filter by map"
|
||||
none_provided = "None provided"
|
||||
null = "-"
|
||||
unknown = "Unknown"
|
||||
unspecified = "not specified"
|
||||
windows = "Windows"
|
||||
@@ -0,0 +1,20 @@
|
||||
bulk_select = "Bulk selects all currently highlighted mods"
|
||||
clear_highlights = "Clears highlights and reverts the table to a default state"
|
||||
header = "Mod actions"
|
||||
highlight_stale = "Highlight stale"
|
||||
highlight_stale_tooltip = (
|
||||
"Shows locally-installed mods which are not \n"
|
||||
"used by any server in your Saved Servers"
|
||||
)
|
||||
select_all = "Select all"
|
||||
select_all_tooltip = "Bulk selects all mods"
|
||||
select_stale = "Select stale"
|
||||
select_stale_tooltip = "Only selects highlighted stale mods"
|
||||
unhighlight_stale = "Unhighlight stale"
|
||||
unhighlight_stale_tooltip = "Clears highlight from stale mods"
|
||||
unselect_all = "Unselect all"
|
||||
unselect_all_tooltip = "Bulk unselects all mods"
|
||||
unsub_selected = "Unsubscribe selected"
|
||||
unsub_selected_tooltip = "Unsubscribes from selected mods"
|
||||
validate = "Validate selected"
|
||||
validate_tooltip = "Validates selected mods and updates them if necessary"
|
||||
+28
-22
@@ -1,28 +1,34 @@
|
||||
developers = "Developers"
|
||||
start_tab = "Start tab"
|
||||
workshop_label = "Subscribed mods"
|
||||
steam_combo = "Steam"
|
||||
flatpak_combo = "Flatpak"
|
||||
flatpak_container_combo = "Flatpak (container)"
|
||||
|
||||
steam_placeholder = "Enter your Steam API key"
|
||||
name_placeholder = "Identifies you to other players"
|
||||
|
||||
server_combo = "Server browser"
|
||||
saved_combo = "Saved servers"
|
||||
recent_combo = "Recent"
|
||||
lan_combo = "LAN"
|
||||
|
||||
fullscreen_eventbox = "This option is not available on Steam Deck."
|
||||
save_button = "Save"
|
||||
|
||||
api_placeholder = "Enter API key"
|
||||
always_fs = "Always fullscreen"
|
||||
api_failed = "API validation failed"
|
||||
api_key = "API Key"
|
||||
api_placeholder = "Enter API key"
|
||||
api_validate = "Validate"
|
||||
|
||||
flatpak_label = "Flatpak client"
|
||||
flatpak_standard = "Standard"
|
||||
developers = "Developers"
|
||||
distance = "Distance display"
|
||||
flatpak_combo = "Flatpak"
|
||||
flatpak_container = "Containerized (flatpak-spawn --host)"
|
||||
flatpak_container_combo = "Flatpak (container)"
|
||||
flatpak_info = (
|
||||
"Containerized mode is used on certain distributions. May have side effects."
|
||||
)
|
||||
flatpak_label = "Flatpak client"
|
||||
flatpak_standard = "Standard"
|
||||
fullscreen_eventbox = "This option is not available on Steam Deck."
|
||||
header = "Options"
|
||||
km = "km (kilometers)"
|
||||
lan_combo = "LAN"
|
||||
last_used = "Last used dimensions"
|
||||
mi = "mi (miles)"
|
||||
name = "Player name"
|
||||
name_placeholder = "Identifies you to other players"
|
||||
prefs = "Preferences"
|
||||
recent_combo = "Recent"
|
||||
save_button = "Save"
|
||||
saved_combo = "Saved servers"
|
||||
server_combo = "Server browser"
|
||||
start_tab = "Start tab"
|
||||
steam_combo = "Steam"
|
||||
steam_placeholder = "Enter your Steam API key"
|
||||
steam_web = "Steam API page"
|
||||
version = "Version"
|
||||
window_size = "Window size at boot"
|
||||
@@ -7,9 +7,12 @@ log_status = "Read the DZGUI log generated since startup"
|
||||
separator_label = "SEPARATOR"
|
||||
separator_status = ""
|
||||
|
||||
system_log_label = "Output system info to log file"
|
||||
system_log_label = "Output system info to a file"
|
||||
system_log_status = "Dump diagnostic data for troubleshooting"
|
||||
|
||||
debug_log_label = "Output debug log to a file"
|
||||
debug_log_status = "Dump a summary of errors/events since DZGUI started"
|
||||
|
||||
docs_label = "Documentation/help files (GitHub) ⧉"
|
||||
docs_status = "Open the DZGUI documentation in a browser"
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
exit_label = "Exit"
|
||||
exit_tooltip = "Quits the application"
|
||||
help_label = "Help"
|
||||
help_tooltip = "Troubleshooting and documentation"
|
||||
mods_label = "Mods"
|
||||
mods_tooltip = "Manage local mods"
|
||||
options_label = "Options"
|
||||
options_tooltip = "Advanced options"
|
||||
servers_label = "Servers"
|
||||
servers_tooltip = "Search for and connect to servers"
|
||||
@@ -0,0 +1,2 @@
|
||||
esc_to_return = "Press ESC to return"
|
||||
question_to_return = "Press ? to return"
|
||||
@@ -0,0 +1,24 @@
|
||||
header = "# Special thanks"
|
||||
description = (
|
||||
"This page recognizes beta testers, collaborators, code "
|
||||
"contributors, and sponsors of the project in alphabetical order.\n"
|
||||
"If you wish to be removed from this list, please submit a ticket."
|
||||
)
|
||||
users = [
|
||||
"bongjutsu",
|
||||
"Deku",
|
||||
"dj3hac",
|
||||
"finntux",
|
||||
"GaryBlackbourne",
|
||||
"jiriks74",
|
||||
"Johnofwrong",
|
||||
"MatheusLasserr",
|
||||
"nolan-perez",
|
||||
"OnniSaarni",
|
||||
"scandalouss",
|
||||
"SnackSBR",
|
||||
"StevelDusa",
|
||||
"sylvaingirardbe",
|
||||
"Thoughtduck216",
|
||||
"u-alexandru",
|
||||
]
|
||||
@@ -3,7 +3,7 @@ title_intro = "Welcome"
|
||||
blurb_intro = """
|
||||
This wizard will help you set up some common config options before launching the application.
|
||||
"""
|
||||
error_sandbox = "Setup cannot be run from inside Flatpak sandbox.\nPlease launch the application directly."
|
||||
error_sandbox = "Setup cannot be run from inside a sandboxed version of Steam (Snap/Flatpak).\nPlease launch the application directly first."
|
||||
welcome = "Welcome to {0}!"
|
||||
|
||||
### SteamPathPage
|
||||
@@ -12,15 +12,15 @@ blurb_steam_path = """
|
||||
DZGUI needs to find the location to your default Steam installation.
|
||||
This will be used to determine whether (and where) DayZ is installed.
|
||||
"""
|
||||
desc_custom_path = "This is the expected Steam path <b>if you set a custom XDG_DATA_HOME directory.</b>"
|
||||
desc_default_path = "This is the default Steam path on <b>most distributions</b>."
|
||||
desc_flatpak_path = (
|
||||
"This is the default Steam path if you are using <b>Flatpak Steam</b>."
|
||||
)
|
||||
desc_ubuntu_path = "This is the default Steam path on <b>Ubuntu-based systems</b>."
|
||||
desc_snap_path = "This is the default Steam path on <b>systems using Snap packages</b>."
|
||||
desc_debian_path = "This is the default Steam path on <b>Debian-based systems</b>."
|
||||
no_valid_paths = (
|
||||
"No valid Steam path or Steam command found on system. Please install Steam to continue."
|
||||
)
|
||||
no_valid_paths = "No valid Steam path or Steam command found on system. Please install Steam to continue."
|
||||
button_scan = "Scan for Steam"
|
||||
|
||||
### ConfigMigrationPage
|
||||
@@ -73,7 +73,7 @@ checkbox_steam_shortcut = (
|
||||
"This creates a standalone copy of DZGUI and adds it to Steam. "
|
||||
"You <b>must restart Steam</b> for the shortcut to appear. This will not replace or update existing shortcuts. "
|
||||
"If you update DZGUI when it is launched via Steam, updates will be applied to the Steam version. "
|
||||
"Not available if you selected the Flatpak client as your Steam default."
|
||||
"Not available if you selected the Snap client as your Steam default."
|
||||
),
|
||||
)
|
||||
checkbox_start_menu = (
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ from dzgui.const.constants import APP_NAME
|
||||
from dzgui.const.enum import Preferences
|
||||
from dzgui.config.query import lookup
|
||||
from dzgui.init.prefix import get_version
|
||||
from dzgui.strings import metadata
|
||||
from dzgui.util.redact import redact_home
|
||||
from dzgui.util.strings import unknown
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -43,7 +43,7 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
|
||||
distro = platform.freedesktop_os_release()["ID_LIKE"]
|
||||
except Exception as e:
|
||||
logger.warn(e)
|
||||
distro = unknown
|
||||
distro = metadata.unknown
|
||||
|
||||
kernel = os.uname().release
|
||||
cpu = get_cpu_model()
|
||||
|
||||
+3
-2
@@ -10,8 +10,9 @@ from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, IMAGES_PATH
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
|
||||
def make_parents(path: "Path") -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
def make_parents(path: "Path", descend: bool = False) -> None:
|
||||
p = path if descend else path.parent
|
||||
p.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def copy_dzgui_to_xdg_data(exe_path: Path) -> None:
|
||||
|
||||
@@ -2,8 +2,7 @@ import re
|
||||
from typing import Any
|
||||
|
||||
from dzgui.util.localize import number
|
||||
from dzgui.strings.generic import selectable_tree
|
||||
from dzgui.util.strings import no_mods, no_servers, workshop
|
||||
from dzgui.strings import crumbs, errors, generic
|
||||
|
||||
import gi
|
||||
|
||||
@@ -45,10 +44,10 @@ def format_hyperlinks(text: str) -> str:
|
||||
|
||||
def format_mods(size: int, mods: int) -> str:
|
||||
if mods == 0:
|
||||
return no_mods
|
||||
return errors.no_mods
|
||||
l_size = number(size)
|
||||
plural = pluralize("mods", mods)
|
||||
suffix = selectable_tree
|
||||
suffix = generic.selectable_tree
|
||||
return f"Found {mods:n} {plural} taking up {l_size} MiB. {suffix}"
|
||||
|
||||
|
||||
@@ -58,7 +57,7 @@ def format_mib(bits: int) -> float:
|
||||
|
||||
def format_server_mods(mods: int) -> str:
|
||||
plural = pluralize("mods", mods)
|
||||
return f"Found {mods:n} {plural}. {workshop}"
|
||||
return f"Found {mods:n} {plural}. {crumbs.workshop}"
|
||||
|
||||
|
||||
def format_player_count(model: Gtk.TreeModel | None, control: list[Any]) -> str:
|
||||
@@ -66,7 +65,7 @@ def format_player_count(model: Gtk.TreeModel | None, control: list[Any]) -> str:
|
||||
hits: int
|
||||
status: str
|
||||
if model is None:
|
||||
return no_servers
|
||||
return errors.no_servers
|
||||
else:
|
||||
hits = len(model)
|
||||
for row in model:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Callable
|
||||
|
||||
def immutable_dataclass(cls: type | None = None, **kwargs: bool) -> type | Callable[[type], type]:
|
||||
kwargs["slots"] = True
|
||||
kwargs["frozen"] = True
|
||||
if cls is None:
|
||||
return lambda c: dataclass(c, **kwargs)
|
||||
return dataclass(cls, **kwargs)
|
||||
+2
-3
@@ -1,10 +1,10 @@
|
||||
import a2s
|
||||
from ipaddress import ip_address
|
||||
import requests
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from dataclasses import dataclass
|
||||
from ipaddress import ip_address
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.api.servers import Record
|
||||
@@ -12,12 +12,11 @@ from dzgui.config.ipdb import read_from_table
|
||||
from dzgui.const.constants import REQUEST_TIMEOUT
|
||||
from dzgui.const.endpoints import IP_ECHO
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Coords:
|
||||
lat: float
|
||||
lon: float
|
||||
|
||||
@@ -1,546 +0,0 @@
|
||||
from dataclasses import dataclass
|
||||
from dzgui.const.constants import SYSTEM_LOG
|
||||
|
||||
|
||||
# General
|
||||
dialog_header = "DZGUI - Dialog"
|
||||
dz = "DayZ"
|
||||
dz_exp = "DayZ Experimental"
|
||||
delimiter = "␞"
|
||||
|
||||
# GenericDialog
|
||||
main_menu = "Return to main menu"
|
||||
exit_app = "Exit"
|
||||
modlist = "Modlist"
|
||||
input_required = "User input required"
|
||||
confirm = "Confirmation"
|
||||
notice = "Notice"
|
||||
wait = "Please wait"
|
||||
restart_required = "App relaunch required"
|
||||
|
||||
# Wait dialogs
|
||||
ping = "Ping"
|
||||
mod = "Mod"
|
||||
_id = "ID"
|
||||
|
||||
# ContextMenu
|
||||
add_note = "Add note"
|
||||
edit_note = "Edit note"
|
||||
show_mods = "Show server-side mods"
|
||||
show_details = "Show server details"
|
||||
refresh_players = "Refresh player count"
|
||||
open_workshop = "Open in Steam Workshop"
|
||||
unsub_mod = "Unsubscribe mod"
|
||||
validate_mod = "Validate mod"
|
||||
copy_name = "Copy name to clipboard"
|
||||
copy_ip = "Copy IP to clipboard"
|
||||
copy_log = "Copy record(s) to clipboard"
|
||||
add = "Add to Saved Servers"
|
||||
add_fav = "Set as favorite"
|
||||
remove = "Remove from Saved Servers"
|
||||
remove_history = "Remove from history"
|
||||
connect = "Connect"
|
||||
|
||||
# Columns
|
||||
server_mod_cols = ["Mod", "ID", "Installed"]
|
||||
mod_cols = ["Mod", "Symlink", "ID", "Size (MiB)", "Color"]
|
||||
log_cols = ["Timestamp", "Flag", "Traceback", "Message"]
|
||||
browser_cols = [
|
||||
"Name",
|
||||
"Map",
|
||||
"View",
|
||||
"Gametime",
|
||||
"Players",
|
||||
"Max",
|
||||
"Queue",
|
||||
"IP",
|
||||
"Qport",
|
||||
"Ping",
|
||||
]
|
||||
|
||||
# DetailsDialog
|
||||
workshop = "Enter/double click a row to open in Steam Workshop."
|
||||
|
||||
# LanDialog
|
||||
default_port = "Use default query port (27016)"
|
||||
custom_port = "Enter custom query port"
|
||||
scan_servers = "Scan LAN servers"
|
||||
select_port = "Select the query port"
|
||||
|
||||
# Errors
|
||||
error_heading = "Error"
|
||||
config_not_found = "DZGUI configuration file not found. Please exit and restart."
|
||||
cannot_acquire_lock = "DZGUI is already open."
|
||||
something_wrong = "Something went wrong. See the detailed error below."
|
||||
steam_key_missing = "No Steam API key is set."
|
||||
malformed_mods = "Found mods on system, but was unable to parse results."
|
||||
steam_missing = "Local Steam installation is not set, possibly malformed config file."
|
||||
build_corrupted = (
|
||||
"Steam settings or DayZ installation may be corrupted. Try restarting Steam."
|
||||
)
|
||||
server_timeout = "Timed out when querying server(s). Check IP or try again later."
|
||||
server_error = (
|
||||
"Error while contacting server, possibly timed out. Please wait and try again."
|
||||
)
|
||||
server_protected = (
|
||||
"This server is password-protected and you will be "
|
||||
"prompted when connecting. Do you want to proceed?"
|
||||
)
|
||||
|
||||
|
||||
# KeybindingsDialog
|
||||
navigation = {
|
||||
"Enter/space/double click": "select row item",
|
||||
"Down arrow": "move down a row/scroll down",
|
||||
"Up arrow": "move up a row/scroll up",
|
||||
"Right arrow": "jump to sidebar from main area",
|
||||
"Left arrow": "jump to main area from sidebar",
|
||||
"Tab": "cycle forward through elements",
|
||||
"Shift-tab": "cycle backward through elements",
|
||||
"ESC/Enter": "close dialogs",
|
||||
"?": "show/hide this dialog",
|
||||
"Ctrl-q": "Quit",
|
||||
}
|
||||
servers = {
|
||||
"Enter/space/double-click": "connect to server",
|
||||
"Right-click/Ctrl-l": "additional context menus",
|
||||
"Ctrl-r": "refresh players",
|
||||
"Ctrl-f": "jump to keyword search field",
|
||||
"Ctrl-m": "jump to maps field",
|
||||
"Ctrl-d": "select default LAN port",
|
||||
"Ctrl-n": "select custom LAN port",
|
||||
"Ctrl-u": "connect to server from preconnect dialog",
|
||||
"Ctrl-i": "jump to IP insert field",
|
||||
"n": "navigate to next tab",
|
||||
"p": "navigate to previous tab",
|
||||
"ESC": "return to table",
|
||||
"1-9": "toggle filter 1-9 on/off",
|
||||
"0": "toggle filter 10",
|
||||
"Minus": "toggle filter 11",
|
||||
"Backslash": "toggle filter 12",
|
||||
"Apostrophe": "toggle filter 13",
|
||||
}
|
||||
vim = {
|
||||
"j": "Move down a row/scroll up",
|
||||
"k": "Move up a row/scroll down",
|
||||
"h": "Jump to main area from sidebar",
|
||||
"l": "Jump to sidebar from main area",
|
||||
"g": "Jump to first row/top of page",
|
||||
"G": "Jump to last row/bottom of page",
|
||||
}
|
||||
key_contexts = ["Servers", "Navigation", "Vim-style keys"]
|
||||
key_header = "Keybindings"
|
||||
|
||||
# ModSelectionPanel
|
||||
|
||||
# labels
|
||||
label_main_menu = "Main menu"
|
||||
|
||||
# buttons
|
||||
ping_servers = "Ping servers"
|
||||
ping_tooltip = (
|
||||
"Refresh the ping for visible servers.\n" "Available once per unique filter context"
|
||||
)
|
||||
|
||||
# statusbar_helptext = "Select a row to see its detailed description"
|
||||
# statusbar_helptext = "No server metadata to list."
|
||||
|
||||
# use e.g. filters.1pp
|
||||
filter_1pp = "1PP"
|
||||
filter_3pp = "3PP"
|
||||
filter_day = "Day"
|
||||
filter_night = "Night"
|
||||
filter_empty = "Empty"
|
||||
filter_full = "Full"
|
||||
filter_lowpop = "Low pop"
|
||||
filter_nonascii = "Non-ASCII"
|
||||
filter_duplicate = "Duplicate"
|
||||
filter_official = "Official"
|
||||
filter_unofficial = "Unofficial"
|
||||
filter_modded = "Modded"
|
||||
filter_unmodded = "Unmodded"
|
||||
|
||||
# state
|
||||
unknown = "Unknown"
|
||||
none_provided = "None provided"
|
||||
disabled = "Disabled"
|
||||
enabled = "Enabled"
|
||||
null = "-"
|
||||
unspecified = "not specified"
|
||||
|
||||
# DLC
|
||||
dlc_frostline = "Frostline"
|
||||
dlc_badlands = "Badlands"
|
||||
dlc_none = "None"
|
||||
|
||||
# platform
|
||||
windows = "Windows"
|
||||
linux = "Linux"
|
||||
|
||||
# misc
|
||||
self_workshop = "Open Steam workshop"
|
||||
settings_updated = "Settings updated!"
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class ModPanelStrings:
|
||||
header: str
|
||||
unhighlight_stale: str
|
||||
unhighlight_stale_tooltip: str
|
||||
highlight_stale: str
|
||||
highlight_stale_tooltip: str
|
||||
unsub_selected: str
|
||||
unsub_selected_tooltip: str
|
||||
unselect_all: str
|
||||
unselect_all_tooltip: str
|
||||
select_all: str
|
||||
select_all_tooltip: str
|
||||
bulk_select: str
|
||||
clear_highlights: str
|
||||
select_stale: str
|
||||
select_stale_tooltip: str
|
||||
validate: str
|
||||
validate_tooltip: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Dialog:
|
||||
querying: str
|
||||
fetching: str
|
||||
filtering: str
|
||||
refreshing: str
|
||||
details: str
|
||||
modlist: str
|
||||
working: str
|
||||
updating_mods: str
|
||||
scanning: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Init:
|
||||
is_steam_running: str
|
||||
is_dayz_running: str
|
||||
requires_steam: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Button:
|
||||
servers_label: str
|
||||
servers_tooltip: str
|
||||
mods_label: str
|
||||
mods_tooltip: str
|
||||
options_label: str
|
||||
options_tooltip: str
|
||||
help_label: str
|
||||
help_tooltip: str
|
||||
exit_label: str
|
||||
exit_tooltip: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Crumbs:
|
||||
changelog: str
|
||||
keys: str
|
||||
log: str
|
||||
_help: str
|
||||
mods: str
|
||||
options: str
|
||||
servers: str
|
||||
thanks: str
|
||||
developers: str
|
||||
default: str
|
||||
offline: str
|
||||
connect: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Thanks:
|
||||
header: str
|
||||
description: str
|
||||
users: list[str]
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Options:
|
||||
header: str
|
||||
steam_web: str
|
||||
enter_steam: str
|
||||
steam_placeholder: str
|
||||
name_placeholder: str
|
||||
last_used: str
|
||||
always_fs: str
|
||||
steam: str
|
||||
flatpak: str
|
||||
km: str
|
||||
mi: str
|
||||
client: str
|
||||
window_size: str
|
||||
distance: str
|
||||
name: str
|
||||
manual_dl: str
|
||||
auto_dl: str
|
||||
update: str
|
||||
install_mode: str
|
||||
force_update: str
|
||||
dl_eventbox: str
|
||||
force_eventbox: str
|
||||
self_update: str
|
||||
no_self_update: str
|
||||
api_key: str
|
||||
prefs: str
|
||||
mods: str
|
||||
version: str
|
||||
branch: str
|
||||
stable: str
|
||||
testing: str
|
||||
manual_sub_msg: str
|
||||
|
||||
|
||||
init = Init(
|
||||
is_steam_running="Is Steam running? DZGUI must be run on top of Steam.",
|
||||
is_dayz_running="Is DayZ already running? DZGUI cannot launch DayZ if another process is using it.",
|
||||
requires_steam="Your chosen client (Steam/Flatpak Steam) must be installed on the system.",
|
||||
)
|
||||
|
||||
mod_panel = ModPanelStrings(
|
||||
header="Mod actions",
|
||||
unhighlight_stale="Unhighlight stale",
|
||||
unhighlight_stale_tooltip="Clears highlight from stale mods",
|
||||
highlight_stale="Highlight stale",
|
||||
highlight_stale_tooltip=(
|
||||
"Shows locally-installed mods which are not \n"
|
||||
"used by any server in your Saved Servers"
|
||||
),
|
||||
unsub_selected="Unsubscribe selected",
|
||||
unsub_selected_tooltip="Unsubscribes from selected mods",
|
||||
unselect_all="Unselect all",
|
||||
unselect_all_tooltip="Bulk unselects all mods",
|
||||
select_all="Select all",
|
||||
select_all_tooltip="Bulk selects all mods",
|
||||
bulk_select="Bulk selects all currently highlighted mods",
|
||||
clear_highlights="Clears highlights and reverts the table to a default state",
|
||||
select_stale="Select stale",
|
||||
select_stale_tooltip="Only selects highlighted stale mods",
|
||||
validate="Validate selected",
|
||||
validate_tooltip="Validates selected mods and updates them if necessary",
|
||||
)
|
||||
|
||||
|
||||
thanks = Thanks(
|
||||
header="# Special thanks",
|
||||
description=(
|
||||
"This page recognizes beta testers, collaborators, code "
|
||||
"contributors, and sponsors of the project in alphabetical order.\n"
|
||||
"If you wish to be removed from this list, please submit a ticket."
|
||||
),
|
||||
users=[
|
||||
"bongjutsu",
|
||||
"Deku",
|
||||
"dj3hac",
|
||||
"finntux",
|
||||
"GaryBlackbourne",
|
||||
"jiriks74",
|
||||
"Johnofwrong",
|
||||
"MatheusLasserr",
|
||||
"nolan-perez",
|
||||
"OnniSaarni",
|
||||
"scandalouss",
|
||||
"SnackSBR",
|
||||
"StevelDusa",
|
||||
"Thoughtduck216",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
options = Options(
|
||||
header="Options",
|
||||
steam_web="Steam API page",
|
||||
enter_steam="Enter your Steam API key",
|
||||
steam_placeholder="Steam API key",
|
||||
name_placeholder="Identifies you to other players in-game",
|
||||
last_used="Last used dimensions",
|
||||
always_fs="Always fullscreen",
|
||||
steam="Steam",
|
||||
flatpak="Flatpak (experimental)",
|
||||
km="km (kilometers)",
|
||||
mi="mi (miles)",
|
||||
client="Steam client",
|
||||
window_size="Window size at boot",
|
||||
distance="Distance display",
|
||||
name="Player name",
|
||||
manual_dl="Manual",
|
||||
auto_dl="Auto",
|
||||
update="Update",
|
||||
install_mode="Mod install mode",
|
||||
force_update="Force update local mods",
|
||||
dl_eventbox=(
|
||||
"Manual: prompt to subscribe to mods in Steam. " "Auto: unmanned downloads."
|
||||
),
|
||||
force_eventbox="Synchronize all local mods. Automatic mode must be enabled.",
|
||||
self_update=(
|
||||
"Stable: only contains stable features. "
|
||||
"Testing: pre-release beta, contains new features."
|
||||
),
|
||||
no_self_update=(
|
||||
"In-app updates are disabled when DZGUI is "
|
||||
"installed globally (e.g., via package manager)."
|
||||
),
|
||||
api_key="API Key",
|
||||
prefs="Preferences",
|
||||
mods="Mods",
|
||||
version="Version",
|
||||
branch="DZGUI branch",
|
||||
stable="Stable",
|
||||
testing="Testing",
|
||||
manual_sub_msg="""When switching from MANUAL to AUTO mod install mode,
|
||||
DZGUI will manage mod installation and deletion for you.
|
||||
To prevent conflicts with Steam Workshop subscriptions and old mods from being downloaded
|
||||
when Steam updates, you should unsubscribe from any existing Workshop mods you manually subscribed to.
|
||||
Open your Profile, then 'Workshop Items' and select 'Unsubscribe from all'
|
||||
on the right-hand side.
|
||||
""",
|
||||
)
|
||||
|
||||
dialog = Dialog(
|
||||
querying="Querying server",
|
||||
fetching="Fetching server metadata",
|
||||
filtering="Filtering servers",
|
||||
refreshing="Refreshing player count",
|
||||
details="Fetching details",
|
||||
modlist="Fetching modlist",
|
||||
working="Working",
|
||||
updating_mods="Updating mods",
|
||||
scanning="Scanning LAN ports",
|
||||
)
|
||||
|
||||
buttons = Button(
|
||||
servers_label="Servers",
|
||||
servers_tooltip="Search for and connect to servers",
|
||||
mods_label="Mods",
|
||||
mods_tooltip="Manage local mods",
|
||||
options_label="Options",
|
||||
options_tooltip="Advanced options",
|
||||
help_label="Help",
|
||||
help_tooltip="Troubleshooting and documentation",
|
||||
exit_label="Exit",
|
||||
exit_tooltip="Quits the application",
|
||||
)
|
||||
|
||||
crumbs = Crumbs(
|
||||
changelog="Help > Changelog",
|
||||
keys="Keybindings",
|
||||
log="Help > Debug log",
|
||||
_help="Help",
|
||||
mods="Mods",
|
||||
options="Options",
|
||||
servers="Servers > Server browser",
|
||||
thanks="Help > Special thanks",
|
||||
developers="Options > Developers",
|
||||
default="Servers > ",
|
||||
offline="Mods > Play offline",
|
||||
connect="Connect",
|
||||
)
|
||||
|
||||
no_mods = "No local mods found."
|
||||
no_servers = "No server metadata to list."
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Flags:
|
||||
description: str
|
||||
version: str
|
||||
uninstall: str
|
||||
debug: str
|
||||
map_count: str
|
||||
|
||||
|
||||
flags = Flags(
|
||||
description="DayZ server browser and mod manager",
|
||||
version="print version information",
|
||||
uninstall="clean up state/config files",
|
||||
debug="enable developer debugging features",
|
||||
map_count="check and update system map count value",
|
||||
)
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class FilePicker:
|
||||
title: str
|
||||
placeholder: str
|
||||
|
||||
|
||||
picker = FilePicker(
|
||||
title="Save diagnostic log to file",
|
||||
placeholder=SYSTEM_LOG,
|
||||
)
|
||||
|
||||
api_error = (
|
||||
"API key validation error or timeout. See 'Help > Show debug log' for details."
|
||||
)
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class DevelopersPage:
|
||||
header: str
|
||||
paths_label: str
|
||||
prefs_label: str
|
||||
columns: list[str]
|
||||
|
||||
|
||||
developers = DevelopersPage(
|
||||
header="Developers",
|
||||
paths_label="Resolved XDG paths",
|
||||
prefs_label="Boot preferences",
|
||||
columns=["Key", "Value"],
|
||||
)
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class ServerLabels:
|
||||
browser: str
|
||||
saved: str
|
||||
recent: str
|
||||
lan: str
|
||||
|
||||
|
||||
server_labels = ServerLabels(
|
||||
browser="Server Browser",
|
||||
saved="Saved Servers",
|
||||
recent="Recent",
|
||||
lan="LAN",
|
||||
)
|
||||
|
||||
|
||||
distance_suffix = "Distance: calculating..."
|
||||
dialog_error = "ERROR"
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class AtomicButton:
|
||||
refresh: str
|
||||
refresh_tooltip: str
|
||||
copy: str
|
||||
keys: str
|
||||
keys_tooltip: str
|
||||
|
||||
|
||||
atomic_buttons = AtomicButton(
|
||||
refresh="Refresh",
|
||||
refresh_tooltip="Refresh server data",
|
||||
copy="Copy",
|
||||
keys="Keys",
|
||||
keys_tooltip="Toggles the keybindings dialog",
|
||||
)
|
||||
|
||||
gtk_theme_missing = "No GTK theme provided"
|
||||
steam_icon_missing = "Steam icon not found in IconTheme"
|
||||
|
||||
missing_changelog = "Error: failed to read changelog"
|
||||
esc_to_return = "Press ESC to return"
|
||||
question_to_return = "Press ? to return"
|
||||
|
||||
alert_button_tooltip = "Click to open debug log"
|
||||
|
||||
address_already_saved = "This address is already in your Saved Servers"
|
||||
stop_scanning = "Stop scanning on first hit"
|
||||
abort_tooltip = "Unless you have multiple DayZ servers on your LAN,\nleave this checked to get results faster"
|
||||
@@ -35,6 +35,8 @@ def rebuild_symlinks(config: Path) -> None:
|
||||
expunge_link(file)
|
||||
|
||||
workshop = get_local_mod_path(steam_path)
|
||||
if workshop.is_dir() is False:
|
||||
return
|
||||
# NOTE: create symlinks for missing mods
|
||||
for mod_id in get_local_mod_ids(steam_path):
|
||||
uid = str(mod_id)
|
||||
|
||||
+5
-3
@@ -1,3 +1,4 @@
|
||||
import gi
|
||||
import logging
|
||||
import signal
|
||||
|
||||
@@ -34,8 +35,6 @@ from dzgui.views.pages.preconnect import PreConnectionAssistant
|
||||
from dzgui.views.pages.servers import ServerNotebook
|
||||
from dzgui.views.pages.thanks import Thanks
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
gi.require_version("GLibUnix", "2.0")
|
||||
from gi.repository import Gtk, GLib, GLibUnix, Gdk # type: ignore
|
||||
@@ -49,7 +48,10 @@ logger = logging.getLogger(APP_NAME)
|
||||
class OuterWindow(Gtk.ApplicationWindow):
|
||||
def __init__(self, app: "App") -> None:
|
||||
super().__init__(
|
||||
application=app, title=APP_NAME, border_width=10, icon_name=APP_NAME_LOWER
|
||||
application=app,
|
||||
title=APP_NAME,
|
||||
border_width=10,
|
||||
icon_name=APP_NAME_LOWER,
|
||||
)
|
||||
|
||||
self.hb = AppHeaderBar()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Sequence
|
||||
|
||||
import gi
|
||||
|
||||
from typing import Sequence
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
class GenericBox(Gtk.Box):
|
||||
|
||||
@@ -2,9 +2,6 @@ from typing import Callable, Literal, Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.util.clip import copy_clipboard
|
||||
from dzgui.strings import buttons
|
||||
from dzgui.util.strings import (
|
||||
atomic_buttons,
|
||||
)
|
||||
from dzgui.const.icons import (
|
||||
ICON_CLIPBOARD,
|
||||
ICON_CLOSE,
|
||||
@@ -99,7 +96,7 @@ class LargeIconTextButton(IconButton):
|
||||
|
||||
class ClipboardButton(IconTextButton):
|
||||
def __init__(self, func: Callable[[], str]) -> None:
|
||||
super().__init__(ICON_CLIPBOARD, atomic_buttons.copy)
|
||||
super().__init__(ICON_CLIPBOARD, buttons.copy_button)
|
||||
self.connect("clicked", self._on_button_clicked, func)
|
||||
|
||||
self.set_tooltip_text(buttons.clipboard_button)
|
||||
@@ -139,7 +136,7 @@ class RefreshButton(IconTextButton):
|
||||
def __init__(self, controller: "Controller") -> None:
|
||||
super().__init__(
|
||||
icon=ICON_REFRESH,
|
||||
label=atomic_buttons.refresh,
|
||||
label=buttons.refresh_button,
|
||||
)
|
||||
|
||||
self.controller = controller
|
||||
@@ -152,7 +149,7 @@ class RefreshButton(IconTextButton):
|
||||
self.set_margin_top(10)
|
||||
self.set_margin_start(80)
|
||||
self.set_margin_end(80)
|
||||
self.set_tooltip_text(atomic_buttons.refresh_tooltip)
|
||||
self.set_tooltip_text(buttons.refresh_tooltip)
|
||||
|
||||
self.connect("clicked", self._on_refresh_clicked)
|
||||
emitter.connect("servers_loaded", self._on_load)
|
||||
@@ -196,21 +193,21 @@ class RefreshButton(IconTextButton):
|
||||
|
||||
def show_time(self, state: bool) -> None:
|
||||
if state is True:
|
||||
self.set_label(f"{atomic_buttons.refresh} ({str(self.time)})")
|
||||
self.set_label(f"{buttons.refresh_button} ({str(self.time)})")
|
||||
else:
|
||||
self.set_label(atomic_buttons.refresh)
|
||||
self.set_label(buttons.refresh_button)
|
||||
|
||||
|
||||
class KeysButton(IconTextButton):
|
||||
def __init__(self, controller: "Controller") -> None:
|
||||
super().__init__(icon=ICON_INPUT_KEYBOARD, label=atomic_buttons.keys)
|
||||
super().__init__(icon=ICON_INPUT_KEYBOARD, label=buttons.keys_button)
|
||||
|
||||
self.controller = controller
|
||||
self.set_margin_top(10)
|
||||
self.set_margin_start(80)
|
||||
self.set_margin_end(80)
|
||||
|
||||
self.set_tooltip_text(atomic_buttons.keys_tooltip)
|
||||
self.set_tooltip_text(buttons.keys_button_tooltip)
|
||||
|
||||
self.connect("clicked", self._on_keys_clicked)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage
|
||||
from dzgui.util.strings import label_main_menu, crumbs
|
||||
from dzgui.strings import crumbs as _crumbs
|
||||
from dzgui.util.format import embolden
|
||||
|
||||
import gi
|
||||
@@ -19,7 +19,7 @@ class Breadcrumbs(Gtk.Label):
|
||||
def __init__(self, controller: "Controller") -> None:
|
||||
super().__init__(halign=Gtk.Align.START)
|
||||
|
||||
crumbs = embolden(label_main_menu)
|
||||
crumbs = embolden(_crumbs.main_menu)
|
||||
self.set_markup(crumbs)
|
||||
|
||||
notebook = controller.get_notebook()
|
||||
@@ -47,7 +47,7 @@ class Breadcrumbs(Gtk.Label):
|
||||
self.set_crumbs(crumbs)
|
||||
|
||||
def set_server_crumbs(self, suffix: str) -> None:
|
||||
self.set_crumbs(crumbs.default + suffix)
|
||||
self.set_crumbs(_crumbs.default + suffix)
|
||||
|
||||
def set_crumbs(self, crumbs: str) -> None:
|
||||
text = embolden(crumbs)
|
||||
|
||||
@@ -3,9 +3,7 @@ from typing import Any, Callable, TYPE_CHECKING
|
||||
from dzgui.api.servers import validate_ip
|
||||
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
||||
from dzgui.util.css import add_class, remove_class
|
||||
from dzgui.strings import connect_panel
|
||||
from dzgui.strings.options import api_placeholder, api_validate
|
||||
from dzgui.strings.errors import api_popover
|
||||
from dzgui.strings import connect_panel, errors, options
|
||||
|
||||
import gi
|
||||
|
||||
@@ -144,7 +142,7 @@ class APIEntry(Gtk.Box):
|
||||
self.func: Callable[[str], None] | None = None
|
||||
|
||||
self.entry = Gtk.Entry(
|
||||
width_chars=60, hexpand=True, placeholder_text=api_placeholder
|
||||
width_chars=60, hexpand=True, placeholder_text=options.api_placeholder
|
||||
)
|
||||
self.entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, ICON_VIEW_REVEAL)
|
||||
self.entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
|
||||
@@ -153,13 +151,13 @@ class APIEntry(Gtk.Box):
|
||||
self.entry.connect("icon-release", self._on_icon_release)
|
||||
self.entry.connect("activate", self._on_field_activated)
|
||||
|
||||
self.submit = Gtk.Button(label=api_validate)
|
||||
self.submit = Gtk.Button(label=options.api_validate)
|
||||
self.submit.set_sensitive(False)
|
||||
self.submit.connect("clicked", self._on_submit)
|
||||
|
||||
self.pop = Gtk.Popover()
|
||||
self.pop_label = Gtk.Label(
|
||||
label=api_popover,
|
||||
label=errors.api_popover,
|
||||
margin_start=10,
|
||||
margin_end=10,
|
||||
)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from typing import Self
|
||||
from dzgui.util import css
|
||||
|
||||
import gi
|
||||
|
||||
from typing import Self
|
||||
|
||||
from dzgui.util import css
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
# TODO: subclass Gtk.Frame directly
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import gi
|
||||
from typing import Self
|
||||
from warnings import deprecated
|
||||
|
||||
@@ -8,10 +9,8 @@ from dzgui.strings import options
|
||||
from dzgui.views.components.box import HBox
|
||||
from dzgui.views.components.buttons import Icon
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
@deprecated("Client choice is determined at setup time")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import ModButton
|
||||
from dzgui.util.strings import mod_panel
|
||||
from dzgui.strings import mod_panel
|
||||
from dzgui.views.components.labels import BoldLabel
|
||||
|
||||
import gi
|
||||
|
||||
@@ -106,14 +106,15 @@ class RightPanel(Gtk.Box):
|
||||
if page.loaded is True:
|
||||
return
|
||||
self.filters_vbox.set_sensitive(False)
|
||||
# TODO: unless it is lan page
|
||||
# self.refresh_button.set_sensitive(False)
|
||||
self.refresh_button.set_sensitive(False)
|
||||
|
||||
def _on_lan_page_init(self, emitter: "Emitter") -> None:
|
||||
self.filters_vbox.set_sensitive(False)
|
||||
|
||||
def _on_servers_loaded(self, emitter: "Emitter", context: "ServerTab") -> None:
|
||||
# TODO: similar logic on notebook page change
|
||||
# TODO: wipe maps store when changing tabs if model is None
|
||||
|
||||
state = self.controller.has_server_model()
|
||||
self.filters_vbox.set_sensitive(state)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
class NoOverlayScrolledWindow(Gtk.ScrolledWindow):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Self, Union, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage, ServerTab
|
||||
from dzgui.util.strings import esc_to_return, question_to_return
|
||||
from dzgui.strings import statusbar
|
||||
|
||||
import gi
|
||||
|
||||
@@ -70,14 +70,14 @@ class Statusbar(Gtk.Grid):
|
||||
NotebookPage.OFFLINE,
|
||||
):
|
||||
self.prior_enum = enum
|
||||
self.set_by_context(enum, esc_to_return)
|
||||
self.set_by_context(enum, statusbar.esc_to_return)
|
||||
return
|
||||
|
||||
match enum:
|
||||
case NotebookPage.HELP:
|
||||
bar = self.controller.get_help_row()
|
||||
case NotebookPage.KEYS:
|
||||
bar = question_to_return
|
||||
bar = statusbar.question_to_return
|
||||
case _:
|
||||
bar = self.prior_status
|
||||
|
||||
@@ -101,7 +101,7 @@ class Statusbar(Gtk.Grid):
|
||||
if type(context) is NotebookPage:
|
||||
self.prior_enum = context
|
||||
self.prior_status = ""
|
||||
# FIXME: CalcDist is being called when table is not loaded
|
||||
|
||||
if dist is None:
|
||||
self.set_by_context(context, "")
|
||||
return
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import gi
|
||||
import sys
|
||||
|
||||
from enum import Enum
|
||||
from typing import Any, Literal, Self, TYPE_CHECKING
|
||||
|
||||
# import time
|
||||
from enum import Enum
|
||||
|
||||
|
||||
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
||||
|
||||
# TODO: import dialog titles
|
||||
from dzgui.api.mods import remove_stale_signatures as remove_stale
|
||||
from dzgui.config.ipdb import get_ipdb
|
||||
from dzgui.const.constants import HEX_GREEN, HEX_RED
|
||||
@@ -17,15 +13,12 @@ from dzgui.init.update import check_updates
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.strings import preboot, dialogs
|
||||
from dzgui.util.format import format_exception
|
||||
from dzgui.util.strings import dialog_header
|
||||
from dzgui.util.symlink import rebuild_symlinks
|
||||
from dzgui.views.components.buttons import ClipboardButton
|
||||
|
||||
|
||||
import gi
|
||||
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GLib, Gdk # noqa
|
||||
from gi.repository import Gtk, GLib, Gdk, Pango
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.config.xdg import Xdg
|
||||
@@ -42,7 +35,7 @@ class Success(Enum):
|
||||
class BootDialog(ColorAwareApp, Gtk.Dialog): # type: ignore
|
||||
def __init__(self, parent: "BootWindow", xdg: "Xdg", version: str) -> None:
|
||||
super().__init__(
|
||||
title=dialog_header,
|
||||
title=dialogs.default_header,
|
||||
transient_for=parent,
|
||||
modal=True,
|
||||
)
|
||||
@@ -101,7 +94,7 @@ class BootDialog(ColorAwareApp, Gtk.Dialog): # type: ignore
|
||||
margin_top=30,
|
||||
margin_bottom=30,
|
||||
)
|
||||
self.error_label = Gtk.Label(margin_start=15, margin_end=15)
|
||||
self.error_label = Gtk.Label(margin_start=15, margin_end=15, wrap=True, wrap_mode=Pango.WrapMode.WORD)
|
||||
|
||||
# TODO: abstract class
|
||||
self.copy_button = ClipboardButton(self.error_label.get_text)
|
||||
|
||||
@@ -2,7 +2,7 @@ import textwrap
|
||||
import sys
|
||||
|
||||
from typing import Self
|
||||
from dzgui.util.strings import dialog_error, dialog_header
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
||||
|
||||
import gi
|
||||
@@ -14,8 +14,8 @@ from gi.repository import Gtk
|
||||
class AbortDialog(ColorAwareApp, Gtk.MessageDialog): # type: ignore
|
||||
def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None:
|
||||
super().__init__(
|
||||
title=dialog_header,
|
||||
text=dialog_error,
|
||||
title=dialogs.default_header,
|
||||
text=(dialogs.error).upper(),
|
||||
transient_for=None,
|
||||
buttons=buttons,
|
||||
)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.util.strings import picker
|
||||
from dzgui.const.constants import DEBUG_LOG, SYSTEM_LOG
|
||||
from dzgui.strings.filepickers import diagnostic_picker_title, debug_picker_title
|
||||
|
||||
import gi
|
||||
|
||||
@@ -9,9 +10,9 @@ from gi.repository import Gtk
|
||||
|
||||
|
||||
class FilePicker(Gtk.FileChooserDialog):
|
||||
def __init__(self, parent: Gtk.Window) -> None:
|
||||
def __init__(self, parent: Gtk.Window, title: str, placeholder: str) -> None:
|
||||
super().__init__(
|
||||
title=picker.title,
|
||||
title=title,
|
||||
action=Gtk.FileChooserAction.SAVE,
|
||||
transient_for=parent,
|
||||
resizable=True,
|
||||
@@ -20,7 +21,7 @@ class FilePicker(Gtk.FileChooserDialog):
|
||||
self.add_buttons("_Save", Gtk.ResponseType.OK) # type: ignore[no-untyped-call]
|
||||
self.set_default_response(Gtk.ResponseType.OK)
|
||||
|
||||
self.set_current_name(picker.placeholder)
|
||||
self.set_current_name(placeholder)
|
||||
|
||||
def pick_file(self) -> Path | None:
|
||||
res = self.run() # type: ignore[no-untyped-call]
|
||||
@@ -35,6 +36,16 @@ class FilePicker(Gtk.FileChooserDialog):
|
||||
return None
|
||||
|
||||
|
||||
class DiagnosticLogPicker(FilePicker):
|
||||
def __init__(self, parent: Gtk.Window) -> None:
|
||||
super().__init__(parent, diagnostic_picker_title, SYSTEM_LOG)
|
||||
|
||||
|
||||
class DebugLogPicker(FilePicker):
|
||||
def __init__(self, parent: Gtk.Window) -> None:
|
||||
super().__init__(parent, debug_picker_title, DEBUG_LOG)
|
||||
|
||||
|
||||
class FolderPicker(Gtk.FileChooserDialog):
|
||||
def __init__(self, parent: Gtk.Window, title: str) -> None:
|
||||
super().__init__(
|
||||
@@ -54,6 +65,7 @@ class FolderPicker(Gtk.FileChooserDialog):
|
||||
return None
|
||||
if res == Gtk.ResponseType.OK:
|
||||
folder = self.get_current_folder()
|
||||
# TODO: this should never be possible
|
||||
if folder is None:
|
||||
try:
|
||||
uri = self.get_uri()
|
||||
@@ -61,7 +73,7 @@ class FolderPicker(Gtk.FileChooserDialog):
|
||||
return None
|
||||
return Path.from_uri(uri)
|
||||
except Exception:
|
||||
# FIXME: edge cases
|
||||
# TODO: edge cases
|
||||
return Path("/")
|
||||
self.destroy()
|
||||
return Path(folder)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Literal, Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.util import strings
|
||||
from dzgui.views.components.buttons import ClipboardButton
|
||||
|
||||
import gi
|
||||
@@ -28,7 +27,7 @@ class GenericDialog(Gtk.MessageDialog):
|
||||
buttons=buttons,
|
||||
text=text,
|
||||
secondary_text=secondary,
|
||||
title=strings.dialog_header,
|
||||
title=dialogs.default_header,
|
||||
modal=True,
|
||||
)
|
||||
|
||||
@@ -52,7 +51,7 @@ class ConfirmationDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", secondary: str):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.confirm,
|
||||
text=dialogs.confirm,
|
||||
mtype=Gtk.MessageType.QUESTION,
|
||||
buttons=Gtk.ButtonsType.OK_CANCEL,
|
||||
secondary=secondary,
|
||||
@@ -63,7 +62,7 @@ class IgnoreDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", secondary: str):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.confirm,
|
||||
text=dialogs.confirm,
|
||||
mtype=Gtk.MessageType.QUESTION,
|
||||
buttons=Gtk.ButtonsType.OK_CANCEL,
|
||||
secondary=secondary,
|
||||
@@ -79,7 +78,7 @@ class NotifyDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", secondary: str):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.notice,
|
||||
text=dialogs.notice,
|
||||
mtype=Gtk.MessageType.INFO,
|
||||
buttons=Gtk.ButtonsType.OK,
|
||||
secondary=secondary,
|
||||
@@ -96,7 +95,7 @@ class WaitDialog(GenericDialog):
|
||||
):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.wait,
|
||||
text=dialogs.wait,
|
||||
mtype=Gtk.MessageType.INFO,
|
||||
buttons=Gtk.ButtonsType.NONE,
|
||||
secondary=secondary,
|
||||
@@ -150,14 +149,14 @@ class QuitDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", secondary: str):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.restart_required,
|
||||
text=dialogs.restart_required,
|
||||
mtype=Gtk.MessageType.INFO,
|
||||
buttons=Gtk.ButtonsType.NONE,
|
||||
secondary=secondary,
|
||||
)
|
||||
|
||||
self.controller = controller
|
||||
self.add_button(strings.exit_app, Gtk.ResponseType.OK)
|
||||
self.add_button(dialogs.exit_app, Gtk.ResponseType.OK)
|
||||
|
||||
self.connect("response", self._on_response)
|
||||
# TODO: superfluous with the above
|
||||
@@ -250,8 +249,8 @@ class ExceptionDialog(TextBufferDialog):
|
||||
def __init__(self, controller: "Controller", trace: str):
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
heading=strings.error_heading,
|
||||
secondary=strings.something_wrong,
|
||||
heading=dialogs.error,
|
||||
secondary=dialogs.something_wrong,
|
||||
text=trace,
|
||||
mtype=Gtk.MessageType.ERROR,
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import textwrap
|
||||
from typing import Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.util.strings import notice
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.views.dialogs.generic import GenericDialog
|
||||
from dzgui.views.components.buttons import SteamTextButton
|
||||
|
||||
@@ -22,7 +22,7 @@ class WorkshopLinkDialog(GenericDialog):
|
||||
text = textwrap.dedent(text).replace("\n", " ")
|
||||
super().__init__(
|
||||
controller,
|
||||
text=notice,
|
||||
text=dialogs.notice,
|
||||
mtype=Gtk.MessageType.INFO,
|
||||
buttons=Gtk.ButtonsType.OK,
|
||||
secondary=text,
|
||||
|
||||
@@ -15,7 +15,7 @@ from dzgui.views.dialogs.generic import GenericDialog
|
||||
from dzgui.views.trees.tree_base import TreeView
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, Pango # noqa
|
||||
from gi.repository import Gtk, Gdk, Pango
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.api.servers import Details
|
||||
|
||||
@@ -14,8 +14,10 @@ from dzgui.const.constants import (
|
||||
HERO_PATH,
|
||||
FLATPAK_ROOT_PATH,
|
||||
LEGACY_CONFIG_PATH,
|
||||
SNAP_STEAM_PATH,
|
||||
TMP_PATH,
|
||||
)
|
||||
from dzgui.config.xdg import get_real_home
|
||||
from dzgui.const.boilerplate import config_boilerplate
|
||||
from dzgui.const.endpoints import STEAM_API_SETUP
|
||||
from dzgui.config import freedesktop
|
||||
@@ -506,7 +508,8 @@ class Assistant(Gtk.Assistant):
|
||||
|
||||
self.pages: dict[EnumeratedWizardPage, int] = {}
|
||||
|
||||
legacy_path = Path.home().joinpath(LEGACY_CONFIG_PATH)
|
||||
home = get_real_home()
|
||||
legacy_path = home.joinpath(LEGACY_CONFIG_PATH)
|
||||
self.has_legacy_config = legacy_path.is_file()
|
||||
for page in (
|
||||
self.page_intro,
|
||||
@@ -699,6 +702,7 @@ class ShortcutCreationPage(OptionalPageMixin, EnumeratedWizardPage): # type: ig
|
||||
|
||||
self.add_start(self.checks_area)
|
||||
self.show_all()
|
||||
|
||||
self.connect("map", self._on_map)
|
||||
|
||||
def _on_start_menu_toggled(self, button: Gtk.CheckButton) -> None:
|
||||
@@ -709,6 +713,9 @@ class ShortcutCreationPage(OptionalPageMixin, EnumeratedWizardPage): # type: ig
|
||||
|
||||
def set_steam_path(self, path: Path) -> None:
|
||||
self.steam_path = path
|
||||
if SNAP_STEAM_PATH in str(self.steam_path):
|
||||
self.steam_checkbox.set_active(False)
|
||||
self.steam_checkbox.set_sensitive(False)
|
||||
|
||||
def is_steam_checkbox_active(self) -> bool:
|
||||
return self.steam_checkbox.get_active()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import gi
|
||||
|
||||
from typing import Any
|
||||
|
||||
from dzgui.const.constants import (
|
||||
@@ -7,10 +9,8 @@ from dzgui.const.constants import (
|
||||
GIO_SETTINGS_VAL,
|
||||
)
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gio # noqa
|
||||
from gi.repository import Gtk, Gio
|
||||
|
||||
|
||||
class ColorAwareApp:
|
||||
|
||||
@@ -2,8 +2,8 @@ import logging
|
||||
|
||||
from dzgui.const.constants import APP_NAME
|
||||
from dzgui.const.enum import ContextMenuItem
|
||||
from dzgui.strings import context_menu
|
||||
from dzgui.util.keys import is_ctrl_mask, is_navkey
|
||||
from dzgui.util.strings import edit_note
|
||||
from dzgui.views.trees.tree_base import TreeView
|
||||
|
||||
import gi
|
||||
@@ -70,7 +70,7 @@ class ContextMixin(TreeView):
|
||||
|
||||
if row == ContextMenuItem.ADD_NOTE:
|
||||
if self.controller.has_note():
|
||||
item.set_label(edit_note)
|
||||
item.set_label(context_menu.edit_note)
|
||||
|
||||
return item
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk # noqa
|
||||
from gi.repository import Gtk, Gdk
|
||||
|
||||
|
||||
class HelpMenuMixin:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import gi
|
||||
|
||||
from dzgui.const.enum import VAdjustment
|
||||
from dzgui.const.constants import SCROLL_INCREMENT
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk # noqa
|
||||
from gi.repository import Gtk, Gdk
|
||||
|
||||
|
||||
class ScrollableMixin:
|
||||
|
||||
@@ -7,7 +7,6 @@ from importlib import resources
|
||||
|
||||
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, CHANGELOG_PATH
|
||||
from dzgui.strings import changelog as clog
|
||||
from dzgui.util.strings import missing_changelog
|
||||
from dzgui.util.format import format_pango
|
||||
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||
@@ -30,8 +29,10 @@ class Changelog(HelpMenuMixin, ScrollableMixin, Gtk.ScrolledWindow): # type: ig
|
||||
try:
|
||||
changelog = resources.read_text(APP_NAME_LOWER, CHANGELOG_PATH)
|
||||
except OSError as e:
|
||||
# TODO: this string will never be parsable by self._parse()
|
||||
# need to update entire label area
|
||||
logger.critical(e)
|
||||
changelog = missing_changelog
|
||||
changelog = clog.missing_changelog
|
||||
|
||||
self.controller = controller
|
||||
self.box = Gtk.Box(
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Self, Union, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage
|
||||
from dzgui.util.css import add_class
|
||||
from dzgui.util.strings import developers
|
||||
from dzgui.strings import developers
|
||||
from dzgui.views.components.labels import BoldLabel
|
||||
from dzgui.views.trees.tree_base import TreeView
|
||||
|
||||
@@ -32,7 +32,7 @@ class Developers(Gtk.ScrolledWindow):
|
||||
orientation=Gtk.Orientation.VERTICAL, margin_start=10, margin_end=10
|
||||
)
|
||||
|
||||
heading = Gtk.Label(label=developers.header)
|
||||
heading = Gtk.Label(label=developers.page_header)
|
||||
heading.set_halign(Gtk.Align.CENTER)
|
||||
add_class(heading, "page-heading")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||
from dzgui.util.strings import navigation, servers, vim, key_header, key_contexts
|
||||
from dzgui.strings import keybindings
|
||||
from dzgui.util.css import add_class
|
||||
|
||||
import gi
|
||||
@@ -26,10 +26,12 @@ class Keybindings(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
self.controller = controller
|
||||
self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
label = Gtk.Label(label=key_header)
|
||||
label = Gtk.Label(label=keybindings.key_header)
|
||||
add_class(label, "page-heading")
|
||||
|
||||
grid = self.build_grid([servers, navigation, vim])
|
||||
grid = self.build_grid(
|
||||
[keybindings.servers, keybindings.navigation, keybindings.vim]
|
||||
)
|
||||
self.box.add(label)
|
||||
self.box.add(grid)
|
||||
self.add(self.box)
|
||||
@@ -94,7 +96,7 @@ class Keybindings(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
|
||||
row, column = 1, 1
|
||||
w, h = 1, 1
|
||||
sidebar = self.build_sidebar(key_contexts)
|
||||
sidebar = self.build_sidebar(keybindings.key_contexts)
|
||||
separator = Gtk.Separator()
|
||||
keys_box = self.build_keys(items)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import gi
|
||||
from pathlib import Path
|
||||
|
||||
from typing import Self, TYPE_CHECKING
|
||||
@@ -8,10 +9,8 @@ from dzgui.views.components.buttons import SteamWorkshopButton
|
||||
from dzgui.views.components.scrollable import NoOverlayScrolledWindow
|
||||
from dzgui.views.trees.tree_mods import ModTreeView
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import gi
|
||||
|
||||
from enum import Enum
|
||||
from typing import Self, TYPE_CHECKING, Union
|
||||
|
||||
from dzgui.util import css
|
||||
from dzgui.const.icons import ICON_EDIT_DELETE, ICON_FOLDER, ICON_WARNING
|
||||
from dzgui.const.constants import (
|
||||
APPID_DAYZ,
|
||||
APPID_DAYZ_EXP,
|
||||
@@ -11,8 +12,10 @@ from dzgui.const.constants import (
|
||||
APPNAME_DAYZ_EXP_HUMAN,
|
||||
)
|
||||
from dzgui.const.enum import ContextMenuGroup, NotebookPage
|
||||
from dzgui.const.icons import ICON_EDIT_DELETE, ICON_FOLDER, ICON_WARNING
|
||||
from dzgui.managers.offline import OfflineManager
|
||||
from dzgui.strings import generic, offline
|
||||
from dzgui.util import css
|
||||
from dzgui.views.components.box import HBox, VBox
|
||||
from dzgui.views.components.buttons import Icon, IconTextButton
|
||||
from dzgui.views.components.eventbox import InfoEventBox
|
||||
@@ -21,11 +24,8 @@ from dzgui.views.components.scrollable import NoOverlayScrolledWindow
|
||||
from dzgui.views.components.misc import ErrorPopover
|
||||
from dzgui.views.trees.tree_mods import OfflineModTreeView
|
||||
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GObject # noqa
|
||||
from gi.repository import Gtk, Gdk
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
@@ -136,7 +136,6 @@ class FolderHBox(HBox):
|
||||
self.folder = ""
|
||||
self.label.set_label("")
|
||||
self.unset_button.hide()
|
||||
# FIXME: rename signal
|
||||
self.emitter.emit("custom_mods_unloaded", self)
|
||||
|
||||
def get_button(self) -> Gtk.Button:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import gi
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, TYPE_CHECKING
|
||||
|
||||
from dzgui.api import pefile as PeFile
|
||||
from dzgui.api.steam import get_last_updated
|
||||
|
||||
from dzgui.config import query
|
||||
from dzgui.const.constants import (
|
||||
APPID_DAYZ,
|
||||
@@ -14,12 +15,11 @@ from dzgui.const.constants import (
|
||||
FLATPAK_SANDBOX,
|
||||
FLATPAK_STEAM_PATH,
|
||||
)
|
||||
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
||||
from dzgui.const.endpoints import STEAM_API_SETUP
|
||||
from dzgui.const.enum import Preferences, ServerTab
|
||||
from dzgui.strings import options
|
||||
from dzgui.util import strings, css, open_links
|
||||
|
||||
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
||||
from dzgui.strings import errors, metadata, options
|
||||
from dzgui.util import css, open_links
|
||||
from dzgui.views.components.box import ShortHBox, VBox
|
||||
from dzgui.views.components.eventbox import InfoEventBox
|
||||
from dzgui.views.components.labels import LeftLabel
|
||||
@@ -29,11 +29,8 @@ from dzgui.views.components.misc import ErrorPopover
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk # noqa
|
||||
from gi.repository import Gtk, Gdk
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
@@ -233,10 +230,19 @@ class ToggleField(Gtk.Box):
|
||||
self.pack_start(self.radio1, expand=False, fill=False, padding=0)
|
||||
self.pack_start(self.radio2, expand=False, fill=False, padding=0)
|
||||
|
||||
self.signal_id: int | None = None
|
||||
|
||||
def disconnect_signal(self) -> None:
|
||||
if self.signal_id is not None:
|
||||
self.radio1.disconnect(self.signal_id)
|
||||
|
||||
def set_suboption_active(self, state: bool) -> None:
|
||||
# NOTE: defer connection of signal until after state is set
|
||||
self.radio2.set_active(state)
|
||||
self.radio1.connect("toggled", self._on_radio_toggled, self.context)
|
||||
self.disconnect_signal()
|
||||
self.signal_id = self.radio1.connect(
|
||||
"toggled", self._on_radio_toggled, self.context
|
||||
)
|
||||
|
||||
def _on_radio_toggled(self, button: Gtk.RadioButton, context: Preferences) -> None:
|
||||
self.controller.toggle_config(context)
|
||||
@@ -282,12 +288,12 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
self.steam_entry: Gtk.Entry
|
||||
self.pop: Gtk.Popover
|
||||
|
||||
self.steam = WebButton(label=strings.options.steam_web)
|
||||
self.steam = WebButton(label=options.steam_web)
|
||||
self.steam.connect("clicked", self._on_link_button_clicked, STEAM_API_SETUP)
|
||||
|
||||
self.steam_box = SteamSubmitField(controller)
|
||||
api_rows = [
|
||||
[LeftLabel(strings.options.steam_placeholder), self.steam_box, self.steam],
|
||||
[LeftLabel(options.steam_placeholder), self.steam_box, self.steam],
|
||||
]
|
||||
|
||||
self.player_box = NameSubmitField(controller)
|
||||
@@ -297,13 +303,13 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
self.flatpak_toggle = FlatpakToggleField(self.controller)
|
||||
self.fullscreen_toggle = ToggleField(
|
||||
self.controller,
|
||||
strings.options.last_used,
|
||||
strings.options.always_fs,
|
||||
options.last_used,
|
||||
options.always_fs,
|
||||
Preferences.WINDOW,
|
||||
)
|
||||
|
||||
self.distance_toggle = ToggleField(
|
||||
self.controller, strings.options.km, strings.options.mi, Preferences.DIST
|
||||
self.controller, options.km, options.mi, Preferences.DIST
|
||||
)
|
||||
|
||||
combo_store = Gtk.ListStore(str, object)
|
||||
@@ -325,10 +331,10 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
self.start_tab_combo.connect("changed", self._on_start_tab_changed)
|
||||
|
||||
pref_rows = [
|
||||
[LeftLabel(strings.options.window_size), self.fullscreen_toggle],
|
||||
[LeftLabel(strings.options.distance), self.distance_toggle],
|
||||
[LeftLabel(options.window_size), self.fullscreen_toggle],
|
||||
[LeftLabel(options.distance), self.distance_toggle],
|
||||
[LeftLabel(options.start_tab), start_tab_hbox],
|
||||
[LeftLabel(strings.options.name), self.player_box],
|
||||
[LeftLabel(options.name), self.player_box],
|
||||
]
|
||||
default = self.controller.query_config(Preferences.DEFAULT)
|
||||
if FLATPAK_STEAM_PATH in default:
|
||||
@@ -337,9 +343,9 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
[LeftLabel(options.flatpak_label), self.flatpak_toggle],
|
||||
)
|
||||
|
||||
self.dayz_version_label = Gtk.Label(label=strings.null, halign=Gtk.Align.START)
|
||||
self.dayz_version_label = Gtk.Label(label=metadata.null, halign=Gtk.Align.START)
|
||||
self.dayz_exp_version_label = Gtk.Label(
|
||||
label=strings.null, halign=Gtk.Align.START
|
||||
label=metadata.null, halign=Gtk.Align.START
|
||||
)
|
||||
|
||||
version_rows = [
|
||||
@@ -370,16 +376,16 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||
|
||||
for pair in [
|
||||
(api_box, strings.options.api_key),
|
||||
(prefs_grid, strings.options.prefs),
|
||||
(version_grid, strings.options.version),
|
||||
(api_box, options.api_key),
|
||||
(prefs_grid, options.prefs),
|
||||
(version_grid, options.version),
|
||||
]:
|
||||
|
||||
frame = HeadingFrame.new_with_widget_and_label(*pair)
|
||||
grid.attach(frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||
row += 1
|
||||
|
||||
label = Gtk.Label(label=strings.options.header)
|
||||
label = Gtk.Label(label=options.header)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
css.add_class(label, "page-heading")
|
||||
|
||||
@@ -434,7 +440,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
prefs = self.controller.get_prefs()
|
||||
# NOTE: re-check in case file was removed by user between runs
|
||||
if prefs.paths.config.is_file() is False:
|
||||
dialog = ExceptionDialog(self.controller, strings.config_not_found)
|
||||
dialog = ExceptionDialog(self.controller, errors.config_not_found)
|
||||
dialog.show_all()
|
||||
dialog.run() # type: ignore[no-untyped-call]
|
||||
raise OSError(f"Config file '{prefs.paths.config}' not found")
|
||||
@@ -466,7 +472,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
|
||||
dayz_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ)
|
||||
if dayz_version is None:
|
||||
dayz_version = strings.null
|
||||
dayz_version = metadata.null
|
||||
else:
|
||||
last_updated = get_last_updated(steam_path, APPID_DAYZ)
|
||||
if last_updated is not None:
|
||||
@@ -474,7 +480,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
|
||||
dayz_exp_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ_EXP)
|
||||
if dayz_exp_version is None:
|
||||
dayz_exp_version = strings.null
|
||||
dayz_exp_version = metadata.null
|
||||
else:
|
||||
last_updated = get_last_updated(steam_path, APPID_DAYZ_EXP)
|
||||
if last_updated is not None:
|
||||
@@ -486,14 +492,5 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
||||
start_tab = self.controller.query_config(Preferences.START_TAB)
|
||||
self.start_tab_combo.set_active(start_tab)
|
||||
|
||||
def _suppress_toggles(self, state: bool) -> None:
|
||||
for toggle in [
|
||||
self.fullscreen_toggle,
|
||||
self.distance_toggle,
|
||||
]:
|
||||
self.controller.suppress_signal(
|
||||
self, toggle.get_children()[0], "_on_radio_toggled", state
|
||||
)
|
||||
|
||||
def grab_content_area(self) -> None:
|
||||
self.grab_focus()
|
||||
@@ -1,11 +1,12 @@
|
||||
from dataclasses import dataclass
|
||||
import gi
|
||||
|
||||
from typing import Self, Sequence, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage
|
||||
from dzgui.const.icons import (
|
||||
ICON_ERROR,
|
||||
ICON_WARNING,
|
||||
)
|
||||
from dzgui.const.enum import NotebookPage
|
||||
from dzgui.util.css import add_class
|
||||
from dzgui.util.keys import is_ctrl_mask
|
||||
from dzgui.util.localize import number
|
||||
@@ -15,33 +16,15 @@ from dzgui.views.dialogs.generic import DebugDialog
|
||||
from dzgui.views.components.frame import HeadingFrame
|
||||
from dzgui.views.trees.tree_server_mods import ServerModTreeView
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gdk, Gtk
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.managers.connection import Prerequisites
|
||||
from dzgui.controllers.mc import Controller
|
||||
from dzgui.controllers.emitter import Emitter
|
||||
|
||||
|
||||
@dataclass
|
||||
class Warnings:
|
||||
passworded: bool
|
||||
dayz_running: bool
|
||||
no_steam: bool
|
||||
wrong_version: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
class Errors:
|
||||
no_space: bool
|
||||
no_dayz_exp: bool
|
||||
no_dayz: bool
|
||||
|
||||
|
||||
class Placeholder(Gtk.Label):
|
||||
def __init__(self, text: str) -> None:
|
||||
super().__init__(
|
||||
|
||||
@@ -6,7 +6,7 @@ from dzgui.const.constants import APP_NAME
|
||||
from dzgui.const.enum import ContextMenuGroup, ServerTab
|
||||
from dzgui.views.trees.tree_servers import ServerTreeView
|
||||
from dzgui.strings.generic import tab_changed_label
|
||||
from dzgui.util.strings import server_labels
|
||||
from dzgui.strings import labels
|
||||
|
||||
import gi
|
||||
|
||||
@@ -57,10 +57,10 @@ class ServerNotebook(Gtk.ScrolledWindow):
|
||||
)
|
||||
|
||||
tabs = [
|
||||
(self.browser, server_labels.browser),
|
||||
(self.saved, server_labels.saved),
|
||||
(self.recent, server_labels.recent),
|
||||
(self.lan, server_labels.lan),
|
||||
(self.browser, labels.servers_browser),
|
||||
(self.saved, labels.servers_saved),
|
||||
(self.recent, labels.servers_recent),
|
||||
(self.lan, labels.servers_lan),
|
||||
]
|
||||
|
||||
for tree, label in tabs:
|
||||
@@ -89,7 +89,7 @@ class ServerNotebook(Gtk.ScrolledWindow):
|
||||
if label is None:
|
||||
return
|
||||
if hasattr(label, "set_text"):
|
||||
label.set_text(f"{server_labels.saved}*")
|
||||
label.set_text(f"{labels.servers_saved}*")
|
||||
|
||||
def _on_servers_loaded(self, emitter: "Emitter", tab: "ServerTab") -> None:
|
||||
# NOTE: workaround for GTK bug where fullscreen causes headers to vanish when model is None
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.util.format import format_pango
|
||||
from dzgui.util.strings import thanks
|
||||
from dzgui.strings import thanks
|
||||
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
from typing import Any, Optional, TYPE_CHECKING
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.constants import APP_NAME, SEPARATOR
|
||||
from dzgui.util.keys import is_ctrl_mask, is_navkey
|
||||
from dzgui.views.mixins.cursor_mixin import CursorMixin
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango # noqa
|
||||
from gi.repository import Gtk, Gdk, GObject
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -20,7 +19,7 @@ if TYPE_CHECKING:
|
||||
|
||||
class TreeView(CursorMixin, Gtk.TreeView): # type: ignore
|
||||
def __init__(
|
||||
self, controller: "Controller", menu: Optional["ContextMenuGroup"]
|
||||
self, controller: "Controller", menu: "ContextMenuGroup | None"
|
||||
) -> None:
|
||||
super().__init__(
|
||||
enable_search=False,
|
||||
@@ -59,7 +58,7 @@ class TreeView(CursorMixin, Gtk.TreeView): # type: ignore
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_current_iter(self) -> Optional[Gtk.TreeIter]:
|
||||
def get_current_iter(self) -> Gtk.TreeIter | None:
|
||||
it = self.get_selection().get_selected()[1]
|
||||
return it
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import logging
|
||||
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.constants import APP_NAME, LOG_FILTERS
|
||||
from dzgui.const.constants import APP_NAME, LOG_DELIMITER, LOG_FILTERS
|
||||
from dzgui.const.enum import ContextMenuGroup
|
||||
from dzgui.model.model_factory import ModelFactory
|
||||
from dzgui.util import strings
|
||||
from dzgui.strings import labels
|
||||
from dzgui.views.trees.tree_base import TreeView
|
||||
from dzgui.views.mixins.context_mixin import ContextMixin
|
||||
|
||||
@@ -36,7 +36,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
|
||||
self.set_model(None)
|
||||
|
||||
self.filters = list(LOG_FILTERS)
|
||||
for i, column_title in enumerate(strings.log_cols):
|
||||
for i, column_title in enumerate(labels.log_cols):
|
||||
renderer = Gtk.CellRendererText()
|
||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||
@@ -92,7 +92,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
|
||||
for record in records:
|
||||
raw_record = model[record]
|
||||
els: tuple[Any] = tuple(raw_record) # type: ignore
|
||||
concat = strings.delimiter.join(map(str, els))
|
||||
concat = LOG_DELIMITER.join(map(str, els))
|
||||
final.append(concat)
|
||||
text = "\n".join(final)
|
||||
return text
|
||||
@@ -10,7 +10,7 @@ from dzgui.views.trees.tree_base import TreeView
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango # noqa
|
||||
from gi.repository import Gtk
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -56,19 +56,18 @@ class MenuTreeView(TreeView):
|
||||
self.controller.populate_log()
|
||||
case RowType.CHANGELOG:
|
||||
self.controller.open_page(NotebookPage.CHANGELOG)
|
||||
case RowType.DUMP_LOG:
|
||||
case RowType.DUMP_DIAGNOSTIC:
|
||||
self.controller.dump_diagnostics()
|
||||
pass
|
||||
|
||||
docs = [
|
||||
RowType.DOCS,
|
||||
RowType.DOCS_FALLBACK,
|
||||
RowType.BUGS,
|
||||
RowType.FORUM,
|
||||
RowType.SPONSOR,
|
||||
]
|
||||
if row_type in docs:
|
||||
open_link_by_rowtype(row_type)
|
||||
case RowType.DUMP_DEBUG:
|
||||
self.controller.dump_log()
|
||||
case (
|
||||
RowType.DOCS
|
||||
| RowType.DOCS_FALLBACK
|
||||
| RowType.BUGS
|
||||
| RowType.FORUM
|
||||
| RowType.SPONSOR
|
||||
):
|
||||
open_link_by_rowtype(row_type)
|
||||
|
||||
def get_row_enum(self) -> str:
|
||||
# NOTE: col 1 contains a RowType enum
|
||||
|
||||
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user