Skip to content

Commit

Permalink
FIX(a11y): Make message type settings accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Jan 7, 2024
1 parent e80958a commit 85f7370
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/mumble/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ LogConfig::LogConfig(Settings &st) : ConfigWidget(st) {
qtwMessages->header()->setSectionResizeMode(ColMessageLimit, QHeaderView::ResizeToContents);
qtwMessages->header()->setSectionResizeMode(ColStaticSound, QHeaderView::ResizeToContents);

qtwMessages->headerItem()->setData(ColMessage, Qt::AccessibleTextRole, tr("Message type"));
qtwMessages->headerItem()->setData(ColConsole, Qt::AccessibleTextRole, tr("Log message to console checkbox"));
qtwMessages->headerItem()->setData(ColNotification, Qt::AccessibleTextRole, tr("Display pop-up notification for message checkbox"));
qtwMessages->headerItem()->setData(ColHighlight, Qt::AccessibleTextRole, tr("Highlight window for message checkbox"));
qtwMessages->headerItem()->setData(ColTTS, Qt::AccessibleTextRole, tr("Read message using text to speech checkbox"));
qtwMessages->headerItem()->setData(ColMessageLimit, Qt::AccessibleTextRole, tr("Limit message notification if user count is high checkbox"));
qtwMessages->headerItem()->setData(ColStaticSound, Qt::AccessibleTextRole, tr("Play sound file for message checkbox"));
qtwMessages->headerItem()->setData(ColStaticSoundPath, Qt::AccessibleTextRole, tr("Path to sound file"));

// Add a "All messages" entry
allMessagesItem = new QTreeWidgetItem(qtwMessages);
allMessagesItem->setText(ColMessage, QObject::tr("All messages"));
Expand Down Expand Up @@ -331,6 +340,10 @@ void LogConfig::on_qtwMessages_itemChanged(QTreeWidgetItem *i, int column) {
}
}
}

if (column != ColMessage && column != ColStaticSoundPath) {
i->setData(column, Qt::AccessibleDescriptionRole, i->checkState(column) == Qt::Checked ? tr("checked") : tr("unchecked"));
}
}

void LogConfig::on_qtwMessages_itemClicked(QTreeWidgetItem *item, int column) {
Expand Down
10 changes: 9 additions & 1 deletion src/mumble/Log.ui
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QTreeWidget" name="qtwMessages">
<widget class="MultiColumnTreeWidget" name="qtwMessages">
<property name="accessibleName">
<string>Log message types and actions</string>
</property>
<property name="accessibleDescription">
<string>Use up and down keys to navigate through the message types. Use left and right keys to navigate between notification possibilities for a single message type.</string>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
Expand Down Expand Up @@ -539,6 +542,11 @@ The setting only applies for new messages, the already shown ones will retain th
<extends>QSlider</extends>
<header>widgets/SemanticSlider.h</header>
</customwidget>
<customwidget>
<class>MultiColumnTreeWidget</class>
<extends>QTreeWidget</extends>
<header>widgets/MultiColumnTreeWidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>qtwMessages</tabstop>
Expand Down

0 comments on commit 85f7370

Please sign in to comment.