Skip to content

Don't Save settings when shouldWriteToDisk returns False#19120

Merged
SaschaCowley merged 5 commits into
masterfrom
noSaveFromLauncher
Oct 29, 2025
Merged

Don't Save settings when shouldWriteToDisk returns False#19120
SaschaCowley merged 5 commits into
masterfrom
noSaveFromLauncher

Conversation

@SaschaCowley

@SaschaCowley SaschaCowley commented Oct 20, 2025

Copy link
Copy Markdown
Member

Link to issue number:

Resolves #18171

Summary of the issue:

Some configuration can still be written to disk when running from the launcher.

Description of user facing changes:

These configurations can no-longer be saved to disk from the launcher.

Description of developer facing changes:

None

Description of development approach:

  • Speech dictionaries: return early from speechDictHandler.SpeechDict.save if shouldWriteToDisk returns False.
  • Punctuation/symbol pronunciation: Return early from characterProcessing.SymbolPronunciations.save if shouldWriteToDisk returns False.
  • Input gestures: return early from inputCore.GlobalGestureMap.save if shouldWriteToDisk returns False.
  • Configuration profiles: Use not NVDAState.shouldWriteToDisk() rather than globalVars.appArgs.secure when deciding whether to force the config profiles dialog's new, triggers, rename and delete buttons to be disabled.
    • Create: Use not NVDAState.shouldWriteToDisk() rather than globalVars.appArgs.secure when deciding whether to return early from config.ConfigManager.createProfile.
    • Modify: Use not NVDAState.shouldWriteToDisk() rather than globalVars.appArgs.secure when deciding whether to return early from config.ConfigManager.saveProfileTriggers.
    • Rename: Use not NVDAState.shouldWriteToDisk() rather than globalVars.appArgs.secure when deciding whether to return early from config.ConfigManager.renameProfile.
    • Delete: Use not NVDAState.shouldWriteToDisk() rather than globalVars.appArgs.secure when deciding whether to return early from config.ConfigManager.deleteProfile.

Testing strategy:

Speech dictionaries:

  • Build a launcher.
  • Run the launcher, and ensure that existing speech dictentries work as expected.
  • Add a newentry and press Ok.
  • Ensure the new entry works as expected.
  • Restart NVDA, and ensure that the new entries were not persisted.

Symbol pronunciations

  • Run from source. Modify a symbol. Ensure that the new pronunciation works as expected.
  • Restart the source copy. Ensure the modification has persisted.
  • Create a launcher. Run it. Modify a symbol. Ensure that the new pronunciation works as expected.
  • Start the instaled copy of NVDA. Ensure that the modified symbol has not been persisted.

