mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
fix: use dedicated LAN error message
This commit is contained in:
parent
7b4382b178
commit
9af2145ee8
@ -14,6 +14,7 @@ from dzgui.const.constants import (
|
||||
)
|
||||
from dzgui.const.enum import FilterMode, Preferences, ServerTab
|
||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.util.strings import api_warn_msg, dialog
|
||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||
|
||||
@ -130,7 +131,7 @@ class ServerModelManager:
|
||||
|
||||
servers = []
|
||||
ports = range(1, 256)
|
||||
failure_func = StoredFunc(self._cleanup_on_failure)
|
||||
failure_func = StoredFunc(self._cleanup_on_lan_failure)
|
||||
|
||||
event = threading.Event()
|
||||
with ThreadPoolExecutor() as executor:
|
||||
@ -405,6 +406,16 @@ class ServerModelManager:
|
||||
if self.first_iteration:
|
||||
self._update_maps()
|
||||
|
||||
def _cleanup_on_lan_failure(self, show_dialog: bool = True) -> None:
|
||||
if self.preserve_on_fail is False:
|
||||
self.tv.set_model(None)
|
||||
filter_man = self.tv.get_filter_man()
|
||||
filter_man.set_unique_maps([])
|
||||
|
||||
if show_dialog:
|
||||
dialog = ExceptionDialog(self.controller, dialogs.load_error_lan)
|
||||
dialog.run()
|
||||
|
||||
def _cleanup_on_failure(self, show_dialog: bool = True) -> None:
|
||||
# TODO: disable map, keyword, and filter widgets if model is None
|
||||
# signal driven (servers_empty, servers_failed_to_load)
|
||||
|
||||
@ -4,3 +4,5 @@ waiting_for_mods = "Waiting for Steam to update mods"
|
||||
fetching_update = "Fetching update"
|
||||
failed_to_update = "Failed to update DZGUI executable"
|
||||
update_success = "Updated successfully. Please exit and relaunch."
|
||||
|
||||
load_error_lan = "Failed to find any servers on your network.\nCheck the server query port or your firewall settings."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user