mirror of
https://github.com/aclist/dztui.git
synced 2026-08-30 03:37:00 +02:00
Compare commits
No commits in common. "c947bc2c9b80b43d65b541b2b02fb1a2e874315f" and "c97e34c33604f6feba03848c5729912af04ea0bb" have entirely different histories.
c947bc2c9b
...
c97e34c336
@ -44,7 +44,6 @@
|
|||||||
- Play offline (load mods directly)
|
- Play offline (load mods directly)
|
||||||
- Generate Steam shortcuts and cover art
|
- Generate Steam shortcuts and cover art
|
||||||
- Warn user if background downloads are disabled
|
- Warn user if background downloads are disabled
|
||||||
- Dynamic copy button
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Conform to PEP 440 versioning for beta versions
|
- Conform to PEP 440 versioning for beta versions
|
||||||
@ -64,7 +63,6 @@
|
|||||||
- Propagate subscribed mods to Steam client
|
- Propagate subscribed mods to Steam client
|
||||||
|
|
||||||
### Dropped
|
### Dropped
|
||||||
- Battlemetrics API support
|
|
||||||
- Debug mode
|
- Debug mode
|
||||||
- Branch switching
|
- Branch switching
|
||||||
- Manual mod install mode (describe rationale)
|
- Manual mod install mode (describe rationale)
|
||||||
@ -75,7 +73,6 @@
|
|||||||
- Center server title text on server dialogs
|
- Center server title text on server dialogs
|
||||||
- Rare segfaults when changing maps (threading)
|
- Rare segfaults when changing maps (threading)
|
||||||
- Moved dialogs out of threads
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with state file
|
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
- Load offline mods
|
- Load offline mods
|
||||||
|
|||||||
@ -85,8 +85,8 @@ class ProxyModelManager:
|
|||||||
if found is False:
|
if found is False:
|
||||||
self.control_model.append(history)
|
self.control_model.append(history)
|
||||||
|
|
||||||
if len(self.control_model) == 11:
|
# if len(self.control_model) == 11:
|
||||||
del self.control_model[0]
|
# del self.control_model[0]
|
||||||
|
|
||||||
self.filter(FilterMode.INITIAL, skip_cache=True)
|
self.filter(FilterMode.INITIAL, skip_cache=True)
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ from dzgui.const.constants import (
|
|||||||
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings import dialogs
|
from dzgui.strings import dialogs
|
||||||
from dzgui.util.strings import server_timeout, dialog
|
from dzgui.util.strings import api_warn_msg, dialog
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@ -175,25 +175,18 @@ class ServerModelManager:
|
|||||||
# TODO: wrap except
|
# TODO: wrap except
|
||||||
if self.controller.get_exit_event().is_set():
|
if self.controller.get_exit_event().is_set():
|
||||||
return
|
return
|
||||||
|
res = future.result(timeout=API_TIMEOUT)
|
||||||
self.thread_man.increment_dialog()
|
self.thread_man.increment_dialog()
|
||||||
|
# NOTE: failing entries are culled
|
||||||
"""
|
if res is None:
|
||||||
Collects futures in linear order after completion
|
# TODO: log which servers failed
|
||||||
for lock-step representation of the state file
|
continue
|
||||||
"""
|
servers.append(res)
|
||||||
for future in futures:
|
if len(servers) == 0:
|
||||||
res = future.result(timeout=API_TIMEOUT)
|
self.thread_man.set_cleanup_func(
|
||||||
# NOTE: failing entries are culled
|
StoredFunc(self._cleanup_on_failure), destroy_first=True
|
||||||
if res is None:
|
)
|
||||||
# TODO: log which servers failed
|
return
|
||||||
# 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)
|
parsed = Servers.parse_json(servers)
|
||||||
self._push_data(parsed)
|
self._push_data(parsed)
|
||||||
@ -241,6 +234,7 @@ class ServerModelManager:
|
|||||||
|
|
||||||
self.first_iteration = False
|
self.first_iteration = False
|
||||||
self.emitter.emit("load_maps", store)
|
self.emitter.emit("load_maps", store)
|
||||||
|
# self.emitter.emit("servers_loaded_init")
|
||||||
|
|
||||||
# TODO: dataclass for record rows; check for other dict annotations
|
# TODO: dataclass for record rows; check for other dict annotations
|
||||||
def add_to_history(self, data: tuple[dict[str, Any], "Record"]) -> None:
|
def add_to_history(self, data: tuple[dict[str, Any], "Record"]) -> None:
|
||||||
@ -419,7 +413,7 @@ class ServerModelManager:
|
|||||||
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
# TODO: distinguish signals, e.g. "servers_failed_to_load", "servers_loaded_empty"
|
||||||
# customize statusbar and dialog accordingly
|
# customize statusbar and dialog accordingly
|
||||||
if show_dialog:
|
if show_dialog:
|
||||||
dialog = ExceptionDialog(self.controller, server_timeout)
|
dialog = ExceptionDialog(self.controller, api_warn_msg)
|
||||||
dialog.run()
|
dialog.run()
|
||||||
|
|
||||||
def _push_data(self, data: list[Any]) -> None:
|
def _push_data(self, data: list[Any]) -> None:
|
||||||
|
|||||||
@ -100,7 +100,10 @@ steam_missing = "Local Steam installation is not set, possibly malformed config
|
|||||||
build_corrupted = (
|
build_corrupted = (
|
||||||
"Steam settings or DayZ installation may be corrupted. Try restarting Steam."
|
"Steam settings or DayZ installation may be corrupted. Try restarting Steam."
|
||||||
)
|
)
|
||||||
server_timeout = "Timed out when querying server(s). Check IP or try again later."
|
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_error = (
|
server_error = (
|
||||||
"Error while contacting server, possibly timed out. Please wait and try again."
|
"Error while contacting server, possibly timed out. Please wait and try again."
|
||||||
)
|
)
|
||||||
@ -305,7 +308,7 @@ class Options:
|
|||||||
force_eventbox: str
|
force_eventbox: str
|
||||||
self_update: str
|
self_update: str
|
||||||
no_self_update: str
|
no_self_update: str
|
||||||
api_key: str
|
api_keys: str
|
||||||
prefs: str
|
prefs: str
|
||||||
mods: str
|
mods: str
|
||||||
version: str
|
version: str
|
||||||
@ -402,7 +405,7 @@ options = Options(
|
|||||||
"In-app updates are disabled when DZGUI is "
|
"In-app updates are disabled when DZGUI is "
|
||||||
"installed globally (e.g., via package manager)."
|
"installed globally (e.g., via package manager)."
|
||||||
),
|
),
|
||||||
api_key="API Key",
|
api_keys="API Keys",
|
||||||
prefs="Preferences",
|
prefs="Preferences",
|
||||||
mods="Mods",
|
mods="Mods",
|
||||||
version="Version",
|
version="Version",
|
||||||
|
|||||||
@ -111,22 +111,19 @@ class WaitDialog(GenericDialog):
|
|||||||
|
|
||||||
self.connect("delete-event", lambda widget, event: True)
|
self.connect("delete-event", lambda widget, event: True)
|
||||||
content = self.get_content_area()
|
content = self.get_content_area()
|
||||||
|
spinner = Gtk.Spinner()
|
||||||
self.prog = Gtk.ProgressBar()
|
self.prog = Gtk.ProgressBar()
|
||||||
|
|
||||||
spinner_box = Gtk.Box(
|
content.pack_end(self.cancel, NO_EXPAND, NO_FILL, 0)
|
||||||
orientation=Gtk.Orientation.HORIZONTAL, halign=Gtk.Align.CENTER
|
content.pack_end(spinner, NO_EXPAND, NO_FILL, 0)
|
||||||
)
|
|
||||||
spinner = Gtk.Spinner()
|
|
||||||
spinner_box.add(spinner)
|
|
||||||
|
|
||||||
if self.jobs > 1:
|
if self.jobs > 1:
|
||||||
content.pack_start(self.prog, NO_EXPAND, NO_FILL, 0)
|
content.pack_end(self.prog, NO_EXPAND, NO_FILL, 0)
|
||||||
else:
|
else:
|
||||||
content.pack_start(spinner_box, NO_EXPAND, NO_FILL, 0)
|
|
||||||
spinner.start()
|
spinner.start()
|
||||||
|
|
||||||
if show_cancel is True:
|
if show_cancel is False:
|
||||||
content.pack_start(self.cancel, NO_EXPAND, NO_FILL, 0)
|
self.connect("realize", lambda _: self.cancel.set_visible(False))
|
||||||
|
|
||||||
def update_text(self, msg: str) -> None:
|
def update_text(self, msg: str) -> None:
|
||||||
self.format_secondary_text(msg)
|
self.format_secondary_text(msg)
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class Options(Gtk.Box):
|
|||||||
strings.options.enter_steam, Preferences.STEAM, True
|
strings.options.enter_steam, Preferences.STEAM, True
|
||||||
)
|
)
|
||||||
api_rows = [
|
api_rows = [
|
||||||
[LeftLabel(strings.options.steam_placeholder), self.steam_box, self.steam],
|
[LeftLabel(strings.options.steam_placeholder), self.steam_box],
|
||||||
]
|
]
|
||||||
|
|
||||||
self.player_box = self._make_submit_field(
|
self.player_box = self._make_submit_field(
|
||||||
@ -136,6 +136,17 @@ class Options(Gtk.Box):
|
|||||||
api_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
api_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
api_grid = self._make_grid(api_rows)
|
api_grid = self._make_grid(api_rows)
|
||||||
api_box.add(api_grid)
|
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)
|
prefs_grid = self._make_grid(pref_rows)
|
||||||
version_grid = self._make_grid(version_rows)
|
version_grid = self._make_grid(version_rows)
|
||||||
@ -156,7 +167,7 @@ class Options(Gtk.Box):
|
|||||||
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
grid.attach(developers, 1, 0, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
|
||||||
|
|
||||||
for pair in [
|
for pair in [
|
||||||
(api_box, strings.options.api_key),
|
(api_box, strings.options.api_keys),
|
||||||
(prefs_grid, strings.options.prefs),
|
(prefs_grid, strings.options.prefs),
|
||||||
(version_grid, strings.options.version),
|
(version_grid, strings.options.version),
|
||||||
]:
|
]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user