mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 07:02:50 +01:00
fix: use dedicated LAN error message
This commit is contained in:
1 parent
7b4382b178
commit
9af2145ee8
2 files changed
+14
-1
No files matched your search
+12
-1
@@ -14,6 +14,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.util.strings import api_warn_msg, dialog
|
from dzgui.util.strings import api_warn_msg, dialog
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ class ServerModelManager:
|
|||||||
|
|
||||||
servers = []
|
servers = []
|
||||||
ports = range(1, 256)
|
ports = range(1, 256)
|
||||||
failure_func = StoredFunc(self._cleanup_on_failure)
|
failure_func = StoredFunc(self._cleanup_on_lan_failure)
|
||||||
|
|
||||||
event = threading.Event()
|
event = threading.Event()
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
@@ -405,6 +406,16 @@ class ServerModelManager:
|
|||||||
if self.first_iteration:
|
if self.first_iteration:
|
||||||
self._update_maps()
|
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:
|
def _cleanup_on_failure(self, show_dialog: bool = True) -> None:
|
||||||
# TODO: disable map, keyword, and filter widgets if model is None
|
# TODO: disable map, keyword, and filter widgets if model is None
|
||||||
# signal driven (servers_empty, servers_failed_to_load)
|
# 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"
|
fetching_update = "Fetching update"
|
||||||
failed_to_update = "Failed to update DZGUI executable"
|
failed_to_update = "Failed to update DZGUI executable"
|
||||||
update_success = "Updated successfully. Please exit and relaunch."
|
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."
|
||||||
Reference in new issue
Block a user