mirror of
https://github.com/aclist/dztui.git
synced 2026-11-06 18:10:58 +01:00
Compare commits
205
Commits
4edf71aa0a
..
dzgui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f5559121d | ||
|
|
019ea82004 | ||
|
|
df291c867c | ||
|
|
9db3ac1f80 | ||
|
|
bdb7da9440 | ||
|
|
cc623914da | ||
|
|
fa9c58f1e2 | ||
|
|
d7ba49ea97 | ||
|
|
bab2379fad | ||
|
|
98b4f37e54 | ||
|
|
8ca8dbb6ff | ||
|
|
7d6e089c03 | ||
|
|
3c75b9362b | ||
|
|
dc24ef6e85 | ||
|
|
f76985c79d | ||
|
|
3d3cd19892 | ||
|
|
c14fb10d23 | ||
|
|
a8417d27d7 | ||
|
|
2d58bb491e | ||
|
|
2f123da63a | ||
|
|
7016edf7cd | ||
|
|
b630cf4080 | ||
|
|
1034a5ac04 | ||
|
|
ebc62b0b1b | ||
|
|
4b47ff1fe0 | ||
|
|
e3155ad7ee | ||
|
|
c45d9fb234 | ||
|
|
22e92e67a7 | ||
|
|
cb45ce7b9a | ||
|
|
9678d41b4c | ||
|
|
0daf567111 | ||
|
|
b75e99ffd7 | ||
|
|
5562c44320 | ||
|
|
236a5dd0a3 | ||
|
|
4c10958d10 | ||
|
|
23f7140c66 | ||
|
|
fbcfa1fb34 | ||
|
|
52f36e0d0a | ||
|
|
d90c069a73 | ||
|
|
d2f3eebd42 | ||
|
|
af64ebb12a | ||
|
|
203ca0d388 | ||
|
|
34ee8c6645 | ||
|
|
0cd561b62a | ||
|
|
b9c30b4f52 | ||
|
|
4bcf894704 | ||
|
|
c37800795b | ||
|
|
929f497b9f | ||
|
|
60aebe5eeb | ||
|
|
aef9a10c42 | ||
|
|
c6034bc6b9 | ||
|
|
005288371b | ||
|
|
53e50a5716 | ||
|
|
a50b11633f | ||
|
|
9c4541fe76 | ||
|
|
ac3e7ee128 | ||
|
|
1495ad386d | ||
|
|
adf8a62e8a | ||
|
|
a1d14669c7 | ||
|
|
46a54cef12 | ||
|
|
321384dc7b | ||
|
|
e02f02b775 | ||
|
|
de524bd2a5 | ||
|
|
edee9b6234 | ||
|
|
cefd041e08 | ||
|
|
881b0b3008 | ||
|
|
2a59441dbc | ||
|
|
5ab18d0796 | ||
|
|
23e3d34947 | ||
|
|
b86dd37b50 | ||
|
|
59fdd30236 | ||
|
|
a35bfda5f1 | ||
|
|
5393bf1f5f | ||
|
|
90b3aa8663 | ||
|
|
728e4daf7c | ||
|
|
7a210c7f39 | ||
|
|
459dd69359 | ||
|
|
fbd1a355d5 | ||
|
|
82d2afb1f2 | ||
|
|
8193980878 | ||
|
|
acdb34d36a | ||
|
|
d6d0b241e0 | ||
|
|
f75ef947c9 | ||
|
|
6dc9a719ee | ||
|
|
785df28f66 | ||
|
|
66e114a400 | ||
|
|
2ba07bbba8 | ||
|
|
65eda05d9f | ||
|
|
f3b3f79bfb | ||
|
|
28c7d7f949 | ||
|
|
d072c8107e | ||
|
|
0629c8a6ba | ||
|
|
8aea4af687 | ||
|
|
0562d8230d | ||
|
|
759327e932 | ||
|
|
36753e02f1 | ||
|
|
2ab2e23736 | ||
|
|
34e7b2e480 | ||
|
|
540d0ad7e4 | ||
|
|
47bea45111 | ||
|
|
d03346b56a | ||
|
|
54e0762882 | ||
|
|
0834a86d33 | ||
|
|
c6a8841614 | ||
|
|
df92acb7dc | ||
|
|
a333571f94 | ||
|
|
05f88b6019 | ||
|
|
1f31c43fe4 | ||
|
|
0763416903 | ||
|
|
3b384c5a4d | ||
|
|
3ab666a807 | ||
|
|
c8f7a32284 | ||
|
|
a070e9fc65 | ||
|
|
5f55e3c664 | ||
|
|
07606d8852 | ||
|
|
afffc90abc | ||
|
|
70db7b45b3 | ||
|
|
aac8558079 | ||
|
|
ac8ff2febf | ||
|
|
6369d895fd | ||
|
|
7413f7c029 | ||
|
|
3f1d8cb24f | ||
|
|
4df12605fc | ||
|
|
2c5da88e06 | ||
|
|
3cb6175436 | ||
|
|
3739f19ab2 | ||
|
|
2da4d001d6 | ||
|
|
5d61a1f513 | ||
|
|
56c80d187b | ||
|
|
e08f66cdcb | ||
|
|
48fee301bb | ||
|
|
20511f5661 | ||
|
|
d2e8333ba9 | ||
|
|
5d37039064 | ||
|
|
ce44cdbc54 | ||
|
|
5b2738420e | ||
|
|
1e29288e2a | ||
|
|
745cc06091 | ||
|
|
0311cc8a95 | ||
|
|
7c3521cf97 | ||
|
|
bb0eefadd2 | ||
|
|
7eb5a4fac5 | ||
|
|
ebce329c3d | ||
|
|
23464d3b51 | ||
|
|
602a7b8edc | ||
|
|
59c58a1df5 | ||
|
|
830318d98e | ||
|
|
271c3e6197 | ||
|
|
1ab9634069 | ||
|
|
8666b0055a | ||
|
|
406554e011 | ||
|
|
5334d07f7f | ||
|
|
6cab96d1f8 | ||
|
|
bc94d989d4 | ||
|
|
e4fff5f242 | ||
|
|
53f2fe922a | ||
|
|
800f68a1b7 | ||
|
|
c6c377e8b9 | ||
|
|
7a68d7e097 | ||
|
|
f60a6edf2b | ||
|
|
8c33a1b371 | ||
|
|
e5f7391b89 | ||
|
|
a8f51280e8 | ||
|
|
c19346529b | ||
|
|
85451f765b | ||
|
|
5a144f7815 | ||
|
|
2370e81403 | ||
|
|
c11511abff | ||
|
|
bda7223ac8 | ||
|
|
6b48ee127d | ||
|
|
aa8a52bfc0 | ||
|
|
8ea62434ee | ||
|
|
baeaeb1b64 | ||
|
|
32b424da5c | ||
|
|
d71110d0a1 | ||
|
|
bc9178d2de | ||
|
|
1533febf9a | ||
|
|
c3c8872fad | ||
|
|
bae6a57e1e | ||
|
|
3bdc0057a2 | ||
|
|
5496f914f2 | ||
|
|
cb9db55bcb | ||
|
|
c0ab8111fd | ||
|
|
10c6a79b17 | ||
|
|
2b4b533a5b | ||
|
|
dcb8be9132 | ||
|
|
278aa8c28a | ||
|
|
32e5bafb33 | ||
|
|
59e19510e3 | ||
|
|
45ab112970 | ||
|
|
ed07fd0343 | ||
|
|
c2c7b37b90 | ||
|
|
23798c91d3 | ||
|
|
659cbb83a3 | ||
|
|
32c467fc6d | ||
|
|
d01add3573 | ||
|
|
0de89a3ef1 | ||
|
|
5686ea76c2 | ||
|
|
5fda598173 | ||
|
|
049fb47019 | ||
|
|
81f269b71b | ||
|
|
c97a7a260f | ||
|
|
b715eb5a3e | ||
|
|
8e6cf7e792 | ||
|
|
98868073a5 |
No files matched your search
@@ -5,6 +5,10 @@ labels: ["bug"]
|
|||||||
assignees:
|
assignees:
|
||||||
- aclist
|
- aclist
|
||||||
body:
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
### WARNING: When posting log/config data, redact any sensitive information like API keys.
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: kb
|
id: kb
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ labels: ["troubleshooting"]
|
|||||||
assignees:
|
assignees:
|
||||||
- aclist
|
- aclist
|
||||||
body:
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
### WARNING: When posting log/config data, redact any sensitive information like API keys.
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
id: device
|
id: device
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ jobs:
|
|||||||
mirror-to-codeberg:
|
mirror-to-codeberg:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: pixta-dev/repository-mirroring-action@v1
|
- uses: pixta-dev/repository-mirroring-action@v1
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
tags
|
tags
|
||||||
|
__pycache__
|
||||||
|
pre-commit
|
||||||
|
tests/
|
||||||
+180
-317
@@ -1,63 +1,80 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [6.0.0-beta.12] 2025-11-14
|
## [6.0.5] 2026-05-17
|
||||||
## Changed
|
## Changed
|
||||||
- Require Python 3.13
|
- Update symlink hash logic to align with DZGUI 7 beta
|
||||||
|
- Update A2S helper to latest commit
|
||||||
|
|
||||||
|
## [6.0.4] 2026-04-13
|
||||||
## Fixed
|
## Fixed
|
||||||
- Normalize beta version
|
- Update A2S module checksums to support servers with missing description field
|
||||||
|
|
||||||
## [6.0.0-beta.11] 2025-11-13
|
## [6.0.3] 2026-04-12
|
||||||
## Added
|
## Fixed
|
||||||
- Support sandboxed flatpak
|
- Use GLibUnix namespace where available when setting up SIGINT callback
|
||||||
|
|
||||||
|
## [6.0.2] 2026-01-26
|
||||||
|
## Fixed
|
||||||
|
- Explicitly use Python 3.13 when calling subprocesses
|
||||||
|
- Raise error correctly from module
|
||||||
|
- Do not spawn dialogs from inside of thread when fetching prereqs
|
||||||
## Changed
|
## Changed
|
||||||
- Preferred client from radio toggle to combobox
|
- Optimize time complexity of startup checks
|
||||||
|
- Optimize coordinate calculation by using local records first
|
||||||
|
- Rename some internal functions
|
||||||
|
- Wrap entire startup process in dialog
|
||||||
|
|
||||||
|
## [6.0.1] 2026-01-16
|
||||||
## Fixed
|
## Fixed
|
||||||
- Config file erroneously getting updated when populating settings menu
|
- Explicitly use Python 3.13 when calling subprocesses
|
||||||
|
|
||||||
## [6.0.0-beta.10] 2025-11-10
|
## [6.0.0] 2026-01-14
|
||||||
## Fixed
|
|
||||||
- Python 3.14 error in finally block
|
|
||||||
- Require Python version between 3.11 and 3.12
|
|
||||||
|
|
||||||
## [6.0.0-beta.9] 2025-11-05
|
|
||||||
## Fixed
|
|
||||||
- UI not being constructed correctly if CHANGELOG.md was missing
|
|
||||||
|
|
||||||
## [6.0.0-beta.8] 2025-11-04
|
|
||||||
## Added
|
|
||||||
- Internal flag to allow distribution packaged releases to disable in-app updates
|
|
||||||
- Pre-boot check to test whether script was invoked directly
|
|
||||||
- Commandline usage help text
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
- ESC key destroying wait dialogs while a thread is pending
|
|
||||||
- Tooltip signals being erroneously drawn on main menu
|
|
||||||
- Leaky variable name in dialog titles
|
|
||||||
- Prevent extraneous signals from propagating when column width is adjusted
|
|
||||||
- Script failing to start when remote endpoints are unavailable (GaryBlackbourne)
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
- Optimize time complexity of pre-boot checks (GaryBlackbourne)
|
|
||||||
- Moved location of notes file
|
|
||||||
- Rewrote distance calculation module (GaryBlackbourne)
|
|
||||||
|
|
||||||
## [6.0.0-beta.7] 2025-09-20
|
|
||||||
## Added
|
|
||||||
- Users can save text notes to describe servers
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
- State file serialization methods
|
|
||||||
|
|
||||||
## [6.0.0-beta.6] 2025-09-12
|
|
||||||
## Added
|
## Added
|
||||||
- Support DayZ Experimental
|
- Support DayZ Experimental
|
||||||
- Show additional client information in Options menu
|
- Ping display on server tables
|
||||||
- Warn user of client version mismatches
|
- Save descriptive text notes on a per-server basis
|
||||||
- Support clickable hyperlinks
|
- Speed up load time and navigation of server tables
|
||||||
|
- More robust threading and cache system when filtering servers
|
||||||
|
- Show additional DayZ client information in Options menu
|
||||||
|
- Warn user of DayZ client version mismatches
|
||||||
|
- Support clickable hyperlinks in dialogs
|
||||||
|
- Rich server metadata details dialog (right-click on server table)
|
||||||
|
- Filter by modded servers
|
||||||
|
- Breadcrumbs showing current menu context
|
||||||
|
- Dedicated changelog page
|
||||||
|
- Dedicated keybindings page
|
||||||
|
- Dedicated settings page ("Options")
|
||||||
|
- Support sandboxed version of Flatpak
|
||||||
|
- Vim-style navigation keybindings
|
||||||
|
- Added "Return to main menu" button to dialog windows when failing to load server table
|
||||||
|
- Dynamic context menus for modded servers
|
||||||
|
- Additional keybindings for new filter toggles
|
||||||
|
- If a server is locked, prompt user when connecting
|
||||||
|
- Internal flag to allow distro-packaged releases to disable in-app updates
|
||||||
|
- Pre-boot checks to test whether script was invoked directly
|
||||||
|
- Commandline usage help text (GaryBlackbourne)
|
||||||
|
- More descriptive help dialogs when initial dependencies are missing
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
- Script failing to start when remote endpoints are unavailable (GaryBlackbourne)
|
||||||
|
- Key stickiness when quickly navigating through entries in tables
|
||||||
|
- Servers returning malformed A2S_INFO blocking server browser from loading
|
||||||
|
- Normalized buttons in dialogs and restored proper padding
|
||||||
|
- GTK errors being emitted to stdout when inserting debug table
|
||||||
|
- Entry dialog sensitivity when validating API keys
|
||||||
|
- Additional validation on entry dialogs to prevent submitting empty text
|
||||||
|
- Suppress errors during pre-boot checks when mods are not installed
|
||||||
|
- Centered filter checkboxes within panel
|
||||||
|
- Do not pop unhighlight/select stale buttons if no stale mods exist
|
||||||
|
- Improved keybinding interaction with side panels
|
||||||
|
- Suppress typeahead search in mod dialogs
|
||||||
|
- Do not trigger global API cooldown if no LAN/favorite servers are found
|
||||||
|
- Fix table column expansion in server mod dialogs
|
||||||
|
- Missing parameters when closing application via window decorations
|
||||||
|
- Statusbar contents not updating on certain pages
|
||||||
|
- Prevent debug button from activating when in certain input fields
|
||||||
|
- Window size not updating correctly when unmaximizing window after changing "fullscreen at boot" setting
|
||||||
|
- Branch toggle signal being emitted when entering Options menu from other contexts
|
||||||
- Mods rarely not appearing in local mod list if download completed too quickly
|
- Mods rarely not appearing in local mod list if download completed too quickly
|
||||||
- Statusbar not updating when clicking a row after spamming keyboard input
|
- Statusbar not updating when clicking a row after spamming keyboard input
|
||||||
- Extraneous logs being generated when subscribing to mods
|
- Extraneous logs being generated when subscribing to mods
|
||||||
@@ -65,342 +82,188 @@
|
|||||||
- Newline terminators in history file
|
- Newline terminators in history file
|
||||||
- Floating point number calculation
|
- Floating point number calculation
|
||||||
- Window resizing too small if no prior resolution was set
|
- Window resizing too small if no prior resolution was set
|
||||||
|
- ESC key destroying wait dialogs while a thread is pending
|
||||||
## [6.0.0-beta.5] 2025-08-20
|
- Tooltip signals being erroneously emitted on main menu
|
||||||
## Fixed
|
- UI not being constructed correctly if CHANGELOG.md was missing
|
||||||
- Servers returning malformed A2S_INFO blocking server browser from loading
|
- Config file erroneously getting updated when populating settings menu
|
||||||
|
- Leaky variable name in dialog titles
|
||||||
## [6.0.0-beta.4] 2025-08-13
|
- Prevent extraneous signals from propagating when column width is adjusted
|
||||||
## Fixed
|
- Server filter panel not being hidden when entering other page contexts
|
||||||
- Branch toggle signal being emitted when entering Options menu from other contexts
|
- Path to remote changelog being constructed incorrectly
|
||||||
|
- Dialogs with newlines breaking output in log table
|
||||||
## [6.0.0-beta.3] 2025-08-08
|
- Path discovery during first-time setup when parsing filepaths with whitespaces
|
||||||
## Added
|
- First-time setup dialog continuously triggering when DayZ install path had whitespaces in it
|
||||||
- Additional server metadata to details dialog
|
|
||||||
- Prompt user when connecting if a server is locked
|
|
||||||
- Dedicated settings page ("Options")
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
- Statusbar contents not updating on certain pages
|
|
||||||
- Breadcrumbs not updating when returning from keybindings page
|
|
||||||
- Wrap long descriptions in server details
|
|
||||||
- Prevent debug button from activating when in certain input fields
|
|
||||||
- Window size not updating correctly when unmaximizing window after changing "fullscreen at boot" setting
|
|
||||||
|
|
||||||
## Dropped
|
|
||||||
- Extraneous information from right statusbar
|
|
||||||
|
|
||||||
## [6.0.0-beta.2] 2025-07-29
|
|
||||||
## Fixed
|
|
||||||
- Missing parameters when closing application via window decorations
|
|
||||||
|
|
||||||
## [6.0.0-beta.1] 2025-07-29
|
|
||||||
## Added
|
|
||||||
- Ping column to server browsing contexts
|
|
||||||
- Server details dialog to server browsing contexts
|
|
||||||
- Filter by modded servers
|
|
||||||
- Breadcrumbs showing current menu context to top of window
|
|
||||||
- Speed up load time and navigation of server tables
|
|
||||||
- More robust threading and cache system when filtering servers
|
|
||||||
- Dedicated changelog page
|
|
||||||
- Dedicated keybindings page
|
|
||||||
- Vim-style navigation keybindings
|
|
||||||
- Additional validation on entry dialogs to prevent submitting empty text
|
|
||||||
- Added "Return to main menu" button to dialog windows when failing to load server table
|
|
||||||
- Dynamic context menus for modded servers
|
|
||||||
- Additional keybindings for filter toggles
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
- Entry dialog sensitivity when validating API keys
|
|
||||||
- Normalized buttons in dialogs and restored proper padding
|
|
||||||
- GTK errors being emitted to stdout when inserting debug table
|
|
||||||
- Suppress errors during pre-boot checks when mods are not installed
|
|
||||||
- Centered filter checkboxes within panel
|
|
||||||
- Do not pop unhighlight/select stale buttons if no stale mods exist
|
|
||||||
- Improved keybinding interaction with side panels
|
|
||||||
- Key stickiness when quickly navigating through entries in tables
|
|
||||||
- Suppress typeahead search in mod dialogs
|
|
||||||
- Do not trigger global API cooldown if no LAN/favorite servers are found
|
|
||||||
- Fix table column expansion in server mod dialogs
|
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
- Require Python 3.13
|
||||||
- Reduced global API cooldown from 60s to 30s
|
- Reduced global API cooldown from 60s to 30s
|
||||||
- Clarify dialog messages when DayZ path could not be found
|
- Clarify dialog messages when DayZ path could not be found
|
||||||
- Auto-focus first item when opening context menus
|
- Auto-focus first item when opening context menus
|
||||||
- Opacity setting on side buttons when in a different context
|
- Opacity setting on side buttons when in a different context
|
||||||
- Refactored BM API key validation to account for new key format
|
- Refactored BM API key validation to account for new key format
|
||||||
|
- State file serialization methods
|
||||||
|
- Optimize time complexity of pre-boot checks (GaryBlackbourne)
|
||||||
|
- Rewrote distance calculation module (GaryBlackbourne)
|
||||||
|
- Changed preferred client setting from radio toggle to combobox
|
||||||
|
|
||||||
## Dropped
|
## Dropped
|
||||||
- Ping readout in statusbar
|
- Ping readout in statusbar
|
||||||
|
- Extraneous information from right statusbar
|
||||||
|
|
||||||
## [5.8.0-beta.2] 2025-07-06
|
## [5.8.3] 2026-01-04
|
||||||
|
## Fixed
|
||||||
|
- Normalize checksum numbers and dates
|
||||||
|
|
||||||
|
## [5.8.2] 2026-01-04
|
||||||
|
## Fixed
|
||||||
|
- Fix regression in symlink routine introduced by previous hotfix
|
||||||
|
|
||||||
|
## [5.8.1] 2025-12-27
|
||||||
|
## Fixed
|
||||||
|
- Path discovery during first-time setup when parsing filepaths with whitespaces
|
||||||
|
- First-time setup dialog continuously triggering when DayZ install path had whitespaces in it
|
||||||
|
|
||||||
|
## [5.8.0] 2025-07-06
|
||||||
## Added
|
## Added
|
||||||
- Filter servers by official/unofficial status
|
- Filter servers by official/unofficial status
|
||||||
|
- Automatically fetch geolocation records
|
||||||
## Changed
|
## Changed
|
||||||
- Updated internal versioning of helper files
|
- Updated internal versioning of helper files
|
||||||
|
|
||||||
## [5.8.0-beta.1] 2025-06-05
|
|
||||||
## Added
|
|
||||||
- Automatically fetch geolocation records
|
|
||||||
## Fixed
|
## Fixed
|
||||||
- Corrected erroneous 2024 date in prior changelog entries
|
- Corrected erroneous 2024 date in prior changelog entries
|
||||||
|
|
||||||
## [5.7.1-beta.1] 2025-04-17
|
## [5.7.0] 2025-04-17
|
||||||
## Changed
|
## Added
|
||||||
- Updated geolocation records
|
- Save application dimensions when quitting and restore on subsequent boot
|
||||||
|
|
||||||
## [5.7.0-beta.13] 2025-04-17
|
|
||||||
## Fixed
|
## Fixed
|
||||||
- Updated checksum for UI helper file
|
- Issues with the window exceeding the bounds of the screen when displaying some table contexts
|
||||||
|
## Changed
|
||||||
|
- More direct server ping query method that should return marginally more accurate times
|
||||||
|
|
||||||
## [5.7.0-beta.12] 2025-04-04
|
## [5.6.7] 2025-04-04
|
||||||
## Dropped
|
## Dropped
|
||||||
- Removed extraneous pre-boot API checks that could cause error messages to be printed if the user had not set up an API key yet
|
- Removed extraneous pre-boot API checks that could cause error messages to be printed if the user had not set up an API key yet
|
||||||
|
|
||||||
## [5.7.0-beta.11] 2025-03-20
|
## [5.6.6] 2025-03-16
|
||||||
## Fixed
|
|
||||||
- Reduce startup time when testing remote APIs
|
|
||||||
|
|
||||||
## [5.7.0-beta.10] 2025-03-15
|
|
||||||
## Added
|
|
||||||
- Restore application size on subsequent startup
|
|
||||||
## Fixed
|
|
||||||
- Grid scaling causes table to exceeds bounds of display viewport
|
|
||||||
- Window exceeds taskbar on Steam Deck
|
|
||||||
- Reduce possibility of timeouts when pinging servers
|
|
||||||
## Changed
|
## Changed
|
||||||
- Packed filter checkbox buttons into a 3x3 grid
|
- Update IP database records for 2025-03
|
||||||
- Updated IP database to 2025-03 records
|
|
||||||
|
|
||||||
## [5.7.0-beta.9] 2025-03-04
|
## [5.6.5] 2025-03-04
|
||||||
## Fixed
|
## Fixed
|
||||||
- Livonia server results being dropped from batch queries
|
- Livonia server results being dropped from batch queries
|
||||||
|
|
||||||
## [5.7.0-beta.8] 2025-02-10
|
## [5.6.4] 2025-02-10
|
||||||
## Changed
|
### Changed
|
||||||
- Drop launch flag and check for invocation through Steam automatically
|
- Drop launch flag and check for invocation through Steam automatically
|
||||||
|
|
||||||
## [5.7.0-beta.7] 2025-02-09
|
## [5.6.3] 2025-02-09
|
||||||
## Changed
|
### Changed
|
||||||
- Update IP database records for 2025-02
|
- Update IP database records for 2025-02
|
||||||
|
|
||||||
## [5.7.0-beta.6] 2025-01-10
|
## [5.6.2] 2025-01-22
|
||||||
## Fixed
|
|
||||||
- Resolve regression introduced with IP resolution feature in 13c6813
|
|
||||||
|
|
||||||
## [5.7.0-beta.5] 2025-01-10
|
|
||||||
## Changed
|
|
||||||
- Stricter redacting of usernames (again)
|
|
||||||
|
|
||||||
## [5.7.0-beta.4] 2025-01-10
|
|
||||||
## Fixed
|
|
||||||
- Clerical hotfix
|
|
||||||
|
|
||||||
## [5.7.0-beta.3] 2025-01-10
|
|
||||||
## Changed
|
|
||||||
- Support legacy jq syntax for Ubuntu variants
|
|
||||||
|
|
||||||
## [5.7.0-beta.2] 2025-01-07
|
|
||||||
## Fixed
|
|
||||||
- Stricter redacting of usernames
|
|
||||||
- Omit nested directories when traversing symlinks
|
|
||||||
|
|
||||||
## [5.7.0-beta.1] 2025-01-07
|
|
||||||
### Changed
|
|
||||||
- Normalize version number
|
|
||||||
|
|
||||||
## [5.6.0-beta.21] 2025-01-06
|
|
||||||
### Added
|
|
||||||
- Add in-app documentation link to Codeberg mirror
|
|
||||||
- Hover tooltips to most buttons
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Prevent ArrowUp/ArrowDown input when inside keyword field
|
- Resolve regression introduced with IP resolution feature in 5.6.0 (restores functionality of right-click action: Add to My Servers)
|
||||||
|
|
||||||
|
## [5.6.1] 2025-01-10
|
||||||
|
### Fixed
|
||||||
|
- Add fallback support for jq 1.6
|
||||||
|
|
||||||
|
## [5.6.0] 2025-01-06
|
||||||
|
### Added
|
||||||
|
- Application header bar and controls
|
||||||
|
- Menu context subtitle in header bar
|
||||||
|
- Bulk delete mods (via 'List installed mods' list). Not compatible with Manual Mod install mode
|
||||||
|
- Highlight stale mods in mods list
|
||||||
|
- Added --steam launch parameter
|
||||||
|
- Open Steam workshop subscriptions dialog when switching from Manual to Auto mode
|
||||||
|
- Hover tooltips to most buttons
|
||||||
|
- Add in-app documentation link to Codeberg mirror
|
||||||
|
- Additional logging
|
||||||
|
### Fixed
|
||||||
|
- Avoid sudo escalation if system map count is sufficient (jiriks74)
|
||||||
|
- Duplicate dialog title on Steam Deck
|
||||||
|
- Resolve remote IP when saving records for game servers with multiple hosts
|
||||||
|
- More performant symlink traversal when checking for legacy links
|
||||||
|
- Only iterate on missing symlinks at boot (400% performance uplift)
|
||||||
|
- Fix for server list truncation causing some servers to not appear in results
|
||||||
|
- Empty dialog popups if user manually deletes local mods while application is running
|
||||||
|
- Update statusbar when removing servers from list/repopulating
|
||||||
|
- Abort DayZ path discovery if Steam files are not synched
|
||||||
|
- Race condition when checking for installed mods
|
||||||
|
- Favorite server message not updating correctly
|
||||||
|
- Improved handling for cases where there are no locally installed mods
|
||||||
|
- Set up mod symlinks at boot, rather than only on server connect
|
||||||
|
- Prevent context menus from opening when table is empty
|
||||||
|
- When reloading table in-place, prevent duplicate panel elements from being added if already present
|
||||||
|
- Clean up local mod signatures from versions file when deleting mods
|
||||||
|
- Focus first row when opening mods list
|
||||||
### Changed
|
### Changed
|
||||||
|
- Redact usernames in log files
|
||||||
|
- Prevent ArrowUp/ArrowDown input when inside keyword field
|
||||||
|
- Admonish user to restart Steam in error dialog if DayZ path could not be found
|
||||||
|
- Refactor control flow for more robust contextual parsing
|
||||||
|
- Stop sending modal dialog hints to outer window
|
||||||
|
- Clean up signal emission
|
||||||
|
- Clarify some error messages and normalize text formatting
|
||||||
- Update forum URL
|
- Update forum URL
|
||||||
- Reword Help section links to include destination
|
|
||||||
- Update README.md
|
- Update README.md
|
||||||
- Update IP database to 2025-01
|
- Update IP database to 2025-01
|
||||||
- Reduce IP database size by 50%
|
- Reduce IP database size by 50%
|
||||||
- Update documentation to 5.6.x standard
|
- Update documentation to 5.6.x standard
|
||||||
### Dropped
|
### Dropped
|
||||||
- Removed temporary mod ID output in debug logs
|
- Hall of Fame section from button links, to be moved inside documentation
|
||||||
- Removed Hall of Fame section from button links, moved inside documentation
|
- Unused imports
|
||||||
- Remove unused imports
|
|
||||||
|
|
||||||
## [5.6.0-beta.20] 2024-12-23
|
## [5.5.3] 2024-12-13
|
||||||
### Added
|
|
||||||
- Output real and resolved mod ids to logs (temporary)
|
|
||||||
- Added -steam launch parameter
|
|
||||||
### Fixed
|
|
||||||
- Only iterate on missing symlinks
|
|
||||||
- Move logging up
|
|
||||||
|
|
||||||
## [5.6.0-beta.19] 2024-12-18
|
|
||||||
### Added
|
|
||||||
- Redact usernames in log files
|
|
||||||
### Fixed
|
|
||||||
- More performant symlink traversal when checking for legacy links
|
|
||||||
|
|
||||||
## [5.6.0-beta.18] 2024-12-14
|
|
||||||
### Added
|
|
||||||
- Open Steam workshop subscriptions dialog
|
|
||||||
- Additional logging
|
|
||||||
### Fixed
|
|
||||||
- Empty dialog popups if user manually deletes local mods while application is running
|
|
||||||
- Abort DayZ path discovery if VDF if Steam files are not synched
|
|
||||||
- Avoid sudo escalation if system map count is sufficient (jiriks74)
|
|
||||||
### Changed
|
|
||||||
- Admonish user to restart Steam in error dialog if DayZ path could not be found
|
|
||||||
|
|
||||||
## [5.6.0-beta.17] 2024-12-14
|
|
||||||
### Added
|
|
||||||
- Additional logging
|
|
||||||
|
|
||||||
## [5.6.0-beta.16] 2024-12-13
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Add remote resource health checks before downloading updates
|
- Add remote resource health checks before downloading updates
|
||||||
### Added
|
### Added
|
||||||
- Add fallback repository
|
- Add fallback repository
|
||||||
|
|
||||||
## [5.6.0-beta.11] 2024-12-07
|
## [5.5.1] 2024-12-03
|
||||||
### Fixed
|
### Fixed
|
||||||
- Add missing function definition
|
- Support localized decimal separators when parsing installed mod sizes
|
||||||
|
|
||||||
## [5.6.0-beta.10] 2024-12-04
|
## [5.5.0] 2024-11-10
|
||||||
### Fixed
|
|
||||||
- Untoggle highlight button when repopulating mod list
|
|
||||||
- Resolve remote IP when saving records for game servers with multiple hosts
|
|
||||||
- Update statusbar when removing servers from list/repopulating
|
|
||||||
### Added:
|
|
||||||
- "Select stale" button to bulk select mods marked as obsolete
|
|
||||||
|
|
||||||
## [5.6.0-beta.9] 2024-12-03
|
|
||||||
### Fixed
|
|
||||||
- Normalize user locale when parsing floats
|
|
||||||
|
|
||||||
## [5.6.0-beta.8] 2024-11-28
|
|
||||||
### Fixed
|
|
||||||
- Normalize user locale when parsing floats
|
|
||||||
|
|
||||||
## [5.6.0-beta.7] 2024-11-28
|
|
||||||
### Changed
|
|
||||||
- Add additional logging when fetching installed mods
|
|
||||||
|
|
||||||
## [5.6.0-beta.6] 2024-11-28
|
|
||||||
### Fixed
|
|
||||||
- Race condition when checking for installed mods
|
|
||||||
|
|
||||||
## [5.6.0-beta.5] 2024-11-21
|
|
||||||
### Added
|
|
||||||
- Highlight stale mods in mods list
|
|
||||||
### Fixed
|
|
||||||
- Duplicate dialog title on Steam Deck
|
|
||||||
|
|
||||||
## [5.6.0-beta.4] 2024-11-20
|
|
||||||
### Added
|
|
||||||
- Application header bar and controls
|
|
||||||
- Menu context subtitle in header bar
|
|
||||||
### Changed
|
|
||||||
- Refactor control flow for more robust contextual parsing
|
|
||||||
- Stop sending modal dialog hints to outer window
|
|
||||||
### Fixed
|
|
||||||
- Favorite server message not updating correctly
|
|
||||||
|
|
||||||
## [5.6.0-beta.3] 2024-11-18
|
|
||||||
### Fixed
|
|
||||||
- Improved handling for cases where there are no locally installed mods
|
|
||||||
- Set up mod symlinks at boot, rather than only on server connect
|
|
||||||
- Prevent context menus from opening when table is empty
|
|
||||||
- When reloading table in-place, prevent duplicate panel elements from being added if already present
|
|
||||||
- Clean up signal emission
|
|
||||||
|
|
||||||
## [5.6.0-beta.2] 2024-11-15
|
|
||||||
### Fixed
|
|
||||||
- Clean up local mod signatures from versions file when deleting mods
|
|
||||||
|
|
||||||
## [5.6.0-beta.1] 2024-11-12
|
|
||||||
### Added
|
|
||||||
- Bulk delete mods (via 'List installed mods' list). Not compatible with Manual Mod install mode
|
|
||||||
### Fixed
|
|
||||||
- Fix for server list truncation causing some servers to not appear in results
|
|
||||||
- Suppress signal emission when switching menu contexts
|
|
||||||
- Focus first row when opening mods list
|
|
||||||
### Changed
|
|
||||||
- Clarify some error messages and normalize text formatting
|
|
||||||
|
|
||||||
## [5.5.0-beta.5] 2024-11-03
|
|
||||||
### Changed
|
|
||||||
- Use updated A2S_RULES logic
|
|
||||||
### Fixed
|
|
||||||
- Servers in saved servers list would populate context menu with same option when right-clicking in server browser
|
|
||||||
|
|
||||||
## [5.5.0-beta.4] 2024-10-31
|
|
||||||
### Added
|
|
||||||
- Expose a toggle setting for whether to launch the application in fullscreen
|
|
||||||
### Fixed
|
|
||||||
- Enable adding/removing servers to/from My Saved Servers when in Recent Servers context
|
|
||||||
|
|
||||||
## [5.5.0-beta.3] 2024-10-31
|
|
||||||
### Fixed
|
|
||||||
- Prevent maps combobox from duplicating contents
|
|
||||||
|
|
||||||
## [5.5.0-beta.2] 2024-10-31
|
|
||||||
### Fixed
|
|
||||||
- Restore keyboard input to keyword entry field
|
|
||||||
|
|
||||||
## [5.5.0-beta.1] 2024-10-30
|
|
||||||
### Added
|
### Added
|
||||||
- Support servers running DLC content (fixes Frostline servers)
|
- Support servers running DLC content (fixes Frostline servers)
|
||||||
- Text autocompletion in maps search field
|
- Expose a toggle setting for whether to launch the application in fullscreen
|
||||||
- Add disk space warning to popup dialog
|
- Text autocompletion in maps search field (partial search)
|
||||||
|
- Add disk space warning to popup dialog when downloading mods
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Servers in saved servers list would populate context menu with same option when right-clicking in server browser
|
||||||
|
- Enable adding/removing servers to/from My Saved Servers when in Recent Servers context
|
||||||
|
- Prevent maps combobox from duplicating contents
|
||||||
|
- Restore keyboard input to keyword entry field
|
||||||
|
### Changed
|
||||||
- Abort fallback query method if DLC is required
|
- Abort fallback query method if DLC is required
|
||||||
|
|
||||||
## [5.4.2-beta.1] 2024-10-05
|
## [5.4.2] 2024-10-05
|
||||||
### Fixed
|
### Fixed
|
||||||
- Sanitize third-party API IDs to remove UGC collisions
|
- Sanitize third-party API IDs to remove UGC collisions
|
||||||
|
|
||||||
## [5.4.1-beta.2] 2024-09-12
|
## [5.4.1] 2024-09-25
|
||||||
### Fixed
|
|
||||||
- Use fallback logic for modlist queries when user traverses networks
|
|
||||||
|
|
||||||
## [5.4.1-beta.2] 2024-09-10
|
|
||||||
### Fixed
|
|
||||||
- Fix signal handling control flow for checkbox toggles
|
|
||||||
|
|
||||||
## [5.4.1-beta.1] 2024-09-10
|
|
||||||
### Added
|
### Added
|
||||||
- Pre-boot validation check for users with self-compiled version of jq
|
- Pre-boot validation check for users with self-compiled version of jq
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Use fallback logic for modlist queries when user traverses networks
|
||||||
|
- Fix signal handling control flow for checkbox toggles
|
||||||
- When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps
|
- When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps
|
||||||
- Server filter toggle signals were accessible from the main menu when switching between menu contexts
|
- Server filter toggle signals were accessible from the main menu when switching between menu contexts
|
||||||
- Global cooldown dialog could sometimes block filter toggles after cooldown reset
|
- Global cooldown dialog could sometimes block filter toggles after cooldown reset
|
||||||
- Normalized minor version number due to a previous clerical error
|
- Normalized minor version number due to a previous clerical error
|
||||||
|
|
||||||
## [5.4.0-beta.5] 2024-08-27
|
## [5.4.0] 2024-08-27
|
||||||
### Added
|
|
||||||
- Freedesktop application icons for system taskbar, tray, and other dialogs
|
|
||||||
### Fixed
|
|
||||||
- Errors being printed to the console when Exit button was explicitly clicked
|
|
||||||
|
|
||||||
## [5.4.0-beta.4] 2024-08-21
|
|
||||||
### Added
|
|
||||||
- Emit CPU model name when exporting system debug log
|
|
||||||
### Fixed
|
|
||||||
- Detect Steam Deck OLED APU variant during initial setup
|
|
||||||
|
|
||||||
## [5.4.0-beta.3] 2024-08-04
|
|
||||||
### Added
|
### Added
|
||||||
- Scan local area network for DayZ servers
|
- Scan local area network for DayZ servers
|
||||||
|
- Freedesktop application icons for system taskbar, tray, and other dialogs
|
||||||
## [5.4.0-beta.2] 2024-08-03
|
- Emit CPU model name when exporting system debug log
|
||||||
### Fixed
|
|
||||||
- Clerical hotfix for previous player names fix
|
|
||||||
- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection
|
|
||||||
|
|
||||||
## [5.4.0-beta.1] 2024-07-16
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Errors being printed to the console when Exit button was explicitly clicked
|
||||||
|
- Detect Steam Deck OLED APU variant during initial setup
|
||||||
- Encapsulate player names correctly so that names with whitespace in them are supported
|
- Encapsulate player names correctly so that names with whitespace in them are supported
|
||||||
|
- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection
|
||||||
|
- Report WM_CLASS name to the window manager
|
||||||
|
|
||||||
## [5.3.2] 2024-07-02
|
## [5.3.2] 2024-07-02
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -538,7 +401,7 @@ As part of this change, version 4.0.0 introduces the ability to connect to or ad
|
|||||||
|
|
||||||
If you encounter any problems with this new release or with the migration of configs, please do not hesitate to submit a bug report.
|
If you encounter any problems with this new release or with the migration of configs, please do not hesitate to submit a bug report.
|
||||||
|
|
||||||
Attention Fedora 38 users: problems with upstream GNOME packages causing crashes have been reported to GNOME development and a fix has been issued. You have the choice of compiling the zenity package
|
Attention Fedora 38 users: problems with upstream GNOME packages causing crashes have been reported to GNOME development and a fix has been issued. You have the choice of compiling the zenity package
|
||||||
from source or waiting until the latest version is merged into Fedora's package manager.
|
from source or waiting until the latest version is merged into Fedora's package manager.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -563,7 +426,7 @@ from source or waiting until the latest version is merged into Fedora's package
|
|||||||
- Store complete IP:Port instead of server IDs
|
- Store complete IP:Port instead of server IDs
|
||||||
- Make Battlemetrics API key optional: this is only used for the 'Connect by ID' and 'Add server by ID' methods and is not required. If you prefer, you can simply connect/add by IP.
|
- Make Battlemetrics API key optional: this is only used for the 'Connect by ID' and 'Add server by ID' methods and is not required. If you prefer, you can simply connect/add by IP.
|
||||||
- Prevent the application from launching in Game Mode on Steam Deck: Steam Deck's kiosk mode has problems sending keyboard input to third party applications. To prevent unintended usage, DZGUI now warns the user to launch the app in Desktop Mode if they attempt to use it from Game Mode. Adding DZGUI as a Non-Steam Game does work on desktop PCs, but is not recommended due to the way Steam handles subshells. For best results, launch DZGUI directly via the script/applications menu (PC) or via the desktop icon (Steam Deck).
|
- Prevent the application from launching in Game Mode on Steam Deck: Steam Deck's kiosk mode has problems sending keyboard input to third party applications. To prevent unintended usage, DZGUI now warns the user to launch the app in Desktop Mode if they attempt to use it from Game Mode. Adding DZGUI as a Non-Steam Game does work on desktop PCs, but is not recommended due to the way Steam handles subshells. For best results, launch DZGUI directly via the script/applications menu (PC) or via the desktop icon (Steam Deck).
|
||||||
- Omit null servers from list: servers that time out or send an empty response are now omitted entirely from the My Servers list, as they will not return meaningful metadata unless they are online.
|
- Omit null servers from list: servers that time out or send an empty response are now omitted entirely from the My Servers list, as they will not return meaningful metadata unless they are online.
|
||||||
The My Servers list thus shows online and accessible servers
|
The My Servers list thus shows online and accessible servers
|
||||||
|
|
||||||
## [3.3.0] 2023-05-16
|
## [3.3.0] 2023-05-16
|
||||||
@@ -582,7 +445,7 @@ from source or waiting until the latest version is merged into Fedora's package
|
|||||||
- First-time setup: sudo escalation when checking system map count for the first time
|
- First-time setup: sudo escalation when checking system map count for the first time
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Steam Deck: non-ASCII delimiter causing setup menu to despawn on some devices
|
- Steam Deck: non-ASCII delimiter causing setup menu to despawn on some devices
|
||||||
- Don't add items in My Servers multiple times to array when the list of favorites is paginated
|
- Don't add items in My Servers multiple times to array when the list of favorites is paginated
|
||||||
- Trigger progress dialogs sooner and in sequence to reduce appearance of visual lag
|
- Trigger progress dialogs sooner and in sequence to reduce appearance of visual lag
|
||||||
- First-time setup: break out of dialogs correctly when user backs out
|
- First-time setup: break out of dialogs correctly when user backs out
|
||||||
|
|||||||
+3
-3
@@ -8,7 +8,7 @@ If you are a developer, you can skip to the end.
|
|||||||
# Requesting help
|
# Requesting help
|
||||||
|
|
||||||
If you encounter a problem with DZGUI, you can submit tickets on the GitHub
|
If you encounter a problem with DZGUI, you can submit tickets on the GitHub
|
||||||
(issue tracker)[https://github.com/aclist/dzgui-devel/issues] under the
|
[issue tracker](https://github.com/aclist/dztui/issues) under the
|
||||||
`troubleshooting` tag.
|
`troubleshooting` tag.
|
||||||
|
|
||||||
# How can I help the project?
|
# How can I help the project?
|
||||||
@@ -24,7 +24,7 @@ accordingly.
|
|||||||
|
|
||||||
## Submitting a ticket
|
## Submitting a ticket
|
||||||
|
|
||||||
Navigate to the GitHub (issue tracker)[https://github.com/aclist/dzgui-devel/issues].
|
Navigate to the GitHub [issue tracker](https://github.com/aclist/dztui/issues).
|
||||||
From there, follow the onscreen prompts. You will be asked questions such as:
|
From there, follow the onscreen prompts. You will be asked questions such as:
|
||||||
|
|
||||||
- What version are you using?
|
- What version are you using?
|
||||||
@@ -67,5 +67,5 @@ will be merged to `prerelease/<latest-version>`, then `testing`, and after a liv
|
|||||||
testing phase, to `stable` as well.
|
testing phase, to `stable` as well.
|
||||||
|
|
||||||
It is recommended to follow
|
It is recommended to follow
|
||||||
(Conventional Commits)[https://www.conventionalcommits.org/en/v1.0.0/], as this
|
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), as this
|
||||||
integrates well with tooling and helps the project review your code.
|
integrates well with tooling and helps the project review your code.
|
||||||
@@ -11,6 +11,15 @@ This overcomes certain limitations in the Linux client and helps prepare the gam
|
|||||||
- Concatenate launch options to pass to Steam
|
- Concatenate launch options to pass to Steam
|
||||||
- Connect to mod-enabled LAN servers
|
- Connect to mod-enabled LAN servers
|
||||||
|
|
||||||
|
## Design philosophy
|
||||||
|
|
||||||
|
DZGUI follows a specific set of guidelines, enumerated below:
|
||||||
|
|
||||||
|
- Provide a free and open-source tool under GPL
|
||||||
|
- Do not use undocumented, third-party servers to aggregate data; no central "DZGUI" server
|
||||||
|
- All connections go to Steam and DayZ servers directly; the tool should function in perpetuity without intermediary endpoints
|
||||||
|
- Target Linux desktop and Steam deck specifically; not a cross-platform tool
|
||||||
|
|
||||||
## Setup and usage
|
## Setup and usage
|
||||||
|
|
||||||
Refer to the documentation for installation and setup instructions:
|
Refer to the documentation for installation and setup instructions:
|
||||||
@@ -18,7 +27,6 @@ Refer to the documentation for installation and setup instructions:
|
|||||||
- [GitHub](https://aclist.github.io/dzgui/index.html)
|
- [GitHub](https://aclist.github.io/dzgui/index.html)
|
||||||
- [Mirror (Codeberg)](https://aclist.codeberg.page)
|
- [Mirror (Codeberg)](https://aclist.codeberg.page)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
src_path=$(realpath "$0")
|
src_path="$(readlink -e "$0")"
|
||||||
|
version=6.0.5
|
||||||
version=6.0.0.beta-12
|
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
@@ -41,6 +40,7 @@ cols_file="$state_path/$prefix.cols.json"
|
|||||||
|
|
||||||
#CACHE FILES
|
#CACHE FILES
|
||||||
coords_file="$cache_path/$prefix.coords"
|
coords_file="$cache_path/$prefix.coords"
|
||||||
|
src_path_file="$cache_path/$prefix.src"
|
||||||
|
|
||||||
#legacy paths
|
#legacy paths
|
||||||
hist_file="$config_path/history"
|
hist_file="$config_path/history"
|
||||||
@@ -117,6 +117,7 @@ setup_state_files(){
|
|||||||
done
|
done
|
||||||
logger INFO "Wiped cache files"
|
logger INFO "Wiped cache files"
|
||||||
fi
|
fi
|
||||||
|
echo "$src_path" > "$src_path_file"
|
||||||
}
|
}
|
||||||
print_config_vals(){
|
print_config_vals(){
|
||||||
local keys=(
|
local keys=(
|
||||||
@@ -141,7 +142,7 @@ test_gobject(){
|
|||||||
python3.13 -c "import gi"
|
python3.13 -c "import gi"
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
logger CRITICAL "Missing PyGObject"
|
logger CRITICAL "Missing PyGObject"
|
||||||
fdialog "Requires PyGObject (python-gobject)"
|
quit_with_help_dialog "Requires PyGObject (python-gobject)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
logger INFO "Found PyGObject in Python env"
|
logger INFO "Found PyGObject in Python env"
|
||||||
@@ -226,7 +227,8 @@ depcheck(){
|
|||||||
for dep in "${!deps[@]}"; do
|
for dep in "${!deps[@]}"; do
|
||||||
if ! command -v "$dep" &> /dev/null; then
|
if ! command -v "$dep" &> /dev/null; then
|
||||||
local msg="Requires $dep >= ${deps[$dep]}"
|
local msg="Requires $dep >= ${deps[$dep]}"
|
||||||
raise_error_and_quit "$msg"
|
echo "$msg"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
local jqmsg="jq must be compiled with support for oniguruma"
|
local jqmsg="jq must be compiled with support for oniguruma"
|
||||||
@@ -235,10 +237,30 @@ depcheck(){
|
|||||||
[[ $? -ne 0 ]] && raise_error_and_quit "$jqmsg"
|
[[ $? -ne 0 ]] && raise_error_and_quit "$jqmsg"
|
||||||
logger INFO "Initial dependencies satisfied"
|
logger INFO "Initial dependencies satisfied"
|
||||||
}
|
}
|
||||||
|
open_url(){
|
||||||
|
url="$1"
|
||||||
|
if [[ -n "$BROWSER" ]]; then
|
||||||
|
logger INFO "Opening '$url' in '$BROWSER'"
|
||||||
|
"$BROWSER" "$url"
|
||||||
|
else
|
||||||
|
logger INFO "Opening '$url' with xdg-open"
|
||||||
|
xdg-open "$url"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
quit_with_help_dialog(){
|
||||||
|
local sel
|
||||||
|
msg="$1"
|
||||||
|
help_button="Open help page"
|
||||||
|
url="https://aclist.github.io/dzgui/installation.html"
|
||||||
|
logger CRITICAL "$msg"
|
||||||
|
sel=$(zenity --info --extra-button="$help_button" --text="$msg")
|
||||||
|
[[ $sel == "$help_button" ]] && open_url "$url" &
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
check_pyver(){
|
check_pyver(){
|
||||||
if [[ ! $(command -v python3.13) ]]; then
|
if [[ ! $(python3.13 --version) ]]; then
|
||||||
local msg="Requires Python 3.13"
|
local msg="Requires Python 3.13"
|
||||||
raise_error_and_quit "$msg"
|
quit_with_help_dialog "$msg"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
watcher_deps(){
|
watcher_deps(){
|
||||||
@@ -313,6 +335,7 @@ check_unmerged(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_version(){
|
check_version(){
|
||||||
|
echo "# Checking version"
|
||||||
[[ -n $reference_branch ]] && return
|
[[ -n $reference_branch ]] && return
|
||||||
local version_url=$(format_version_url)
|
local version_url=$(format_version_url)
|
||||||
local upstream=$(curl -Ls "$version_url" | awk -F= '/^version=/ {print $2}')
|
local upstream=$(curl -Ls "$version_url" | awk -F= '/^version=/ {print $2}')
|
||||||
@@ -363,7 +386,7 @@ prompt_dl(){
|
|||||||
Your branch: $branch
|
Your branch: $branch
|
||||||
Your version: $version
|
Your version: $version
|
||||||
Upstream version: $upstream
|
Upstream version: $upstream
|
||||||
|
|
||||||
Version updates introduce important bug fixes and are encouraged. Attempt to download the latest version?
|
Version updates introduce important bug fixes and are encouraged. Attempt to download the latest version?
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -377,10 +400,11 @@ prompt_dl(){
|
|||||||
dl_changelog(){
|
dl_changelog(){
|
||||||
local mdbranch
|
local mdbranch
|
||||||
local md
|
local md
|
||||||
|
source "$config_file"
|
||||||
[[ $branch == "stable" ]] && mdbranch="dzgui"
|
[[ $branch == "stable" ]] && mdbranch="dzgui"
|
||||||
[[ $branch == "testing" ]] && mdbranch="testing"
|
[[ $branch == "testing" ]] && mdbranch="testing"
|
||||||
local md="$url_prefix/${mdbranch}/$file"
|
local changelog="$url_prefix/${mdbranch}/CHANGELOG.md"
|
||||||
curl -Ls "$md" > "$state_path/CHANGELOG.md"
|
curl -Ls "$changelog" > "$state_path/CHANGELOG.md"
|
||||||
}
|
}
|
||||||
test_display_mode(){
|
test_display_mode(){
|
||||||
pgrep -a gamescope | grep -q "generate-drm-mode"
|
pgrep -a gamescope | grep -q "generate-drm-mode"
|
||||||
@@ -391,6 +415,7 @@ test_display_mode(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_architecture(){
|
check_architecture(){
|
||||||
|
echo "# Checking system architecture"
|
||||||
local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}')
|
local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}')
|
||||||
read -a APU_MODEL <<< "$cpu"
|
read -a APU_MODEL <<< "$cpu"
|
||||||
if [[ ${APU_MODEL[3]} != "0932" ]] && [[ ${APU_MODEL[3]} != "0405" ]]; then
|
if [[ ${APU_MODEL[3]} != "0932" ]] && [[ ${APU_MODEL[3]} != "0405" ]]; then
|
||||||
@@ -407,6 +432,7 @@ check_architecture(){
|
|||||||
logger INFO "Setting architecture to 'Steam Deck'"
|
logger INFO "Setting architecture to 'Steam Deck'"
|
||||||
}
|
}
|
||||||
check_map_count(){
|
check_map_count(){
|
||||||
|
echo "# Checking map count"
|
||||||
[[ $is_steam_deck -gt 0 ]] && return 0
|
[[ $is_steam_deck -gt 0 ]] && return 0
|
||||||
local map_count_file="/proc/sys/vm/max_map_count"
|
local map_count_file="/proc/sys/vm/max_map_count"
|
||||||
local min_count=1048576
|
local min_count=1048576
|
||||||
@@ -456,6 +482,7 @@ tdialog(){
|
|||||||
$steamsafe_zenity --info --text="$1" "${zenity_flags[@]}"
|
$steamsafe_zenity --info --text="$1" "${zenity_flags[@]}"
|
||||||
}
|
}
|
||||||
steam_deps(){
|
steam_deps(){
|
||||||
|
echo "# Checking Steam"
|
||||||
local flatpak
|
local flatpak
|
||||||
local steam
|
local steam
|
||||||
[[ $(command -v flatpak) ]] && flatpak=$(flatpak list | grep valvesoftware.Steam)
|
[[ $(command -v flatpak) ]] && flatpak=$(flatpak list | grep valvesoftware.Steam)
|
||||||
@@ -466,20 +493,13 @@ steam_deps(){
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
migrate_files(){
|
|
||||||
if [[ ! -f $config_path/dztuirc.oldapi ]]; then
|
|
||||||
cp $config_file $config_path/dztuirc.oldapi
|
|
||||||
logger INFO "Migrated old API file"
|
|
||||||
fi
|
|
||||||
[[ ! -f $hist_file ]] && return
|
|
||||||
rm $hist_file
|
|
||||||
logger INFO "Wiped old history file"
|
|
||||||
}
|
|
||||||
stale_symlinks(){
|
stale_symlinks(){
|
||||||
|
echo "# Cleaning stale symlinks"
|
||||||
local game_dir="$steam_path/steamapps/common/DayZ"
|
local game_dir="$steam_path/steamapps/common/DayZ"
|
||||||
for l in $(find "$game_dir" -xtype l); do
|
readarray -t links < <(find "$game_dir" -xtype l)
|
||||||
logger DEBUG "Updating stale symlink '$l'"
|
for link in "${links[@]}"; do
|
||||||
unlink "$l"
|
logger DEBUG "Updating stale symlink '$link'"
|
||||||
|
unlink "$link"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,7 +508,7 @@ check_availability() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
local url=$1
|
local url=$1
|
||||||
local timeout_sec="3"
|
local timeout_sec="2"
|
||||||
if [[ $2 ]]; then
|
if [[ $2 ]]; then
|
||||||
timeout_sec=$2
|
timeout_sec=$2
|
||||||
fi
|
fi
|
||||||
@@ -499,6 +519,7 @@ check_availability() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local_latlon(){
|
local_latlon(){
|
||||||
|
echo "# Checking coordinates"
|
||||||
if [[ -z $(command -v dig) ]]; then
|
if [[ -z $(command -v dig) ]]; then
|
||||||
local url_ipecho="https://ipecho.net/plain"
|
local url_ipecho="https://ipecho.net/plain"
|
||||||
if ! check_availability "ipecho.net"; then
|
if ! check_availability "ipecho.net"; then
|
||||||
@@ -510,6 +531,9 @@ local_latlon(){
|
|||||||
# TODO : implement checking remote
|
# TODO : implement checking remote
|
||||||
local local_ip=$(dig -4 +short myip.opendns.com @resolver1.opendns.com)
|
local local_ip=$(dig -4 +short myip.opendns.com @resolver1.opendns.com)
|
||||||
fi
|
fi
|
||||||
|
if calc_local_coords "$local_ip"; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
local url_ip_api="http://ip-api.com/json/$local_ip"
|
local url_ip_api="http://ip-api.com/json/$local_ip"
|
||||||
if ! check_availability "ip-api.com"; then
|
if ! check_availability "ip-api.com"; then
|
||||||
logger WARN "Failed to get local coordinates, ip-api.com service may be down."
|
logger WARN "Failed to get local coordinates, ip-api.com service may be down."
|
||||||
@@ -524,6 +548,7 @@ local_latlon(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
lock(){
|
lock(){
|
||||||
|
echo "# Setting up lock file"
|
||||||
[[ ! -f $lock_file ]] && touch $lock_file
|
[[ ! -f $lock_file ]] && touch $lock_file
|
||||||
local pid=$(cat $lock_file)
|
local pid=$(cat $lock_file)
|
||||||
ps -p $pid -o pid= >/dev/null 2>&1
|
ps -p $pid -o pid= >/dev/null 2>&1
|
||||||
@@ -542,9 +567,12 @@ get_hash(){
|
|||||||
md5sum "$1" | awk '{print $1}'
|
md5sum "$1" | awk '{print $1}'
|
||||||
}
|
}
|
||||||
fetch_a2s(){
|
fetch_a2s(){
|
||||||
# this file is currently monolithic
|
sum="d26da2fe03df2b95436f823f0496887b"
|
||||||
[[ -d $helpers_path/a2s ]] && { logger INFO "A2S helper is current"; return 0; }
|
if [[ -d $helpers_path/a2s ]] && [[ $(get_hash "$helpers_path/a2s/info.py") == $sum ]]; then
|
||||||
local sha=c7590ffa9a6d0c6912e17ceeab15b832a1090640
|
logger INFO "A2S helper is current"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
local sha=b40eb24cdbb06ebd08272f224257fe5a81610e86
|
||||||
local author="yepoleb"
|
local author="yepoleb"
|
||||||
local repo="python-a2s"
|
local repo="python-a2s"
|
||||||
local url="https://github.com/$author/$repo/tarball/$sha"
|
local url="https://github.com/$author/$repo/tarball/$sha"
|
||||||
@@ -558,13 +586,13 @@ fetch_a2s(){
|
|||||||
logger INFO "Updated A2S helper to sha '$sha'"
|
logger INFO "Updated A2S helper to sha '$sha'"
|
||||||
}
|
}
|
||||||
fetch_dzq(){
|
fetch_dzq(){
|
||||||
local sum="0a334e1e144e76e560419d155435c91e"
|
local sum="0d316badbb8d943c5f078e73862cac3e"
|
||||||
local file="$helpers_path/a2s/dayzquery.py"
|
local file="$helpers_path/a2s/dayzquery.py"
|
||||||
if [[ -f $file ]] && [[ $(get_hash "$file") == $sum ]]; then
|
if [[ -f $file ]] && [[ $(get_hash "$file") == $sum ]]; then
|
||||||
logger INFO "DZQ is current"
|
logger INFO "DZQ is current"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
local sha=a22a9f428cbe075d7dda62f78000296955eea92a
|
local sha="07483b88ed096327ebca752f5e177011b604d7fe"
|
||||||
local author="yepoleb"
|
local author="yepoleb"
|
||||||
local repo="dayzquery"
|
local repo="dayzquery"
|
||||||
local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py"
|
local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py"
|
||||||
@@ -601,12 +629,12 @@ fetch_helpers_by_sum(){
|
|||||||
[[ -f "$config_file" ]] && source "$config_file"
|
[[ -f "$config_file" ]] && source "$config_file"
|
||||||
declare -A sums
|
declare -A sums
|
||||||
sums=(
|
sums=(
|
||||||
["funcs"]="bb059b81826babc53a268d0f5afe1110"
|
["funcs"]="cff21e5ecfbbf72951f9f772b46024c9"
|
||||||
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
||||||
["servers.py"]="ed442c3aecf33f777d59dcf53650d263"
|
["servers.py"]="ed442c3aecf33f777d59dcf53650d263"
|
||||||
["ui.py"]="2276386252bd571b3505cbbc74359732"
|
["ui.py"]="cf52a3d5883afe02a013d8673df494fa"
|
||||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||||
["pefile.py"]="21531f2c0d9dfa5f110cf6779f9d22c0"
|
["pefile.py"]="b452974a84bff1d821872fcebf59e380"
|
||||||
)
|
)
|
||||||
local author="aclist"
|
local author="aclist"
|
||||||
local repo="dztui"
|
local repo="dztui"
|
||||||
@@ -666,15 +694,12 @@ fetch_km_helper(){
|
|||||||
}
|
}
|
||||||
get_response_code(){
|
get_response_code(){
|
||||||
local url="$1"
|
local url="$1"
|
||||||
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
curl --connect-timeout 3 -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
||||||
}
|
|
||||||
raise_error_and_quit(){
|
|
||||||
echo "$1"
|
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_ip_db(){
|
fetch_ip_db(){
|
||||||
parse_dl_url(){
|
parse_dl_url(){
|
||||||
curl -Ls "$url" \
|
curl --connect-timeout 3 -Ls "$url" \
|
||||||
| grep "csv.gz" \
|
| grep "csv.gz" \
|
||||||
| awk -F"['']" '{print $2}'
|
| awk -F"['']" '{print $2}'
|
||||||
}
|
}
|
||||||
@@ -690,6 +715,9 @@ fetch_ip_db(){
|
|||||||
fetch(){
|
fetch(){
|
||||||
logger INFO "Triggering fetch routine"
|
logger INFO "Triggering fetch routine"
|
||||||
local url="$1"
|
local url="$1"
|
||||||
|
local ip_file="${state_path}/ips.csv"
|
||||||
|
local base_file="${state_path}/${this_month}.csv.gz"
|
||||||
|
local extracted_file="${state_path}/${this_month}.csv"
|
||||||
|
|
||||||
curl -Ls "$url" > "$base_file"
|
curl -Ls "$url" > "$base_file"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
@@ -709,7 +737,7 @@ fetch_ip_db(){
|
|||||||
logger WARN "Abnormal exit while parsing IPs"
|
logger WARN "Abnormal exit while parsing IPs"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
rm "${state_path}/${month}.csv"
|
rm "${state_path}/${this_month}.csv"
|
||||||
|
|
||||||
readarray -t records < <(cat $ip_file | awk -F, 'NR==1 {print $1} END {print $1}')
|
readarray -t records < <(cat $ip_file | awk -F, 'NR==1 {print $1} END {print $1}')
|
||||||
if [[ ${records[0]} != "0.0.0.0" ]] && [[ ${records[1]} != "224.0.0.0" ]]; then
|
if [[ ${records[0]} != "0.0.0.0" ]] && [[ ${records[1]} != "224.0.0.0" ]]; then
|
||||||
@@ -724,55 +752,57 @@ fetch_ip_db(){
|
|||||||
rm "$ip_file"
|
rm "$ip_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$month" > "$month_file"
|
echo "$this_month" > "$month_file"
|
||||||
logger INFO "Wrote '$month' to stub '$month_file'"
|
logger INFO "Wrote '$this_month' to stub '$month_file'"
|
||||||
logger INFO "Updated '$ip_file'"
|
logger INFO "Updated '$ip_file'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_remote(){
|
||||||
|
local url="$1"
|
||||||
|
local res=$(get_response_code "$url")
|
||||||
|
if [[ $res -ne 200 ]]; then
|
||||||
|
logger WARN "Failed to retrieve remote resource: '$url' ($res)"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
logger INFO "Resolved remote URL: '$url'"
|
||||||
|
|
||||||
|
# test dl url
|
||||||
|
local dl_url="$(parse_dl_url)"
|
||||||
|
local res=$(get_response_code "$dl_url")
|
||||||
|
if [[ $res -ne 200 ]]; then
|
||||||
|
logger WARN "Remote resource unavailable: '$dl_url' ($res)"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
logger INFO "Resolved download URL: '$dl_url'"
|
||||||
|
fetch "$dl_url"
|
||||||
|
}
|
||||||
|
|
||||||
local url="https://db-ip.com/db/download/ip-to-city-lite"
|
local url="https://db-ip.com/db/download/ip-to-city-lite"
|
||||||
local month_file="${state_path}/.month"
|
month_file="${state_path}/.month"
|
||||||
local ip_file="${state_path}/ips.csv"
|
this_month=$(date +%Y-%m)
|
||||||
|
|
||||||
# test main url
|
|
||||||
local res=$(get_response_code "$url")
|
|
||||||
if [[ $res -ne 200 ]]; then
|
|
||||||
logger WARN "Failed to retrieve remote resource: '$url' ($res)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
logger INFO "Resolved remote URL: '$url'"
|
|
||||||
|
|
||||||
# test dl url
|
|
||||||
local dl_url="$(parse_dl_url)"
|
|
||||||
local res=$(get_response_code "$dl_url")
|
|
||||||
if [[ $res -ne 200 ]]; then
|
|
||||||
logger WARN "Remote resource unavailable: '$dl_url' ($res)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
logger INFO "Resolved download URL: '$dl_url'"
|
|
||||||
|
|
||||||
local month=$(parse_dl_url_date "$dl_url")
|
|
||||||
local base_file="${state_path}/${month}.csv.gz"
|
|
||||||
local extracted_file="${state_path}/${month}.csv"
|
|
||||||
|
|
||||||
# no stub file
|
# no stub file
|
||||||
if [[ ! -f $month_file ]]; then
|
if [[ ! -f $month_file ]]; then
|
||||||
logger WARN "No stub file '$month_file' present"
|
logger WARN "No stub file '$month_file' present"
|
||||||
fetch "$dl_url"
|
check_remote "$url"
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# local needs update
|
|
||||||
local last_month=$(< "$month_file")
|
|
||||||
if [[ $last_month != "$month" ]]; then
|
|
||||||
logger WARN "Local stub '$last_month' does not match remote stub '$month'"
|
|
||||||
fetch "$dl_url"
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if stub is same date, abort
|
# if stub is same date, abort
|
||||||
logger INFO "Local stub '$last_month' is identical to remote, skipping"
|
local last_month=$(< "$month_file")
|
||||||
|
if [[ $last_month == "$this_month" ]]; then
|
||||||
|
logger INFO "Local stub '$last_month' is identical to remote, skipping"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# local needs update
|
||||||
|
logger WARN "Local stub '$last_month' does not match '$this_month'"
|
||||||
|
check_remote "$url"
|
||||||
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
fetch_helpers(){
|
fetch_helpers(){
|
||||||
|
echo "# Checking helper files"
|
||||||
fetch_a2s
|
fetch_a2s
|
||||||
fetch_dzq
|
fetch_dzq
|
||||||
fetch_km_helper
|
fetch_km_helper
|
||||||
@@ -871,12 +901,26 @@ file_picker(){
|
|||||||
}
|
}
|
||||||
find_library_folder(){
|
find_library_folder(){
|
||||||
local search_path="$1"
|
local search_path="$1"
|
||||||
steam_path="$(python3.13 "$helpers_path/vdf2json.py" -i "$1/steamapps/libraryfolders.vdf" \
|
readarray -t paths < <(python3.13 "$helpers_path/vdf2json.py" -i "$1/steamapps/libraryfolders.vdf" \
|
||||||
| jq -r '.libraryfolders[]|select(.apps|has("221100")).path')"
|
| jq -r '.libraryfolders[]|select(.apps|has("221100")).path')
|
||||||
if [[ ! $? -eq 0 ]] || [[ -z $steam_path ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
logger WARN "Failed to parse Steam path using '$search_path'"
|
logger WARN "Failed to parse Steam path using '$search_path'"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if [[ ${#paths[@]} -eq 0 ]]; then
|
||||||
|
logger WARN "No valid VDF paths in '$search_path'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ ${#paths[@]} -gt 1 ]]; then
|
||||||
|
for path in "${paths[@]}"; do
|
||||||
|
if [[ -d "$path" ]]; then
|
||||||
|
steam_path="$path"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
steam_path="${paths[0]}"
|
||||||
|
fi
|
||||||
logger INFO "Steam path resolved to: $steam_path"
|
logger INFO "Steam path resolved to: $steam_path"
|
||||||
}
|
}
|
||||||
create_config(){
|
create_config(){
|
||||||
@@ -946,6 +990,7 @@ create_config(){
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
varcheck(){
|
varcheck(){
|
||||||
|
echo "# Checking config file"
|
||||||
local msg="Config file '$config_file' missing. Start first-time setup now?"
|
local msg="Config file '$config_file' missing. Start first-time setup now?"
|
||||||
local msg2="The Steam paths set in your config file appear to be invalid (DayZ was moved or uninstalled). Restart first-time setup now?"
|
local msg2="The Steam paths set in your config file appear to be invalid (DayZ was moved or uninstalled). Restart first-time setup now?"
|
||||||
if [[ ! -f $config_file ]]; then
|
if [[ ! -f $config_file ]]; then
|
||||||
@@ -959,7 +1004,7 @@ varcheck(){
|
|||||||
source "$config_file"
|
source "$config_file"
|
||||||
local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
||||||
local game_dir="$steam_path/steamapps/common/DayZ"
|
local game_dir="$steam_path/steamapps/common/DayZ"
|
||||||
if [[ ! -d $steam_path ]] || [[ ! -d $game_dir ]] || [[ ! $(find $game_dir -type f) ]]; then
|
if [[ ! -d $steam_path ]] || [[ ! -d $game_dir ]] || [[ ! $(find "$game_dir" -type f) ]]; then
|
||||||
logger WARN "DayZ path resolved to '$game_dir'"
|
logger WARN "DayZ path resolved to '$game_dir'"
|
||||||
logger WARN "Workshop path resolved to '$workshop_dir'"
|
logger WARN "Workshop path resolved to '$workshop_dir'"
|
||||||
qdialog "$msg2" "Yes" "Exit"
|
qdialog "$msg2" "Yes" "Exit"
|
||||||
@@ -972,12 +1017,14 @@ varcheck(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
is_dzg_downloading(){
|
is_dzg_downloading(){
|
||||||
|
echo "# Checking DayZ"
|
||||||
if [[ -d $steam_path ]] && [[ -d $steam_path/downloading/$aid ]]; then
|
if [[ -d $steam_path ]] && [[ -d $steam_path/downloading/$aid ]]; then
|
||||||
logger WARN "DayZ may be scheduling updates"
|
logger WARN "DayZ may be scheduling updates"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
is_steam_running(){
|
is_steam_running(){
|
||||||
|
echo "# Checking Steam"
|
||||||
local res=$(ps aux | grep "steamwebhelper" | grep -v grep)
|
local res=$(ps aux | grep "steamwebhelper" | grep -v grep)
|
||||||
if [[ -z $res ]]; then
|
if [[ -z $res ]]; then
|
||||||
logger WARN "Steam may not be running"
|
logger WARN "Steam may not be running"
|
||||||
@@ -990,6 +1037,7 @@ get_response_code(){
|
|||||||
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
||||||
}
|
}
|
||||||
test_connection(){
|
test_connection(){
|
||||||
|
echo "# Testing connection"
|
||||||
declare -A hr
|
declare -A hr
|
||||||
local res1
|
local res1
|
||||||
local res2
|
local res2
|
||||||
@@ -1023,6 +1071,7 @@ legacy_cols(){
|
|||||||
mv $cols_file.new $cols_file
|
mv $cols_file.new $cols_file
|
||||||
}
|
}
|
||||||
stale_mod_signatures(){
|
stale_mod_signatures(){
|
||||||
|
echo "# Checking stale mods"
|
||||||
[[ ! -f "$versions_file" ]] && return
|
[[ ! -f "$versions_file" ]] && return
|
||||||
local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
||||||
if [[ -d $workshop_dir ]]; then
|
if [[ -d $workshop_dir ]]; then
|
||||||
@@ -1036,18 +1085,48 @@ stale_mod_signatures(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
create_new_links(){
|
create_new_links(){
|
||||||
|
echo "# Setting up symlinks"
|
||||||
"$func_helper" "update_symlinks"
|
"$func_helper" "update_symlinks"
|
||||||
}
|
}
|
||||||
|
calc_local_coords(){
|
||||||
|
local ip="$1"
|
||||||
|
[[ ! -f "$geo_helper" ]] && return 1
|
||||||
|
|
||||||
|
IFS="." read -ra split <<< "$ip"
|
||||||
|
[[ ${#split[@]} -ne 4 ]] && return 1
|
||||||
|
|
||||||
|
prefix="^${split[0]}.${split[1]}."
|
||||||
|
readarray -t res < <(grep "$prefix" "$geo_helper")
|
||||||
|
|
||||||
|
for address in "${res[@]}"; do
|
||||||
|
IFS="," read -ra fields <<< "$address"
|
||||||
|
upper="${fields[1]}"
|
||||||
|
IFS="." read -ra upper_digits <<< "$upper"
|
||||||
|
if [[ ${split[2]} -gt ${upper_digits[2]} ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ ${split[2]} -eq ${upper_digits[2]} ]]; then
|
||||||
|
if [[ ${split[3]} -gt ${upper_digits[3]} ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ ${split[3]} -eq ${upper_digits[3]} ]]; then
|
||||||
|
echo "${fields[-2]}" >> "$coords_file"
|
||||||
|
echo "${fields[-1]}" >> "$coords_file"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ ${split[2]} -lt ${upper_digits[2]} ]]; then
|
||||||
|
echo "${fields[-2]}" >> "$coords_file"
|
||||||
|
echo "${fields[-1]}" >> "$coords_file"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
initial_setup(){
|
initial_setup(){
|
||||||
setup_dirs
|
|
||||||
setup_state_files
|
|
||||||
depcheck
|
|
||||||
check_pyver
|
|
||||||
test_gobject
|
|
||||||
watcher_deps
|
|
||||||
check_architecture
|
check_architecture
|
||||||
test_connection
|
test_connection
|
||||||
fetch_helpers > >(pdialog "Checking helper files")
|
fetch_helpers
|
||||||
varcheck
|
varcheck
|
||||||
source "$config_file"
|
source "$config_file"
|
||||||
lock
|
lock
|
||||||
@@ -1056,14 +1135,12 @@ initial_setup(){
|
|||||||
check_version
|
check_version
|
||||||
check_map_count
|
check_map_count
|
||||||
steam_deps
|
steam_deps
|
||||||
migrate_files
|
|
||||||
stale_symlinks
|
stale_symlinks
|
||||||
stale_mod_signatures
|
stale_mod_signatures
|
||||||
create_new_links
|
create_new_links
|
||||||
local_latlon
|
local_latlon
|
||||||
is_steam_running
|
is_steam_running
|
||||||
is_dzg_downloading
|
is_dzg_downloading
|
||||||
print_config_vals
|
|
||||||
}
|
}
|
||||||
uninstall(){
|
uninstall(){
|
||||||
_full(){
|
_full(){
|
||||||
@@ -1165,8 +1242,15 @@ main(){
|
|||||||
|
|
||||||
set_im_module
|
set_im_module
|
||||||
|
|
||||||
printf "Initializing setup...\n"
|
printf "Checking dependencies...\n"
|
||||||
initial_setup
|
setup_dirs
|
||||||
|
setup_state_files
|
||||||
|
depcheck
|
||||||
|
check_pyver
|
||||||
|
test_gobject
|
||||||
|
watcher_deps
|
||||||
|
|
||||||
|
initial_setup > >(pdialog "Initializing setup")
|
||||||
|
|
||||||
printf "All OK. Kicking off UI...\n"
|
printf "All OK. Kicking off UI...\n"
|
||||||
python3.13 "$ui_helper" "--init-ui" "$version" "$is_steam_deck"
|
python3.13 "$ui_helper" "--init-ui" "$version" "$is_steam_deck"
|
||||||
|
|||||||
+19
-9
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version="6.0.0-beta.12"
|
version="6.0.5"
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
@@ -51,6 +51,7 @@ _cache_binary="$cache_dir/$prefix.binary"
|
|||||||
_cache_coords="$cache_path/$prefix.coords"
|
_cache_coords="$cache_path/$prefix.coords"
|
||||||
_cache_cooldown="$cache_path/$prefix.cooldown"
|
_cache_cooldown="$cache_path/$prefix.cooldown"
|
||||||
_cache_lan="$cache_path/$prefix.lan"
|
_cache_lan="$cache_path/$prefix.lan"
|
||||||
|
_cache_src_path="$cache_path/$prefix.src"
|
||||||
|
|
||||||
#XDG
|
#XDG
|
||||||
freedesktop_path="$HOME/.local/share/applications"
|
freedesktop_path="$HOME/.local/share/applications"
|
||||||
@@ -285,7 +286,7 @@ a2s(){
|
|||||||
local mode="$3"
|
local mode="$3"
|
||||||
logger INFO "Querying '$ip:$qport' with mode '$mode'"
|
logger INFO "Querying '$ip:$qport' with mode '$mode'"
|
||||||
local res
|
local res
|
||||||
res=$(python3 "$query_helper" "$ip" "$qport" "$mode")
|
res=$(python3.13 "$query_helper" "$ip" "$qport" "$mode")
|
||||||
if [[ $? -eq 1 ]]; then
|
if [[ $? -eq 1 ]]; then
|
||||||
res=$(try_fallback "$ip" "$qport" "$mode")
|
res=$(try_fallback "$ip" "$qport" "$mode")
|
||||||
if [[ $? -eq 1 ]]; then
|
if [[ $? -eq 1 ]]; then
|
||||||
@@ -308,7 +309,7 @@ is_in_favs(){
|
|||||||
find_id(){
|
find_id(){
|
||||||
local file="$default_steam_path/config/loginusers.vdf"
|
local file="$default_steam_path/config/loginusers.vdf"
|
||||||
[[ ! -f $file ]] && return 1
|
[[ ! -f $file ]] && return 1
|
||||||
local res=$(python3 "$helpers_path/vdf2json.py" \
|
local res=$(python3.13 "$helpers_path/vdf2json.py" \
|
||||||
-i "$file" \
|
-i "$file" \
|
||||||
| jq -r '.users
|
| jq -r '.users
|
||||||
|to_entries[]
|
|to_entries[]
|
||||||
@@ -337,7 +338,7 @@ list_mods(){
|
|||||||
name=$(awk -F\" '/name/ {print $2}' "${dir}/meta.cpp")
|
name=$(awk -F\" '/name/ {print $2}' "${dir}/meta.cpp")
|
||||||
base_dir=$(basename $(readlink -f $game_dir/$symlink))
|
base_dir=$(basename $(readlink -f $game_dir/$symlink))
|
||||||
size=$(du -s "$(readlink -f "$game_dir/$symlink")" | awk '{print $1}')
|
size=$(du -s "$(readlink -f "$game_dir/$symlink")" | awk '{print $1}')
|
||||||
size=$(python3 -c "n=($size/1024) +.005; print(round(n,4))")
|
size=$(python3.13 -c "n=($size/1024) +.005; print(round(n,4))")
|
||||||
LC_NUMERIC=C printf "%s$sep%s$sep%s$sep%3.3f\n" "$name" "$symlink" "$base_dir" "$size"
|
LC_NUMERIC=C printf "%s$sep%s$sep%s$sep%3.3f\n" "$name" "$symlink" "$base_dir" "$size"
|
||||||
done | sort -k1)
|
done | sort -k1)
|
||||||
# user may have manually pruned mods out-of-band
|
# user may have manually pruned mods out-of-band
|
||||||
@@ -396,6 +397,7 @@ get_dist(){
|
|||||||
logger INFO "Distance: $dist km"
|
logger INFO "Distance: $dist km"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
query_config(){
|
query_config(){
|
||||||
[[ -n $2 ]] && local key=$2
|
[[ -n $2 ]] && local key=$2
|
||||||
keys=(
|
keys=(
|
||||||
@@ -421,6 +423,7 @@ query_config(){
|
|||||||
echo "${!i}"
|
echo "${!i}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
align_versions_file(){
|
align_versions_file(){
|
||||||
shift
|
shift
|
||||||
local mod="$1"
|
local mod="$1"
|
||||||
@@ -586,9 +589,6 @@ default_steam_path="$default_steam_path"
|
|||||||
|
|
||||||
#Preferred Steam launch command (for Flatpak support)
|
#Preferred Steam launch command (for Flatpak support)
|
||||||
preferred_client="$preferred_client"
|
preferred_client="$preferred_client"
|
||||||
|
|
||||||
#DZGUI source path
|
|
||||||
src_path="$src_path"
|
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
format_version_url(){
|
format_version_url(){
|
||||||
@@ -642,6 +642,7 @@ download_new_version(){
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
local version_url="$(format_version_url)"
|
local version_url="$(format_version_url)"
|
||||||
|
local src_path="$(< "$_cache_src_path")"
|
||||||
mv "$src_path" "$src_path.old"
|
mv "$src_path" "$src_path.old"
|
||||||
curl -Ls "$version_url" > "$src_path"
|
curl -Ls "$version_url" > "$src_path"
|
||||||
rc=$?
|
rc=$?
|
||||||
@@ -928,13 +929,19 @@ query_defunct(){
|
|||||||
<<< "$result" awk '{print $2}'
|
<<< "$result" awk '{print $2}'
|
||||||
}
|
}
|
||||||
encode(){
|
encode(){
|
||||||
echo "$1" | md5sum | cut -c -8
|
echo -n "$1" | md5sum | cut -c -8
|
||||||
}
|
}
|
||||||
compare(){
|
compare(){
|
||||||
local modlist="$@"
|
local modlist="$@"
|
||||||
diff=$(comm -23 <(<<< "$modlist" sort -u) <(installed_mods | sort))
|
diff=$(comm -23 <(<<< "$modlist" sort -u) <(installed_mods | sort))
|
||||||
echo "$diff"
|
echo "$diff"
|
||||||
}
|
}
|
||||||
|
unlink_all(){
|
||||||
|
readarray -t links < <(find "$game_dir" -maxdepth 1 -mindepth 1 -type l)
|
||||||
|
for link in "${links[@]}"; do
|
||||||
|
unlink "$link"
|
||||||
|
done
|
||||||
|
}
|
||||||
legacy_symlinks(){
|
legacy_symlinks(){
|
||||||
logger INFO "Removing legacy symlinks"
|
logger INFO "Removing legacy symlinks"
|
||||||
|
|
||||||
@@ -1025,7 +1032,10 @@ update_symlinks(){
|
|||||||
if [[ ! -d "$workshop_dir" ]]; then
|
if [[ ! -d "$workshop_dir" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
legacy_symlinks
|
if [[ ! -d "$game_dir" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
unlink_all
|
||||||
symlinks
|
symlinks
|
||||||
}
|
}
|
||||||
try_fallback(){
|
try_fallback(){
|
||||||
|
|||||||
+1
-1
@@ -295,7 +295,7 @@ def get_dayz_version(file: Path) -> DayZVersion | Exception:
|
|||||||
try:
|
try:
|
||||||
version = get_version(file)
|
version = get_version(file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return e
|
raise e
|
||||||
patch = str(version.build) + str(version.revision)
|
patch = str(version.build) + str(version.revision)
|
||||||
dz_vers = DayZVersion(version.major, version.minor, int(patch))
|
dz_vers = DayZVersion(version.major, version.minor, int(patch))
|
||||||
return dz_vers
|
return dz_vers
|
||||||
|
|||||||
+156
-266
@@ -19,7 +19,7 @@ from collections.abc import Callable
|
|||||||
from concurrent.futures import wait
|
from concurrent.futures import wait
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Literal, Self, Any
|
from typing import Literal, Self, Any, TYPE_CHECKING
|
||||||
|
|
||||||
import servers as Servers # noqa E402
|
import servers as Servers # noqa E402
|
||||||
import pefile as PeFile # noqa E402
|
import pefile as PeFile # noqa E402
|
||||||
@@ -32,12 +32,16 @@ from pefile import (
|
|||||||
)
|
)
|
||||||
from pefile import VersionMatch
|
from pefile import VersionMatch
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from servers import Prereqs
|
||||||
|
|
||||||
locale.setlocale(locale.LC_ALL, "")
|
locale.setlocale(locale.LC_ALL, "")
|
||||||
|
|
||||||
import gi # noqa E402
|
import gi # noqa E402
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango # noqa E402
|
gi.require_version("GLibUnix", "2.0")
|
||||||
|
from gi.repository import Gtk, GLib, GLibUnix, Gdk, GObject, Pango # noqa E402
|
||||||
|
|
||||||
# https://bugzilla.gnome.org/show_bug.cgi?id=708676
|
# https://bugzilla.gnome.org/show_bug.cgi?id=708676
|
||||||
warnings.filterwarnings("ignore", ".*g_value_get_int", Warning)
|
warnings.filterwarnings("ignore", ".*g_value_get_int", Warning)
|
||||||
@@ -850,9 +854,7 @@ def call_out(command: str, *args: str) -> subprocess.CompletedProcess:
|
|||||||
arg_ar = []
|
arg_ar = []
|
||||||
for i in args:
|
for i in args:
|
||||||
arg_ar.append(i)
|
arg_ar.append(i)
|
||||||
logger.info(
|
logger.info(f"Context '{name}' calling subprocess '{command}' with args '{arg_ar}'")
|
||||||
f"Context '{name}' calling subprocess '{command}' with args '{arg_ar}'"
|
|
||||||
)
|
|
||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
["/usr/bin/env", "bash", funcs, command] + arg_ar,
|
["/usr/bin/env", "bash", funcs, command] + arg_ar,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
@@ -866,20 +868,19 @@ def spawn_dialog(msg: str, mode: Popup) -> bool:
|
|||||||
dialog = GenericDialog(msg, mode)
|
dialog = GenericDialog(msg, mode)
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
|
clean_msg = msg.replace("\n", " ")
|
||||||
|
|
||||||
match response:
|
match response:
|
||||||
case Gtk.ResponseType.OK:
|
case Gtk.ResponseType.OK:
|
||||||
logger.info(f"User confirmed dialog with message '{msg}'")
|
logger.info(f"User confirmed dialog with message '{clean_msg}'")
|
||||||
return False
|
return False
|
||||||
case Gtk.ResponseType.CANCEL | Gtk.ResponseType.DELETE_EVENT:
|
case Gtk.ResponseType.CANCEL | Gtk.ResponseType.DELETE_EVENT:
|
||||||
logger.info(f"User aborted dialog with message '{msg}'")
|
logger.info(f"User aborted dialog with message '{clean_msg}'")
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def process_shell_return_code(
|
def process_shell_return_code(msg: str, code: int, original_input: RowType) -> None:
|
||||||
msg: str, code: int, original_input: RowType
|
|
||||||
) -> None:
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Processing return code '{code}' for the input "
|
f"Processing return code '{code}' for the input "
|
||||||
f"'{original_input}', returned message '{msg}'"
|
f"'{original_input}', returned message '{msg}'"
|
||||||
@@ -906,9 +907,7 @@ def process_shell_return_code(
|
|||||||
spawn_dialog("Invalid Steam API key, reverting", Popup.NOTIFY)
|
spawn_dialog("Invalid Steam API key, reverting", Popup.NOTIFY)
|
||||||
App.notebook.settings.revert(Preferences.STEAM)
|
App.notebook.settings.revert(Preferences.STEAM)
|
||||||
case 79: # failed settings update (bm)
|
case 79: # failed settings update (bm)
|
||||||
spawn_dialog(
|
spawn_dialog("Invalid Battlemetrics API key, reverting", Popup.NOTIFY)
|
||||||
"Invalid Battlemetrics API key, reverting", Popup.NOTIFY
|
|
||||||
)
|
|
||||||
App.notebook.settings.revert(Preferences.BM)
|
App.notebook.settings.revert(Preferences.BM)
|
||||||
case 80: # pop toast after successful settings change
|
case 80: # pop toast after successful settings change
|
||||||
config_vals.clear()
|
config_vals.clear()
|
||||||
@@ -974,9 +973,7 @@ def call_on_thread(
|
|||||||
if state:
|
if state:
|
||||||
wait_dialog = GenericDialog(msg, Popup.WAIT)
|
wait_dialog = GenericDialog(msg, Popup.WAIT)
|
||||||
wait_dialog.show_all()
|
wait_dialog.show_all()
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=_background, args=(subproc, args, wait_dialog))
|
||||||
target=_background, args=(subproc, args, wait_dialog)
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
else:
|
else:
|
||||||
"""
|
"""
|
||||||
@@ -1001,18 +998,14 @@ def process_tree_option(choice: RowType) -> None:
|
|||||||
record = App.treeview.get_record_string()
|
record = App.treeview.get_record_string()
|
||||||
wait_msg = command.dict["wait_msg"]
|
wait_msg = command.dict["wait_msg"]
|
||||||
show_wait_dialog = True
|
show_wait_dialog = True
|
||||||
call_on_thread(
|
call_on_thread(show_wait_dialog, cmd_string, wait_msg, record, choice=choice)
|
||||||
show_wait_dialog, cmd_string, wait_msg, record, choice=choice
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# modlist highlight stale action
|
# modlist highlight stale action
|
||||||
if context == WindowContext.TABLE_MODS and command == RowType.HIGHLIGHT:
|
if context == WindowContext.TABLE_MODS and command == RowType.HIGHLIGHT:
|
||||||
wait_msg = command.dict["wait_msg"]
|
wait_msg = command.dict["wait_msg"]
|
||||||
show_wait_dialog = True
|
show_wait_dialog = True
|
||||||
call_on_thread(
|
call_on_thread(show_wait_dialog, cmd_string, wait_msg, "", choice=choice)
|
||||||
show_wait_dialog, cmd_string, wait_msg, "", choice=choice
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if command == RowType.CHANGELOG:
|
if command == RowType.CHANGELOG:
|
||||||
@@ -1026,13 +1019,7 @@ def process_tree_option(choice: RowType) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
record = str_to_record(record)
|
record = str_to_record(record)
|
||||||
thread_new_with_dialog(
|
prepare_connection(command, record)
|
||||||
App.treeview.prepare_connection,
|
|
||||||
parse_shell_output,
|
|
||||||
"Querying server",
|
|
||||||
command,
|
|
||||||
[record],
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
match command.dict["type"]:
|
match command.dict["type"]:
|
||||||
@@ -1060,48 +1047,50 @@ def parse_shell_output(proc: subprocess.CompletedProcess, row: RowType):
|
|||||||
process_shell_return_code(msg, proc.returncode, row)
|
process_shell_return_code(msg, proc.returncode, row)
|
||||||
|
|
||||||
|
|
||||||
def thread_new_with_dialog(
|
def prepare_connection(rowtype: RowType, record: Record) -> None:
|
||||||
func: Callable,
|
def background(rowtype: RowType, record: Record) -> None:
|
||||||
callback: Callable | None,
|
def cleanup() -> None:
|
||||||
msg: str,
|
App.treeview.wait_dialog.destroy()
|
||||||
row: RowType | None,
|
# NOTE: When using RowType.CONN_BY_IP, the gameport needs to be interpolated
|
||||||
args: list,
|
record.gameport = prereqs.gameport
|
||||||
) -> None:
|
addr = record_to_str(record)
|
||||||
"""
|
|
||||||
Pop a GenericDialog transient to App.treeview and
|
|
||||||
call a function on a thread, with optional callback.
|
|
||||||
Chiefly used for connection-related subprocesses.
|
|
||||||
|
|
||||||
After completion, the dialog is destroyed in the main event loop
|
if proceed is False:
|
||||||
and additional exception handling occurs.
|
spawn_dialog(msg, Popup.NOTIFY)
|
||||||
|
return
|
||||||
|
if msg != "":
|
||||||
|
res = spawn_dialog(msg, Popup.CONFIRM)
|
||||||
|
if res is False:
|
||||||
|
try_connect(addr, str(prereqs.appid), str(pefile_path), rowtype)
|
||||||
|
else:
|
||||||
|
try_connect(addr, str(prereqs.appid), str(pefile_path), rowtype)
|
||||||
|
|
||||||
This is intended as a bridge between legacy shell methods and the UI.
|
proceed, msg, pefile_path, prereqs = App.treeview.get_prereqs(record)
|
||||||
A more abstracted version of call_on_thread() for when extra threaded
|
GLib.idle_add(cleanup)
|
||||||
processing occurs before calls to shell subprocesses.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def background(*args):
|
msg = "Checking prerequisites"
|
||||||
|
App.treeview.dialog_show(msg)
|
||||||
|
thread = threading.Thread(target=background, args=(rowtype, record))
|
||||||
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
|
def try_connect(addr: str, appid: str, path: str, row: RowType) -> None:
|
||||||
|
def background(addr, appid, path):
|
||||||
def cleanup():
|
def cleanup():
|
||||||
App.treeview.dialog_hide()
|
App.treeview.dialog_hide()
|
||||||
if exception is not None:
|
parse_shell_output(proc, row)
|
||||||
spawn_dialog(str(exception), Popup.NOTIFY)
|
|
||||||
process_user_input(row)
|
|
||||||
return
|
|
||||||
if callback is not None and proc is not None:
|
|
||||||
callback(proc, row)
|
|
||||||
|
|
||||||
exception = None
|
|
||||||
proc = None
|
|
||||||
try:
|
try:
|
||||||
proc = func(*args)
|
proc = call_out("try_connect", addr, appid, path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception = e
|
logger.critical(e)
|
||||||
GLib.idle_add(cleanup)
|
GLib.idle_add(cleanup)
|
||||||
return
|
return
|
||||||
GLib.idle_add(cleanup)
|
GLib.idle_add(cleanup)
|
||||||
|
|
||||||
|
msg = "Querying server"
|
||||||
App.treeview.dialog_show(msg)
|
App.treeview.dialog_show(msg)
|
||||||
thread = threading.Thread(target=background, args=(args))
|
thread = threading.Thread(target=background, args=(addr, appid, path))
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
@@ -1141,27 +1130,32 @@ def record_to_str(record: Record) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def connect_by_ip(enum: RowType, response: str) -> None:
|
def connect_by_ip(enum: RowType, response: str) -> None:
|
||||||
def _prep(response: str) -> None:
|
try:
|
||||||
record = Servers.validate_ip(response)
|
record = Servers.validate_ip(response)
|
||||||
proc = App.treeview.prepare_connection(record)
|
except Exception as e:
|
||||||
return proc
|
spawn_dialog(str(e), Popup.NOTIFY)
|
||||||
|
return
|
||||||
thread_new_with_dialog(
|
prepare_connection(enum, record)
|
||||||
_prep, parse_shell_output, "Querying IP", enum, [response]
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def connect_by_id(enum: RowType, response: str, key: str) -> None:
|
def connect_by_id(enum: RowType, response: str, key: str) -> None:
|
||||||
def _prep(key: str, response: str) -> None:
|
def _prep(key: str, response: str) -> None:
|
||||||
record = Servers.query_bm_api(key, response)
|
def cleanup() -> None:
|
||||||
proc = App.treeview.prepare_connection(record)
|
App.treeview.dialog_hide()
|
||||||
return proc
|
prepare_connection(enum, record)
|
||||||
|
|
||||||
thread_new_with_dialog(
|
try:
|
||||||
_prep, parse_shell_output, "Querying API", enum, [key, response]
|
record = Servers.query_bm_api(key, response)
|
||||||
)
|
except Exception as e:
|
||||||
return
|
spawn_dialog(str(e), Popup.NOTIFY)
|
||||||
|
App.treeview.dialog_hide()
|
||||||
|
return
|
||||||
|
GLib.idle_add(cleanup)
|
||||||
|
|
||||||
|
msg = "Validating ID"
|
||||||
|
App.treeview.dialog_show(msg)
|
||||||
|
thread = threading.Thread(target=_prep, args=(key, response))
|
||||||
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
def process_user_input(enum: RowType) -> None:
|
def process_user_input(enum: RowType) -> None:
|
||||||
@@ -1172,9 +1166,7 @@ def process_user_input(enum: RowType) -> None:
|
|||||||
if enum == RowType.CONN_BY_ID:
|
if enum == RowType.CONN_BY_ID:
|
||||||
key = query_config("api_key")[0]
|
key = query_config("api_key")[0]
|
||||||
if len(key) == 0:
|
if len(key) == 0:
|
||||||
spawn_dialog(
|
spawn_dialog("No Battlemetrics API key is set; see Options", Popup.NOTIFY)
|
||||||
"No Battlemetrics API key is set; see Options", Popup.NOTIFY
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
user_entry = EntryDialog(prompt, Popup.ENTRY, link_label)
|
user_entry = EntryDialog(prompt, Popup.ENTRY, link_label)
|
||||||
@@ -1195,9 +1187,7 @@ def process_user_input(enum: RowType) -> None:
|
|||||||
|
|
||||||
show_wait_dialog = True
|
show_wait_dialog = True
|
||||||
wait_msg = "Working"
|
wait_msg = "Working"
|
||||||
call_on_thread(
|
call_on_thread(show_wait_dialog, cmd_string, wait_msg, response, choice=enum)
|
||||||
show_wait_dialog, cmd_string, wait_msg, response, choice=enum
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -1285,9 +1275,7 @@ class OuterWindow(Gtk.Window):
|
|||||||
logger.info(f"Using default window size {w},{h}")
|
logger.info(f"Using default window size {w},{h}")
|
||||||
self.set_default_size(w, h)
|
self.set_default_size(w, h)
|
||||||
|
|
||||||
def _on_delete_event(
|
def _on_delete_event(self, window: "OuterWindow", event: Gdk.EventKey) -> None:
|
||||||
self, window: "OuterWindow", event: Gdk.EventKey
|
|
||||||
) -> None:
|
|
||||||
self.halt_proc_and_quit()
|
self.halt_proc_and_quit()
|
||||||
|
|
||||||
def halt_proc_and_quit(self) -> None:
|
def halt_proc_and_quit(self) -> None:
|
||||||
@@ -1354,8 +1342,7 @@ class RightPanel(Gtk.Box):
|
|||||||
self.pack_start(self.filters_vbox, False, False, 0)
|
self.pack_start(self.filters_vbox, False, False, 0)
|
||||||
|
|
||||||
debug_tooltip = (
|
debug_tooltip = (
|
||||||
"Used to perform a dry run without\n"
|
"Used to perform a dry run without\n" "actually connecting to a server"
|
||||||
"actually connecting to a server"
|
|
||||||
)
|
)
|
||||||
ping_tooltip = (
|
ping_tooltip = (
|
||||||
"Refresh the ping for visible servers.\n"
|
"Refresh the ping for visible servers.\n"
|
||||||
@@ -1424,8 +1411,7 @@ class RightPanel(Gtk.Box):
|
|||||||
rows = ModelManager.get_filtered()
|
rows = ModelManager.get_filtered()
|
||||||
with ThreadPoolExecutor(100) as executor:
|
with ThreadPoolExecutor(100) as executor:
|
||||||
futures = [
|
futures = [
|
||||||
executor.submit(Servers.ping, i, row)
|
executor.submit(Servers.ping, i, row) for i, row in enumerate(rows)
|
||||||
for i, row in enumerate(rows)
|
|
||||||
]
|
]
|
||||||
wait(futures)
|
wait(futures)
|
||||||
for future in futures:
|
for future in futures:
|
||||||
@@ -1486,6 +1472,8 @@ class ButtonBox(Gtk.Box):
|
|||||||
context = button.type
|
context = button.type
|
||||||
logger.info(f"User clicked '{context}'")
|
logger.info(f"User clicked '{context}'")
|
||||||
|
|
||||||
|
App.grid.right_panel.filters_vbox.set_visible(False)
|
||||||
|
|
||||||
if context == ButtonType.EXIT:
|
if context == ButtonType.EXIT:
|
||||||
logger.info("Normal user exit")
|
logger.info("Normal user exit")
|
||||||
save_res_and_quit()
|
save_res_and_quit()
|
||||||
@@ -1799,9 +1787,7 @@ class ModelManagerSingleton:
|
|||||||
|
|
||||||
|
|
||||||
class TreeView(Gtk.TreeView):
|
class TreeView(Gtk.TreeView):
|
||||||
__gsignals__ = {
|
__gsignals__ = {"on_distcalc_started": (GObject.SignalFlags.RUN_FIRST, None, ())}
|
||||||
"on_distcalc_started": (GObject.SignalFlags.RUN_FIRST, None, ())
|
|
||||||
}
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -1920,9 +1906,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
if self.current_proc and self.current_proc.is_alive():
|
if self.current_proc and self.current_proc.is_alive():
|
||||||
self.current_proc.terminate()
|
self.current_proc.terminate()
|
||||||
|
|
||||||
def _delete_note(
|
def _delete_note(self, button: Gtk.Button, user_entry: Gtk.Box, addr: str) -> None:
|
||||||
self, button: Gtk.Button, user_entry: Gtk.Box, addr: str
|
|
||||||
) -> None:
|
|
||||||
box = button.get_parent()
|
box = button.get_parent()
|
||||||
dialog = box.get_parent()
|
dialog = box.get_parent()
|
||||||
try:
|
try:
|
||||||
@@ -2014,9 +1998,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
model.remove(it)
|
model.remove(it)
|
||||||
|
|
||||||
block_signals()
|
block_signals()
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=ModelManager.resync_model, args=(addr, qport))
|
||||||
target=ModelManager.resync_model, args=(addr, qport)
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def remove_from_history(self) -> None:
|
def remove_from_history(self) -> None:
|
||||||
@@ -2040,16 +2022,12 @@ class TreeView(Gtk.TreeView):
|
|||||||
if hasattr(TreeView, menu_item.action):
|
if hasattr(TreeView, menu_item.action):
|
||||||
func = getattr(TreeView, menu_item.action)
|
func = getattr(TreeView, menu_item.action)
|
||||||
msg = (
|
msg = (
|
||||||
f"User clicked context menu '{menu_item.get_label()}', "
|
f"User clicked context menu '{menu_item.get_label()}', " f"calls {func}"
|
||||||
f"calls {func}"
|
|
||||||
)
|
)
|
||||||
logger.info(msg)
|
logger.info(msg)
|
||||||
func(self)
|
func(self)
|
||||||
else:
|
else:
|
||||||
msg = (
|
msg = f"Context menu function for '{menu_item.action}' " f"does not exist"
|
||||||
f"Context menu function for '{menu_item.action}' "
|
|
||||||
f"does not exist"
|
|
||||||
)
|
|
||||||
u_msg = (
|
u_msg = (
|
||||||
f"Something went wrong when accessing the method "
|
f"Something went wrong when accessing the method "
|
||||||
f"'{menu_item.action}'"
|
f"'{menu_item.action}'"
|
||||||
@@ -2090,9 +2068,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _on_button_release(
|
def _on_button_release(self, widget: Gtk.Widget, event: Gdk.EventButton) -> None:
|
||||||
self, widget: Gtk.Widget, event: Gdk.EventButton
|
|
||||||
) -> None:
|
|
||||||
if event.type is Gdk.EventType.BUTTON_RELEASE and event.button != 3:
|
if event.type is Gdk.EventType.BUTTON_RELEASE and event.button != 3:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -2176,9 +2152,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
if event.type is Gdk.EventType.KEY_PRESS and event.keyval is Gdk.KEY_l:
|
if event.type is Gdk.EventType.KEY_PRESS and event.keyval is Gdk.KEY_l:
|
||||||
if self.is_selection_empty():
|
if self.is_selection_empty():
|
||||||
return
|
return
|
||||||
self.menu.popup_at_widget(
|
self.menu.popup_at_widget(widget, Gdk.Gravity.CENTER, Gdk.Gravity.WEST)
|
||||||
widget, Gdk.Gravity.CENTER, Gdk.Gravity.WEST
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
self.menu.popup_at_pointer(event)
|
self.menu.popup_at_pointer(event)
|
||||||
self.menu.select_first(False)
|
self.menu.select_first(False)
|
||||||
@@ -2192,9 +2166,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
return None
|
return None
|
||||||
call_out("start_cooldown", "", "")
|
call_out("start_cooldown", "", "")
|
||||||
|
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=self._background_player_count, args=())
|
||||||
target=self._background_player_count, args=()
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def get_current_iter(self) -> Gtk.TreeIter | None:
|
def get_current_iter(self) -> Gtk.TreeIter | None:
|
||||||
@@ -2209,9 +2181,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
|
|
||||||
context = App.treeview.get_subpage_label()
|
context = App.treeview.get_subpage_label()
|
||||||
row_sel = self.get_value_at_index(0)
|
row_sel = self.get_value_at_index(0)
|
||||||
logger.info(
|
logger.info(f"Tree selection for context '{context}' changed to '{row_sel}'")
|
||||||
f"Tree selection for context '{context}' changed to '{row_sel}'"
|
|
||||||
)
|
|
||||||
|
|
||||||
if self.current_proc and self.current_proc.is_alive():
|
if self.current_proc and self.current_proc.is_alive():
|
||||||
self.current_proc.terminate()
|
self.current_proc.terminate()
|
||||||
@@ -2269,9 +2239,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
self.set_cursor(path)
|
self.set_cursor(path)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _on_keypress(
|
def _on_keypress(self, treeview: Gtk.TreeView, event: Gdk.EventKey) -> bool | None:
|
||||||
self, treeview: Gtk.TreeView, event: Gdk.EventKey
|
|
||||||
) -> bool | None:
|
|
||||||
keyname = Gdk.keyval_name(event.keyval)
|
keyname = Gdk.keyval_name(event.keyval)
|
||||||
grid = App.grid
|
grid = App.grid
|
||||||
if event.state is Gdk.ModifierType.CONTROL_MASK:
|
if event.state is Gdk.ModifierType.CONTROL_MASK:
|
||||||
@@ -2326,9 +2294,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
return False
|
return False
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _on_key_release(
|
def _on_key_release(self, treeview: Gtk.TreeView, event: Gdk.EventKey) -> None:
|
||||||
self, treeview: Gtk.TreeView, event: Gdk.EventKey
|
|
||||||
) -> None:
|
|
||||||
"""
|
"""
|
||||||
Suppresses spamming on keydown
|
Suppresses spamming on keydown
|
||||||
"""
|
"""
|
||||||
@@ -2443,10 +2409,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
params = Servers.params
|
params = Servers.params
|
||||||
serv = []
|
serv = []
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
futures = [
|
futures = [executor.submit(job, key, APPID_DAYZ, param) for param in params]
|
||||||
executor.submit(job, key, APPID_DAYZ, param)
|
|
||||||
for param in params
|
|
||||||
]
|
|
||||||
wait(futures)
|
wait(futures)
|
||||||
for future in futures:
|
for future in futures:
|
||||||
res = future.result()
|
res = future.result()
|
||||||
@@ -2468,10 +2431,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
|
|
||||||
def _dump_lan(self, port: int) -> list | None:
|
def _dump_lan(self, port: int) -> list | None:
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
futures = [
|
futures = [executor.submit(Servers.test_ip, i, port) for i in range(1, 256)]
|
||||||
executor.submit(Servers.test_ip, i, port)
|
|
||||||
for i in range(1, 256)
|
|
||||||
]
|
|
||||||
wait(futures)
|
wait(futures)
|
||||||
servers = []
|
servers = []
|
||||||
for future in futures:
|
for future in futures:
|
||||||
@@ -2490,6 +2450,8 @@ class TreeView(Gtk.TreeView):
|
|||||||
def _dump_servers(self, ips: list) -> list | None:
|
def _dump_servers(self, ips: list) -> list | None:
|
||||||
if len(ips) == 0:
|
if len(ips) == 0:
|
||||||
return []
|
return []
|
||||||
|
# NOTE: block malformed records
|
||||||
|
ips = [ip for ip in ips if len(ip.split(":")) == 3 and ip.split(":")[2] != ""]
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
futures = [
|
futures = [
|
||||||
executor.submit(
|
executor.submit(
|
||||||
@@ -2594,9 +2556,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
ModelManager.set_store(App.treeview.get_model())
|
ModelManager.set_store(App.treeview.get_model())
|
||||||
App.treeview.set_model(None)
|
App.treeview.set_model(None)
|
||||||
|
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=ModelManager.filter, args=(mode, *args))
|
||||||
target=ModelManager.filter, args=(mode, *args)
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def _background_quad(self, dialog: "GenericDialog", mode: RowType) -> None:
|
def _background_quad(self, dialog: "GenericDialog", mode: RowType) -> None:
|
||||||
@@ -2755,13 +2715,9 @@ class TreeView(Gtk.TreeView):
|
|||||||
self.initialize_columns()
|
self.initialize_columns()
|
||||||
self.set_selection_mode(Gtk.SelectionMode.SINGLE)
|
self.set_selection_mode(Gtk.SelectionMode.SINGLE)
|
||||||
|
|
||||||
self.wait_dialog = GenericDialog(
|
self.wait_dialog = GenericDialog("Fetching server metadata", Popup.WAIT)
|
||||||
"Fetching server metadata", Popup.WAIT
|
|
||||||
)
|
|
||||||
self.wait_dialog.show_all()
|
self.wait_dialog.show_all()
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=self._query_servers, args=(mode, port))
|
||||||
target=self._query_servers, args=(mode, port)
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def _format_float(
|
def _format_float(
|
||||||
@@ -2940,9 +2896,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
def get_view(self):
|
def get_view(self):
|
||||||
return self.view
|
return self.view
|
||||||
|
|
||||||
def prepare_connection(
|
def get_prereqs(self, record: Record) -> tuple[bool, str, str | None, "Prereqs"]:
|
||||||
self, record: Record
|
|
||||||
) -> subprocess.CompletedProcess | None:
|
|
||||||
"""
|
"""
|
||||||
Always called on a thread with a dialog on the transient parent window
|
Always called on a thread with a dialog on the transient parent window
|
||||||
"""
|
"""
|
||||||
@@ -2950,50 +2904,39 @@ class TreeView(Gtk.TreeView):
|
|||||||
if prereqs.appid is None:
|
if prereqs.appid is None:
|
||||||
logger.warning(f"Query to '{record.ip}:{record.qport}' timed out")
|
logger.warning(f"Query to '{record.ip}:{record.qport}' timed out")
|
||||||
msg = "Timed out when querying server, check IP or try again later"
|
msg = "Timed out when querying server, check IP or try again later"
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
return (False, msg, None, prereqs)
|
||||||
return None
|
|
||||||
|
|
||||||
build = "DayZ" if prereqs.appid == APPID_DAYZ else "DayZ Experimental"
|
build = "DayZ" if prereqs.appid == APPID_DAYZ else "DayZ Experimental"
|
||||||
steam_path = query_config("default_steam_path")[0]
|
steam_path = query_config("default_steam_path")[0]
|
||||||
|
|
||||||
if len(steam_path) < 1:
|
if len(steam_path) < 1:
|
||||||
logger.critical(
|
logger.critical("Config file has no value set for 'default_steam_path'")
|
||||||
"Config file has no value set for 'default_steam_path'"
|
|
||||||
)
|
|
||||||
msg = "Local Steam installation is not set, possibly malformed config file."
|
msg = "Local Steam installation is not set, possibly malformed config file."
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
return (False, msg, None, prereqs)
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pefile_path = PeFile.get_pefile_path(steam_path, prereqs.appid)
|
pefile_path = PeFile.get_pefile_path(steam_path, prereqs.appid)
|
||||||
except AppNotInstalledError:
|
except AppNotInstalledError:
|
||||||
logger.critical(
|
logger.critical(f"'{prereqs.appid}' not found in user's libraryfolders")
|
||||||
f"'{prereqs.appid}' not found in user's libraryfolders"
|
|
||||||
)
|
|
||||||
msg = (
|
msg = (
|
||||||
f"This server is running {build}. You can install "
|
f"This server is running {build}. You can install "
|
||||||
f"{build} by searching for it in your Steam library. "
|
f"{build} by searching for it in your Steam library. "
|
||||||
f"If you recently installed {build} or moved it to a different drive, "
|
f"If you recently installed {build} or moved it to a different drive, "
|
||||||
"restart Steam to allow these changes to synchronize, then try again."
|
"restart Steam to allow these changes to synchronize, then try again."
|
||||||
)
|
)
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
return (False, msg, None, prereqs)
|
||||||
return None
|
|
||||||
except AppMovedError:
|
except AppMovedError:
|
||||||
logger.critical(
|
logger.critical(f"Library folder synch error for '{prereqs.appid}'")
|
||||||
f"Library folder synch error for '{prereqs.appid}'"
|
|
||||||
)
|
|
||||||
msg = (
|
msg = (
|
||||||
f"Steam is reporting that {build} is installed at a non-existent location. "
|
f"Steam is reporting that {build} is installed at a non-existent location. "
|
||||||
f"If you recently installed {build} or moved it to a different drive, "
|
f"If you recently installed {build} or moved it to a different drive, "
|
||||||
"restart Steam to allow these changes to synchronize, then try again."
|
"restart Steam to allow these changes to synchronize, then try again."
|
||||||
)
|
)
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
return (False, msg, None, prereqs)
|
||||||
return None
|
|
||||||
except (VDFLoadError, PeFileError, Exception) as e:
|
except (VDFLoadError, PeFileError, Exception) as e:
|
||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
msg = "Steam settings or DayZ installation may be corrupted. Try restarting Steam."
|
msg = "Steam settings or DayZ installation may be corrupted. Try restarting Steam."
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
return (False, msg, None, prereqs)
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
local_vers = PeFile.get_dayz_version(pefile_path)
|
local_vers = PeFile.get_dayz_version(pefile_path)
|
||||||
@@ -3005,7 +2948,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
local_vers = None
|
local_vers = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
remote_vers = PeFile.dayz_version_from_str(prereqs.version)
|
remote_vers = PeFile.dayz_version_from_str(prereqs)
|
||||||
except Exception:
|
except Exception:
|
||||||
remote_vers = None
|
remote_vers = None
|
||||||
|
|
||||||
@@ -3018,18 +2961,15 @@ class TreeView(Gtk.TreeView):
|
|||||||
f"This server is running a newer build ({prereqs.version}) of {build} than "
|
f"This server is running a newer build ({prereqs.version}) of {build} than "
|
||||||
f"your local version. You may be unable to connect. Proceed anyway?"
|
f"your local version. You may be unable to connect. Proceed anyway?"
|
||||||
)
|
)
|
||||||
res = spawn_dialog(msg, Popup.CONFIRM)
|
return (True, msg, pefile_path, prereqs)
|
||||||
if res is True:
|
|
||||||
return None
|
|
||||||
case VersionMatch.LOCAL_NEWER:
|
case VersionMatch.LOCAL_NEWER:
|
||||||
msg = (
|
msg = (
|
||||||
f"This server is running an out-of-date build ({prereqs.version}) of {build}. "
|
f"This server is running an out-of-date build ({prereqs.version}) of {build}. "
|
||||||
"You may be unable to connect. Proceed anyway?"
|
"You may be unable to connect. Proceed anyway?"
|
||||||
)
|
)
|
||||||
res = spawn_dialog(msg, Popup.CONFIRM)
|
return (True, msg, pefile_path, prereqs)
|
||||||
if res is True:
|
|
||||||
return None
|
|
||||||
case VersionMatch.SAME_VERSION:
|
case VersionMatch.SAME_VERSION:
|
||||||
|
return (True, "", pefile_path, prereqs)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if prereqs.password is True:
|
if prereqs.password is True:
|
||||||
@@ -3037,19 +2977,9 @@ class TreeView(Gtk.TreeView):
|
|||||||
"This server is password-protected and you will be "
|
"This server is password-protected and you will be "
|
||||||
"prompted when connecting. Do you want to proceed?"
|
"prompted when connecting. Do you want to proceed?"
|
||||||
)
|
)
|
||||||
res = spawn_dialog(msg, Popup.CONFIRM)
|
return (True, msg, pefile_path, prereqs)
|
||||||
if res is True:
|
|
||||||
return None
|
|
||||||
|
|
||||||
"""
|
return (True, "", pefile_path, prereqs)
|
||||||
When using RowType.CONN_BY_IP, the gameport needs to be interpolated
|
|
||||||
"""
|
|
||||||
record.gameport = prereqs.gameport
|
|
||||||
addr = record_to_str(record)
|
|
||||||
proc = call_out(
|
|
||||||
"try_connect", addr, str(prereqs.appid), str(pefile_path)
|
|
||||||
)
|
|
||||||
return proc
|
|
||||||
|
|
||||||
@signal_emission
|
@signal_emission
|
||||||
@update_window_labels
|
@update_window_labels
|
||||||
@@ -3119,13 +3049,7 @@ class TreeView(Gtk.TreeView):
|
|||||||
record = self.get_record()
|
record = self.get_record()
|
||||||
if record is None:
|
if record is None:
|
||||||
return
|
return
|
||||||
thread_new_with_dialog(
|
prepare_connection(None, record)
|
||||||
self.prepare_connection,
|
|
||||||
parse_shell_output,
|
|
||||||
"Querying server",
|
|
||||||
None,
|
|
||||||
[record],
|
|
||||||
)
|
|
||||||
case _: # any other non-server option from the main menu
|
case _: # any other non-server option from the main menu
|
||||||
process_tree_option(output)
|
process_tree_option(output)
|
||||||
|
|
||||||
@@ -3210,7 +3134,7 @@ class GenericDialog(Gtk.MessageDialog):
|
|||||||
self.outer.set_margin_end(30)
|
self.outer.set_margin_end(30)
|
||||||
|
|
||||||
def _on_dialog_delete(
|
def _on_dialog_delete(
|
||||||
self, response_id: Gtk.ResponseType, event: Gdk.Event
|
self, response_id: Gtk.ResponseType, event: Gdk.Event
|
||||||
) -> Literal[True]:
|
) -> Literal[True]:
|
||||||
"""
|
"""
|
||||||
Prevent manual dialog destruction
|
Prevent manual dialog destruction
|
||||||
@@ -3289,9 +3213,7 @@ class LanDialog(Gtk.MessageDialog):
|
|||||||
self.connect("delete-event", self.restore_context)
|
self.connect("delete-event", self.restore_context)
|
||||||
|
|
||||||
self.entry.connect("insert-text", self._on_text_typed)
|
self.entry.connect("insert-text", self._on_text_typed)
|
||||||
self.entry.get_property("buffer").connect(
|
self.entry.get_property("buffer").connect("deleted-text", self._on_text_deleted)
|
||||||
"deleted-text", self._on_text_deleted
|
|
||||||
)
|
|
||||||
|
|
||||||
def _validate(self, text: str) -> None:
|
def _validate(self, text: str) -> None:
|
||||||
if self._is_invalid(text):
|
if self._is_invalid(text):
|
||||||
@@ -3407,9 +3329,7 @@ class DetailsDialog(GenericDialog):
|
|||||||
for i, column_title in enumerate(["Item", "Details"]):
|
for i, column_title in enumerate(["Item", "Details"]):
|
||||||
renderer = Gtk.CellRendererText(xalign=0)
|
renderer = Gtk.CellRendererText(xalign=0)
|
||||||
if i == 0:
|
if i == 0:
|
||||||
column = Gtk.TreeViewColumn(
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i, weight=2)
|
||||||
column_title, renderer, text=i, weight=2
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
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)
|
||||||
@@ -3425,12 +3345,8 @@ class DetailsDialog(GenericDialog):
|
|||||||
scrollable_message = Gtk.ScrolledWindow()
|
scrollable_message = Gtk.ScrolledWindow()
|
||||||
desc = Gtk.Label(label="Server message", valign=Gtk.Align.START)
|
desc = Gtk.Label(label="Server message", valign=Gtk.Align.START)
|
||||||
add_class(desc, "details-heading")
|
add_class(desc, "details-heading")
|
||||||
box = Gtk.Box(
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, halign=Gtk.Align.CENTER)
|
||||||
orientation=Gtk.Orientation.VERTICAL, halign=Gtk.Align.CENTER
|
self.description = Gtk.Label(justify=Gtk.Justification.CENTER, wrap=True)
|
||||||
)
|
|
||||||
self.description = Gtk.Label(
|
|
||||||
justify=Gtk.Justification.CENTER, wrap=True
|
|
||||||
)
|
|
||||||
sep = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
|
sep = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
|
||||||
sep.set_margin_bottom(10)
|
sep.set_margin_bottom(10)
|
||||||
for el in desc, sep, self.description:
|
for el in desc, sep, self.description:
|
||||||
@@ -3468,9 +3384,7 @@ class DetailsDialog(GenericDialog):
|
|||||||
self.run()
|
self.run()
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
def _background(
|
def _background(self, dialog: "GenericDialog", ip: str, qport: int) -> None:
|
||||||
self, dialog: "GenericDialog", ip: str, qport: int
|
|
||||||
) -> None:
|
|
||||||
response = Servers.details(self.ip, self.qport)
|
response = Servers.details(self.ip, self.qport)
|
||||||
if response.success:
|
if response.success:
|
||||||
for row in response.data:
|
for row in response.data:
|
||||||
@@ -3527,9 +3441,7 @@ class ModDialog(GenericDialog):
|
|||||||
|
|
||||||
wait_dialog = GenericDialog("Fetching modlist", Popup.WAIT)
|
wait_dialog = GenericDialog("Fetching modlist", Popup.WAIT)
|
||||||
wait_dialog.show_all()
|
wait_dialog.show_all()
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(target=self._background, args=(wait_dialog, record))
|
||||||
target=self._background, args=(wait_dialog, record)
|
|
||||||
)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def _background(self, dialog: "GenericDialog", record: str) -> None:
|
def _background(self, dialog: "GenericDialog", record: str) -> None:
|
||||||
@@ -3554,9 +3466,7 @@ class ModDialog(GenericDialog):
|
|||||||
self.view.set_model(modlist_store)
|
self.view.set_model(modlist_store)
|
||||||
GLib.idle_add(_load)
|
GLib.idle_add(_load)
|
||||||
|
|
||||||
def _parse_modlist_rows(
|
def _parse_modlist_rows(self, data: subprocess.CompletedProcess) -> bool | int:
|
||||||
self, data: subprocess.CompletedProcess
|
|
||||||
) -> bool | int:
|
|
||||||
lines = data.stdout.splitlines()
|
lines = data.stdout.splitlines()
|
||||||
hits = len(lines)
|
hits = len(lines)
|
||||||
reader = csv.reader(lines, delimiter=delimiter)
|
reader = csv.reader(lines, delimiter=delimiter)
|
||||||
@@ -3586,9 +3496,7 @@ class ModDialog(GenericDialog):
|
|||||||
|
|
||||||
|
|
||||||
class LinkDialog(GenericDialog):
|
class LinkDialog(GenericDialog):
|
||||||
def __init__(
|
def __init__(self, text: str, link: str | None, command: RowType, uid: str = ""):
|
||||||
self, text: str, link: str | None, command: RowType, uid: str = ""
|
|
||||||
):
|
|
||||||
super().__init__(text, Popup.NOTIFY)
|
super().__init__(text, Popup.NOTIFY)
|
||||||
|
|
||||||
text = textwrap.dedent(text)
|
text = textwrap.dedent(text)
|
||||||
@@ -3806,7 +3714,12 @@ class Options(Gtk.Box):
|
|||||||
client_store = Gtk.ListStore(str, str)
|
client_store = Gtk.ListStore(str, str)
|
||||||
client_store.append(["steam", "steam"])
|
client_store.append(["steam", "steam"])
|
||||||
client_store.append(["flatpak", "flatpak run com.valvesoftware.Steam"])
|
client_store.append(["flatpak", "flatpak run com.valvesoftware.Steam"])
|
||||||
client_store.append(["flatpak (container)", "flatpak-spawn --host flatpak run com.valvesoftware.Steam"])
|
client_store.append(
|
||||||
|
[
|
||||||
|
"flatpak (container)",
|
||||||
|
"flatpak-spawn --host flatpak run com.valvesoftware.Steam",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
||||||
self.client_combo = Gtk.ComboBox.new_with_model(client_store)
|
self.client_combo = Gtk.ComboBox.new_with_model(client_store)
|
||||||
@@ -3830,8 +3743,7 @@ class Options(Gtk.Box):
|
|||||||
self.force_button.set_sensitive(False)
|
self.force_button.set_sensitive(False)
|
||||||
|
|
||||||
msg = (
|
msg = (
|
||||||
"Manual: prompt to subscribe to mods in Steam. "
|
"Manual: prompt to subscribe to mods in Steam. " "Auto: unmanned downloads."
|
||||||
"Auto: unmanned downloads."
|
|
||||||
)
|
)
|
||||||
eb = InfoEventBox(msg)
|
eb = InfoEventBox(msg)
|
||||||
|
|
||||||
@@ -3890,9 +3802,7 @@ class Options(Gtk.Box):
|
|||||||
self.make_frame(mods_grid, "Mods"),
|
self.make_frame(mods_grid, "Mods"),
|
||||||
self.make_frame(version_grid, "Version"),
|
self.make_frame(version_grid, "Version"),
|
||||||
]:
|
]:
|
||||||
grid.attach(
|
grid.attach(frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||||
frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT
|
|
||||||
)
|
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
self.scrollable = Gtk.ScrolledWindow(vexpand=True)
|
self.scrollable = Gtk.ScrolledWindow(vexpand=True)
|
||||||
@@ -3938,9 +3848,7 @@ class Options(Gtk.Box):
|
|||||||
|
|
||||||
return box
|
return box
|
||||||
|
|
||||||
def _on_field_activated(
|
def _on_field_activated(self, entry: Gtk.Entry, context: Preferences) -> None:
|
||||||
self, entry: Gtk.Entry, context: Preferences
|
|
||||||
) -> None:
|
|
||||||
text = entry.get_text()
|
text = entry.get_text()
|
||||||
button = entry.sibling
|
button = entry.sibling
|
||||||
if not self._is_valid_text(text, context):
|
if not self._is_valid_text(text, context):
|
||||||
@@ -3961,9 +3869,7 @@ class Options(Gtk.Box):
|
|||||||
for record in rows:
|
for record in rows:
|
||||||
col = 1
|
col = 1
|
||||||
for el in record:
|
for el in record:
|
||||||
grid.attach(
|
grid.attach(el, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||||
el, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT
|
|
||||||
)
|
|
||||||
col += 1
|
col += 1
|
||||||
row += 1
|
row += 1
|
||||||
return grid
|
return grid
|
||||||
@@ -4016,9 +3922,7 @@ class Options(Gtk.Box):
|
|||||||
return
|
return
|
||||||
process_toggle(RowType.TGL_BRANCH)
|
process_toggle(RowType.TGL_BRANCH)
|
||||||
|
|
||||||
def _on_radio_toggled(
|
def _on_radio_toggled(self, button: Gtk.RadioButton, context: Preferences) -> None:
|
||||||
self, button: Gtk.RadioButton, context: Preferences
|
|
||||||
) -> None:
|
|
||||||
if App.treeview.subpage is not RowType.OPTIONS:
|
if App.treeview.subpage is not RowType.OPTIONS:
|
||||||
return
|
return
|
||||||
match context:
|
match context:
|
||||||
@@ -4162,18 +4066,14 @@ class Options(Gtk.Box):
|
|||||||
field[1].get_children()[1].set_sensitive(False)
|
field[1].get_children()[1].set_sensitive(False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pe_file_path = PeFile.get_pefile_path(
|
pe_file_path = PeFile.get_pefile_path(default_steam_path, APPID_DAYZ)
|
||||||
default_steam_path, APPID_DAYZ
|
|
||||||
)
|
|
||||||
vers = PeFile.get_dayz_version(pe_file_path)
|
vers = PeFile.get_dayz_version(pe_file_path)
|
||||||
dayz_version = PeFile.dayz_version_to_str(vers)
|
dayz_version = PeFile.dayz_version_to_str(vers)
|
||||||
except Exception:
|
except Exception:
|
||||||
dayz_version = "-"
|
dayz_version = "-"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exp_file_path = PeFile.get_pefile_path(
|
exp_file_path = PeFile.get_pefile_path(default_steam_path, APPID_DAYZ_EXP)
|
||||||
default_steam_path, APPID_DAYZ_EXP
|
|
||||||
)
|
|
||||||
vers = PeFile.get_dayz_version(exp_file_path)
|
vers = PeFile.get_dayz_version(exp_file_path)
|
||||||
dayz_exp_version = PeFile.dayz_version_to_str(vers)
|
dayz_exp_version = PeFile.dayz_version_to_str(vers)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -4282,9 +4182,7 @@ class KeybindingsDialog(Gtk.Box):
|
|||||||
if not sep:
|
if not sep:
|
||||||
grid.attach(desc, col, row, w, h)
|
grid.attach(desc, col, row, w, h)
|
||||||
else:
|
else:
|
||||||
grid.attach_next_to(
|
grid.attach_next_to(desc, sep, Gtk.PositionType.BOTTOM, w, h)
|
||||||
desc, sep, Gtk.PositionType.BOTTOM, w, h
|
|
||||||
)
|
|
||||||
row += 1
|
row += 1
|
||||||
sep = None
|
sep = None
|
||||||
grid.attach_next_to(frame, desc, Gtk.PositionType.RIGHT, w, h)
|
grid.attach_next_to(frame, desc, Gtk.PositionType.RIGHT, w, h)
|
||||||
@@ -4292,9 +4190,7 @@ class KeybindingsDialog(Gtk.Box):
|
|||||||
l_spacer = Gtk.Label(label="")
|
l_spacer = Gtk.Label(label="")
|
||||||
r_spacer = Gtk.Label(label="")
|
r_spacer = Gtk.Label(label="")
|
||||||
grid.attach(l_spacer, col, row + 1, w, h)
|
grid.attach(l_spacer, col, row + 1, w, h)
|
||||||
grid.attach_next_to(
|
grid.attach_next_to(r_spacer, l_spacer, Gtk.PositionType.RIGHT, w, h)
|
||||||
r_spacer, l_spacer, Gtk.PositionType.RIGHT, w, h
|
|
||||||
)
|
|
||||||
row += 1
|
row += 1
|
||||||
return grid
|
return grid
|
||||||
|
|
||||||
@@ -4303,9 +4199,7 @@ class KeybindingsDialog(Gtk.Box):
|
|||||||
col = 0
|
col = 0
|
||||||
w = 1
|
w = 1
|
||||||
h = 1
|
h = 1
|
||||||
sidebar = Gtk.Grid(
|
sidebar = Gtk.Grid(row_homogeneous=True, orientation=Gtk.Orientation.VERTICAL)
|
||||||
row_homogeneous=True, orientation=Gtk.Orientation.VERTICAL
|
|
||||||
)
|
|
||||||
for cat in categories:
|
for cat in categories:
|
||||||
label = Gtk.Label(label=cat)
|
label = Gtk.Label(label=cat)
|
||||||
add_class(label, "left-label")
|
add_class(label, "left-label")
|
||||||
@@ -4325,9 +4219,7 @@ class KeybindingsDialog(Gtk.Box):
|
|||||||
column = 1
|
column = 1
|
||||||
w = 1
|
w = 1
|
||||||
h = 1
|
h = 1
|
||||||
sidebar = self.build_sidebar(
|
sidebar = self.build_sidebar(["Servers", "Navigation", "Vim-style keys"])
|
||||||
["Servers", "Navigation", "Vim-style keys"]
|
|
||||||
)
|
|
||||||
separator = Gtk.Separator()
|
separator = Gtk.Separator()
|
||||||
keys_box = self.build_keys(items)
|
keys_box = self.build_keys(items)
|
||||||
|
|
||||||
@@ -4545,9 +4437,7 @@ class Statusbar(Gtk.Statusbar):
|
|||||||
|
|
||||||
players_pretty = pluralize("players", players)
|
players_pretty = pluralize("players", players)
|
||||||
hits_pretty = pluralize("matches", hits)
|
hits_pretty = pluralize("matches", hits)
|
||||||
formatted = (
|
formatted = f"Found {hits:n} {hits_pretty} with {players:n} {players_pretty}"
|
||||||
f"Found {hits:n} {hits_pretty} with {players:n} {players_pretty}"
|
|
||||||
)
|
|
||||||
suffix = "| Distance: calculating..."
|
suffix = "| Distance: calculating..."
|
||||||
|
|
||||||
if players == 0:
|
if players == 0:
|
||||||
@@ -4599,9 +4489,7 @@ class Grid(Gtk.Grid):
|
|||||||
self.breadcrumbs = Gtk.Label(label="Main menu", halign=Gtk.Align.START)
|
self.breadcrumbs = Gtk.Label(label="Main menu", halign=Gtk.Align.START)
|
||||||
|
|
||||||
self.attach(self.notebook, 0, 0, 3, 1)
|
self.attach(self.notebook, 0, 0, 3, 1)
|
||||||
self.attach_next_to(
|
self.attach_next_to(self.breadcrumbs, self.notebook, Gtk.PositionType.TOP, 3, 1)
|
||||||
self.breadcrumbs, self.notebook, Gtk.PositionType.TOP, 3, 1
|
|
||||||
)
|
|
||||||
self.attach_next_to(
|
self.attach_next_to(
|
||||||
self.statusbar, self.notebook, Gtk.PositionType.BOTTOM, 3, 1
|
self.statusbar, self.notebook, Gtk.PositionType.BOTTOM, 3, 1
|
||||||
)
|
)
|
||||||
@@ -4663,11 +4551,23 @@ class App(Gtk.Application):
|
|||||||
)
|
)
|
||||||
self.win.add_accel_group(accel)
|
self.win.add_accel_group(accel)
|
||||||
|
|
||||||
GLib.unix_signal_add(
|
self.setup_signals()
|
||||||
GLib.PRIORITY_DEFAULT, signal.SIGINT, self._catch_sigint
|
|
||||||
)
|
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
||||||
|
def setup_signals(self) -> None:
|
||||||
|
SIGNAL_ADD = "signal_add"
|
||||||
|
SIGNAL_ADD_FULL = "signal_add_full"
|
||||||
|
try:
|
||||||
|
if SIGNAL_ADD in dir(GLibUnix):
|
||||||
|
func = GLibUnix.signal_add
|
||||||
|
elif SIGNAL_ADD_FULL in dir(GLibUnix):
|
||||||
|
func = GLibUnix.signal_add_full
|
||||||
|
else:
|
||||||
|
func = GLib.unix_signal_add
|
||||||
|
func(GLib.PRIORITY_DEFAULT, signal.SIGINT, self._catch_sigint)
|
||||||
|
except Exception as e:
|
||||||
|
logger.critical(e)
|
||||||
|
|
||||||
def _catch_sigint(self) -> None:
|
def _catch_sigint(self) -> None:
|
||||||
self.win.halt_proc_and_quit()
|
self.win.halt_proc_and_quit()
|
||||||
|
|
||||||
@@ -4752,9 +4652,7 @@ class ModSelectionPanel(Gtk.Box):
|
|||||||
|
|
||||||
def toggle_select_stale_button(self, state: bool) -> None:
|
def toggle_select_stale_button(self, state: bool) -> None:
|
||||||
if state:
|
if state:
|
||||||
button = Gtk.Button(
|
button = Gtk.Button(label="Select stale", margin_start=10, margin_end=10)
|
||||||
label="Select stale", margin_start=10, margin_end=10
|
|
||||||
)
|
|
||||||
text = "Bulk selects all currently highlighted mods"
|
text = "Bulk selects all currently highlighted mods"
|
||||||
button.set_tooltip_text(text)
|
button.set_tooltip_text(text)
|
||||||
button.connect("clicked", self._on_button_clicked)
|
button.connect("clicked", self._on_button_clicked)
|
||||||
@@ -4874,9 +4772,7 @@ class FilterPanel(Gtk.Box):
|
|||||||
self.keyword_entry = Gtk.Entry()
|
self.keyword_entry = Gtk.Entry()
|
||||||
self.keyword_entry.set_placeholder_text("Filter by keyword")
|
self.keyword_entry.set_placeholder_text("Filter by keyword")
|
||||||
self.keyword_entry.connect("activate", self._on_keyword_enter)
|
self.keyword_entry.connect("activate", self._on_keyword_enter)
|
||||||
self.keyword_entry.connect(
|
self.keyword_entry.connect("key-press-event", self._on_keyword_keypress)
|
||||||
"key-press-event", self._on_keyword_keypress
|
|
||||||
)
|
|
||||||
|
|
||||||
completion = Gtk.EntryCompletion(inline_completion=True)
|
completion = Gtk.EntryCompletion(inline_completion=True)
|
||||||
completion.set_text_column(0)
|
completion.set_text_column(0)
|
||||||
@@ -4944,9 +4840,7 @@ class FilterPanel(Gtk.Box):
|
|||||||
state = self.default_filters[label]
|
state = self.default_filters[label]
|
||||||
check.set_active(state)
|
check.set_active(state)
|
||||||
|
|
||||||
def _on_map_entry_keypress(
|
def _on_map_entry_keypress(self, entry: Gtk.Entry, event: Gdk.EventKey) -> None:
|
||||||
self, entry: Gtk.Entry, event: Gdk.EventKey
|
|
||||||
) -> None:
|
|
||||||
match event.keyval:
|
match event.keyval:
|
||||||
case Gdk.KEY_Return:
|
case Gdk.KEY_Return:
|
||||||
text = entry.get_text()
|
text = entry.get_text()
|
||||||
@@ -4989,9 +4883,7 @@ class FilterPanel(Gtk.Box):
|
|||||||
App.treeview.grab_focus()
|
App.treeview.grab_focus()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _on_keyword_keypress(
|
def _on_keyword_keypress(self, entry: Gtk.Entry, event: Gdk.EventKey) -> bool:
|
||||||
self, entry: Gtk.Entry, event: Gdk.EventKey
|
|
||||||
) -> bool:
|
|
||||||
match event.keyval:
|
match event.keyval:
|
||||||
case Gdk.KEY_Up:
|
case Gdk.KEY_Up:
|
||||||
return True
|
return True
|
||||||
@@ -5002,9 +4894,7 @@ class FilterPanel(Gtk.Box):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _on_combo_keypress(
|
def _on_combo_keypress(self, combo: Gtk.ComboBox, event: Gdk.EventKey) -> bool:
|
||||||
self, combo: Gtk.ComboBox, event: Gdk.EventKey
|
|
||||||
) -> bool:
|
|
||||||
match event.keyval:
|
match event.keyval:
|
||||||
case Gdk.KEY_Down:
|
case Gdk.KEY_Down:
|
||||||
self.maps_combo.popup()
|
self.maps_combo.popup()
|
||||||
|
|||||||
Reference in new issue
Block a user