Commit a754714a authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Send state-change event if user ID is checked or unchecked

We assume that itemChanged() is emited because a user ID was checked or
unchecked. In this case, we send a state-change event for the checked
state to notify accessibility tools. Unfortunately, orca doesn't read
the checked state for already focussed objects but hopefully other
screen readers do.

GnuPG-bug-id: 6046
parent 39564c0f
......@@ -349,9 +349,9 @@ public:
mainLay->addWidget(new KSeparator{Qt::Horizontal, q});
auto listView = new ListView{q};
listView->setModel(&mUserIDModel);
mainLay->addWidget(listView, 1);
userIdListView = new ListView{q};
userIdListView->setModel(&mUserIDModel);
mainLay->addWidget(userIdListView, 1);
// Setup the advanced area
auto expander = new AnimatedExpander{i18n("Advanced"), i18n("Show advanced options"), q};
......@@ -471,7 +471,9 @@ public:
expander->setContentLayout(advLay);
connect(&mUserIDModel, &QStandardItemModel::itemChanged, q, &CertifyWidget::changed);
connect(&mUserIDModel, &QStandardItemModel::itemChanged, q, [this](QStandardItem *item) {
onItemChanged(item);
});
connect(mExportCB, &QCheckBox::toggled, [this] (bool on) {
mPublishCB->setEnabled(on);
......@@ -681,11 +683,28 @@ public:
j->start(secKey(), GpgME::Key::Ultimate);
}
void onItemChanged(QStandardItem *item)
{
Q_EMIT q->changed();
#ifndef QT_NO_ACCESSIBILITY
if (item) {
// assume that the checked state changed
QAccessible::State st;
st.checked = true;
QAccessibleStateChangeEvent e(userIdListView, st);
e.setChild(item->index().row());
QAccessible::updateAccessibility(&e);
}
#endif
}
public:
CertifyWidget *const q;
QLabel *mFprLabel = nullptr;
KeySelectionCombo *mSecKeySelect = nullptr;
KMessageWidget *mMissingOwnerTrustInfo = nullptr;
ListView *userIdListView = nullptr;
QCheckBox *mExportCB = nullptr;
QCheckBox *mPublishCB = nullptr;
QLineEdit *mTagsLE = nullptr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment