Home GnuPG

qt: Improve accessibility when entering new password

Description

qt: Improve accessibility when entering new password

* qt/pinentrydialog.h (PinEntryDialog): Change type of field
mRepeatError from QString to QLabel*.
* qt/pinentrydialog.cpp (PinEntryDialog::PinEntryDialog): Initialize
mRepeatError. Add widget for "entered passwords do not match"
error. Do not make the Ok button the default button. Connect to
returnPressed signal of (first) password input field.
(PinEntryDialog::focusChanged): Update default state of Ok button.
(PinEntryDialog::textChanged): Remove code disabling the Ok button
and setting a tooltip.
(PinEntryDialog::setRepeatErrorText): Set text of "entered passwords
do not match" widget.
(PinEntryDialog::onAccept): Show error if entered passwords do not
match.

Accessibility when asking for a new password is improved by:

  • Move focus from first password input field to second password input

field when Return is pressed while first password input field has
focus. Previously, nothing happened (unless first and second password
matched).

  • Show an error notification, if entered passwords do not match,

instead of disabling the Ok button and setting a tooltip.

If the platform requested accessibility information, then we use a
more intrusive message box for notifying the user that the entered
passwords do not match. This is a workaround because at least the
GNOME screen reader ignores the warning label that we make visible.
It also ignores our other warning labels, so this is probably only
a temporary workaround.

Details

Provenance
ikloeckerAuthored on Aug 9 2021, 9:57 AM
Parents
rPe5d4738a76b4: qt: Mask caps lock toggle bit on windows
Branches
Unknown
Tags
Unknown
Tasks
T5543: pinentry-qt: Accessibility switch to repeat on enter