mirror of
https://github.com/aclist/dztui.git
synced 2026-11-23 18:09:30 +01:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5423d9ad56 | ||
|
|
1aed045149 |
No files matched your search
+72
-58
@@ -2,98 +2,112 @@
|
|||||||
|
|
||||||
## [7.0.0] Unreleased
|
## [7.0.0] Unreleased
|
||||||
### Added
|
### Added
|
||||||
- Turnkey setup wizard
|
- Setup wizard
|
||||||
- Turnkey uninstall wizard
|
- Uninstall wizard
|
||||||
- Support for Nasdara (Badlands) DLC
|
- Descriptive details panel to certain error dialogs
|
||||||
|
- Changelog text wrapping and formatting
|
||||||
|
- Changelog ships with source
|
||||||
|
- Documentation ships with source
|
||||||
|
- Decouple UI components into modules
|
||||||
|
- Choose from kilometer or miles distance display
|
||||||
|
- More granular haversine calculation
|
||||||
|
- Parse XDG data dirs with fallbacks
|
||||||
- Dedicated mods page
|
- Dedicated mods page
|
||||||
- Dedicated thanks page
|
- Dedicated thanks page
|
||||||
- Automatically generate Steam shortcuts and cover art
|
- Rearrange menus/breadcrumbs
|
||||||
- Load offline mods/missions (primarily intended for use with specific mods like DayZ Editor)
|
|
||||||
- Descriptive details panel to certain error dialogs
|
|
||||||
- Choose from kilometer or miles distance display
|
|
||||||
- More granular server distance calculation
|
|
||||||
- Open filepicker when generating system log
|
- Open filepicker when generating system log
|
||||||
- Integrated server tabs in a single pane
|
- Developers page (and -d flag)
|
||||||
|
- Redact API key in log table
|
||||||
|
- Integrate add/connect widgets into main menu
|
||||||
- Favorite/connect/LAN panels integrated with server views
|
- Favorite/connect/LAN panels integrated with server views
|
||||||
- Choice to abort on first LAN server found
|
- Abort on first LAN server found
|
||||||
- Colorized IP/ID validation in text entry fields
|
- Colorized IP/ID validation fields
|
||||||
- Copy favorite server IP to clipboard
|
- Copy favorite server IP to clipboard
|
||||||
|
- Set favorite server from tables
|
||||||
- Detailed/copyable trace in critical error dialogs
|
- Detailed/copyable trace in critical error dialogs
|
||||||
- Visual icons to most buttons
|
- Visual icons
|
||||||
- Unset favorite server button
|
- Unset favorite server button
|
||||||
- Propagate column width changes to all tables
|
- Integrated server notebook
|
||||||
- Remember row position in menus
|
- Propagate width changes to all tables
|
||||||
|
- Remember tree position in menus
|
||||||
- Show hidden server count after filtering
|
- Show hidden server count after filtering
|
||||||
- Atomic map filters per server context
|
- Atomic map filters per server context
|
||||||
- Concurrency when checking stale mods (performance uplift)
|
- Use concurrency when checking stale mods (performance uplift)
|
||||||
- Copy DZGUI version by clicking corner label
|
- Copy version by clicking label
|
||||||
- Server name to server mod dialogs
|
- Add server name to server mod dialogs
|
||||||
- Application preboot progress dialog
|
- Lazy load ping cell data func
|
||||||
- Lazy load server ping values on demand
|
- Refresh servers button
|
||||||
- Dedicated refresh servers button
|
- Early load alerts button
|
||||||
- Server preconnect area with warnings
|
- Preconnect dialog
|
||||||
- Choose to jump into game splash screen instead of server
|
- Preconnect warnings/failsafes like filesize
|
||||||
- Save filters per server context between sessions
|
- Save filters per server context between sessions
|
||||||
|
- Preboot progress dialog
|
||||||
|
- Choose to jump into splash screen instead of server
|
||||||
- Collapsible connection panel
|
- Collapsible connection panel
|
||||||
- Warn user if background downloads are disabled on Steam
|
- Play offline (load mods directly)
|
||||||
- Prompt to update map count during setup (-u flag)
|
- Generate Steam shortcuts and cover art
|
||||||
- Tooltips to filter button
|
- Warn user if background downloads are disabled
|
||||||
- Changelog node collapse/expand capability
|
- Dynamic copy button
|
||||||
- Support for local light/dark mode changes on system theme
|
- Update map count (-u flag)
|
||||||
- Server time calculator in server details dialogs
|
- Filter button tooltips
|
||||||
- "Unmodded" filter to servers filters panel
|
- 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
|
- 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
|
- Support Snap package version of Steam
|
||||||
- Export debug log to a named file
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Moved to prebuilt package and release structure
|
- Conform to PEP 440 versioning for beta versions
|
||||||
- Conform to PEP 440 version numbering
|
|
||||||
- Changelog file bundled inside application
|
|
||||||
- Enforce fullscreen mode on Steam Deck
|
- Enforce fullscreen mode on Steam Deck
|
||||||
- Reduce padding on some buttons
|
- Reduce padding on keys button
|
||||||
- Made navigation breadcrumbs boldface
|
- Boldface breadcrumbs
|
||||||
- Changed some dialog error messages from popups to popovers
|
- Changed some dialog error messages from popups to popovers
|
||||||
- Packed filter checkboxes in a symmetrically flowed box
|
- Changed how filter buttons are packed in sidebar
|
||||||
- Added boldface labels to frames
|
- Bold labels inside frames
|
||||||
- Prevent sidebar buttons from stealing focus when clicked
|
- Sidebar buttons do not steal focus
|
||||||
- Copy IP method copies "ip:queryport" only instead of "ip:gameport:queryport
|
- Copy IP copies IP:queryport only instead of IP:gameport:queryport, mimics syntax needed by add by ip method
|
||||||
- Dynamically load new server model into view without flushing
|
- Load new model into view without flushing
|
||||||
- Cull servers with abnormal queue values (e.g., integer overflow: 2147483647)
|
- Cull servers with abnormal queue values (integer overflow: 2147483647)
|
||||||
|
- Packaging structure
|
||||||
- Suppress log messages from imported modules
|
- Suppress log messages from imported modules
|
||||||
- Embed Workshop link in Options menu
|
- Embed Workshop link in Options menu
|
||||||
- Remove occlusion on scrollbars positioned next to tables
|
- Disable overlay scrollbars on server tables
|
||||||
- Use SQLite for geolocation records
|
- Reduce size of geolocation DB on disk (~100MB)
|
||||||
- Initialize LAN page with inclusive default server filters
|
- Enable LAN page Empty/Full filters on first run of app
|
||||||
- Redact API keys in debug log table
|
- Propagate subscribed mods to Steam client
|
||||||
- Propagate subscribed mod selections to Steam client
|
|
||||||
- Make j/k keys in context menus follow same wraparound logic as down arrow/up arrow
|
- Make j/k keys in context menus follow same wraparound logic as down arrow/up arrow
|
||||||
- Changed "force update" mod logic to "validate mod" for better integration with Steam client
|
- Use SQLite DB for geolocation records
|
||||||
- More robust configuration and state file directory parsing
|
|
||||||
|
|
||||||
### Dropped
|
### Dropped
|
||||||
- Battlemetrics API support
|
- Battlemetrics API support
|
||||||
- Unused metadata from system log files
|
- Unused metadata from system log files
|
||||||
- Branch switching logic
|
- Branch switching
|
||||||
- Manual mod install mode
|
- Manual mod install mode (describe rationale)
|
||||||
- Remnants of legacy Bash script logic
|
- Force update mods
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Longstanding issue with left clicks not registering as tree selection changes after spamming keyboard input
|
- Longstanding issue with left clicks not registering as tree selection changes after spamming keyboard input
|
||||||
- In-game time field missing certain ranges of time at night
|
- In-game time field missing certain ranges of time at night
|
||||||
- Long text entries not being wrapped in changelog
|
- Wrap long entries in changelog
|
||||||
- Certain server descriptions with special characters not rendering correctly
|
- Certain server descriptions with special characters not rendering correctly
|
||||||
- Center server title text on server dialogs
|
- Center server title text on server dialogs
|
||||||
- Rare segmentation faults when changing maps
|
- Rare segfaults when changing maps (threading)
|
||||||
- Rare segmentation faults when spawning dialogs
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with actual history file
|
- History table not being in lock-step with state file
|
||||||
- History records only being cosmetically removed
|
|
||||||
- Current keyword filter not being applied when refreshing table
|
- Current keyword filter not being applied when refreshing table
|
||||||
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
||||||
- Collisions between native Steam and Steam Flatpak clients
|
- Collisions between native Steam and Steam Flatpak clients
|
||||||
- Signals becoming stacked each time Options page was reloaded
|
- Sticky toggle signal on radio buttons when reloading Options
|
||||||
- Handle missing mods directory if not installed previously
|
- Handle missing mods directory if not installed previously
|
||||||
- Keyboard input not being blocked when filter area is grayed out
|
- Filters not blocked by keyboard keys when filters are disabled
|
||||||
|
|
||||||
|
### Developer-facing
|
||||||
|
- Options -> Dev page
|
||||||
|
- Raw debug command in preconnect menu
|
||||||
|
|
||||||
## [6.0.5] 2026-05-17
|
## [6.0.5] 2026-05-17
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -29,8 +29,3 @@ sphinx-build -M html source build -a
|
|||||||
2. Set up the build target: `rustup target add x86_64-unknown-linux-musl`
|
2. Set up the build target: `rustup target add x86_64-unknown-linux-musl`
|
||||||
3. Run `python3 scripts/release.py`
|
3. Run `python3 scripts/release.py`
|
||||||
4. Generate a release and tag against the resulting tarfile generated in `dist`
|
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
-1
@@ -119,6 +119,6 @@ The milestone of 500 tickets/PRs being closed was reached.
|
|||||||
- 2023: 322
|
- 2023: 322
|
||||||
- 2024: 347
|
- 2024: 347
|
||||||
- 2025: 426
|
- 2025: 426
|
||||||
- 2026: 1521
|
- 2026: 1300
|
||||||
|
|
||||||
DZGUI 7 is scheduled to release as a stable version within the year.
|
DZGUI 7 is scheduled to release as a stable version within the year.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
Installation
|
Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. attention::
|
.. note::
|
||||||
Version 6 of DZGUI 6 has been fully replaced with DZGUI 7.
|
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.
|
Users on existing DZGUI 6 installations should migrate to the DZGUI 7 build.
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,8 @@ From Steam
|
|||||||
--------------
|
--------------
|
||||||
DZGUI will also ask you if you want to add a "non-Steam game" shortcut to 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.
|
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.
|
You must restart Steam for this shortcut to take effect in your library.
|
||||||
|
|
||||||
.. attention::
|
|
||||||
Steam shortcut integration is not supported on the Snap package version of steam
|
|
||||||
due to its containerized nature. Snap users should run DZGUI directly from the system.
|
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
You can also pass DZGUI launch parameter's to the Steam shortcut via Steam's right-click menu. See :doc:`flags`.
|
You can also pass DZGUI launch parameter's to the Steam shortcut via Steam's right-click menu. See :doc:`flags`.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
After satisfying the dependencies above, create a virtual environment (venv) and install PyGObject:
|
||||||
|
|
||||||
|
If you have ``uv`` as your Python version manager, invoke the following:
|
||||||
|
|
||||||
|
.. code:: console
|
||||||
|
|
||||||
|
uv venv --python 3.13 $HOME/.virtualenvs/dzgui
|
||||||
|
source $HOME/.virtualenvs/dzgui/bin/activate
|
||||||
|
uv pip install PyGObject
|
||||||
|
|
||||||
|
If you installed the ``python3.13`` package directly instead of ``uv``, use the below:
|
||||||
|
|
||||||
|
.. code:: console
|
||||||
|
|
||||||
|
python3.13 -m venv $HOME/.virtualenvs/dzgui
|
||||||
|
source $HOME/.virtualenvs/dzgui/bin/activate
|
||||||
|
pip install PyGObject
|
||||||
|
|
||||||
|
You can now proceed to the :ref:`Installscript`.
|
||||||
|
After installation, refer to the additional remarks below.
|
||||||
|
|
||||||
|
.. important::
|
||||||
|
Since PyGObject is localized to a venv, it is advisable to create a wrapper script to ensure
|
||||||
|
the venv is activated on subsequent invocations of DZGUI.
|
||||||
|
|
||||||
|
.. code:: console
|
||||||
|
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
source $HOME/.virtualenvs/dzgui/bin/activate
|
||||||
|
<insert your path to dzgui.sh>
|
||||||
|
|
||||||
|
Make sure to update the placeholder path on the last line. For example, if you ran the
|
||||||
|
installscript from your home directory, the wrapper script would look like:
|
||||||
|
|
||||||
|
.. code:: console
|
||||||
|
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
source $HOME/.virtualenvs/dzgui/bin/activate
|
||||||
|
$HOME/dzgui.sh
|
||||||
|
|
||||||
|
Save this wrapper script in a location of your choice, e.g., ``mywrapper.sh`` and set the
|
||||||
|
executable bit: ``chmod +x mywrapper.sh`` This script will be your entrypoint for
|
||||||
|
future invocations of DZGUI, so you should launch it, not ``dzgui.sh``
|
||||||
+24
-24
@@ -15,7 +15,7 @@ from dzgui.const.constants import APP_NAME, REQUEST_TIMEOUT
|
|||||||
from dzgui.const.endpoints import STEAM_SERVERS
|
from dzgui.const.endpoints import STEAM_SERVERS
|
||||||
from dzgui.model.proxy_model import ServerRow
|
from dzgui.model.proxy_model import ServerRow
|
||||||
from dzgui.util.format import format_exception
|
from dzgui.util.format import format_exception
|
||||||
from dzgui.strings import metadata
|
from dzgui.util import strings
|
||||||
|
|
||||||
import a2s
|
import a2s
|
||||||
import dayzquery
|
import dayzquery
|
||||||
@@ -182,14 +182,14 @@ def parse_json(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if "no3rd" in r:
|
if "no3rd" in r:
|
||||||
view = metadata.filter_1pp
|
view = strings.filter_1pp
|
||||||
else:
|
else:
|
||||||
view = metadata.filter_3pp
|
view = strings.filter_3pp
|
||||||
|
|
||||||
if "external" in r:
|
if "external" in r:
|
||||||
provider = metadata.filter_unofficial
|
provider = strings.filter_unofficial
|
||||||
else:
|
else:
|
||||||
provider = metadata.filter_official
|
provider = strings.filter_official
|
||||||
|
|
||||||
if "mod" in r:
|
if "mod" in r:
|
||||||
modded = True
|
modded = True
|
||||||
@@ -209,9 +209,9 @@ def parse_json(
|
|||||||
if test_time:
|
if test_time:
|
||||||
time = test_time.group(0)
|
time = test_time.group(0)
|
||||||
else:
|
else:
|
||||||
time = metadata.unknown
|
time = strings.unknown
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
time = metadata.unknown
|
time = strings.unknown
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ip = row["addr"].split(":")[0] + ":" + str(row["gameport"])
|
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:
|
def get_details(record: Record) -> Details | None:
|
||||||
ip = record.ip
|
ip = record.ip
|
||||||
qport = record.qport
|
qport = record.qport
|
||||||
default_str = metadata.none_provided
|
default_str = strings.none_provided
|
||||||
|
|
||||||
try:
|
try:
|
||||||
info = a2s.info((ip, qport))
|
info = a2s.info((ip, qport))
|
||||||
@@ -300,9 +300,9 @@ def get_details(record: Record) -> Details | None:
|
|||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
battleye = metadata.disabled
|
battleye = strings.disabled
|
||||||
if "battleye" in keywords:
|
if "battleye" in keywords:
|
||||||
battleye = metadata.enabled
|
battleye = strings.enabled
|
||||||
|
|
||||||
name = info.server_name
|
name = info.server_name
|
||||||
day_accel = 1.0
|
day_accel = 1.0
|
||||||
@@ -322,48 +322,48 @@ def get_details(record: Record) -> Details | None:
|
|||||||
try:
|
try:
|
||||||
password = info.password_protected
|
password = info.password_protected
|
||||||
if password is False:
|
if password is False:
|
||||||
password = metadata.disabled
|
password = strings.disabled
|
||||||
else:
|
else:
|
||||||
password = metadata.enabled
|
password = strings.enabled
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
password = "-"
|
password = "-"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vac = info.vac_enabled
|
vac = info.vac_enabled
|
||||||
if vac is False:
|
if vac is False:
|
||||||
vac = metadata.disabled
|
vac = strings.disabled
|
||||||
else:
|
else:
|
||||||
vac = metadata.enabled
|
vac = strings.enabled
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
vac = metadata.null
|
vac = strings.null
|
||||||
|
|
||||||
try:
|
try:
|
||||||
version = info.version
|
version = info.version
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
version = metadata.null
|
version = strings.null
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dlc = rules.dlc_flags
|
dlc = rules.dlc_flags
|
||||||
match dlc:
|
match dlc:
|
||||||
case 0:
|
case 0:
|
||||||
dlc = metadata.dlc_none
|
dlc = strings.dlc_none
|
||||||
case 2:
|
case 2:
|
||||||
dlc = metadata.dlc_frostline
|
dlc = strings.dlc_frostline
|
||||||
case 4:
|
case 4:
|
||||||
dlc = metadata.dlc_badlands
|
dlc = strings.dlc_badlands
|
||||||
case _:
|
case _:
|
||||||
dlc = metadata.unspecified
|
dlc = strings.unspecified
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
dlc = metadata.unspecified
|
dlc = strings.unspecified
|
||||||
|
|
||||||
try:
|
try:
|
||||||
platform = rules.platform
|
platform = rules.platform
|
||||||
if platform == "win":
|
if platform == "win":
|
||||||
platform = metadata.windows
|
platform = strings.windows
|
||||||
if platform == "?":
|
if platform == "?":
|
||||||
platform = metadata.linux
|
platform = strings.linux
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
platform = metadata.unspecified
|
platform = strings.unspecified
|
||||||
|
|
||||||
try:
|
try:
|
||||||
description = rules.description.strip()
|
description = rules.description.strip()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import binascii
|
|||||||
import ctypes
|
import ctypes
|
||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
import vdf # type: ignore[import-untyped]
|
import vdf # type: ignore
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from importlib import resources
|
from importlib import resources
|
||||||
@@ -12,7 +12,7 @@ from typing import Any
|
|||||||
from dzgui.api.steam import find_user_id_32
|
from dzgui.api.steam import find_user_id_32
|
||||||
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, IMAGES_PATH
|
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.dirs import copy_dzgui_to_xdg_data, make_parents
|
||||||
from dzgui.strings import metadata
|
from dzgui.util.strings import unknown
|
||||||
|
|
||||||
logger = logging.getLogger(APP_NAME)
|
logger = logging.getLogger(APP_NAME)
|
||||||
|
|
||||||
@@ -61,10 +61,10 @@ class Shortcuts:
|
|||||||
return str(self.shortcuts["shortcuts"][key]["AppName"])
|
return str(self.shortcuts["shortcuts"][key]["AppName"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
return metadata.unknown
|
return unknown
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
return metadata.unknown
|
return unknown
|
||||||
|
|
||||||
def get_shortcuts(self) -> Any:
|
def get_shortcuts(self) -> Any:
|
||||||
return self.shortcuts
|
return self.shortcuts
|
||||||
@@ -114,7 +114,6 @@ class Shortcuts:
|
|||||||
make_parents(dest)
|
make_parents(dest)
|
||||||
b = images.joinpath(img).with_suffix(".png").read_bytes()
|
b = images.joinpath(img).with_suffix(".png").read_bytes()
|
||||||
dest.write_bytes(b)
|
dest.write_bytes(b)
|
||||||
logger.debug(f"Wrote grid image to '{dest}'")
|
|
||||||
|
|
||||||
# NOTE: legacy Big Picture header
|
# NOTE: legacy Big Picture header
|
||||||
b = images.joinpath("_hero.png").read_bytes()
|
b = images.joinpath("_hero.png").read_bytes()
|
||||||
@@ -128,7 +127,6 @@ class Shortcuts:
|
|||||||
except Exception:
|
except Exception:
|
||||||
n = 0
|
n = 0
|
||||||
self.shortcuts["shortcuts"][str(n)] = entry
|
self.shortcuts["shortcuts"][str(n)] = entry
|
||||||
logger.debug(f"Added shortcut at index {n}")
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _create_entry(cls, meta: ShortcutMetadata) -> dict[str, Any]:
|
def _create_entry(cls, meta: ShortcutMetadata) -> dict[str, Any]:
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import psutil
|
|||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
import subprocess
|
import subprocess
|
||||||
import vdf # type: ignore[import-untyped]
|
import vdf # type: ignore
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|||||||
+3
-2
@@ -22,13 +22,14 @@ from dzgui.init.migrate import (
|
|||||||
migrate_cols_file,
|
migrate_cols_file,
|
||||||
)
|
)
|
||||||
from dzgui.init.prereqs import has_flatpak_client, has_steam_client
|
from dzgui.init.prereqs import has_flatpak_client, has_steam_client
|
||||||
from dzgui.strings import boot, errors
|
from dzgui.strings import boot
|
||||||
|
|
||||||
from dzgui.util.deck import is_steam_deck, is_game_mode
|
from dzgui.util.deck import is_steam_deck, is_game_mode
|
||||||
from dzgui.util.dirs import make_parents
|
from dzgui.util.dirs import make_parents
|
||||||
from dzgui.util.localize import set_locale
|
from dzgui.util.localize import set_locale
|
||||||
from dzgui.util.map_count import test_map_count
|
from dzgui.util.map_count import test_map_count
|
||||||
from dzgui.util.redact import RedactionFilter, REDACTION_PATTERNS
|
from dzgui.util.redact import RedactionFilter, REDACTION_PATTERNS
|
||||||
|
from dzgui.util.strings import init
|
||||||
|
|
||||||
from dzgui.views.base import App
|
from dzgui.views.base import App
|
||||||
from dzgui.views.dialogs.boot import BootWindow
|
from dzgui.views.dialogs.boot import BootWindow
|
||||||
@@ -158,7 +159,7 @@ def build_gui(version: str, is_debug: bool) -> App | None:
|
|||||||
else:
|
else:
|
||||||
has_client = has_steam_client()
|
has_client = has_steam_client()
|
||||||
if has_client is False:
|
if has_client is False:
|
||||||
EarlyAlertDialog(errors.requires_steam)
|
EarlyAlertDialog(init.requires_steam)
|
||||||
|
|
||||||
bootwin = BootWindow(XDG, version)
|
bootwin = BootWindow(XDG, version)
|
||||||
local_coords, latest_release = bootwin.get_results()
|
local_coords, latest_release = bootwin.get_results()
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ SYSTEM_LOG = f"{APP_NAME}_SYSTEM.LOG"
|
|||||||
CHANGELOG_PATH = "data/CHANGELOG.md"
|
CHANGELOG_PATH = "data/CHANGELOG.md"
|
||||||
IMAGES_PATH = "data/images"
|
IMAGES_PATH = "data/images"
|
||||||
ICONS_PATH = "data/images/gtk"
|
ICONS_PATH = "data/images/gtk"
|
||||||
LOG_DELIMITER = "␞"
|
|
||||||
|
|
||||||
HERO_PATH = "data/images/_hero.png"
|
HERO_PATH = "data/images/_hero.png"
|
||||||
CSS_PATH = "data/app.css"
|
CSS_PATH = "data/app.css"
|
||||||
|
|||||||
+52
-47
@@ -2,7 +2,8 @@ from __future__ import annotations
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from dzgui.strings import crumbs, context_menu, mod_panel, rows, side_buttons
|
from dzgui.util import strings
|
||||||
|
from dzgui.strings import rows
|
||||||
|
|
||||||
|
|
||||||
class Port(Enum):
|
class Port(Enum):
|
||||||
@@ -83,21 +84,21 @@ class ContextMenuMeta:
|
|||||||
|
|
||||||
|
|
||||||
class ContextMenuItem(Enum):
|
class ContextMenuItem(Enum):
|
||||||
ADD_NOTE = ContextMenuMeta(context_menu.add_note)
|
ADD_NOTE = ContextMenuMeta(strings.add_note)
|
||||||
ADD_SERVER = ContextMenuMeta(context_menu.add)
|
ADD_SERVER = ContextMenuMeta(strings.add)
|
||||||
CONNECT = ContextMenuMeta(context_menu.connect)
|
CONNECT = ContextMenuMeta(strings.connect)
|
||||||
COPY_LOG_CLIPBOARD = ContextMenuMeta(context_menu.copy_log)
|
COPY_LOG_CLIPBOARD = ContextMenuMeta(strings.copy_log)
|
||||||
COPY_SERVER_IP = ContextMenuMeta(context_menu.copy_ip)
|
COPY_SERVER_IP = ContextMenuMeta(strings.copy_ip)
|
||||||
COPY_SERVER_NAME = ContextMenuMeta(context_menu.copy_name)
|
COPY_SERVER_NAME = ContextMenuMeta(strings.copy_name)
|
||||||
UNSUB_MOD = ContextMenuMeta(context_menu.unsub_mod)
|
UNSUB_MOD = ContextMenuMeta(strings.unsub_mod)
|
||||||
VALIDATE_MOD = ContextMenuMeta(context_menu.validate_mod)
|
VALIDATE_MOD = ContextMenuMeta(strings.validate_mod)
|
||||||
OPEN_WORKSHOP = ContextMenuMeta(context_menu.open_workshop)
|
OPEN_WORKSHOP = ContextMenuMeta(strings.open_workshop)
|
||||||
REFRESH_PLAYERS = ContextMenuMeta(context_menu.refresh_players)
|
REFRESH_PLAYERS = ContextMenuMeta(strings.refresh_players)
|
||||||
REMOVE_HISTORY = ContextMenuMeta(context_menu.remove_history)
|
REMOVE_HISTORY = ContextMenuMeta(strings.remove_history)
|
||||||
REMOVE_SERVER = ContextMenuMeta(context_menu.remove)
|
REMOVE_SERVER = ContextMenuMeta(strings.remove)
|
||||||
SET_FAV = ContextMenuMeta(context_menu.set_fav)
|
SET_FAV = ContextMenuMeta(strings.add_fav)
|
||||||
SHOW_DETAILS = ContextMenuMeta(context_menu.show_details)
|
SHOW_DETAILS = ContextMenuMeta(strings.show_details)
|
||||||
SHOW_MODS = ContextMenuMeta(context_menu.show_mods)
|
SHOW_MODS = ContextMenuMeta(strings.show_mods)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def label(self) -> str:
|
def label(self) -> str:
|
||||||
@@ -181,17 +182,17 @@ class Preferences(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class NotebookPage(Enum):
|
class NotebookPage(Enum):
|
||||||
OFFLINE = NotebookMeta(crumbs.offline, True)
|
OFFLINE = NotebookMeta(strings.crumbs.offline, True)
|
||||||
CHANGELOG = NotebookMeta(crumbs.changelog, True)
|
CHANGELOG = NotebookMeta(strings.crumbs.changelog, True)
|
||||||
DEVELOPERS = NotebookMeta(crumbs.developers, False)
|
DEVELOPERS = NotebookMeta(strings.crumbs.developers, False)
|
||||||
HELP = NotebookMeta(crumbs._help, True)
|
HELP = NotebookMeta(strings.crumbs._help, True)
|
||||||
KEYS = NotebookMeta(crumbs.keys, True)
|
KEYS = NotebookMeta(strings.crumbs.keys, True)
|
||||||
LOG = NotebookMeta(crumbs.log, True)
|
LOG = NotebookMeta(strings.crumbs.log, True)
|
||||||
MODS = NotebookMeta(crumbs.mods, True)
|
MODS = NotebookMeta(strings.crumbs.mods, True)
|
||||||
OPTIONS = NotebookMeta(crumbs.options, False)
|
OPTIONS = NotebookMeta(strings.crumbs.options, False)
|
||||||
SERVERS = NotebookMeta(crumbs.servers, True)
|
SERVERS = NotebookMeta(strings.crumbs.servers, True)
|
||||||
THANKS = NotebookMeta(crumbs.thanks, True)
|
THANKS = NotebookMeta(strings.crumbs.thanks, True)
|
||||||
CONNECTION = NotebookMeta(crumbs.connect, True)
|
CONNECTION = NotebookMeta(strings.crumbs.connect, True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def crumbs(self) -> str:
|
def crumbs(self) -> str:
|
||||||
@@ -225,25 +226,29 @@ class RowType(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class ModButton(Enum):
|
class ModButton(Enum):
|
||||||
SELECT_ALL = ModButtonMeta(mod_panel.select_all, mod_panel.select_all_tooltip)
|
SELECT_ALL = ModButtonMeta(
|
||||||
UNSELECT_ALL = ModButtonMeta(mod_panel.unselect_all, mod_panel.unselect_all_tooltip)
|
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
|
||||||
|
)
|
||||||
HIGHLIGHT_STALE = ModButtonMeta(
|
HIGHLIGHT_STALE = ModButtonMeta(
|
||||||
mod_panel.highlight_stale, mod_panel.highlight_stale_tooltip
|
strings.mod_panel.highlight_stale, strings.mod_panel.highlight_stale_tooltip
|
||||||
)
|
)
|
||||||
UNHIGHLIGHT_STALE = ModButtonMeta(
|
UNHIGHLIGHT_STALE = ModButtonMeta(
|
||||||
mod_panel.unhighlight_stale, mod_panel.unhighlight_stale_tooltip
|
strings.mod_panel.unhighlight_stale, strings.mod_panel.unhighlight_stale_tooltip
|
||||||
)
|
)
|
||||||
UNSUB_SELECTED = ModButtonMeta(
|
UNSUB_SELECTED = ModButtonMeta(
|
||||||
mod_panel.unsub_selected,
|
strings.mod_panel.unsub_selected,
|
||||||
mod_panel.unsub_selected_tooltip,
|
strings.mod_panel.unsub_selected_tooltip,
|
||||||
)
|
)
|
||||||
SELECT_STALE = ModButtonMeta(
|
SELECT_STALE = ModButtonMeta(
|
||||||
mod_panel.select_stale,
|
strings.mod_panel.select_stale,
|
||||||
mod_panel.select_stale_tooltip,
|
strings.mod_panel.select_stale_tooltip,
|
||||||
)
|
)
|
||||||
VALIDATE = ModButtonMeta(
|
VALIDATE = ModButtonMeta(
|
||||||
mod_panel.validate,
|
strings.mod_panel.validate,
|
||||||
mod_panel.validate_tooltip,
|
strings.mod_panel.validate_tooltip,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -257,28 +262,28 @@ class ModButton(Enum):
|
|||||||
|
|
||||||
class ButtonType(Enum):
|
class ButtonType(Enum):
|
||||||
SERVERS = ButtonTypeMeta(
|
SERVERS = ButtonTypeMeta(
|
||||||
side_buttons.servers_label,
|
strings.buttons.servers_label,
|
||||||
side_buttons.servers_tooltip,
|
strings.buttons.servers_tooltip,
|
||||||
NotebookPage.SERVERS,
|
NotebookPage.SERVERS,
|
||||||
)
|
)
|
||||||
MODS = ButtonTypeMeta(
|
MODS = ButtonTypeMeta(
|
||||||
side_buttons.mods_label,
|
strings.buttons.mods_label,
|
||||||
side_buttons.mods_tooltip,
|
strings.buttons.mods_tooltip,
|
||||||
NotebookPage.MODS,
|
NotebookPage.MODS,
|
||||||
)
|
)
|
||||||
OPTIONS = ButtonTypeMeta(
|
OPTIONS = ButtonTypeMeta(
|
||||||
side_buttons.options_label,
|
strings.buttons.options_label,
|
||||||
side_buttons.options_tooltip,
|
strings.buttons.options_tooltip,
|
||||||
NotebookPage.OPTIONS,
|
NotebookPage.OPTIONS,
|
||||||
)
|
)
|
||||||
HELP = ButtonTypeMeta(
|
HELP = ButtonTypeMeta(
|
||||||
side_buttons.help_label,
|
strings.buttons.help_label,
|
||||||
side_buttons.help_tooltip,
|
strings.buttons.help_tooltip,
|
||||||
NotebookPage.HELP,
|
NotebookPage.HELP,
|
||||||
)
|
)
|
||||||
EXIT = ButtonTypeMeta(
|
EXIT = ButtonTypeMeta(
|
||||||
side_buttons.exit_label,
|
strings.buttons.exit_label,
|
||||||
side_buttons.exit_tooltip,
|
strings.buttons.exit_tooltip,
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+71
-60
@@ -2,98 +2,109 @@
|
|||||||
|
|
||||||
## [7.0.0] Unreleased
|
## [7.0.0] Unreleased
|
||||||
### Added
|
### Added
|
||||||
- Turnkey setup wizard
|
- Setup wizard
|
||||||
- Turnkey uninstall wizard
|
- Uninstall wizard
|
||||||
- Support for Nasdara (Badlands) DLC
|
- Descriptive details panel to certain error dialogs
|
||||||
|
- Changelog text wrapping and formatting
|
||||||
|
- Changelog ships with source
|
||||||
|
- Documentation ships with source
|
||||||
|
- Decouple UI components into modules
|
||||||
|
- Choose from kilometer or miles distance display
|
||||||
|
- More granular haversine calculation
|
||||||
|
- Parse XDG data dirs with fallbacks
|
||||||
- Dedicated mods page
|
- Dedicated mods page
|
||||||
- Dedicated thanks page
|
- Dedicated thanks page
|
||||||
- Automatically generate Steam shortcuts and cover art
|
- Rearrange menus/breadcrumbs
|
||||||
- Load offline mods/missions (primarily intended for use with specific mods like DayZ Editor)
|
|
||||||
- Descriptive details panel to certain error dialogs
|
|
||||||
- Choose from kilometer or miles distance display
|
|
||||||
- More granular server distance calculation
|
|
||||||
- Open filepicker when generating system log
|
- Open filepicker when generating system log
|
||||||
- Integrated server tabs in a single pane
|
- Developers page (and -d flag)
|
||||||
|
- Redact API key in log table
|
||||||
|
- Integrate add/connect widgets into main menu
|
||||||
- Favorite/connect/LAN panels integrated with server views
|
- Favorite/connect/LAN panels integrated with server views
|
||||||
- Choice to abort on first LAN server found
|
- Abort on first LAN server found
|
||||||
- Colorized IP/ID validation in text entry fields
|
- Colorized IP/ID validation fields
|
||||||
- Copy favorite server IP to clipboard
|
- Copy favorite server IP to clipboard
|
||||||
|
- Set favorite server from tables
|
||||||
- Detailed/copyable trace in critical error dialogs
|
- Detailed/copyable trace in critical error dialogs
|
||||||
- Visual icons to most buttons
|
- Visual icons
|
||||||
- Unset favorite server button
|
- Unset favorite server button
|
||||||
- Propagate column width changes to all tables
|
- Integrated server notebook
|
||||||
- Remember row position in menus
|
- Propagate width changes to all tables
|
||||||
|
- Remember tree position in menus
|
||||||
- Show hidden server count after filtering
|
- Show hidden server count after filtering
|
||||||
- Atomic map filters per server context
|
- Atomic map filters per server context
|
||||||
- Concurrency when checking stale mods (performance uplift)
|
- Use concurrency when checking stale mods (performance uplift)
|
||||||
- Copy DZGUI version by clicking corner label
|
- Copy version by clicking label
|
||||||
- Server name to server mod dialogs
|
- Add server name to server mod dialogs
|
||||||
- Application preboot progress dialog
|
- Lazy load ping cell data func
|
||||||
- Lazy load server ping values on demand
|
- Refresh servers button
|
||||||
- Dedicated refresh servers button
|
- Early load alerts button
|
||||||
- Server preconnect area with warnings
|
- Preconnect dialog
|
||||||
- Choose to jump into game splash screen instead of server
|
- Preconnect warnings/failsafes like filesize
|
||||||
- Save filters per server context between sessions
|
- Save filters per server context between sessions
|
||||||
|
- Preboot progress dialog
|
||||||
|
- Choose to jump into splash screen instead of server
|
||||||
- Collapsible connection panel
|
- Collapsible connection panel
|
||||||
- Warn user if background downloads are disabled on Steam
|
- Play offline (load mods directly)
|
||||||
- Prompt to update map count during setup (-u flag)
|
- Generate Steam shortcuts and cover art
|
||||||
- Tooltips to filter button
|
- Warn user if background downloads are disabled
|
||||||
- Changelog node collapse/expand capability
|
- Dynamic copy button
|
||||||
- Support for local light/dark mode changes on system theme
|
- Update map count (-u flag)
|
||||||
- Server time calculator in server details dialogs
|
- Filter button tooltips
|
||||||
- "Unmodded" filter to servers filters panel
|
- 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
|
- List timestamp of last DayZ client update
|
||||||
- Support Snap package version of Steam
|
- Validate mods via Mod page to pull in updates
|
||||||
- Export debug log to a named file
|
- Support for Nasdara (Badlands) DLC
|
||||||
|
- Load offline mods
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Moved to prebuilt package and release structure
|
- Conform to PEP 440 versioning for beta versions
|
||||||
- Conform to PEP 440 version numbering
|
|
||||||
- Changelog file bundled inside application
|
|
||||||
- Enforce fullscreen mode on Steam Deck
|
- Enforce fullscreen mode on Steam Deck
|
||||||
- Reduce padding on some buttons
|
- Reduce padding on keys button
|
||||||
- Made navigation breadcrumbs boldface
|
- Boldface breadcrumbs
|
||||||
- Changed some dialog error messages from popups to popovers
|
- Changed some dialog error messages from popups to popovers
|
||||||
- Packed filter checkboxes in a symmetrically flowed box
|
- Changed how filter buttons are packed in sidebar
|
||||||
- Added boldface labels to frames
|
- Bold labels inside frames
|
||||||
- Prevent sidebar buttons from stealing focus when clicked
|
- Sidebar buttons do not steal focus
|
||||||
- Copy IP method copies "ip:queryport" only instead of "ip:gameport:queryport
|
- Copy IP copies IP:queryport only instead of IP:gameport:queryport, mimics syntax needed by add by ip method
|
||||||
- Dynamically load new server model into view without flushing
|
- Load new model into view without flushing
|
||||||
- Cull servers with abnormal queue values (e.g., integer overflow: 2147483647)
|
- Cull servers with abnormal queue values (integer overflow: 2147483647)
|
||||||
|
- Packaging structure
|
||||||
- Suppress log messages from imported modules
|
- Suppress log messages from imported modules
|
||||||
- Embed Workshop link in Options menu
|
- Embed Workshop link in Options menu
|
||||||
- Remove occlusion on scrollbars positioned next to tables
|
- Disable overlay scrollbars on server tables
|
||||||
- Use SQLite for geolocation records
|
- Reduce size of geolocation DB on disk (~100MB)
|
||||||
- Initialize LAN page with inclusive default server filters
|
- Enable LAN page Empty/Full filters on first run of app
|
||||||
- Redact API keys in debug log table
|
- Propagate subscribed mods to Steam client
|
||||||
- Propagate subscribed mod selections to Steam client
|
|
||||||
- Make j/k keys in context menus follow same wraparound logic as down arrow/up arrow
|
- Make j/k keys in context menus follow same wraparound logic as down arrow/up arrow
|
||||||
- Changed "force update" mod logic to "validate mod" for better integration with Steam client
|
- Use SQLite DB for geolocation records
|
||||||
- More robust configuration and state file directory parsing
|
|
||||||
|
|
||||||
### Dropped
|
### Dropped
|
||||||
- Battlemetrics API support
|
- Battlemetrics API support
|
||||||
- Unused metadata from system log files
|
- Unused metadata from system log files
|
||||||
- Branch switching logic
|
- Branch switching
|
||||||
- Manual mod install mode
|
- Manual mod install mode (describe rationale)
|
||||||
- Remnants of legacy Bash script logic
|
- Force update mods
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Longstanding issue with left clicks not registering as tree selection changes after spamming keyboard input
|
- Longstanding issue with left clicks not registering as tree selection changes after spamming keyboard input
|
||||||
- In-game time field missing certain ranges of time at night
|
- In-game time field missing certain ranges of time at night
|
||||||
- Long text entries not being wrapped in changelog
|
- Wrap long entries in changelog
|
||||||
- Certain server descriptions with special characters not rendering correctly
|
- Certain server descriptions with special characters not rendering correctly
|
||||||
- Center server title text on server dialogs
|
- Center server title text on server dialogs
|
||||||
- Rare segmentation faults when changing maps
|
- Rare segfaults when changing maps (threading)
|
||||||
- Rare segmentation faults when spawning dialogs
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with actual history file
|
- History table not being in lock-step with state file
|
||||||
- History records only being cosmetically removed
|
|
||||||
- Current keyword filter not being applied when refreshing table
|
- Current keyword filter not being applied when refreshing table
|
||||||
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
- Steam Flatpak cannot run DZGUI as a non-Steam game
|
||||||
- Collisions between native Steam and Steam Flatpak clients
|
- Collisions between native Steam and Steam Flatpak clients
|
||||||
- Signals becoming stacked each time Options page was reloaded
|
- Sticky toggle signal on radio buttons when reloading Options
|
||||||
- Handle missing mods directory if not installed previously
|
|
||||||
- Keyboard input not being blocked when filter area is grayed out
|
### Developer-facing
|
||||||
|
- Options -> Dev page
|
||||||
|
- Raw debug command in preconnect menu
|
||||||
|
|
||||||
## [6.0.5] 2026-05-17
|
## [6.0.5] 2026-05-17
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ from pathlib import Path
|
|||||||
from typing import TextIO
|
from typing import TextIO
|
||||||
|
|
||||||
from dzgui.const.constants import LOCK_FILE
|
from dzgui.const.constants import LOCK_FILE
|
||||||
from dzgui.strings import errors
|
from dzgui.util.strings import cannot_acquire_lock
|
||||||
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
||||||
|
|
||||||
|
|
||||||
@@ -21,6 +21,6 @@ def lock_acquire() -> TextIO:
|
|||||||
try:
|
try:
|
||||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
except OSError:
|
except OSError:
|
||||||
EarlyAlertDialog(errors.cannot_acquire_lock)
|
EarlyAlertDialog(cannot_acquire_lock)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return lock
|
return lock
|
||||||
@@ -66,7 +66,7 @@ def copy_state_files(state_path: Path) -> None:
|
|||||||
".month",
|
".month",
|
||||||
]
|
]
|
||||||
if state_path == legacy:
|
if state_path == legacy:
|
||||||
logger.debug(f"Legacy state path '{legacy}' is identical to current")
|
# TODO: log this
|
||||||
return
|
return
|
||||||
for file in legacy.iterdir():
|
for file in legacy.iterdir():
|
||||||
if file.name in to_copy:
|
if file.name in to_copy:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ def has_flatpak_client() -> bool:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(e)
|
logger.critical(e)
|
||||||
return False
|
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.init.prefix import get_version
|
||||||
from dzgui.util.deck import is_steam_deck
|
from dzgui.util.deck import is_steam_deck
|
||||||
from dzgui.util.map_count import set_map_count
|
from dzgui.util.map_count import set_map_count
|
||||||
from dzgui.strings import flags
|
from dzgui.util.strings import flags
|
||||||
|
|
||||||
from dzgui.views.dialogs.uninstall import UninstallWizard
|
from dzgui.views.dialogs.uninstall import UninstallWizard
|
||||||
from dzgui.config.xdg import get_xdg_paths
|
from dzgui.config.xdg import get_xdg_paths
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ from dzgui.api.probe import test_steam_api
|
|||||||
from dzgui.const.enum import Preferences
|
from dzgui.const.enum import Preferences
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
|
from dzgui.strings import dialogs
|
||||||
from dzgui.util._json import read_json, write_json
|
from dzgui.util._json import read_json, write_json
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -98,7 +99,7 @@ class ConfigManager:
|
|||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
@call_on_thread("", show_dialog=False)
|
@call_on_thread(dialogs.checking_api, show_dialog=False)
|
||||||
def update_steam_api_key(self, text: str) -> None:
|
def update_steam_api_key(self, text: str) -> None:
|
||||||
res = test_steam_api(text)
|
res = test_steam_api(text)
|
||||||
if res is True:
|
if res is True:
|
||||||
|
|||||||
@@ -42,9 +42,15 @@ from dzgui.api.steam import is_dayz_running
|
|||||||
from dzgui.const.enum import NotebookPage, Preferences
|
from dzgui.const.enum import NotebookPage, Preferences
|
||||||
from dzgui.init.proc import is_steam_running
|
from dzgui.init.proc import is_steam_running
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings import dialogs, errors, kb
|
from dzgui.strings.dialogs import (
|
||||||
|
waiting_for_launch,
|
||||||
|
waiting_for_mods,
|
||||||
|
waiting_for_directories,
|
||||||
|
)
|
||||||
|
from dzgui.strings import kb
|
||||||
from dzgui.strings.server_mods import checkmark, resync, invalid_mod
|
from dzgui.strings.server_mods import checkmark, resync, invalid_mod
|
||||||
from dzgui.util.format import format_exception, format_mib
|
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.util.symlink import rebuild_symlinks
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
from dzgui.views.dialogs.servers import ServerDetailsDialog, ServerModDialog
|
from dzgui.views.dialogs.servers import ServerDetailsDialog, ServerModDialog
|
||||||
@@ -97,12 +103,12 @@ class ConnectionManager:
|
|||||||
self.remote_mod_ids: list[str] = []
|
self.remote_mod_ids: list[str] = []
|
||||||
self.missing_mods: list[tuple[str, str, int, int]] = []
|
self.missing_mods: list[tuple[str, str, int, int]] = []
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def connect_by_ip(self, addr: str) -> None:
|
def connect_by_ip(self, addr: str) -> None:
|
||||||
res = Servers.query_by_ip(addr)
|
res = Servers.query_by_ip(addr)
|
||||||
self._prepare_connection(res)
|
self._prepare_connection(res)
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def connect_by_record(self, record: Servers.Record) -> None:
|
def connect_by_record(self, record: Servers.Record) -> None:
|
||||||
res = Servers.query_by_record(record)
|
res = Servers.query_by_record(record)
|
||||||
self._prepare_connection(res)
|
self._prepare_connection(res)
|
||||||
@@ -147,7 +153,7 @@ class ConnectionManager:
|
|||||||
self.missing_mods = missing_mods
|
self.missing_mods = missing_mods
|
||||||
self.remote_mod_ids = [mod[1] for mod in remote_mods]
|
self.remote_mod_ids = [mod[1] for mod in remote_mods]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -224,7 +230,7 @@ class ConnectionManager:
|
|||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def query_details(self, record: Servers.Record) -> None:
|
def query_details(self, record: Servers.Record) -> None:
|
||||||
details = Servers.get_details(record)
|
details = Servers.get_details(record)
|
||||||
if details is None:
|
if details is None:
|
||||||
@@ -269,7 +275,7 @@ class ConnectionManager:
|
|||||||
|
|
||||||
return alpha_mods, missing_mods
|
return alpha_mods, missing_mods
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def query_modlist_and_present(self, record: Servers.Record) -> None:
|
def query_modlist_and_present(self, record: Servers.Record) -> None:
|
||||||
try:
|
try:
|
||||||
mods, missing_mods = self._query_modlist(record)
|
mods, missing_mods = self._query_modlist(record)
|
||||||
@@ -297,7 +303,7 @@ class ConnectionManager:
|
|||||||
dialog.run() # type: ignore[no-untyped-call]
|
dialog.run() # type: ignore[no-untyped-call]
|
||||||
|
|
||||||
def _server_timeout(self) -> None:
|
def _server_timeout(self) -> None:
|
||||||
dialog = ExceptionDialog(self.controller, errors.server_timeout)
|
dialog = ExceptionDialog(self.controller, server_timeout)
|
||||||
dialog.set_details_buffer(kb.DZG_006)
|
dialog.set_details_buffer(kb.DZG_006)
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
dialog.run() # type: ignore[no-untyped-call]
|
dialog.run() # type: ignore[no-untyped-call]
|
||||||
@@ -322,7 +328,7 @@ class ConnectionManager:
|
|||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.thread_man.update_dialog(dialogs.waiting_for_launch)
|
self.thread_man.update_dialog(waiting_for_launch)
|
||||||
while True:
|
while True:
|
||||||
if self.controller.is_cancel_pending():
|
if self.controller.is_cancel_pending():
|
||||||
# TODO: some facility to also close spawned steam process
|
# TODO: some facility to also close spawned steam process
|
||||||
@@ -355,7 +361,7 @@ class ConnectionManager:
|
|||||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.thread_man.update_dialog(dialogs.waiting_for_directories)
|
self.thread_man.update_dialog(waiting_for_directories)
|
||||||
for title, mod, stamp, size in self.missing_mods:
|
for title, mod, stamp, size in self.missing_mods:
|
||||||
mod_path = self.workshop / mod
|
mod_path = self.workshop / mod
|
||||||
|
|
||||||
@@ -381,7 +387,7 @@ class ConnectionManager:
|
|||||||
# TODO: just push steam path directly
|
# TODO: just push steam path directly
|
||||||
self._connect_steam(menu_only)
|
self._connect_steam(menu_only)
|
||||||
|
|
||||||
@call_on_thread(dialogs.waiting_for_mods, show_cancel=True)
|
@call_on_thread(waiting_for_mods, show_cancel=True)
|
||||||
def update_and_connect(self, menu_only: bool = False) -> None:
|
def update_and_connect(self, menu_only: bool = False) -> None:
|
||||||
if len(self.missing_mods) > 0:
|
if len(self.missing_mods) > 0:
|
||||||
self._update_mods(menu_only)
|
self._update_mods(menu_only)
|
||||||
|
|||||||
+34
-33
@@ -1,7 +1,8 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.strings import metadata
|
from dzgui.util import strings
|
||||||
|
from dzgui.strings.filters import all_maps
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from dzgui.model.model_factory import FastInsertListStore
|
from dzgui.model.model_factory import FastInsertListStore
|
||||||
@@ -12,43 +13,43 @@ class FilterManager:
|
|||||||
|
|
||||||
self.map_store = ModelFactory().make_map_store()
|
self.map_store = ModelFactory().make_map_store()
|
||||||
|
|
||||||
# TODO: namespace under own file: metadata.filters
|
# TODO: namespace under own file: strings.filters
|
||||||
self.default_filters = {
|
self.default_filters = {
|
||||||
metadata.filter_1pp: True,
|
strings.filter_1pp: True,
|
||||||
metadata.filter_day: True,
|
strings.filter_day: True,
|
||||||
metadata.filter_empty: show_empty,
|
strings.filter_empty: show_empty,
|
||||||
metadata.filter_3pp: True,
|
strings.filter_3pp: True,
|
||||||
metadata.filter_night: True,
|
strings.filter_night: True,
|
||||||
metadata.filter_full: show_full,
|
strings.filter_full: show_full,
|
||||||
metadata.filter_official: True,
|
strings.filter_official: True,
|
||||||
metadata.filter_modded: True,
|
strings.filter_modded: True,
|
||||||
metadata.filter_lowpop: True,
|
strings.filter_lowpop: True,
|
||||||
metadata.filter_unofficial: True,
|
strings.filter_unofficial: True,
|
||||||
metadata.filter_unmodded: True,
|
strings.filter_unmodded: True,
|
||||||
metadata.filter_duplicate: False,
|
strings.filter_duplicate: False,
|
||||||
metadata.filter_nonascii: False,
|
strings.filter_nonascii: False,
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: strings
|
# TODO: strings
|
||||||
self.tooltips = {
|
self.tooltips = {
|
||||||
metadata.filter_1pp: "First-person perspective",
|
strings.filter_1pp: "First-person perspective",
|
||||||
metadata.filter_day: "In-game time between 0600 and 1759",
|
strings.filter_day: "In-game time between 0600 and 1759",
|
||||||
metadata.filter_empty: "Servers with no players",
|
strings.filter_empty: "Servers with no players",
|
||||||
metadata.filter_3pp: "Third-person perspective",
|
strings.filter_3pp: "Third-person perspective",
|
||||||
metadata.filter_night: "In-game time between 1800 and 0559",
|
strings.filter_night: "In-game time between 1800 and 0559",
|
||||||
metadata.filter_full: "Servers with no open slots",
|
strings.filter_full: "Servers with no open slots",
|
||||||
metadata.filter_official: "Bohemia official servers",
|
strings.filter_official: "Bohemia official servers",
|
||||||
metadata.filter_nonascii: "Server names using non-standard, complex glyphs",
|
strings.filter_nonascii: "Server names using non-standard, complex glyphs",
|
||||||
metadata.filter_lowpop: "Current population is under 30% of total",
|
strings.filter_lowpop: "Current population is under 30% of total",
|
||||||
metadata.filter_unofficial: "Third-party servers",
|
strings.filter_unofficial: "Third-party servers",
|
||||||
metadata.filter_duplicate: "Duplicates of existing servers (usually spoofed)",
|
strings.filter_duplicate: "Duplicates of existing servers (usually spoofed)",
|
||||||
metadata.filter_modded: "Servers with one or more mods",
|
strings.filter_modded: "Servers with one or more mods",
|
||||||
metadata.filter_unmodded: "Servers with no mods",
|
strings.filter_unmodded: "Servers with no mods",
|
||||||
}
|
}
|
||||||
|
|
||||||
self.active_keyword = ""
|
self.active_keyword = ""
|
||||||
self.active_map = (0, metadata.all_maps)
|
self.active_map = (0, all_maps)
|
||||||
self.prior_map = metadata.all_maps
|
self.prior_map = all_maps
|
||||||
|
|
||||||
self.enabled_filters = dict(self.default_filters)
|
self.enabled_filters = dict(self.default_filters)
|
||||||
|
|
||||||
@@ -88,9 +89,9 @@ class FilterManager:
|
|||||||
|
|
||||||
def reinit_map_store(self) -> None:
|
def reinit_map_store(self) -> None:
|
||||||
model = ModelFactory().make_map_store()
|
model = ModelFactory().make_map_store()
|
||||||
model.append([metadata.all_maps])
|
model.append([all_maps])
|
||||||
self.map_store = model
|
self.map_store = model
|
||||||
self.active_map = (0, metadata.all_maps)
|
self.active_map = (0, all_maps)
|
||||||
|
|
||||||
def append_map(self, row: list[str]) -> None:
|
def append_map(self, row: list[str]) -> None:
|
||||||
self.map_store.append(row)
|
self.map_store.append(row)
|
||||||
@@ -104,7 +105,7 @@ class FilterManager:
|
|||||||
|
|
||||||
self.reinit_map_store()
|
self.reinit_map_store()
|
||||||
maps.sort()
|
maps.sort()
|
||||||
clean = [m for m in maps if m != metadata.all_maps]
|
clean = [m for m in maps if m != all_maps]
|
||||||
for m in clean:
|
for m in clean:
|
||||||
self.append_map([m])
|
self.append_map([m])
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class UpdateManager:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
func = StoredFunc(self._on_update_failure, str(e))
|
func = StoredFunc(self._on_update_failure, str(e))
|
||||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
|
|
||||||
def _on_update_success(self) -> None:
|
def _on_update_success(self) -> None:
|
||||||
msg = dialogs.update_success
|
msg = dialogs.update_success
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Sequence, TYPE_CHECKING
|
from typing import Any, Sequence, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.constants import LOG_DELIMITER
|
|
||||||
from dzgui.const.enum import HELP_MENU_ROWS
|
from dzgui.const.enum import HELP_MENU_ROWS
|
||||||
|
from dzgui.util.strings import delimiter
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class ModelFactory:
|
|||||||
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
|
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
|
||||||
store = self.make_log_store()
|
store = self.make_log_store()
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
lines = [line.split(LOG_DELIMITER) for line in f.read().splitlines()]
|
lines = [line.split(delimiter) for line in f.read().splitlines()]
|
||||||
for record in lines:
|
for record in lines:
|
||||||
store.append(record)
|
store.append(record)
|
||||||
return store
|
return store
|
||||||
|
|||||||
+23
-22
@@ -6,7 +6,8 @@ from typing import TYPE_CHECKING
|
|||||||
|
|
||||||
from dzgui.const.enum import FilterMode
|
from dzgui.const.enum import FilterMode
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.strings import metadata
|
from dzgui.util import strings
|
||||||
|
from dzgui.strings import filters as str_filters
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from dzgui.managers.filter import FilterManager
|
from dzgui.managers.filter import FilterManager
|
||||||
@@ -67,32 +68,32 @@ class FiltrationManager:
|
|||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
|
||||||
self.filter_map = {
|
self.filter_map = {
|
||||||
metadata.filter_3pp: self.filter_3pp,
|
strings.filter_3pp: self.filter_3pp,
|
||||||
metadata.filter_1pp: self.filter_1pp,
|
strings.filter_1pp: self.filter_1pp,
|
||||||
metadata.filter_official: self.filter_official,
|
strings.filter_official: self.filter_official,
|
||||||
metadata.filter_unofficial: self.filter_unofficial,
|
strings.filter_unofficial: self.filter_unofficial,
|
||||||
metadata.filter_empty: self.filter_empty,
|
strings.filter_empty: self.filter_empty,
|
||||||
metadata.filter_full: self.filter_full,
|
strings.filter_full: self.filter_full,
|
||||||
metadata.filter_duplicate: self.filter_duplicate,
|
strings.filter_duplicate: self.filter_duplicate,
|
||||||
metadata.filter_day: self.filter_day,
|
strings.filter_day: self.filter_day,
|
||||||
metadata.filter_night: self.filter_night,
|
strings.filter_night: self.filter_night,
|
||||||
metadata.filter_nonascii: self.filter_nonascii,
|
strings.filter_nonascii: self.filter_nonascii,
|
||||||
metadata.filter_lowpop: self.filter_lowpop,
|
strings.filter_lowpop: self.filter_lowpop,
|
||||||
metadata.filter_modded: self.filter_modded,
|
strings.filter_modded: self.filter_modded,
|
||||||
metadata.filter_unmodded: self.filter_unmodded,
|
strings.filter_unmodded: self.filter_unmodded,
|
||||||
}
|
}
|
||||||
|
|
||||||
def filter_3pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
def filter_3pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||||
return [row for row in rows if row.view != metadata.filter_3pp]
|
return [row for row in rows if row.view != strings.filter_3pp]
|
||||||
|
|
||||||
def filter_1pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
def filter_1pp(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||||
return [row for row in rows if row.view != metadata.filter_1pp]
|
return [row for row in rows if row.view != strings.filter_1pp]
|
||||||
|
|
||||||
def filter_official(self, rows: list[ServerRow]) -> list[ServerRow]:
|
def filter_official(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||||
return [row for row in rows if row.provider != metadata.filter_official]
|
return [row for row in rows if row.provider != strings.filter_official]
|
||||||
|
|
||||||
def filter_unofficial(self, rows: list[ServerRow]) -> list[ServerRow]:
|
def filter_unofficial(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||||
return [row for row in rows if row.provider != metadata.filter_unofficial]
|
return [row for row in rows if row.provider != strings.filter_unofficial]
|
||||||
|
|
||||||
def filter_empty(self, rows: list[ServerRow]) -> list[ServerRow]:
|
def filter_empty(self, rows: list[ServerRow]) -> list[ServerRow]:
|
||||||
return [row for row in rows if row.players != 0]
|
return [row for row in rows if row.players != 0]
|
||||||
@@ -291,7 +292,7 @@ class ProxyModelManager:
|
|||||||
rows = self.filtered
|
rows = self.filtered
|
||||||
sel_map = self.filter_man.get_active_map_name()
|
sel_map = self.filter_man.get_active_map_name()
|
||||||
|
|
||||||
if sel_map == metadata.all_maps:
|
if sel_map == str_filters.all_maps:
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
rows = [row for row in rows if row.mapname == sel_map]
|
rows = [row for row in rows if row.mapname == sel_map]
|
||||||
@@ -320,9 +321,9 @@ class ProxyModelManager:
|
|||||||
Sub-filtration of the current model
|
Sub-filtration of the current model
|
||||||
"""
|
"""
|
||||||
pairs = {
|
pairs = {
|
||||||
metadata.filter_3pp: metadata.filter_1pp,
|
strings.filter_3pp: strings.filter_1pp,
|
||||||
metadata.filter_day: metadata.filter_night,
|
strings.filter_day: strings.filter_night,
|
||||||
metadata.filter_official: metadata.filter_unofficial,
|
strings.filter_official: strings.filter_unofficial,
|
||||||
}
|
}
|
||||||
for k, v in pairs.items():
|
for k, v in pairs.items():
|
||||||
if k in filters and v in filters:
|
if k in filters and v in filters:
|
||||||
|
|||||||
+14
-13
@@ -14,7 +14,8 @@ from dzgui.const.constants import (
|
|||||||
)
|
)
|
||||||
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings import dialogs, errors, kb
|
from dzgui.strings import dialogs, kb
|
||||||
|
from dzgui.util.strings import server_timeout, dialog
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -82,7 +83,7 @@ class ServerModelManager:
|
|||||||
self.preserve_on_fail = True
|
self.preserve_on_fail = True
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
@call_on_thread(dialogs.fetching_server)
|
@call_on_thread(dialog.fetching)
|
||||||
def _dump_api(self) -> None:
|
def _dump_api(self) -> None:
|
||||||
# TODO: pass api key a priori in .load() call?
|
# TODO: pass api key a priori in .load() call?
|
||||||
failure_func = StoredFunc(self._cleanup_on_failure)
|
failure_func = StoredFunc(self._cleanup_on_failure)
|
||||||
@@ -125,7 +126,7 @@ class ServerModelManager:
|
|||||||
parsed = Servers.parse_json(servers)
|
parsed = Servers.parse_json(servers)
|
||||||
self._push_data(parsed)
|
self._push_data(parsed)
|
||||||
|
|
||||||
@call_on_thread(dialogs.scanning_lan, show_cancel=True)
|
@call_on_thread(dialog.scanning, show_cancel=True)
|
||||||
def dump_lan(self, port: int, early_abort: bool) -> None:
|
def dump_lan(self, port: int, early_abort: bool) -> None:
|
||||||
self.first_iteration = True
|
self.first_iteration = True
|
||||||
|
|
||||||
@@ -158,7 +159,7 @@ class ServerModelManager:
|
|||||||
parsed = Servers.parse_json(servers)
|
parsed = Servers.parse_json(servers)
|
||||||
self._push_data(parsed)
|
self._push_data(parsed)
|
||||||
|
|
||||||
@call_on_thread(dialogs.fetching_server)
|
@call_on_thread(dialog.fetching)
|
||||||
def _dump_ips(self, ips: list[str]) -> None:
|
def _dump_ips(self, ips: list[str]) -> None:
|
||||||
job = Servers.query_direct
|
job = Servers.query_direct
|
||||||
servers = []
|
servers = []
|
||||||
@@ -198,20 +199,20 @@ class ServerModelManager:
|
|||||||
parsed = Servers.parse_json(servers)
|
parsed = Servers.parse_json(servers)
|
||||||
self._push_data(parsed)
|
self._push_data(parsed)
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def add_by_ip(self, addr: str) -> None:
|
def add_by_ip(self, addr: str) -> None:
|
||||||
self.preserve_on_fail = True
|
self.preserve_on_fail = True
|
||||||
try:
|
try:
|
||||||
res = Servers.query_by_ip(addr)
|
res = Servers.query_by_ip(addr)
|
||||||
self._parse_single_record(res)
|
self._parse_single_record(res)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
self.thread_man.set_cleanup_func(
|
self.thread_man.set_cleanup_func(
|
||||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def add_by_record(self, record: Servers.Record) -> None:
|
def add_by_record(self, record: Servers.Record) -> None:
|
||||||
self.preserve_on_fail = True
|
self.preserve_on_fail = True
|
||||||
# NOTE: rationale: a raw Record as shown in server browser may resolve to a different IP
|
# NOTE: rationale: a raw Record as shown in server browser may resolve to a different IP
|
||||||
@@ -219,20 +220,20 @@ class ServerModelManager:
|
|||||||
res = Servers.query_by_record(record)
|
res = Servers.query_by_record(record)
|
||||||
self._parse_single_record(res)
|
self._parse_single_record(res)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
self.thread_man.set_cleanup_func(
|
self.thread_man.set_cleanup_func(
|
||||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def remove_by_record(self, record: Servers.Record) -> None:
|
def remove_by_record(self, record: Servers.Record) -> None:
|
||||||
self.preserve_on_fail = True
|
self.preserve_on_fail = True
|
||||||
try:
|
try:
|
||||||
res = Servers.query_by_record(record)
|
res = Servers.query_by_record(record)
|
||||||
self._parse_single_record(res, delete=True)
|
self._parse_single_record(res, delete=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
self.thread_man.set_cleanup_func(
|
self.thread_man.set_cleanup_func(
|
||||||
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||||
)
|
)
|
||||||
@@ -286,7 +287,7 @@ class ServerModelManager:
|
|||||||
config_man.remove_from_history_file(fqip)
|
config_man.remove_from_history_file(fqip)
|
||||||
self.update_history()
|
self.update_history()
|
||||||
|
|
||||||
@call_on_thread(dialogs.querying)
|
@call_on_thread(dialog.querying)
|
||||||
def update_playercount(
|
def update_playercount(
|
||||||
self, treeiter: Gtk.TreeIter, record: Servers.Record
|
self, treeiter: Gtk.TreeIter, record: Servers.Record
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -447,7 +448,7 @@ class ServerModelManager:
|
|||||||
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
||||||
# customize statusbar and dialog accordingly
|
# customize statusbar and dialog accordingly
|
||||||
if show_dialog:
|
if show_dialog:
|
||||||
dialog = ExceptionDialog(self.controller, errors.server_timeout)
|
dialog = ExceptionDialog(self.controller, server_timeout)
|
||||||
dialog.set_details_buffer(kb.DZG_006)
|
dialog.set_details_buffer(kb.DZG_006)
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
dialog.run() # type: ignore[no-untyped-call]
|
dialog.run() # type: ignore[no-untyped-call]
|
||||||
@@ -470,7 +471,7 @@ class ServerModelManager:
|
|||||||
def _get_proxy_man(self) -> "ProxyModelManager":
|
def _get_proxy_man(self) -> "ProxyModelManager":
|
||||||
return self.proxy_man
|
return self.proxy_man
|
||||||
|
|
||||||
@call_on_thread(dialogs.filtering)
|
@call_on_thread(dialog.filtering)
|
||||||
def refilter(self, mode: FilterMode) -> None:
|
def refilter(self, mode: FilterMode) -> None:
|
||||||
self.first_iteration = False
|
self.first_iteration = False
|
||||||
proxy_man = self._get_proxy_man()
|
proxy_man = self._get_proxy_man()
|
||||||
|
|||||||
+10
-10
@@ -1,16 +1,16 @@
|
|||||||
clipboard_button = "Copy to clipboard"
|
clipboard_button = "Copy to clipboard"
|
||||||
clipboard_ip_button = "Copy IP to clipboard"
|
clipboard_ip_button = "Copy IP to clipboard"
|
||||||
copy_button = "Copy"
|
|
||||||
dock_button_collapse = "Collapse the connection panel"
|
dock_button_collapse = "Collapse the connection panel"
|
||||||
dock_button_expand = "Expand the connection panel"
|
dock_button_expand = "Expand the connection panel"
|
||||||
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 = "Steam Workshop"
|
||||||
workshop_tooltip = "Open your Workshop subscriptions"
|
workshop_tooltip = "Open your Workshop subscriptions"
|
||||||
|
|
||||||
|
version_notifier = "Copied!"
|
||||||
|
version_tooltip = "Click to copy to clipboard"
|
||||||
|
|
||||||
|
update_button = "Updates available"
|
||||||
|
|
||||||
|
unset_button_label = "Unset"
|
||||||
|
unset_button_tooltip = "Unset this server as favorite"
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
collapse_all = "Collapse all"
|
collapse_all = "Collapse all"
|
||||||
expand_all = "Expand all"
|
expand_all = "Expand all"
|
||||||
missing_changelog = "Error: failed to read changelog"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
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"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
_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."
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
page_header = "Developers"
|
|
||||||
paths_label = "Resolved XDG paths"
|
|
||||||
prefs_label = "Boot preferences"
|
|
||||||
columns = ["Key", "Value"]
|
|
||||||
+31
-35
@@ -1,37 +1,33 @@
|
|||||||
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"
|
|
||||||
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"
|
|
||||||
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_launch = "Waiting for DayZ to launch"
|
||||||
waiting_for_mods = "Queueing up mods (step 1/2)"
|
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"
|
||||||
|
|
||||||
|
debug_heading = "Debug"
|
||||||
|
debug_secondary = "Launch arguments"
|
||||||
|
|
||||||
|
toggle_calc = "Toggle calculator"
|
||||||
|
|
||||||
|
server_details = "Server details"
|
||||||
|
server_message = "Server message"
|
||||||
|
|
||||||
|
caught_cancel_signal = "Caught cancel signal, cleaning up"
|
||||||
@@ -1,14 +1,7 @@
|
|||||||
api_validation_error = (
|
api_validation_error = (
|
||||||
"API key validation error. Key was typed incorrectly or is defunct."
|
"API key validation error. Key was typed incorrectly or is defunct."
|
||||||
)
|
)
|
||||||
|
|
||||||
api_popover = "API key validation failed."
|
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."
|
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."
|
workshop_endpoint_error = "Steam Workshop service unavailable, try again later."
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
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"
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
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"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# 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"
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
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"
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
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"
|
|
||||||
+22
-28
@@ -1,34 +1,28 @@
|
|||||||
always_fs = "Always fullscreen"
|
|
||||||
api_failed = "API validation failed"
|
|
||||||
api_key = "API Key"
|
|
||||||
api_placeholder = "Enter API key"
|
|
||||||
api_validate = "Validate"
|
|
||||||
developers = "Developers"
|
developers = "Developers"
|
||||||
distance = "Distance display"
|
start_tab = "Start tab"
|
||||||
|
workshop_label = "Subscribed mods"
|
||||||
|
steam_combo = "Steam"
|
||||||
flatpak_combo = "Flatpak"
|
flatpak_combo = "Flatpak"
|
||||||
flatpak_container = "Containerized (flatpak-spawn --host)"
|
|
||||||
flatpak_container_combo = "Flatpak (container)"
|
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"
|
||||||
|
api_failed = "API validation failed"
|
||||||
|
api_validate = "Validate"
|
||||||
|
|
||||||
|
flatpak_label = "Flatpak client"
|
||||||
|
flatpak_standard = "Standard"
|
||||||
|
flatpak_container = "Containerized (flatpak-spawn --host)"
|
||||||
flatpak_info = (
|
flatpak_info = (
|
||||||
"Containerized mode is used on certain distributions. May have side effects."
|
"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"
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
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"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
esc_to_return = "Press ESC to return"
|
|
||||||
question_to_return = "Press ? to return"
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
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",
|
|
||||||
]
|
|
||||||
+2
-2
@@ -10,8 +10,8 @@ from dzgui.const.constants import APP_NAME
|
|||||||
from dzgui.const.enum import Preferences
|
from dzgui.const.enum import Preferences
|
||||||
from dzgui.config.query import lookup
|
from dzgui.config.query import lookup
|
||||||
from dzgui.init.prefix import get_version
|
from dzgui.init.prefix import get_version
|
||||||
from dzgui.strings import metadata
|
|
||||||
from dzgui.util.redact import redact_home
|
from dzgui.util.redact import redact_home
|
||||||
|
from dzgui.util.strings import unknown
|
||||||
|
|
||||||
logger = logging.getLogger(APP_NAME)
|
logger = logging.getLogger(APP_NAME)
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
|
|||||||
distro = platform.freedesktop_os_release()["ID_LIKE"]
|
distro = platform.freedesktop_os_release()["ID_LIKE"]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warn(e)
|
logger.warn(e)
|
||||||
distro = metadata.unknown
|
distro = unknown
|
||||||
|
|
||||||
kernel = os.uname().release
|
kernel = os.uname().release
|
||||||
cpu = get_cpu_model()
|
cpu = get_cpu_model()
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import re
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from dzgui.util.localize import number
|
from dzgui.util.localize import number
|
||||||
from dzgui.strings import crumbs, errors, generic
|
from dzgui.strings.generic import selectable_tree
|
||||||
|
from dzgui.util.strings import no_mods, no_servers, workshop
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -44,10 +45,10 @@ def format_hyperlinks(text: str) -> str:
|
|||||||
|
|
||||||
def format_mods(size: int, mods: int) -> str:
|
def format_mods(size: int, mods: int) -> str:
|
||||||
if mods == 0:
|
if mods == 0:
|
||||||
return errors.no_mods
|
return no_mods
|
||||||
l_size = number(size)
|
l_size = number(size)
|
||||||
plural = pluralize("mods", mods)
|
plural = pluralize("mods", mods)
|
||||||
suffix = generic.selectable_tree
|
suffix = selectable_tree
|
||||||
return f"Found {mods:n} {plural} taking up {l_size} MiB. {suffix}"
|
return f"Found {mods:n} {plural} taking up {l_size} MiB. {suffix}"
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ def format_mib(bits: int) -> float:
|
|||||||
|
|
||||||
def format_server_mods(mods: int) -> str:
|
def format_server_mods(mods: int) -> str:
|
||||||
plural = pluralize("mods", mods)
|
plural = pluralize("mods", mods)
|
||||||
return f"Found {mods:n} {plural}. {crumbs.workshop}"
|
return f"Found {mods:n} {plural}. {workshop}"
|
||||||
|
|
||||||
|
|
||||||
def format_player_count(model: Gtk.TreeModel | None, control: list[Any]) -> str:
|
def format_player_count(model: Gtk.TreeModel | None, control: list[Any]) -> str:
|
||||||
@@ -65,7 +66,7 @@ def format_player_count(model: Gtk.TreeModel | None, control: list[Any]) -> str:
|
|||||||
hits: int
|
hits: int
|
||||||
status: str
|
status: str
|
||||||
if model is None:
|
if model is None:
|
||||||
return errors.no_servers
|
return no_servers
|
||||||
else:
|
else:
|
||||||
hits = len(model)
|
hits = len(model)
|
||||||
for row in model:
|
for row in model:
|
||||||
|
|||||||
@@ -0,0 +1,546 @@
|
|||||||
|
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"
|
||||||
@@ -2,6 +2,9 @@ from typing import Callable, Literal, Self, TYPE_CHECKING
|
|||||||
|
|
||||||
from dzgui.util.clip import copy_clipboard
|
from dzgui.util.clip import copy_clipboard
|
||||||
from dzgui.strings import buttons
|
from dzgui.strings import buttons
|
||||||
|
from dzgui.util.strings import (
|
||||||
|
atomic_buttons,
|
||||||
|
)
|
||||||
from dzgui.const.icons import (
|
from dzgui.const.icons import (
|
||||||
ICON_CLIPBOARD,
|
ICON_CLIPBOARD,
|
||||||
ICON_CLOSE,
|
ICON_CLOSE,
|
||||||
@@ -96,7 +99,7 @@ class LargeIconTextButton(IconButton):
|
|||||||
|
|
||||||
class ClipboardButton(IconTextButton):
|
class ClipboardButton(IconTextButton):
|
||||||
def __init__(self, func: Callable[[], str]) -> None:
|
def __init__(self, func: Callable[[], str]) -> None:
|
||||||
super().__init__(ICON_CLIPBOARD, buttons.copy_button)
|
super().__init__(ICON_CLIPBOARD, atomic_buttons.copy)
|
||||||
self.connect("clicked", self._on_button_clicked, func)
|
self.connect("clicked", self._on_button_clicked, func)
|
||||||
|
|
||||||
self.set_tooltip_text(buttons.clipboard_button)
|
self.set_tooltip_text(buttons.clipboard_button)
|
||||||
@@ -136,7 +139,7 @@ class RefreshButton(IconTextButton):
|
|||||||
def __init__(self, controller: "Controller") -> None:
|
def __init__(self, controller: "Controller") -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
icon=ICON_REFRESH,
|
icon=ICON_REFRESH,
|
||||||
label=buttons.refresh_button,
|
label=atomic_buttons.refresh,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
@@ -149,7 +152,7 @@ class RefreshButton(IconTextButton):
|
|||||||
self.set_margin_top(10)
|
self.set_margin_top(10)
|
||||||
self.set_margin_start(80)
|
self.set_margin_start(80)
|
||||||
self.set_margin_end(80)
|
self.set_margin_end(80)
|
||||||
self.set_tooltip_text(buttons.refresh_tooltip)
|
self.set_tooltip_text(atomic_buttons.refresh_tooltip)
|
||||||
|
|
||||||
self.connect("clicked", self._on_refresh_clicked)
|
self.connect("clicked", self._on_refresh_clicked)
|
||||||
emitter.connect("servers_loaded", self._on_load)
|
emitter.connect("servers_loaded", self._on_load)
|
||||||
@@ -193,21 +196,21 @@ class RefreshButton(IconTextButton):
|
|||||||
|
|
||||||
def show_time(self, state: bool) -> None:
|
def show_time(self, state: bool) -> None:
|
||||||
if state is True:
|
if state is True:
|
||||||
self.set_label(f"{buttons.refresh_button} ({str(self.time)})")
|
self.set_label(f"{atomic_buttons.refresh} ({str(self.time)})")
|
||||||
else:
|
else:
|
||||||
self.set_label(buttons.refresh_button)
|
self.set_label(atomic_buttons.refresh)
|
||||||
|
|
||||||
|
|
||||||
class KeysButton(IconTextButton):
|
class KeysButton(IconTextButton):
|
||||||
def __init__(self, controller: "Controller") -> None:
|
def __init__(self, controller: "Controller") -> None:
|
||||||
super().__init__(icon=ICON_INPUT_KEYBOARD, label=buttons.keys_button)
|
super().__init__(icon=ICON_INPUT_KEYBOARD, label=atomic_buttons.keys)
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.set_margin_top(10)
|
self.set_margin_top(10)
|
||||||
self.set_margin_start(80)
|
self.set_margin_start(80)
|
||||||
self.set_margin_end(80)
|
self.set_margin_end(80)
|
||||||
|
|
||||||
self.set_tooltip_text(buttons.keys_button_tooltip)
|
self.set_tooltip_text(atomic_buttons.keys_tooltip)
|
||||||
|
|
||||||
self.connect("clicked", self._on_keys_clicked)
|
self.connect("clicked", self._on_keys_clicked)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.enum import NotebookPage
|
from dzgui.const.enum import NotebookPage
|
||||||
from dzgui.strings import crumbs as _crumbs
|
from dzgui.util.strings import label_main_menu, crumbs
|
||||||
from dzgui.util.format import embolden
|
from dzgui.util.format import embolden
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -19,7 +19,7 @@ class Breadcrumbs(Gtk.Label):
|
|||||||
def __init__(self, controller: "Controller") -> None:
|
def __init__(self, controller: "Controller") -> None:
|
||||||
super().__init__(halign=Gtk.Align.START)
|
super().__init__(halign=Gtk.Align.START)
|
||||||
|
|
||||||
crumbs = embolden(_crumbs.main_menu)
|
crumbs = embolden(label_main_menu)
|
||||||
self.set_markup(crumbs)
|
self.set_markup(crumbs)
|
||||||
|
|
||||||
notebook = controller.get_notebook()
|
notebook = controller.get_notebook()
|
||||||
@@ -47,7 +47,7 @@ class Breadcrumbs(Gtk.Label):
|
|||||||
self.set_crumbs(crumbs)
|
self.set_crumbs(crumbs)
|
||||||
|
|
||||||
def set_server_crumbs(self, suffix: str) -> None:
|
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:
|
def set_crumbs(self, crumbs: str) -> None:
|
||||||
text = embolden(crumbs)
|
text = embolden(crumbs)
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ from typing import Any, Callable, TYPE_CHECKING
|
|||||||
from dzgui.api.servers import validate_ip
|
from dzgui.api.servers import validate_ip
|
||||||
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
||||||
from dzgui.util.css import add_class, remove_class
|
from dzgui.util.css import add_class, remove_class
|
||||||
from dzgui.strings import connect_panel, errors, options
|
from dzgui.strings import connect_panel
|
||||||
|
from dzgui.strings.options import api_placeholder, api_validate
|
||||||
|
from dzgui.strings.errors import api_popover
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -142,7 +144,7 @@ class APIEntry(Gtk.Box):
|
|||||||
self.func: Callable[[str], None] | None = None
|
self.func: Callable[[str], None] | None = None
|
||||||
|
|
||||||
self.entry = Gtk.Entry(
|
self.entry = Gtk.Entry(
|
||||||
width_chars=60, hexpand=True, placeholder_text=options.api_placeholder
|
width_chars=60, hexpand=True, placeholder_text=api_placeholder
|
||||||
)
|
)
|
||||||
self.entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, ICON_VIEW_REVEAL)
|
self.entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, ICON_VIEW_REVEAL)
|
||||||
self.entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
|
self.entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
|
||||||
@@ -151,13 +153,13 @@ class APIEntry(Gtk.Box):
|
|||||||
self.entry.connect("icon-release", self._on_icon_release)
|
self.entry.connect("icon-release", self._on_icon_release)
|
||||||
self.entry.connect("activate", self._on_field_activated)
|
self.entry.connect("activate", self._on_field_activated)
|
||||||
|
|
||||||
self.submit = Gtk.Button(label=options.api_validate)
|
self.submit = Gtk.Button(label=api_validate)
|
||||||
self.submit.set_sensitive(False)
|
self.submit.set_sensitive(False)
|
||||||
self.submit.connect("clicked", self._on_submit)
|
self.submit.connect("clicked", self._on_submit)
|
||||||
|
|
||||||
self.pop = Gtk.Popover()
|
self.pop = Gtk.Popover()
|
||||||
self.pop_label = Gtk.Label(
|
self.pop_label = Gtk.Label(
|
||||||
label=errors.api_popover,
|
label=api_popover,
|
||||||
margin_start=10,
|
margin_start=10,
|
||||||
margin_end=10,
|
margin_end=10,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import Self, TYPE_CHECKING
|
from typing import Self, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.enum import ModButton
|
from dzgui.const.enum import ModButton
|
||||||
from dzgui.strings import mod_panel
|
from dzgui.util.strings import mod_panel
|
||||||
from dzgui.views.components.labels import BoldLabel
|
from dzgui.views.components.labels import BoldLabel
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import Self, Union, TYPE_CHECKING
|
from typing import Self, Union, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.enum import NotebookPage, ServerTab
|
from dzgui.const.enum import NotebookPage, ServerTab
|
||||||
from dzgui.strings import statusbar
|
from dzgui.util.strings import esc_to_return, question_to_return
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -70,14 +70,14 @@ class Statusbar(Gtk.Grid):
|
|||||||
NotebookPage.OFFLINE,
|
NotebookPage.OFFLINE,
|
||||||
):
|
):
|
||||||
self.prior_enum = enum
|
self.prior_enum = enum
|
||||||
self.set_by_context(enum, statusbar.esc_to_return)
|
self.set_by_context(enum, esc_to_return)
|
||||||
return
|
return
|
||||||
|
|
||||||
match enum:
|
match enum:
|
||||||
case NotebookPage.HELP:
|
case NotebookPage.HELP:
|
||||||
bar = self.controller.get_help_row()
|
bar = self.controller.get_help_row()
|
||||||
case NotebookPage.KEYS:
|
case NotebookPage.KEYS:
|
||||||
bar = statusbar.question_to_return
|
bar = question_to_return
|
||||||
case _:
|
case _:
|
||||||
bar = self.prior_status
|
bar = self.prior_status
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ from dzgui.init.update import check_updates
|
|||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings import preboot, dialogs
|
from dzgui.strings import preboot, dialogs
|
||||||
from dzgui.util.format import format_exception
|
from dzgui.util.format import format_exception
|
||||||
|
from dzgui.util.strings import dialog_header
|
||||||
from dzgui.util.symlink import rebuild_symlinks
|
from dzgui.util.symlink import rebuild_symlinks
|
||||||
from dzgui.views.components.buttons import ClipboardButton
|
from dzgui.views.components.buttons import ClipboardButton
|
||||||
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GLib, Gdk, Pango
|
from gi.repository import Gtk, GLib, Gdk
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from dzgui.config.xdg import Xdg
|
from dzgui.config.xdg import Xdg
|
||||||
@@ -35,7 +36,7 @@ class Success(Enum):
|
|||||||
class BootDialog(ColorAwareApp, Gtk.Dialog): # type: ignore
|
class BootDialog(ColorAwareApp, Gtk.Dialog): # type: ignore
|
||||||
def __init__(self, parent: "BootWindow", xdg: "Xdg", version: str) -> None:
|
def __init__(self, parent: "BootWindow", xdg: "Xdg", version: str) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
title=dialogs.default_header,
|
title=dialog_header,
|
||||||
transient_for=parent,
|
transient_for=parent,
|
||||||
modal=True,
|
modal=True,
|
||||||
)
|
)
|
||||||
@@ -94,7 +95,7 @@ class BootDialog(ColorAwareApp, Gtk.Dialog): # type: ignore
|
|||||||
margin_top=30,
|
margin_top=30,
|
||||||
margin_bottom=30,
|
margin_bottom=30,
|
||||||
)
|
)
|
||||||
self.error_label = Gtk.Label(margin_start=15, margin_end=15, wrap=True, wrap_mode=Pango.WrapMode.WORD)
|
self.error_label = Gtk.Label(margin_start=15, margin_end=15)
|
||||||
|
|
||||||
# TODO: abstract class
|
# TODO: abstract class
|
||||||
self.copy_button = ClipboardButton(self.error_label.get_text)
|
self.copy_button = ClipboardButton(self.error_label.get_text)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import textwrap
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from typing import Self
|
from typing import Self
|
||||||
from dzgui.strings import dialogs
|
from dzgui.util.strings import dialog_error, dialog_header
|
||||||
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
from dzgui.views.mixins.colorscheme import ColorAwareApp
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -14,8 +14,8 @@ from gi.repository import Gtk
|
|||||||
class AbortDialog(ColorAwareApp, Gtk.MessageDialog): # type: ignore
|
class AbortDialog(ColorAwareApp, Gtk.MessageDialog): # type: ignore
|
||||||
def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None:
|
def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
title=dialogs.default_header,
|
title=dialog_header,
|
||||||
text=(dialogs.error).upper(),
|
text=dialog_error,
|
||||||
transient_for=None,
|
transient_for=None,
|
||||||
buttons=buttons,
|
buttons=buttons,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Literal, Self, TYPE_CHECKING
|
from typing import Literal, Self, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.strings import dialogs
|
from dzgui.strings import dialogs
|
||||||
|
from dzgui.util import strings
|
||||||
from dzgui.views.components.buttons import ClipboardButton
|
from dzgui.views.components.buttons import ClipboardButton
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -27,7 +28,7 @@ class GenericDialog(Gtk.MessageDialog):
|
|||||||
buttons=buttons,
|
buttons=buttons,
|
||||||
text=text,
|
text=text,
|
||||||
secondary_text=secondary,
|
secondary_text=secondary,
|
||||||
title=dialogs.default_header,
|
title=strings.dialog_header,
|
||||||
modal=True,
|
modal=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ class ConfirmationDialog(GenericDialog):
|
|||||||
def __init__(self, controller: "Controller", secondary: str):
|
def __init__(self, controller: "Controller", secondary: str):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=dialogs.confirm,
|
text=strings.confirm,
|
||||||
mtype=Gtk.MessageType.QUESTION,
|
mtype=Gtk.MessageType.QUESTION,
|
||||||
buttons=Gtk.ButtonsType.OK_CANCEL,
|
buttons=Gtk.ButtonsType.OK_CANCEL,
|
||||||
secondary=secondary,
|
secondary=secondary,
|
||||||
@@ -62,7 +63,7 @@ class IgnoreDialog(GenericDialog):
|
|||||||
def __init__(self, controller: "Controller", secondary: str):
|
def __init__(self, controller: "Controller", secondary: str):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=dialogs.confirm,
|
text=strings.confirm,
|
||||||
mtype=Gtk.MessageType.QUESTION,
|
mtype=Gtk.MessageType.QUESTION,
|
||||||
buttons=Gtk.ButtonsType.OK_CANCEL,
|
buttons=Gtk.ButtonsType.OK_CANCEL,
|
||||||
secondary=secondary,
|
secondary=secondary,
|
||||||
@@ -78,7 +79,7 @@ class NotifyDialog(GenericDialog):
|
|||||||
def __init__(self, controller: "Controller", secondary: str):
|
def __init__(self, controller: "Controller", secondary: str):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=dialogs.notice,
|
text=strings.notice,
|
||||||
mtype=Gtk.MessageType.INFO,
|
mtype=Gtk.MessageType.INFO,
|
||||||
buttons=Gtk.ButtonsType.OK,
|
buttons=Gtk.ButtonsType.OK,
|
||||||
secondary=secondary,
|
secondary=secondary,
|
||||||
@@ -95,7 +96,7 @@ class WaitDialog(GenericDialog):
|
|||||||
):
|
):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=dialogs.wait,
|
text=strings.wait,
|
||||||
mtype=Gtk.MessageType.INFO,
|
mtype=Gtk.MessageType.INFO,
|
||||||
buttons=Gtk.ButtonsType.NONE,
|
buttons=Gtk.ButtonsType.NONE,
|
||||||
secondary=secondary,
|
secondary=secondary,
|
||||||
@@ -149,14 +150,14 @@ class QuitDialog(GenericDialog):
|
|||||||
def __init__(self, controller: "Controller", secondary: str):
|
def __init__(self, controller: "Controller", secondary: str):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=dialogs.restart_required,
|
text=strings.restart_required,
|
||||||
mtype=Gtk.MessageType.INFO,
|
mtype=Gtk.MessageType.INFO,
|
||||||
buttons=Gtk.ButtonsType.NONE,
|
buttons=Gtk.ButtonsType.NONE,
|
||||||
secondary=secondary,
|
secondary=secondary,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.add_button(dialogs.exit_app, Gtk.ResponseType.OK)
|
self.add_button(strings.exit_app, Gtk.ResponseType.OK)
|
||||||
|
|
||||||
self.connect("response", self._on_response)
|
self.connect("response", self._on_response)
|
||||||
# TODO: superfluous with the above
|
# TODO: superfluous with the above
|
||||||
@@ -249,8 +250,8 @@ class ExceptionDialog(TextBufferDialog):
|
|||||||
def __init__(self, controller: "Controller", trace: str):
|
def __init__(self, controller: "Controller", trace: str):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
heading=dialogs.error,
|
heading=strings.error_heading,
|
||||||
secondary=dialogs.something_wrong,
|
secondary=strings.something_wrong,
|
||||||
text=trace,
|
text=trace,
|
||||||
mtype=Gtk.MessageType.ERROR,
|
mtype=Gtk.MessageType.ERROR,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import textwrap
|
import textwrap
|
||||||
from typing import Self, TYPE_CHECKING
|
from typing import Self, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.strings import dialogs
|
from dzgui.util.strings import notice
|
||||||
from dzgui.views.dialogs.generic import GenericDialog
|
from dzgui.views.dialogs.generic import GenericDialog
|
||||||
from dzgui.views.components.buttons import SteamTextButton
|
from dzgui.views.components.buttons import SteamTextButton
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ class WorkshopLinkDialog(GenericDialog):
|
|||||||
text = textwrap.dedent(text).replace("\n", " ")
|
text = textwrap.dedent(text).replace("\n", " ")
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller,
|
controller,
|
||||||
text=dialogs.notice,
|
text=notice,
|
||||||
mtype=Gtk.MessageType.INFO,
|
mtype=Gtk.MessageType.INFO,
|
||||||
buttons=Gtk.ButtonsType.OK,
|
buttons=Gtk.ButtonsType.OK,
|
||||||
secondary=text,
|
secondary=text,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import logging
|
|||||||
|
|
||||||
from dzgui.const.constants import APP_NAME
|
from dzgui.const.constants import APP_NAME
|
||||||
from dzgui.const.enum import ContextMenuItem
|
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.keys import is_ctrl_mask, is_navkey
|
||||||
|
from dzgui.util.strings import edit_note
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
from dzgui.views.trees.tree_base import TreeView
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -70,7 +70,7 @@ class ContextMixin(TreeView):
|
|||||||
|
|
||||||
if row == ContextMenuItem.ADD_NOTE:
|
if row == ContextMenuItem.ADD_NOTE:
|
||||||
if self.controller.has_note():
|
if self.controller.has_note():
|
||||||
item.set_label(context_menu.edit_note)
|
item.set_label(edit_note)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from importlib import resources
|
|||||||
|
|
||||||
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, CHANGELOG_PATH
|
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, CHANGELOG_PATH
|
||||||
from dzgui.strings import changelog as clog
|
from dzgui.strings import changelog as clog
|
||||||
|
from dzgui.util.strings import missing_changelog
|
||||||
from dzgui.util.format import format_pango
|
from dzgui.util.format import format_pango
|
||||||
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
||||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||||
@@ -29,10 +30,8 @@ class Changelog(HelpMenuMixin, ScrollableMixin, Gtk.ScrolledWindow): # type: ig
|
|||||||
try:
|
try:
|
||||||
changelog = resources.read_text(APP_NAME_LOWER, CHANGELOG_PATH)
|
changelog = resources.read_text(APP_NAME_LOWER, CHANGELOG_PATH)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
# TODO: this string will never be parsable by self._parse()
|
|
||||||
# need to update entire label area
|
|
||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
changelog = clog.missing_changelog
|
changelog = missing_changelog
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.box = Gtk.Box(
|
self.box = Gtk.Box(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from typing import Self, Union, TYPE_CHECKING
|
|||||||
|
|
||||||
from dzgui.const.enum import NotebookPage
|
from dzgui.const.enum import NotebookPage
|
||||||
from dzgui.util.css import add_class
|
from dzgui.util.css import add_class
|
||||||
from dzgui.strings import developers
|
from dzgui.util.strings import developers
|
||||||
from dzgui.views.components.labels import BoldLabel
|
from dzgui.views.components.labels import BoldLabel
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
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
|
orientation=Gtk.Orientation.VERTICAL, margin_start=10, margin_end=10
|
||||||
)
|
)
|
||||||
|
|
||||||
heading = Gtk.Label(label=developers.page_header)
|
heading = Gtk.Label(label=developers.header)
|
||||||
heading.set_halign(Gtk.Align.CENTER)
|
heading.set_halign(Gtk.Align.CENTER)
|
||||||
add_class(heading, "page-heading")
|
add_class(heading, "page-heading")
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||||
from dzgui.strings import keybindings
|
from dzgui.util.strings import navigation, servers, vim, key_header, key_contexts
|
||||||
from dzgui.util.css import add_class
|
from dzgui.util.css import add_class
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@@ -26,12 +26,10 @@ class Keybindings(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
|
||||||
label = Gtk.Label(label=keybindings.key_header)
|
label = Gtk.Label(label=key_header)
|
||||||
add_class(label, "page-heading")
|
add_class(label, "page-heading")
|
||||||
|
|
||||||
grid = self.build_grid(
|
grid = self.build_grid([servers, navigation, vim])
|
||||||
[keybindings.servers, keybindings.navigation, keybindings.vim]
|
|
||||||
)
|
|
||||||
self.box.add(label)
|
self.box.add(label)
|
||||||
self.box.add(grid)
|
self.box.add(grid)
|
||||||
self.add(self.box)
|
self.add(self.box)
|
||||||
@@ -96,7 +94,7 @@ class Keybindings(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
|
|
||||||
row, column = 1, 1
|
row, column = 1, 1
|
||||||
w, h = 1, 1
|
w, h = 1, 1
|
||||||
sidebar = self.build_sidebar(keybindings.key_contexts)
|
sidebar = self.build_sidebar(key_contexts)
|
||||||
separator = Gtk.Separator()
|
separator = Gtk.Separator()
|
||||||
keys_box = self.build_keys(items)
|
keys_box = self.build_keys(items)
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from dzgui.const.constants import (
|
|||||||
from dzgui.const.endpoints import STEAM_API_SETUP
|
from dzgui.const.endpoints import STEAM_API_SETUP
|
||||||
from dzgui.const.enum import Preferences, ServerTab
|
from dzgui.const.enum import Preferences, ServerTab
|
||||||
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
from dzgui.const.icons import ICON_VIEW_CONCEAL, ICON_VIEW_REVEAL
|
||||||
from dzgui.strings import errors, metadata, options
|
from dzgui.strings import options
|
||||||
from dzgui.util import css, open_links
|
from dzgui.util import strings, css, open_links
|
||||||
from dzgui.views.components.box import ShortHBox, VBox
|
from dzgui.views.components.box import ShortHBox, VBox
|
||||||
from dzgui.views.components.eventbox import InfoEventBox
|
from dzgui.views.components.eventbox import InfoEventBox
|
||||||
from dzgui.views.components.labels import LeftLabel
|
from dzgui.views.components.labels import LeftLabel
|
||||||
@@ -288,12 +288,12 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
self.steam_entry: Gtk.Entry
|
self.steam_entry: Gtk.Entry
|
||||||
self.pop: Gtk.Popover
|
self.pop: Gtk.Popover
|
||||||
|
|
||||||
self.steam = WebButton(label=options.steam_web)
|
self.steam = WebButton(label=strings.options.steam_web)
|
||||||
self.steam.connect("clicked", self._on_link_button_clicked, STEAM_API_SETUP)
|
self.steam.connect("clicked", self._on_link_button_clicked, STEAM_API_SETUP)
|
||||||
|
|
||||||
self.steam_box = SteamSubmitField(controller)
|
self.steam_box = SteamSubmitField(controller)
|
||||||
api_rows = [
|
api_rows = [
|
||||||
[LeftLabel(options.steam_placeholder), self.steam_box, self.steam],
|
[LeftLabel(strings.options.steam_placeholder), self.steam_box, self.steam],
|
||||||
]
|
]
|
||||||
|
|
||||||
self.player_box = NameSubmitField(controller)
|
self.player_box = NameSubmitField(controller)
|
||||||
@@ -303,13 +303,13 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
self.flatpak_toggle = FlatpakToggleField(self.controller)
|
self.flatpak_toggle = FlatpakToggleField(self.controller)
|
||||||
self.fullscreen_toggle = ToggleField(
|
self.fullscreen_toggle = ToggleField(
|
||||||
self.controller,
|
self.controller,
|
||||||
options.last_used,
|
strings.options.last_used,
|
||||||
options.always_fs,
|
strings.options.always_fs,
|
||||||
Preferences.WINDOW,
|
Preferences.WINDOW,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.distance_toggle = ToggleField(
|
self.distance_toggle = ToggleField(
|
||||||
self.controller, options.km, options.mi, Preferences.DIST
|
self.controller, strings.options.km, strings.options.mi, Preferences.DIST
|
||||||
)
|
)
|
||||||
|
|
||||||
combo_store = Gtk.ListStore(str, object)
|
combo_store = Gtk.ListStore(str, object)
|
||||||
@@ -331,10 +331,10 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
self.start_tab_combo.connect("changed", self._on_start_tab_changed)
|
self.start_tab_combo.connect("changed", self._on_start_tab_changed)
|
||||||
|
|
||||||
pref_rows = [
|
pref_rows = [
|
||||||
[LeftLabel(options.window_size), self.fullscreen_toggle],
|
[LeftLabel(strings.options.window_size), self.fullscreen_toggle],
|
||||||
[LeftLabel(options.distance), self.distance_toggle],
|
[LeftLabel(strings.options.distance), self.distance_toggle],
|
||||||
[LeftLabel(options.start_tab), start_tab_hbox],
|
[LeftLabel(options.start_tab), start_tab_hbox],
|
||||||
[LeftLabel(options.name), self.player_box],
|
[LeftLabel(strings.options.name), self.player_box],
|
||||||
]
|
]
|
||||||
default = self.controller.query_config(Preferences.DEFAULT)
|
default = self.controller.query_config(Preferences.DEFAULT)
|
||||||
if FLATPAK_STEAM_PATH in default:
|
if FLATPAK_STEAM_PATH in default:
|
||||||
@@ -343,9 +343,9 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
[LeftLabel(options.flatpak_label), self.flatpak_toggle],
|
[LeftLabel(options.flatpak_label), self.flatpak_toggle],
|
||||||
)
|
)
|
||||||
|
|
||||||
self.dayz_version_label = Gtk.Label(label=metadata.null, halign=Gtk.Align.START)
|
self.dayz_version_label = Gtk.Label(label=strings.null, halign=Gtk.Align.START)
|
||||||
self.dayz_exp_version_label = Gtk.Label(
|
self.dayz_exp_version_label = Gtk.Label(
|
||||||
label=metadata.null, halign=Gtk.Align.START
|
label=strings.null, halign=Gtk.Align.START
|
||||||
)
|
)
|
||||||
|
|
||||||
version_rows = [
|
version_rows = [
|
||||||
@@ -376,16 +376,16 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||||
|
|
||||||
for pair in [
|
for pair in [
|
||||||
(api_box, options.api_key),
|
(api_box, strings.options.api_key),
|
||||||
(prefs_grid, options.prefs),
|
(prefs_grid, strings.options.prefs),
|
||||||
(version_grid, options.version),
|
(version_grid, strings.options.version),
|
||||||
]:
|
]:
|
||||||
|
|
||||||
frame = HeadingFrame.new_with_widget_and_label(*pair)
|
frame = HeadingFrame.new_with_widget_and_label(*pair)
|
||||||
grid.attach(frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
grid.attach(frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
label = Gtk.Label(label=options.header)
|
label = Gtk.Label(label=strings.options.header)
|
||||||
label.set_halign(Gtk.Align.CENTER)
|
label.set_halign(Gtk.Align.CENTER)
|
||||||
css.add_class(label, "page-heading")
|
css.add_class(label, "page-heading")
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
prefs = self.controller.get_prefs()
|
prefs = self.controller.get_prefs()
|
||||||
# NOTE: re-check in case file was removed by user between runs
|
# NOTE: re-check in case file was removed by user between runs
|
||||||
if prefs.paths.config.is_file() is False:
|
if prefs.paths.config.is_file() is False:
|
||||||
dialog = ExceptionDialog(self.controller, errors.config_not_found)
|
dialog = ExceptionDialog(self.controller, strings.config_not_found)
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
dialog.run() # type: ignore[no-untyped-call]
|
dialog.run() # type: ignore[no-untyped-call]
|
||||||
raise OSError(f"Config file '{prefs.paths.config}' not found")
|
raise OSError(f"Config file '{prefs.paths.config}' not found")
|
||||||
@@ -472,7 +472,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
|
|
||||||
dayz_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ)
|
dayz_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ)
|
||||||
if dayz_version is None:
|
if dayz_version is None:
|
||||||
dayz_version = metadata.null
|
dayz_version = strings.null
|
||||||
else:
|
else:
|
||||||
last_updated = get_last_updated(steam_path, APPID_DAYZ)
|
last_updated = get_last_updated(steam_path, APPID_DAYZ)
|
||||||
if last_updated is not None:
|
if last_updated is not None:
|
||||||
@@ -480,7 +480,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
|
|||||||
|
|
||||||
dayz_exp_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ_EXP)
|
dayz_exp_version = PeFile.get_pretty_version(steam_path, APPID_DAYZ_EXP)
|
||||||
if dayz_exp_version is None:
|
if dayz_exp_version is None:
|
||||||
dayz_exp_version = metadata.null
|
dayz_exp_version = strings.null
|
||||||
else:
|
else:
|
||||||
last_updated = get_last_updated(steam_path, APPID_DAYZ_EXP)
|
last_updated = get_last_updated(steam_path, APPID_DAYZ_EXP)
|
||||||
if last_updated is not None:
|
if last_updated is not None:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from dzgui.const.constants import APP_NAME
|
|||||||
from dzgui.const.enum import ContextMenuGroup, ServerTab
|
from dzgui.const.enum import ContextMenuGroup, ServerTab
|
||||||
from dzgui.views.trees.tree_servers import ServerTreeView
|
from dzgui.views.trees.tree_servers import ServerTreeView
|
||||||
from dzgui.strings.generic import tab_changed_label
|
from dzgui.strings.generic import tab_changed_label
|
||||||
from dzgui.strings import labels
|
from dzgui.util.strings import server_labels
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -57,10 +57,10 @@ class ServerNotebook(Gtk.ScrolledWindow):
|
|||||||
)
|
)
|
||||||
|
|
||||||
tabs = [
|
tabs = [
|
||||||
(self.browser, labels.servers_browser),
|
(self.browser, server_labels.browser),
|
||||||
(self.saved, labels.servers_saved),
|
(self.saved, server_labels.saved),
|
||||||
(self.recent, labels.servers_recent),
|
(self.recent, server_labels.recent),
|
||||||
(self.lan, labels.servers_lan),
|
(self.lan, server_labels.lan),
|
||||||
]
|
]
|
||||||
|
|
||||||
for tree, label in tabs:
|
for tree, label in tabs:
|
||||||
@@ -89,7 +89,7 @@ class ServerNotebook(Gtk.ScrolledWindow):
|
|||||||
if label is None:
|
if label is None:
|
||||||
return
|
return
|
||||||
if hasattr(label, "set_text"):
|
if hasattr(label, "set_text"):
|
||||||
label.set_text(f"{labels.servers_saved}*")
|
label.set_text(f"{server_labels.saved}*")
|
||||||
|
|
||||||
def _on_servers_loaded(self, emitter: "Emitter", tab: "ServerTab") -> None:
|
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
|
# 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 typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.util.format import format_pango
|
from dzgui.util.format import format_pango
|
||||||
from dzgui.strings import thanks
|
from dzgui.util.strings import thanks
|
||||||
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
|
||||||
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import logging
|
|||||||
|
|
||||||
from typing import Any, TYPE_CHECKING
|
from typing import Any, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.constants import APP_NAME, LOG_DELIMITER, LOG_FILTERS
|
from dzgui.const.constants import APP_NAME, LOG_FILTERS
|
||||||
from dzgui.const.enum import ContextMenuGroup
|
from dzgui.const.enum import ContextMenuGroup
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.strings import labels
|
from dzgui.util import strings
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
from dzgui.views.trees.tree_base import TreeView
|
||||||
from dzgui.views.mixins.context_mixin import ContextMixin
|
from dzgui.views.mixins.context_mixin import ContextMixin
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
|
|||||||
self.set_model(None)
|
self.set_model(None)
|
||||||
|
|
||||||
self.filters = list(LOG_FILTERS)
|
self.filters = list(LOG_FILTERS)
|
||||||
for i, column_title in enumerate(labels.log_cols):
|
for i, column_title in enumerate(strings.log_cols):
|
||||||
renderer = Gtk.CellRendererText()
|
renderer = Gtk.CellRendererText()
|
||||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||||
@@ -92,7 +92,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
|
|||||||
for record in records:
|
for record in records:
|
||||||
raw_record = model[record]
|
raw_record = model[record]
|
||||||
els: tuple[Any] = tuple(raw_record) # type: ignore
|
els: tuple[Any] = tuple(raw_record) # type: ignore
|
||||||
concat = LOG_DELIMITER.join(map(str, els))
|
concat = strings.delimiter.join(map(str, els))
|
||||||
final.append(concat)
|
final.append(concat)
|
||||||
text = "\n".join(final)
|
text = "\n".join(final)
|
||||||
return text
|
return text
|
||||||
@@ -6,8 +6,7 @@ from typing import Any, TYPE_CHECKING
|
|||||||
from dzgui.const.constants import APP_NAME, HEX_RED
|
from dzgui.const.constants import APP_NAME, HEX_RED
|
||||||
from dzgui.const.enum import ContextMenuGroup
|
from dzgui.const.enum import ContextMenuGroup
|
||||||
from dzgui.managers.mods import ModManager
|
from dzgui.managers.mods import ModManager
|
||||||
from dzgui.strings import labels
|
from dzgui.util import strings, localize
|
||||||
from dzgui.util import localize
|
|
||||||
from dzgui.views.mixins.context_mixin import ContextMixin
|
from dzgui.views.mixins.context_mixin import ContextMixin
|
||||||
from dzgui.views.mixins.mods_mixin import ModsMixin
|
from dzgui.views.mixins.mods_mixin import ModsMixin
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
from dzgui.views.trees.tree_base import TreeView
|
||||||
@@ -39,7 +38,7 @@ class ModTreeView(ModsMixin, ContextMixin, TreeView): # type: ignore
|
|||||||
self.set_fixed_height_mode(True)
|
self.set_fixed_height_mode(True)
|
||||||
self.set_model(None)
|
self.set_model(None)
|
||||||
|
|
||||||
for i, column_title in enumerate(labels.mod_cols):
|
for i, column_title in enumerate(strings.mod_cols):
|
||||||
renderer = Gtk.CellRendererText()
|
renderer = Gtk.CellRendererText()
|
||||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
column.set_cell_data_func(renderer, self._format_color, func_data=None)
|
column.set_cell_data_func(renderer, self._format_color, func_data=None)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from dzgui.const.constants import APP_NAME
|
|||||||
from dzgui.const.enum import ContextMenuItem, ContextMenuGroup, ServerTab
|
from dzgui.const.enum import ContextMenuItem, ContextMenuGroup, ServerTab
|
||||||
from dzgui.managers.filter import FilterManager
|
from dzgui.managers.filter import FilterManager
|
||||||
from dzgui.model.proxy_model import ProxyModelManager, ServerRow
|
from dzgui.model.proxy_model import ProxyModelManager, ServerRow
|
||||||
from dzgui.strings import labels
|
from dzgui.util import strings
|
||||||
from dzgui.util.dist import CalcDist
|
from dzgui.util.dist import CalcDist
|
||||||
from dzgui.util.keys import is_ctrl_mask
|
from dzgui.util.keys import is_ctrl_mask
|
||||||
from dzgui.views.mixins.context_mixin import ContextMixin
|
from dzgui.views.mixins.context_mixin import ContextMixin
|
||||||
@@ -89,7 +89,7 @@ class ServerTreeView(ContextMixin, TreeView): # type: ignore
|
|||||||
|
|
||||||
# TODO: abstract column population logic
|
# TODO: abstract column population logic
|
||||||
# TODO: resize col width func causes snapping behavior
|
# TODO: resize col width func causes snapping behavior
|
||||||
browser_cols = labels.browser_cols
|
browser_cols = strings.browser_cols
|
||||||
for i, column_title in enumerate(browser_cols):
|
for i, column_title in enumerate(browser_cols):
|
||||||
renderer = Gtk.CellRendererText()
|
renderer = Gtk.CellRendererText()
|
||||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "aclist"}
|
{name = "aclist"}
|
||||||
]
|
]
|
||||||
version = "7.0.0b31"
|
version = "7.0.0b30"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import tomllib
|
import tomllib
|
||||||
from shared import get_git_root
|
from shared import get_git_root
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
|
|
||||||
def get_entrypoint() -> Any:
|
def get_entrypoint() -> None:
|
||||||
root = get_git_root()
|
root = get_git_root()
|
||||||
p = root.joinpath("pyproject.toml")
|
p = root.joinpath("pyproject.toml")
|
||||||
with open(p, "rb") as f:
|
with open(p, "rb") as f:
|
||||||
|
|||||||
+3
-3
@@ -52,7 +52,7 @@ def untar(file: str, glob: str, renamed: str) -> None:
|
|||||||
os.rename(_dir, build_dir.joinpath(renamed))
|
os.rename(_dir, build_dir.joinpath(renamed))
|
||||||
|
|
||||||
|
|
||||||
def install_deps() -> int:
|
def install_deps() -> None:
|
||||||
pip = build_dir.joinpath(f"{CPYTHON_BUILD}/bin/pip")
|
pip = build_dir.joinpath(f"{CPYTHON_BUILD}/bin/pip")
|
||||||
proc = subprocess.run([pip, "install", root])
|
proc = subprocess.run([pip, "install", root])
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
@@ -65,12 +65,12 @@ def repackage() -> None:
|
|||||||
tar.add(build_dir.joinpath(CPYTHON_BUILD), arcname="python")
|
tar.add(build_dir.joinpath(CPYTHON_BUILD), arcname="python")
|
||||||
|
|
||||||
|
|
||||||
def rebuild_cpython() -> str:
|
def rebuild_cpython() -> None:
|
||||||
if cpython_dir.is_dir() is False:
|
if cpython_dir.is_dir() is False:
|
||||||
get_cpython()
|
get_cpython()
|
||||||
code = install_deps()
|
code = install_deps()
|
||||||
if code != 0:
|
if code != 0:
|
||||||
return ""
|
return
|
||||||
repackage()
|
repackage()
|
||||||
return get_packaged_version()
|
return get_packaged_version()
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -92,8 +92,8 @@ with tarfile.open(tarpath, "w:gz") as tar:
|
|||||||
tar.add(subfolder, arcname=appname, filter=update_uname)
|
tar.add(subfolder, arcname=appname, filter=update_uname)
|
||||||
print(f"Wrote tarfile to '{tarpath}'")
|
print(f"Wrote tarfile to '{tarpath}'")
|
||||||
|
|
||||||
built_proc = subprocess.run([release_exe, "-v"], capture_output=True, text=True)
|
proc = subprocess.run([release_exe, "-v"], capture_output=True, text=True)
|
||||||
assert str(built_proc.stdout).rstrip() == version
|
assert proc.stdout.rstrip() == version
|
||||||
|
|
||||||
# TODO: clean up staging directory
|
# TODO: clean up staging directory
|
||||||
release_exe.unlink()
|
release_exe.unlink()
|
||||||
|
|||||||
+4
-10
@@ -8,13 +8,7 @@ def get_image_path() -> Path:
|
|||||||
return get_git_root().joinpath("dzgui/data/images/example.png")
|
return get_git_root().joinpath("dzgui/data/images/example.png")
|
||||||
|
|
||||||
|
|
||||||
def take_screenshot() -> None:
|
p = get_image_path()
|
||||||
p = get_image_path()
|
app = build_gui("", False)
|
||||||
app = build_gui("", False)
|
app.set_automation_param("screenshot_path", p)
|
||||||
if app is None:
|
app.run(None)
|
||||||
return
|
|
||||||
app.set_automation_param("screenshot_path", p)
|
|
||||||
app.run(None)
|
|
||||||
|
|
||||||
|
|
||||||
take_screenshot()
|
|
||||||
+10
-5
@@ -3,9 +3,14 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
cmd = ["git", "ls-files", "--others", "--exclude-standard"]
|
cmd = ["git", "ls-files", "--others", "--exclude-standard"]
|
||||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
result = subprocess.Popen(
|
||||||
untracked = [os.path.basename(line.rstrip()) for line in result.stdout.splitlines()]
|
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
|
||||||
if bool(untracked):
|
)
|
||||||
print("The following files are untracked. Add to .gitignore if this is intended.")
|
with open(".gitignore", "r") as f:
|
||||||
print("\n".join(untracked))
|
ignored = [line.rstrip() for line in f]
|
||||||
|
|
||||||
|
untracked = [os.path.basename(line.rstrip()) for line in result.stdout]
|
||||||
|
for file in untracked:
|
||||||
|
if not any(file in item for item in ignored):
|
||||||
|
print(f"File '{file}' is untracked. Add to .gitignore file if this is intended.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import vdf # type: ignore[import-untyped]
|
import vdf
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -7,13 +7,11 @@ from dzgui.api.mods import get_local_mod_ids
|
|||||||
from dzgui.util.dirs import make_parents
|
from dzgui.util.dirs import make_parents
|
||||||
from tests.fixtures import fixture_path
|
from tests.fixtures import fixture_path
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def libraryfolders() -> Path:
|
def libraryfolders() -> Path:
|
||||||
return fixture_path("api/steamapps/libraryfolders.vdf")
|
return fixture_path("api/steamapps/libraryfolders.vdf")
|
||||||
|
|
||||||
|
def test_missing_mod_dir(tmp_path, libraryfolders: Path) -> None:
|
||||||
def test_missing_mod_dir(tmp_path: Path, libraryfolders: Path) -> None:
|
|
||||||
"""
|
"""
|
||||||
Updates fixture file key with tmp path value serializes to file,
|
Updates fixture file key with tmp path value serializes to file,
|
||||||
then tests for missing mod directory returning an empty list
|
then tests for missing mod directory returning an empty list
|
||||||
|
|||||||
@@ -1,93 +1,80 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
import unittest
|
||||||
|
|
||||||
from typing import Literal, TYPE_CHECKING
|
from unittest.mock import patch
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from dzgui.const.constants import (
|
from dzgui.const.constants import (
|
||||||
FLATPAK_APPID,
|
FLATPAK_APPID,
|
||||||
FLATPAK_ROOT_PATH,
|
FLATPAK_ROOT_PATH,
|
||||||
|
FLATPAK_RUN_CMD,
|
||||||
|
FLATPAK_SANDBOX,
|
||||||
)
|
)
|
||||||
from dzgui.init import proc
|
from dzgui.init import proc
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from _pytest.monkeypatch import MonkeyPatch
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.flatpak
|
pytestmark = pytest.mark.flatpak
|
||||||
|
|
||||||
|
|
||||||
def mock_has_cmd(cmd: str) -> Literal[True]:
|
class TestSteamDetection(unittest.TestCase):
|
||||||
return True
|
def test_flatpak_detection_with_multiple_running_apps(self) -> None:
|
||||||
|
def flatpak_output(args: Any, *, text: str) -> str:
|
||||||
|
# Default 'flatpak ps' includes instance, PID, app and runtime columns.
|
||||||
|
if args == ["flatpak", "ps", "--columns=application"]:
|
||||||
|
return f"com.spotify.Client\n{FLATPAK_APPID}\n{FLATPAK_APPID}\n"
|
||||||
|
return f"3904921611\t1257689\t{FLATPAK_APPID}\torg.freedesktop.Platform\n"
|
||||||
|
|
||||||
|
with (
|
||||||
|
patch.object(proc, "has_cmd", return_value=True),
|
||||||
|
patch.object(proc.subprocess, "check_output", side_effect=flatpak_output),
|
||||||
|
):
|
||||||
|
for client in (FLATPAK_RUN_CMD, FLATPAK_SANDBOX):
|
||||||
|
with self.subTest(client=client):
|
||||||
|
self.assertTrue(proc.is_steam_running(client))
|
||||||
|
|
||||||
def mock_has_not_cmd(cmd: str) -> Literal[False]:
|
def test_flatpak_not_running(self) -> None:
|
||||||
return False
|
with patch.object(proc, "has_cmd", return_value=True):
|
||||||
|
for output in ("", "com.spotify.Client\n", f"{FLATPAK_APPID}Helper\n"):
|
||||||
|
with (
|
||||||
|
self.subTest(output=output),
|
||||||
|
patch.object(proc.subprocess, "check_output", return_value=output),
|
||||||
|
):
|
||||||
|
self.assertFalse(proc.is_flatpak_steam_running())
|
||||||
|
|
||||||
|
def test_flatpak_not_installed(self) -> None:
|
||||||
|
with (
|
||||||
|
patch.object(proc, "has_cmd", return_value=False),
|
||||||
|
patch.object(proc.subprocess, "check_output") as check_output,
|
||||||
|
):
|
||||||
|
self.assertFalse(proc.is_flatpak_steam_running())
|
||||||
|
check_output.assert_not_called()
|
||||||
|
|
||||||
def mock_get_flatpak_output() -> list[str]:
|
def test_native_steam(self) -> None:
|
||||||
lines = ["Application", "com.freedesktop.Platform", f"{FLATPAK_APPID}"]
|
with patch.object(proc, "has_cmd", return_value=True):
|
||||||
return lines
|
for output, expected in (
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"output, expected",
|
|
||||||
[
|
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
[f"/home/user/{FLATPAK_ROOT_PATH}/.local/share/Steam"],
|
[FLATPAK_ROOT_PATH],
|
||||||
["/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper"],
|
"/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper",
|
||||||
],
|
],
|
||||||
True,
|
True,
|
||||||
),
|
),
|
||||||
(
|
([[FLATPAK_ROOT_PATH]], False),
|
||||||
[
|
([[FLATPAK_ROOT_PATH], ["steam-runtime-launcher-service"]], False),
|
||||||
[f"/home/user/{FLATPAK_ROOT_PATH}/.local/share/Steam"],
|
|
||||||
["steam-runtime-launcher-service"],
|
|
||||||
],
|
|
||||||
False,
|
|
||||||
),
|
|
||||||
([[f"/home/user/{FLATPAK_ROOT_PATH}/.local/share/Steam"]], False),
|
|
||||||
([["/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper"]], True),
|
([["/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper"]], True),
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
["/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper"],
|
["/home/user/.local/share/Steam/ubuntu12_64/steamwebhelper"],
|
||||||
["steam-runtime-launcher-service"],
|
"steam-runtime-launcher-service",
|
||||||
],
|
],
|
||||||
True,
|
True,
|
||||||
),
|
),
|
||||||
],
|
):
|
||||||
)
|
with (
|
||||||
def test_native_steam_running(
|
self.subTest(running=output),
|
||||||
monkeypatch: "MonkeyPatch", output: list[list[str]], expected: bool
|
patch.object(proc, "get_steam_procs", return_value=output),
|
||||||
) -> None:
|
):
|
||||||
def mock_get_steam_procs() -> list[list[str]]:
|
self.assertEqual(proc.is_native_steam_running(), expected)
|
||||||
return output
|
|
||||||
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.has_cmd", mock_has_cmd)
|
def test_invalid_client(self) -> None:
|
||||||
monkeypatch.setattr("dzgui.init.proc.get_steam_procs", mock_get_steam_procs)
|
with self.assertRaises(TypeError):
|
||||||
assert proc.is_native_steam_running() == expected
|
|
||||||
|
|
||||||
|
|
||||||
def test_flatpak_running(monkeypatch: "MonkeyPatch") -> None:
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.has_cmd", mock_has_cmd)
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.get_flatpak_output", mock_get_flatpak_output)
|
|
||||||
assert proc.is_flatpak_steam_running()
|
|
||||||
|
|
||||||
|
|
||||||
def test_flatpak_sandboxed(monkeypatch: "MonkeyPatch") -> None:
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.has_cmd", mock_has_not_cmd)
|
|
||||||
monkeypatch.setenv("FLATPAK_ID", FLATPAK_APPID)
|
|
||||||
assert proc.is_flatpak_steam_running()
|
|
||||||
|
|
||||||
|
|
||||||
def test_flatpak_not_installed(monkeypatch: "MonkeyPatch") -> None:
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.has_cmd", mock_has_not_cmd)
|
|
||||||
assert not proc.is_flatpak_steam_running()
|
|
||||||
|
|
||||||
|
|
||||||
def test_steam_not_installed(monkeypatch: "MonkeyPatch") -> None:
|
|
||||||
monkeypatch.setattr("dzgui.init.proc.has_cmd", mock_has_not_cmd)
|
|
||||||
assert not proc.is_native_steam_running()
|
|
||||||
|
|
||||||
|
|
||||||
def test_invalid_client() -> None:
|
|
||||||
with pytest.raises(TypeError):
|
|
||||||
proc.is_steam_running("invalid-client")
|
proc.is_steam_running("invalid-client")
|
||||||
Reference in new issue
Block a user