UI Config Manager¶
- class UIConfigManager[source]¶
Manages the user interface configuration settings.
This includes the management of header and footer text for exported PDFs, custom fonts, font paths, and an optional branding logo. The class also handles the downloading of default fonts if they are not already present.
- property config: dict[source]¶
Retrieves the current UI configuration from property list, or creates default configuration.
- Returns:
Retrieved UI configuration settings or default config.
- Return type:
- property fonts_present: bool¶
This property verifies if the required font files (regular and bold) are present in the expected directory.
- Returns:
Trueif the fonts are present.- Return type:
- create_default_config()[source]¶
This method writes default values for header text, footer text, font paths and optional branding logo into the property list file. It also ensures that the necessary fonts are downloaded if they are not already present.
- reset_config() bool[source]¶
Removes all existing UI settings from the property list file.
This method is useful if the user wants to reconfigure the UI elements of PDF reports, such as header/footer text, font choices, and branding logo.
See Resetting Patcher for more details.
- Returns:
Trueif the reset was successful.- Return type: