Option to configure when the error sound may be played.#12689
Conversation
See test results for failed build of commit 07328b1303 |
Co-authored-by: Łukasz Golonka <lukasz.golonka@mailbox.org>
|
I have checked context help on the appVeyor artifact. And I have addressed @lukaszgo1's comments (thanks Lukasz for the review). |
|
Looking at this again would it be possible to move the code which is responsible for determining if the error sound should play into a separate method/function? It would allow add-on developers / power users to monkey patch just a single function rather than the entire |
Done. |
While modifying this part of code, let's make critical error sound playing asynchronous - allows to spare a few seconds in the code execution. Thanks @LeonarddeR for suggestion. Co-authored-by: Leonard de Ruijter <leonardder@users.noreply.github.com>
|
This PR is ready again. @feerrenrut you may want to review this one since you gave indications in #12672 (comment). |
feerrenrut
left a comment
There was a problem hiding this comment.
The only thing that concerns me is the async sound playing. It is probably fine, and I'm happy for this to get some testing on alpha. But if there is an issue, we'll need to revert that aspect.
I won't merge this immediately, to give others a chance to review.
Fix-up of #12689. Summary of the issue: When pressing "Restore defaults" button in advanced settings panel, the option "Play a sound for logged errors" is not restored. Description of user facing changes Pressing "Restore defaults" in adv settings panel now restores all the options of this panel. Description of development approach Added self.playErrorSoundCombo in restoreToDefaults and haveConfigDefaultsBeenRestored functions where it was missing. Also reordered the statements in these two functions to match the advanced settings panel layout (tab order) so that checking all the items be more easy.
Link to issue number:
#12672
Summary of the issue:
The error sound that is played in test versions may also be useful to testers on stable and RC releases.
The motivation to have this feature included in NVDA's core rather than in an add-on is that it may be useful to test NVDA stable versions with add-ons disabled.
Description of how this pull request fixes the issue:
Added a 'Play a sound for logged errors' option in the advanced settings panel. It is a combo-box with two choices:
According to the discussion in Have a way to configure beep on error #12672, I do not provide an option to disable error sounds in tests versions, since test versions are aimed to capture potential issues. Thus error notifications should not be disabled for this usage.
If an error occurs before the config is initialized, the default behaviour is applied, i.e. the error sound is played only in test versions.
Note for reviewers:
handlemethod rather than at the top of the module since NVDA could not start in the latter case. I do not know why however, since I do not know anymore how to debug this since the virtual environment has been set up.Additional modification:
While working on this part of the code, I have made the critical error sound played asynchronously upon @LeonarddeR's suggestion. It should allow to spare 2-3 seconds (the time of the error sound) in the code execution time.
NV Access, if you prefer not to include this modification for whatever reason, I or you may revert this commit.
Testing strategy:
Manual testing:
Triggered an error in the 4 following situations and checked that the error sound is played for the 3 first ones and not the last one:
The stable version is simulated running NVDA from source with this branch and entering the 2 following lines in the Python console:
The error is triggered by trying to enable the screen curtain while Windows Magnifier is enabled with color inversion activated. But many other ways could have been used.
I will also check context help on the snapshot generated by appVeyor.
Known issues with pull request:
If an error occurs before the config is initialized, the default behaviour is applied, i.e. the error sound is played only in test versions whatever the value of this option is in the config.
Change log entries:
New features (or Changes? Or For developers?)
It is now possible to configure the error sound to be played in any version of NVDA, not only in test versions. (#12672)
Code Review Checklist: