RodTracker.backend.settings
Classes which contain RodTracker GUI user settings.
Author: Adrian Niemann (adrian.niemann@ovgu.de)
Date: 2022-2024
- class Configuration[source]
Bases:
QObjectGeneric class that shall hold configurations/settings.
- path: str = '/home/docs/.config/RodTracker/configurations.json'
Path to the file for storing this configuration.
- Type:
str
- read(path: str | None = None)[source]
Reads configurations from a file and saves them in this object.
- Parameters:
path (str, optional) – Path of the file to read. If no path is given the classes saved path is used, this might be the default path or a programmatically exchanged path.
- Returns:
None
- classmethod save(new_path: str | None = None, new_data: dict | None = None)[source]
Saves the
contentsto a location on disk.The saving location is determined by the objects property
pathif the parameter is left out.- Parameters:
new_path (str, optional) – Location to save the contents to. If this parameter is left blank the
Configurationobject’spathproperty is used.new_data (dict, optional) – Configuration data, that is supposed to be saved and therefore replace the old configuration data.
- Returns:
None
- class Settings(path: str | None = None)[source]
Bases:
ConfigurationHolds settings for the GUI.
- Parameters:
path (str, optional) – Location and name where the settings are saved as a
*.jsonfile. The default location is used, if no path is given.
Signals
- parent
- Type:
QWidget
- path: str = '/home/docs/.config/RodTracker/settings.json'
Location and name where the settings are saved as a
*.jsonfile.- Type:
str
- read(path: str | None = None)[source]
Reads configurations from a file and saves them in this object.
- Parameters:
path (str, optional) – Path of the file to read. If no path is given the classes saved path is used, this might be the default path or a programmatically exchanged path.
- Returns:
None
- settings_changed
Propagates settings that have potentially been changed.
- Type:
pyqtSignal(dict)