UI refactoring

This commit is contained in:
Flowseal
2026-09-25 16:30:14 +03:00
parent caa949bee0
commit ad7f3cae9e
12 changed files with 1116 additions and 1107 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ from __future__ import annotations
import sys
import os
from typing import Any, Dict
from copy import deepcopy
from ui.i18n import detect_system_language
@@ -26,11 +27,12 @@ _TRAY_DEFAULTS_COMMON: Dict[str, Any] = {
"cfproxy_worker_domain": [],
"force_test_dc": False,
"no_secure": False,
"appearance": "auto",
}
def default_tray_config() -> Dict[str, Any]:
cfg = dict(_TRAY_DEFAULTS_COMMON)
cfg = deepcopy(_TRAY_DEFAULTS_COMMON)
cfg["secret"] = os.urandom(16).hex()
cfg["language"] = detect_system_language().value
+2 -1
View File
@@ -11,6 +11,7 @@ import threading
import time
from pathlib import Path
from typing import Any, Callable, Dict, Optional, Tuple
from copy import deepcopy
import psutil
@@ -211,7 +212,7 @@ def load_config() -> dict:
except Exception as exc:
log.warning("Failed to load config: %s", repr(exc))
if cfg is None:
cfg = dict(DEFAULT_CONFIG)
cfg = deepcopy(DEFAULT_CONFIG)
_apply_ui_language(cfg)
return cfg