-
-
Notifications
You must be signed in to change notification settings - Fork 679
Avoid a situation where no NVDA modifier key is defined #14528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
See test results for failed build of commit e3c1c5a506 |
…through startup dialog and remove unneeded imports.
See test results for failed build of commit 2f93e756b8 |
See test results for failed build of commit 7ac0f5ad22 |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd I have addressed all the review comments. However I have raised a new question while addressing the review. Please answer before merging. Thanks. |
Yes, this is a good idea. Suggest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if I missed any other questions
Yes please, your feedback to this comment in
|
I agree, remove the parameter in this PR. |
I have addressed the parameter issue and implemented the deprecation. I have also updated the initial description's change log with the deprecation info. The PR is ready to review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
…bels displayed in the user's language (#14658) Fixes #14657 Summary of the issue: In pull request #14528 keyLabels were imported pretty early during NVDA's startup. Since this module contains localized strings at the module level these are translated before languageHandler is initialized. This means that they're translated either to the default language of the system, or for locales for which Python's locale.getdefaultlocale fails they remain in English, disregarding the language set in preferences. Description of user facing changes Key labels are once again presented in the language set in preferences. Description of development approach keyLabels are imported lazily in the configFlags I've added docstring to the keyLabels module explaining when it can be safely imported. Testing strategy: On a English Windows set NVDA's language to Polish, ensured that key labels in the keyboard help and in the preferences are displayed in Polish.
Link to issue number:
Fixes #14527
May be considered a follow-up of #14233.
Summary of the issue:
When configuring NVDA Modifier Key for a non-default profile and for the default profile, we can end-up with no NVDA key defined at all in the non-default profile (see #14527 for detailed steps).
This is due to the fact that the config stores one item per NVDA key but that there is a dependency between these values to honor the requirement that at least one key should be defined as NVDA key. These values are checked when changing NVDA keys via the GUI. But the requirement may be missed when switching profiles and stacking their configurations.
There is also a second scenario allowing to have no NVDA key defined using only default profile:
This scenario is quite unlikely but there is no check in NVDA startup dialog to prevent such situation.
Description of user facing changes
Situations where no NVDA key is defined will not be possible anymore.
Description of development approach
During the dev, I have had to import key labels (via the config flag) early during NVDA startup. This has caused issues since
pgettext
was not yet defined at this moment. I have tried to fix this; but please double-check it because I do not know very well this part of the code and why gettext translations need to be initialized two times during NVDA startup.Note: with this PR,
keyboardHandler.SUPPORTED_NVDA_MODIFIER_KEY
is not used anymore in NVDA's code. Should I deprecate it?Testing strategy:
Manual tests:
nvda.ini
Unit tests:
Known issues with pull request:
None
Change log entries:
Bug fixes
When configuring NVDA it will be ensured that at least one key is defined as NVDA key in any situation. (#14527)
Deprecation:
keyboardHandler.SUPPORTED_NVDA_MODIFIER_KEYS is deprecated with no direct replacement. Consider using the class config.configFlags.NVDAKey instead. (#14528)
API breaking changes:
In the configuration, the following keys have been removed from the
[keyboard]
section: useCapsLockAsNVDAModifierKey, useNumpadInsertAsNVDAModifierKey, useExtendedInsertAsNVDAModifierKey. They are replaced by NVDAModifierKeys. (Avoid a situation where no NVDA modifier key is defined #14528)Code Review Checklist: