Don't Save settings when shouldWriteToDisk returns False#19120
Merged
Conversation
9512767 to
1cdd88a
Compare
michaelDCurran
approved these changes
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
speechDictHandler.SpeechDict.saveifshouldWriteToDiskreturnsFalse.characterProcessing.SymbolPronunciations.saveifshouldWriteToDiskreturnsFalse.inputCore.GlobalGestureMap.saveifshouldWriteToDiskreturnsFalse.not NVDAState.shouldWriteToDisk()rather thanglobalVars.appArgs.securewhen deciding whether to force the config profiles dialog's new, triggers, rename and delete buttons to be disabled.not NVDAState.shouldWriteToDisk()rather thanglobalVars.appArgs.securewhen deciding whether to return early fromconfig.ConfigManager.createProfile.not NVDAState.shouldWriteToDisk()rather thanglobalVars.appArgs.securewhen deciding whether to return early fromconfig.ConfigManager.saveProfileTriggers.not NVDAState.shouldWriteToDisk()rather thanglobalVars.appArgs.securewhen deciding whether to return early fromconfig.ConfigManager.renameProfile.not NVDAState.shouldWriteToDisk()rather thanglobalVars.appArgs.securewhen deciding whether to return early fromconfig.ConfigManager.deleteProfile.Testing strategy:
Speech dictionaries:
Symbol pronunciations
Input gestures:
NVDA+conrol+shift+tto report the time. Check that it works. Restart NVDA and use the gesture t ensure it has been persisted to disk.NVDA+control+shift+rto report the time. Perfor the gesture to ensure that it works as expected.Config profiles
config.conf.createProfile,config.conf.renameProfile,config.conf.deleteProfile, andconfig.conf.saveProfileTriggers. Observe the log to ensre the functions return early.Known issues with pull request:
None.
Code Review Checklist: