Compare commits

...

9 Commits

Author SHA1 Message Date
aclist
c947bc2c9b
Merge pull request #425 from aclist/fix/flickering-cancel-button
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: flickering cancel button
2026-07-28 17:12:43 +09:00
aclist
06315972b1
Merge pull request #424 from aclist/fix/options-web-button
chore: normalize position of web button following BM API drop
2026-07-28 17:11:45 +09:00
aclist
4e36824ed7
Merge pull request #423 from aclist/fix/lockstep-history
fix:  maintain lockstep with history file (#362)
2026-07-28 17:11:15 +09:00
aclist
0bb618b703 fix: more applicable error message
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-07-28 17:10:19 +09:00
aclist
b8e11d5b59 chore: clean up comments 2026-07-28 16:48:01 +09:00
aclist
db8b1acbc6 fix: pack spinner in dedicated box
Resolves #357. Spinner and cancel button occupied the same region of the
content area, causing spinner repaint events on each frame to redraw the
cancel button, triggering a flickering effect.
2026-07-28 16:40:01 +09:00
aclist
1e5d66c9be chore: change alignment property to hold future items 2026-07-27 23:19:23 +09:00
aclist
202620c062 chore: normalize position of web button following BM API drop 2026-07-27 23:17:49 +09:00
aclist
673038a1ab fix: maintain lockstep with history file (#362) 2026-07-27 22:11:48 +09:00
6 changed files with 39 additions and 41 deletions

View File

@ -44,6 +44,7 @@
- Play offline (load mods directly)
- Generate Steam shortcuts and cover art
- Warn user if background downloads are disabled
- Dynamic copy button
### Changed
- Conform to PEP 440 versioning for beta versions
@ -63,6 +64,7 @@
- Propagate subscribed mods to Steam client
### Dropped
- Battlemetrics API support
- Debug mode
- Branch switching
- Manual mod install mode (describe rationale)
@ -73,6 +75,7 @@
- Center server title text on server dialogs
- Rare segfaults when changing maps (threading)
- Moved dialogs out of threads
- History table not being in lock-step with state file
### Unreleased
- Load offline mods

View File

@ -85,8 +85,8 @@ class ProxyModelManager:
if found is False:
self.control_model.append(history)
# if len(self.control_model) == 11:
# del self.control_model[0]
if len(self.control_model) == 11:
del self.control_model[0]
self.filter(FilterMode.INITIAL, skip_cache=True)

View File

@ -15,7 +15,7 @@ from dzgui.const.constants import (
from dzgui.const.enum import FilterMode, Preferences, ServerTab
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
from dzgui.strings import dialogs
from dzgui.util.strings import api_warn_msg, dialog
from dzgui.util.strings import server_timeout, dialog
from dzgui.views.dialogs.generic import ExceptionDialog
import gi
@ -175,18 +175,25 @@ class ServerModelManager:
# TODO: wrap except
if self.controller.get_exit_event().is_set():
return
res = future.result(timeout=API_TIMEOUT)
self.thread_man.increment_dialog()
# NOTE: failing entries are culled
if res is None:
# TODO: log which servers failed
continue
servers.append(res)
if len(servers) == 0:
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_failure), destroy_first=True
)
return
"""
Collects futures in linear order after completion
for lock-step representation of the state file
"""
for future in futures:
res = future.result(timeout=API_TIMEOUT)
# NOTE: failing entries are culled
if res is None:
# TODO: log which servers failed
# query_direct() currently does not return enough information
continue
servers.append(res)
if len(servers) == 0:
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_failure), destroy_first=True
)
return
parsed = Servers.parse_json(servers)
self._push_data(parsed)
@ -234,7 +241,6 @@ class ServerModelManager:
self.first_iteration = False
self.emitter.emit("load_maps", store)
# self.emitter.emit("servers_loaded_init")
# TODO: dataclass for record rows; check for other dict annotations
def add_to_history(self, data: tuple[dict[str, Any], "Record"]) -> None:
@ -413,7 +419,7 @@ class ServerModelManager:
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
# customize statusbar and dialog accordingly
if show_dialog:
dialog = ExceptionDialog(self.controller, api_warn_msg)
dialog = ExceptionDialog(self.controller, server_timeout)
dialog.run()
def _push_data(self, data: list[Any]) -> None:

View File

@ -100,10 +100,7 @@ steam_missing = "Local Steam installation is not set, possibly malformed config
build_corrupted = (
"Steam settings or DayZ installation may be corrupted. Try restarting Steam."
)
api_warn_msg = """No servers returned. Please wait and try again.
This usually indicates a transitory network timeout. If this issue persists, your API key or network may be malfunctioning.
"""
server_timeout = "Timed out when querying server, check IP or try again later."
server_timeout = "Timed out when querying server(s). Check IP or try again later."
server_error = (
"Error while contacting server, possibly timed out. Please wait and try again."
)
@ -308,7 +305,7 @@ class Options:
force_eventbox: str
self_update: str
no_self_update: str
api_keys: str
api_key: str
prefs: str
mods: str
version: str
@ -405,7 +402,7 @@ options = Options(
"In-app updates are disabled when DZGUI is "
"installed globally (e.g., via package manager)."
),
api_keys="API Keys",
api_key="API Key",
prefs="Preferences",
mods="Mods",
version="Version",

View File

@ -111,19 +111,22 @@ class WaitDialog(GenericDialog):
self.connect("delete-event", lambda widget, event: True)
content = self.get_content_area()
spinner = Gtk.Spinner()
self.prog = Gtk.ProgressBar()
content.pack_end(self.cancel, NO_EXPAND, NO_FILL, 0)
content.pack_end(spinner, NO_EXPAND, NO_FILL, 0)
spinner_box = Gtk.Box(
orientation=Gtk.Orientation.HORIZONTAL, halign=Gtk.Align.CENTER
)
spinner = Gtk.Spinner()
spinner_box.add(spinner)
if self.jobs > 1:
content.pack_end(self.prog, NO_EXPAND, NO_FILL, 0)
content.pack_start(self.prog, NO_EXPAND, NO_FILL, 0)
else:
content.pack_start(spinner_box, NO_EXPAND, NO_FILL, 0)
spinner.start()
if show_cancel is False:
self.connect("realize", lambda _: self.cancel.set_visible(False))
if show_cancel is True:
content.pack_start(self.cancel, NO_EXPAND, NO_FILL, 0)
def update_text(self, msg: str) -> None:
self.format_secondary_text(msg)

View File

@ -74,7 +74,7 @@ class Options(Gtk.Box):
strings.options.enter_steam, Preferences.STEAM, True
)
api_rows = [
[LeftLabel(strings.options.steam_placeholder), self.steam_box],
[LeftLabel(strings.options.steam_placeholder), self.steam_box, self.steam],
]
self.player_box = self._make_submit_field(
@ -136,17 +136,6 @@ class Options(Gtk.Box):
api_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
api_grid = self._make_grid(api_rows)
api_box.add(api_grid)
api_links_box = Gtk.Box(
orientation=Gtk.Orientation.HORIZONTAL,
margin_start=5,
margin_end=5,
margin_top=5,
margin_bottom=10,
homogeneous=True,
spacing=10,
)
api_links_box.add(self.steam)
api_box.add(api_links_box)
prefs_grid = self._make_grid(pref_rows)
version_grid = self._make_grid(version_rows)
@ -167,7 +156,7 @@ class Options(Gtk.Box):
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
for pair in [
(api_box, strings.options.api_keys),
(api_box, strings.options.api_key),
(prefs_grid, strings.options.prefs),
(version_grid, strings.options.version),
]: