Configuration and runtime¶
Configuration and runtime state services for project setup and UI behavior.
⚠️ Strict validation contracts¶
ConfigService.save_config() now validates known payloads in strict mode
before writing files:
| Config file | Validated sections |
|---|---|
app.config.yaml |
app, settings_panel |
translation.config.yaml |
translation, language_detection, supported_languages |
theme.config.yaml |
palette |
Unknown keys in validated sections are rejected (strict schema mode). When validation fails, the file is not written.
🎨 Theme default source¶
The default/active theme is read from settings_panel.theme.default in
app.config.yaml.
app.theme is no longer part of the configuration contract.
📦 ConfigService¶
ConfigService
¶
Bases: ConfigServiceProtocol
Modular configuration service for EzQt_App.
set_project_root
¶
Set the active project root directory.
load_config
¶
get_config_value
¶
Read a specific value from a configuration using dot-notation key path.
Parameters¶
config_name:
Configuration file name.
key_path:
Dot-separated path (e.g. "app.name" or "palette.dark").
default:
Value returned when key is absent.
save_config
¶
Persist a named configuration to the project directory.
Writes use ruamel.yaml round-trip mode to preserve existing comments,
key ordering, and formatting whenever the target file already exists.
Configuration reads stay on PyYAML for the current typed read path.
Parameters¶
config_name: Configuration file name. config_data: Data to serialise as YAML.
Returns¶
bool
True if the write succeeded.
get_config_paths
¶
Return candidate paths for config_name in priority order.
Parameters¶
config_name:
Logical configuration name (e.g. "app", "languages",
"theme"). Files are resolved as <name>.config.yaml.
copy_package_configs_to_project
¶
Copy package configuration files into the child project.
Returns¶
bool
True if the operation succeeded.
get_loaded_configs
¶
Return a snapshot of currently cached configuration paths.
📦 SettingsService¶
SettingsService
¶
Bases: SettingsServiceProtocol
Service managing mutable application settings state.
Initialize settings state container.
set_custom_title_bar_enabled
¶
Enable or disable custom title bar.
set_app_min_size_qsize
¶
Set minimum window size from QSize (convenience, not part of the port).
set_app_dimensions
¶
Set default window dimensions.
set_debug_enabled
¶
Enable or disable debug console output.
set_theme
¶
Set active theme.
Accepts either a 'preset:variant' string (e.g. 'blue_gray:dark')
or a bare variant (e.g. 'dark', 'light') for backward compat.
A bare variant keeps the current THEME_PRESET unchanged.
set_time_animation
¶
Set animation duration in milliseconds.
📦 RuntimeStateService¶
RuntimeStateService
¶
Bases: RuntimeStateServiceProtocol
Service managing runtime flags and legacy global UI state.
Initialize runtime state.
🔍 Related ports¶
ezqt_app.domain.ports.config_service.ConfigServiceProtocolezqt_app.domain.ports.settings_service.SettingsServiceProtocolezqt_app.domain.ports.runtime_state_service.RuntimeStateServiceProtocol