change: delegate early checks to BootWindow

This commit is contained in:
aclist 2026-06-10 15:59:44 +09:00
parent ab439144ea
commit 606df3423c
7 changed files with 9 additions and 17 deletions

View File

@ -20,5 +20,4 @@ def is_dayz_installed(config: Path) -> None:
PeFile.get_app_path(Path(path) / LIBRARYFOLDERS_PATH, APPID_DAYZ)
except Exception as e:
logger.critical(e)
EarlyAlertDialog(dayz_not_found)
sys.exit(1)
raise e

View File

@ -11,7 +11,6 @@ from dzgui.const.enum import Preferences
from dzgui.config.query import lookup
from dzgui.config.userprefs import UserPrefs
from dzgui.config.xdg import get_xdg_paths, parse_filepaths
from dzgui.init.dayz import is_dayz_installed
from dzgui.init.flock import lock_acquire
from dzgui.init.migrate import (
has_new_config,
@ -124,18 +123,9 @@ def main() -> None:
if has_steam_client() is False:
EarlyAlertDialog(init.requires_steam)
is_dayz_installed(XDG.config)
bootwin = BootWindow(XDG, version)
local_coords, latest_release = bootwin.get_results()
# rebuild_symlinks(XDG.config)
# remove_stale_signatures(XDG.config, XDG.version)
## TODO: handle IP DB failure and use coords fallback
# local_coords = get_local_coords(XDG.ips)
# latest_release = check_updates(version)
use_miles = lookup(XDG.config, Preferences.DIST)
prefs = UserPrefs(
is_steam_deck=_is_steam_deck,

View File

@ -5,7 +5,7 @@ from dzgui.api.mods import get_custom_mods
from dzgui.api.steam import launch_offline
from dzgui.const.enum import Preferences
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
from dzgui.model.model_factory import FastInsertListStore, ModelFactory
from dzgui.model.model_factory import ModelFactory
from dzgui.strings import dialogs
from dzgui.util.symlink import clone_symlinks
@ -31,7 +31,7 @@ class OfflineManager:
# TODO: strings
@call_on_thread("parsing")
def parse_custom_mods(self, local_mods: list[str], folder: str) -> "FastInsertListStore":
def parse_custom_mods(self, local_mods: list[str], folder: str) -> None:
mods = get_custom_mods(Path(folder))
store = ModelFactory().make_mod_store()
store.extend(mods)
@ -44,7 +44,6 @@ class OfflineManager:
func = StoredFunc(self.emitter.emit, "custom_mods_loaded", store, folder, has_duplicates)
self.thread_man.set_cleanup_func(func)
# TODO: return store from cleanup function
def setup(
self,

View File

@ -3,4 +3,4 @@ api_validation_error = (
)
api_popover = "API key validation failed."
dayz_not_found = "Could not find DayZ and/or Steam: are they installed?"
dayz_not_found = "Could not find a valid DayZ installation."

View File

@ -3,3 +3,4 @@ signatures = "Updating mod signatures"
geo = "Checking geolocation records"
coords = "Checking local coordinates"
updates = "Checking for updates"
dayz = "Looking for DayZ"

View File

@ -10,6 +10,7 @@ from dzgui.api.mods import remove_stale_signatures as remove_stale
from dzgui.config.ipdb import get_ipdb
from dzgui.const.constants import HEX_GREEN, HEX_RED
from dzgui.init.coords import get_local_coords
from dzgui.init.dayz import is_dayz_installed
from dzgui.init.update import check_updates
from dzgui.const.constants import EXPAND, FILL
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
@ -119,6 +120,7 @@ class BootDialog(Gtk.Dialog):
self.error_box.hide()
steps = [
(StoredFunc(is_dayz_installed, self.xdg.config), preboot.dayz, False),
(StoredFunc(rebuild_symlinks, self.xdg.config), preboot.symlinks, False),
(
StoredFunc(remove_stale, self.xdg.config, self.xdg.version),
@ -126,6 +128,7 @@ class BootDialog(Gtk.Dialog):
False,
),
(StoredFunc(get_ipdb, self.xdg.ips), preboot.geo, False),
# TODO: handle IP DB failure and use coords fallback
(StoredFunc(get_local_coords, self.xdg.ips), preboot.coords, True),
(StoredFunc(check_updates, self.version), preboot.updates, True),
]

View File

@ -231,7 +231,7 @@ class OfflineLoader(Gtk.Box):
self.add(PageHeading(offline.heading))
self.local_frame = ModFrame(controller, offline.local_frame)
self.custom_frame = CustomModFrame(controller, offline.custom_frame)
self.custom_frame = CustomModFrame(self, controller, offline.custom_frame)
# TODO: suppress symlink column
self.custom_tree = OfflineModTreeView(controller)