mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 06:32:53 +01:00
change: delegate early checks to BootWindow
This commit is contained in:
1 parent
ab439144ea
commit
606df3423c
7 files changed
+9
-17
No files matched your search
+1
-2
@@ -20,5 +20,4 @@ def is_dayz_installed(config: Path) -> None:
|
|||||||
PeFile.get_app_path(Path(path) / LIBRARYFOLDERS_PATH, APPID_DAYZ)
|
PeFile.get_app_path(Path(path) / LIBRARYFOLDERS_PATH, APPID_DAYZ)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
EarlyAlertDialog(dayz_not_found)
|
raise e
|
||||||
sys.exit(1)
|
|
||||||
@@ -11,7 +11,6 @@ from dzgui.const.enum import Preferences
|
|||||||
from dzgui.config.query import lookup
|
from dzgui.config.query import lookup
|
||||||
from dzgui.config.userprefs import UserPrefs
|
from dzgui.config.userprefs import UserPrefs
|
||||||
from dzgui.config.xdg import get_xdg_paths, parse_filepaths
|
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.flock import lock_acquire
|
||||||
from dzgui.init.migrate import (
|
from dzgui.init.migrate import (
|
||||||
has_new_config,
|
has_new_config,
|
||||||
@@ -124,18 +123,9 @@ def main() -> None:
|
|||||||
if has_steam_client() is False:
|
if has_steam_client() is False:
|
||||||
EarlyAlertDialog(init.requires_steam)
|
EarlyAlertDialog(init.requires_steam)
|
||||||
|
|
||||||
is_dayz_installed(XDG.config)
|
|
||||||
|
|
||||||
bootwin = BootWindow(XDG, version)
|
bootwin = BootWindow(XDG, version)
|
||||||
local_coords, latest_release = bootwin.get_results()
|
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)
|
use_miles = lookup(XDG.config, Preferences.DIST)
|
||||||
prefs = UserPrefs(
|
prefs = UserPrefs(
|
||||||
is_steam_deck=_is_steam_deck,
|
is_steam_deck=_is_steam_deck,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from dzgui.api.mods import get_custom_mods
|
|||||||
from dzgui.api.steam import launch_offline
|
from dzgui.api.steam import launch_offline
|
||||||
from dzgui.const.enum import Preferences
|
from dzgui.const.enum import Preferences
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
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.strings import dialogs
|
||||||
from dzgui.util.symlink import clone_symlinks
|
from dzgui.util.symlink import clone_symlinks
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class OfflineManager:
|
|||||||
|
|
||||||
# TODO: strings
|
# TODO: strings
|
||||||
@call_on_thread("parsing")
|
@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))
|
mods = get_custom_mods(Path(folder))
|
||||||
store = ModelFactory().make_mod_store()
|
store = ModelFactory().make_mod_store()
|
||||||
store.extend(mods)
|
store.extend(mods)
|
||||||
@@ -44,7 +44,6 @@ class OfflineManager:
|
|||||||
|
|
||||||
func = StoredFunc(self.emitter.emit, "custom_mods_loaded", store, folder, has_duplicates)
|
func = StoredFunc(self.emitter.emit, "custom_mods_loaded", store, folder, has_duplicates)
|
||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
# TODO: return store from cleanup function
|
|
||||||
|
|
||||||
def setup(
|
def setup(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ api_validation_error = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
api_popover = "API key validation failed."
|
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."
|
||||||
@@ -3,3 +3,4 @@ signatures = "Updating mod signatures"
|
|||||||
geo = "Checking geolocation records"
|
geo = "Checking geolocation records"
|
||||||
coords = "Checking local coordinates"
|
coords = "Checking local coordinates"
|
||||||
updates = "Checking for updates"
|
updates = "Checking for updates"
|
||||||
|
dayz = "Looking for DayZ"
|
||||||
@@ -10,6 +10,7 @@ from dzgui.api.mods import remove_stale_signatures as remove_stale
|
|||||||
from dzgui.config.ipdb import get_ipdb
|
from dzgui.config.ipdb import get_ipdb
|
||||||
from dzgui.const.constants import HEX_GREEN, HEX_RED
|
from dzgui.const.constants import HEX_GREEN, HEX_RED
|
||||||
from dzgui.init.coords import get_local_coords
|
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.init.update import check_updates
|
||||||
from dzgui.const.constants import EXPAND, FILL
|
from dzgui.const.constants import EXPAND, FILL
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
@@ -119,6 +120,7 @@ class BootDialog(Gtk.Dialog):
|
|||||||
self.error_box.hide()
|
self.error_box.hide()
|
||||||
|
|
||||||
steps = [
|
steps = [
|
||||||
|
(StoredFunc(is_dayz_installed, self.xdg.config), preboot.dayz, False),
|
||||||
(StoredFunc(rebuild_symlinks, self.xdg.config), preboot.symlinks, False),
|
(StoredFunc(rebuild_symlinks, self.xdg.config), preboot.symlinks, False),
|
||||||
(
|
(
|
||||||
StoredFunc(remove_stale, self.xdg.config, self.xdg.version),
|
StoredFunc(remove_stale, self.xdg.config, self.xdg.version),
|
||||||
@@ -126,6 +128,7 @@ class BootDialog(Gtk.Dialog):
|
|||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
(StoredFunc(get_ipdb, self.xdg.ips), preboot.geo, 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(get_local_coords, self.xdg.ips), preboot.coords, True),
|
||||||
(StoredFunc(check_updates, self.version), preboot.updates, True),
|
(StoredFunc(check_updates, self.version), preboot.updates, True),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class OfflineLoader(Gtk.Box):
|
|||||||
self.add(PageHeading(offline.heading))
|
self.add(PageHeading(offline.heading))
|
||||||
|
|
||||||
self.local_frame = ModFrame(controller, offline.local_frame)
|
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
|
# TODO: suppress symlink column
|
||||||
self.custom_tree = OfflineModTreeView(controller)
|
self.custom_tree = OfflineModTreeView(controller)
|
||||||
|
|||||||
Reference in new issue
Block a user