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.
- GnuPG-bug-id: T5543