nvda
b65f5bb7 - New addon api versioning approach (PR #9151)

Commit
7 years ago
New addon api versioning approach (PR #9151) Closes #9055 * The incompatible addons dialog is no longer shown on startup. Since there is no saved state, this would warn about any installed incompatible addons every time NVDA was started. * Replace compatibility checks - NVDA now uses two (internal) values to determine addon compatibility, in addition to the `lastTestedNVDAVersion` and `minimumNVDAVersion` from the addonManifest. These new values are `CURRENT` and `BACK_COMPAT_TO`, in the addonAPIVersion module. - An addon is considered compatible if there is an overlap of the two ranges formed by the addon manifest values and the internal NVDA values. - Renamed `_showAddonUntestedDialog` - Clarified the name of the function to report that an addon is no longer supported by NVDA. The addon is considered "too old". As opposed to NVDA being "too old" for a newly developed addon. * Introduce a new method of stopping incompatible addons from "running". - No longer "disable" them to stop them from running. - When being set to disabled, the state was being saved. This meant the launcher could interfere with an installed version of NVDA, even if the installation was aborted. - We rely on `_getAvailableAddonsFromPath` to be setting the blocked state. - Improve comment in `addToPackagePath`, which is currently the end point for "enabling" an addon. * Addon API version values are now used as tuples throughout code. - Read from addon manifest and validate and convert to tuple. - Validate manifest condition: `minRequiredVersion <= lastTested` - It's not sensible to have a minRequiredVersion later than the version tested against. * Update info for NVDA now keeps `APIVersion` and `backCompatibleToVersion` as tuples rather than strings. - When an update is postponed it is saved as a tuple. - This saves confusion about whether its a string or a tuple. * Fix freeze on exit when destroy not called manually for `AutoWidthColumnCheckListCtrl` - Removes need to manually call destroy on `IncompatibleAddonsDialog` - `accPropServices` needs to be cleaned up when the control is destroyed. The `Destroy` method is not called by the wx framework, but we can register to receive the event see https://github.com/wxWidgets/Phoenix/issues/630 * Allow the possibility of using a parent window other than the addon manager when installing an addon. Useful in the case of installing via a shell extension, where gui.mainframe should be the parent. - Removed coupling between the `installAddon` function and `AddonManager` class - Reduced nesting of the `installAddon` function - Moved methods to module level. These had no dependence on instance, or class level members. * Use windows sounds for addon install warning / error dialogs. * Use context manager for writing to file in `_download` of class `UpdateDownloader` in `updateCheck.py` - There were several ways that the file could fail to be closed. * Unified the way that NVDA versions / API versions are formatted to a string, added tests - One function is for outputting a full version string (including build part). - The other is for formatting a version string for the GUI (which will remove the minor part when it is zero). * Moved the regex used to convert addon manifest API versions from strings to tuples into the `addonAPIVersion` module. * No longer raise error for failed audio ducking when it failed due to "access denied" - Ensure that a warning is put in the log for access denied errors when setting audio ducking.
Author
Parents
Loading