Updated the update system to support multi channels (stable / pre-release).
This commit is contained in:
@@ -13,6 +13,7 @@ from typing import Any
|
||||
|
||||
from .locking import launcher_operation_lock
|
||||
from .paths import AppPaths
|
||||
from .update_resolver import SUPPORTED_CHANNELS
|
||||
|
||||
|
||||
SETTINGS_SCHEMA = 1
|
||||
@@ -47,6 +48,7 @@ class Settings:
|
||||
download_speed_limit_mbps: float | None = None
|
||||
low_bandwidth_mode: bool = False
|
||||
allow_window_resizing: bool = False
|
||||
update_channel: str = "stable"
|
||||
|
||||
@property
|
||||
def source_override(self) -> Path | None:
|
||||
@@ -176,6 +178,7 @@ def _settings_from_object(value: dict[str, object]) -> Settings:
|
||||
"download_speed_limit_mbps",
|
||||
),
|
||||
low_bandwidth_mode=_boolean(value, "low_bandwidth_mode", False),
|
||||
update_channel=_string(value, "update_channel", "stable"),
|
||||
)
|
||||
_validate(settings)
|
||||
return settings
|
||||
@@ -273,6 +276,8 @@ def _validate(settings: Settings) -> None:
|
||||
raise ValueError(f"unsupported runtime selection: {settings.runtime}")
|
||||
if settings.proton_sync not in {"auto", "fsync", "esync"}:
|
||||
raise ValueError(f"unsupported Proton synchronization mode: {settings.proton_sync}")
|
||||
if settings.update_channel not in SUPPORTED_CHANNELS:
|
||||
raise ValueError(f"unsupported launcher update channel: {settings.update_channel}")
|
||||
if (
|
||||
settings.download_speed_limit_mbps is not None
|
||||
and (
|
||||
|
||||
Reference in New Issue
Block a user