refactor: externalize app configuration to JSON and unify UI color scheme constants
This commit is contained in:
@@ -7,8 +7,59 @@ Verwendet pathlib für alle Pfadoperationen.
|
||||
|
||||
import json
|
||||
import platform
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# ---- Globale App-Informationen (aus config.json) ----
|
||||
APP_INFO = {
|
||||
"app_name": "fcco Converter",
|
||||
"app_version": "2.0.0",
|
||||
"repo_owner": "public",
|
||||
"repo_name": "fcco-Converter",
|
||||
"gitea_api_base": "https://git.joelunger.de/api/v1"
|
||||
}
|
||||
|
||||
def _load_app_info():
|
||||
try:
|
||||
# Finde config.json relativ zum Skript oder im PyInstaller Bundle
|
||||
if getattr(sys, "frozen", False):
|
||||
base_dir = Path(sys.executable).parent
|
||||
else:
|
||||
base_dir = Path(__file__).parent.parent
|
||||
|
||||
config_path = base_dir / "config.json"
|
||||
if config_path.exists():
|
||||
with open(config_path, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
APP_INFO.update(data)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
_load_app_info()
|
||||
|
||||
# =========================================================================
|
||||
# Farbschema
|
||||
# =========================================================================
|
||||
|
||||
T = {
|
||||
"bg": "#000000",
|
||||
"surface": "#111111",
|
||||
"elevated": "#1a1a1a",
|
||||
"card": "#222222",
|
||||
"input": "#000000",
|
||||
"accent": "#ffffff",
|
||||
"accent_h": "#e6e6e6",
|
||||
"success": "#ffffff",
|
||||
"success_h": "#e6e6e6",
|
||||
"warn": "#ffffff",
|
||||
"error": "#ffffff",
|
||||
"text": "#ffffff",
|
||||
"text2": "#b3b3b3",
|
||||
"muted": "#808080",
|
||||
"border": "#333333",
|
||||
"btn2": "#1a1a1a",
|
||||
"btn2_h": "#333333",
|
||||
}
|
||||
|
||||
# Standardmäßige Export-Kategorien
|
||||
DEFAULT_EXPORT_PATHS = {
|
||||
|
||||
Reference in New Issue
Block a user