mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 16:27:13 +03:00
* new class `PrefsVersion` in prefs.py. A singleton `prefsSaved` (note case) is created. * When new preferences are added and require defaults on first run the code should use: `if prefsVersion.shouldSetDefaults(<prior release version>, [<optional old test>]):` to check if defaults should be set in preferences. So if prior release was '3.4.6.0' and you've added a new preference with defaults you should call this with '3.4.6.0' as the first argument. The <optional old test> is really only for historical purposes, as a fallback in case no 'PrefsVersion' has yet been set in the user's Registry/settings file. * Any code that adds such a new preference **MUST** make changes to the `versions` dictionary in the PrefsVersion class. 1. Add the predicted next version to the dictionary, with number one higher than 'current' 2. Set 'current' equal to that new value. Obviously if other post-last-release code has already done this then you don't need to. Failure to update the versions dictionary in this manner will lead to an Exception being raised, and the code the preferences are for failing (i.e. EDDN means no EDDN tab on Settings). Closes #407