This class contains the core default settings.
Class to wrap QSettings.
- Exposes all the methods of QSettings.
- Adds functionality for OpenLP Portable. If the
defaultFormatis set to
IniFormat, and the path to the Ini file is set using
set_filename, then the Settings constructor (without any arguments) will create a Settings object for accessing settings stored in that Ini file.
- This dict contains all core settings with their default values.
Each entry is structured in the following way:
('general/enable slide loop', 'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)])
The first entry is the old key; it will be removed.
The second entry is the new key; we will add it to the config. If this is just an empty string, we just remove the old key. The last entry is a list containing two-pair tuples. If the list is empty, no conversion is made. If the first value is callable i.e. a function, the function will be called with the old setting’s value. Otherwise each pair describes how to convert the old setting’s value:
This means, that if the value of
general/enable slide loopis equal (
Truethen we set
SlideLimits.Wrap. NOTE, this means that the rules have to cover all cases! So, if the type of the old value is bool, then there must be two rules.
Static method to merge the given
Parameters: default_values – A dict with setting keys and their default values.
Get the default value of the given key
This removes the settings needed for old way we saved files (e. g. the image paths for the image plugin). A list of file paths are returned.
Note: Only a list of paths is returned; this does not convert anything!
param plugin: The Plugin object.The caller has to convert/save the list himself; o
This method is only called to clean up the config. It removes old settings and it renames settings. See
__obsolete_settings__for more details.
Sets the complete path to an Ini file to be used by Settings objects.
Does not affect existing Settings objects.
This static method is called on start up. It is used to perform any operation on the __default_settings__ dict.
Returns the value for the given
key. The returned
valueis of the same type as the default value in the Settings.__default_settings__ dict.
Parameters: key – The key to return the value from.
If phonon is in the setting string replace it with system :param string: String to convert :return: Converted string
If the value is not a list convert it to a list :param value: Value to convert :return: value as a List