Input gestures:

  • Build a launcher.
  • Create a new gesture in the installed copy (in my case, NVDA+conrol+shift+t to report the time. Check that it works. Restart NVDA and use the gesture t ensure it has been persisted to disk.
  • Start the launcher. Use the new gesture to ensure it works in the launcher.
  • Add a new gesture (in my case, NVDA+control+shift+r to report the time. Perfor the gesture to ensure that it works as expected.
  • Check the log outpu to ensure that a message was logged about gestures not being saved.
  • Restart the installed copy. Ensure that the gesture created in the launcher copy does not work, but the gesture created in the installed copy does.

Config profiles

  • Build a launcher.
  • From the installed copy, create a new configuration profile.
  • Run the launcher. Open the config profiles dialog. Attempt to create, update or delete a profile.
  • From the NVDA Python Console, attempt to call all of config.conf.createProfile, config.conf.renameProfile, config.conf.deleteProfile, and config.conf.saveProfileTriggers. Observe the log to ensre the functions return early.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@SaschaCowley SaschaCowley changed the title Don't write settings whe shouldWriteToDisk returns False Don't Save settings when shouldWriteToDisk returns False Oct 20, 2025
@SaschaCowley SaschaCowley added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Oct 21, 2025
@SaschaCowley SaschaCowley marked this pull request as ready for review October 29, 2025 07:00
@SaschaCowley SaschaCowley requested a review from a team as a code owner October 29, 2025 07:00
@SaschaCowley SaschaCowley merged commit 9c44dd5 into master Oct 29, 2025
29 checks passed
@SaschaCowley SaschaCowley deleted the noSaveFromLauncher branch October 29, 2025 23:25
@github-actions github-actions Bot added this to the 2026.1 milestone Oct 29, 2025
bramd pushed a commit to bramd/nvda that referenced this pull request Nov 11, 2025
)

Resolves nvaccess#18171

### Summary of the issue:

Some configuration can still be written to disk when running from the
launcher.

### Description of user facing changes:

These configurations can no-longer be saved to disk from the launcher.

### Description of developer facing changes:

None

### Description of development approach:

* [x] Speech dictionaries: return early from
`speechDictHandler.SpeechDict.save` if `shouldWriteToDisk` returns
`False`.
* [x] Punctuation/symbol pronunciation: Return early from
`characterProcessing.SymbolPronunciations.save` if `shouldWriteToDisk`
returns `False`.
* [x] Input gestures: return early from
`inputCore.GlobalGestureMap.save` if `shouldWriteToDisk` returns
`False`.
* [x] Configuration profiles: Use `not NVDAState.shouldWriteToDisk()`
rather than `globalVars.appArgs.secure` when deciding whether to force
the config profiles dialog's new, triggers, rename and delete buttons to
be disabled.
* [x] Create: Use `not NVDAState.shouldWriteToDisk()` rather than
`globalVars.appArgs.secure` when deciding whether to return early from
`config.ConfigManager.createProfile`.
* [x] Modify: Use `not NVDAState.shouldWriteToDisk()` rather than
`globalVars.appArgs.secure` when deciding whether to return early from
`config.ConfigManager.saveProfileTriggers`.
* [x] Rename: Use `not NVDAState.shouldWriteToDisk()` rather than
`globalVars.appArgs.secure` when deciding whether to return early from
`config.ConfigManager.renameProfile`.
* [x] Delete: Use `not NVDAState.shouldWriteToDisk()` rather than
`globalVars.appArgs.secure` when deciding whether to return early from
`config.ConfigManager.deleteProfile`.

### Testing strategy:

#### Speech dictionaries:

* Build a launcher.
* Run the launcher, and ensure that existing speech dictentries work as
expected.
* Add a newentry and press Ok.
* Ensure the new entry works as expected.
* Restart NVDA, and ensure that the new entries were not persisted.

#### Symbol pronunciations

* Run from source. Modify a symbol. Ensure that the new pronunciation
works as expected.
* Restart the source copy. Ensure the modification has persisted.
* Create a launcher. Run it. Modify a symbol. Ensure that the new
pronunciation works as expected.
* Start the instaled copy of NVDA. Ensure that the modified symbol has
not been persisted.

#### Input gestures:

* Build a launcher.
* Create a new gesture in the installed copy (in my case,
`NVDA+conrol+shift+t` to report the time. Check that it works. Restart
NVDA and use the gesture t ensure it has been persisted to disk.
* Start the launcher. Use the new gesture to ensure it works in the
launcher.
* Add a new gesture (in my case, `NVDA+control+shift+r` to report the
time. Perfor the gesture to ensure that it works as expected.
* Check the log outpu to ensure that a message was logged about gestures
not being saved.
* Restart the installed copy. Ensure that the gesture created in the
launcher copy does not work, but the gesture created in the installed
copy does.

#### Config profiles

* Build a launcher.
* From the installed copy, create a new configuration profile.
* Run the launcher. Open the config profiles dialog. Attempt to create,
update or delete a profile.
* From the NVDA Python Console, attempt to call all of
`config.conf.createProfile`, `config.conf.renameProfile`,
`config.conf.deleteProfile`, and `config.conf.saveProfileTriggers`.
Observe the log to ensre the functions return early.

### Known issues with pull request:

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not allow to save some settings to disk while running NVDA from the installer

3 participants