Skip to content

Add-on config: allow add-ons to respond to config save/reload/reset actions via a new extension points action #7598

@josephsl

Description

@josephsl

Hi,

For various reasons, some add-ons do not participate in Config Manager/Profiles scheme. In case of one of my add-ons, the ability to delete sections from aggregated sections is needed, while @tspivey has expressed some reservations about current approach to config profile handling.

To cater to these scenarios - especially if add-on settings are stored elsewhere, and in order to provide a possible justification for cloud-based settings, I'd like to propose adding two or three extension point actions:

  • config.saveConfig: this action will ask registered add-ons to save settings.
  • config.reloadConfig: this action will ask add-ons to reload last saved settings from disk.
  • config.resetConfig: this action will ask add-ons to reset their settings to defaults.
    Use cases:
  1. A user using Remote Support add-on has configured a lab machine to act as an always-on accessibility training workstation. After configuring server details, this user presses Control+NVDA+C to save settings, but found that the settings were not saved to disk, as they'll be saved once the configuration dialog closes or when NVDA exits.
  2. A student using an add-on that takes advantage of a future cloud settings backup service wants to load add-on settings stored on the cloud. After playing around with settings, she misconfigured an option and now would like to restore her settings from a cloud backup.

Algorithm:

  1. Similar to profile switch extension point action (see notes from @jcsteh), config.conf.save method will call config.saveConfig.notify to notify add-ons to save settings.
  2. Similarly, config.conf.reset will either call config.reloadConfig.notify or config.resetConfig.notify depending on if this is just a pure reload or a complete reset.

Impact and requirements: this proposal requires NVDA 2017.4. The impact would be greatest for add-ons that takes advantage of this.

Mitigation strategies for add-ons:

  1. Add-ons that wishes to support older NVDA releases must check for presence of extensionPoints module (import/except test).
  2. Any add-on that wishes to fully support this proposal must target NVDA 2017.4 or later to fully take advantage of this.
  3. For cloud-based settings: add-ons that stores config files on disk must be willing to deal with a possibility where settings can come from anywhere, including from a URL/JSON data, command line switches and what not.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions