Skip to content
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

Improve accessibility #1308

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9602552
pytest: add configuration
benoit-pierre May 20, 2021
f7af10d
tox: use pytest directly
benoit-pierre May 20, 2021
0f509b4
ci: use pytest directly
benoit-pierre May 20, 2021
aa12d59
setup: drop custom test command
benoit-pierre May 20, 2021
6446f29
build_utils/setup: drop custom test command
benoit-pierre May 20, 2021
22dfb93
test: add support for `gui_qt` tests
benoit-pierre May 20, 2021
0449fab
config: tweak `DictionaryConfig.__repr__`
benoit-pierre May 20, 2021
a1b621e
gui_qt/dictionaries: rework widget
benoit-pierre May 20, 2021
d5447a9
gui_qt/main_window: minor cleanup
benoit-pierre May 22, 2021
2b22bfd
gui_qt/dictionaries: tweak context menu
benoit-pierre May 22, 2021
9cd7e7a
gui_qt/dictionaries: tweak code to make testing easier
benoit-pierre May 23, 2021
65244d6
tests: add some tests for the dictionaries widget
benoit-pierre May 23, 2021
9284cca
add news entry
benoit-pierre May 23, 2021
d3035be
gui_qt: disable tab-key navigation inside tables
user202729 Apr 30, 2021
88339b3
gui_qt/config: improve accessibility
benoit-pierre Apr 30, 2021
9e69c8e
gui_qt/config: fix tab-key navigation
benoit-pierre Apr 30, 2021
1d66b41
gui_qt/config: minor cleanup
benoit-pierre Apr 30, 2021
e8213cd
gui_qt/main_window: improve accessibility
benoit-pierre May 2, 2021
14dc834
gui_qt/config_serial: improve accessibility
benoit-pierre May 4, 2021
7e3d018
gui_qt/config_log: improve accessibility
benoit-pierre May 8, 2021
c79a854
gui_qt/config_keyboard: improve accessibility
benoit-pierre May 8, 2021
06018d5
gui_qt/config: improve keyboard navigation
benoit-pierre May 8, 2021
0818b39
gui_qt/dictionary_editor: improve accessibility
benoit-pierre May 8, 2021
3fba7e4
gui_qt/add_translation: improve accessibility
benoit-pierre May 8, 2021
8cc97f0
gui_qt/paper_tape: improve accessibility
benoit-pierre May 12, 2021
0aa6a86
gui_qt/lookup: improve accessibility
benoit-pierre May 12, 2021
cc794c2
gui_qt/suggestions_widget: simplify implementation
benoit-pierre May 10, 2021
8ee99f4
gui_qt/paper_tape: fix missing translation
benoit-pierre May 10, 2021
dce77da
gui_qt/suggestions_widget: improve accessibility
benoit-pierre May 12, 2021
894791e
gui_qt/suggestions: improve accessibility
benoit-pierre May 12, 2021
52d47f3
gui_qt/dictionaries: improve accessibility
benoit-pierre May 23, 2021
83dcb84
i18n: update main translations catalog
benoit-pierre May 10, 2021
247d4ea
add news entry
benoit-pierre May 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 97 additions & 19 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion .github/workflows/ci/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ list_cache()

run_tests()
{
"$python" setup.py -q test -- --color=yes --durations=5 -ra "$@"
test_cmd=(env QT_QPA_PLATFORM=offscreen "$python" -m pytest --color=yes --durations=5 "$@")
run "$python" setup.py -q egg_info
info "$(printf "%q " "${test_cmd[@]}")"
"${test_cmd[@]}"
}

setup_cache_name()
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci/skiplist_job_build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.github/workflows/ci/skiplist_job_test.txt
.github/workflows/ci/skiplist_job_test_packaging.txt
.github/workflows/ci/skiplist_job_test*.txt
.gitignore
pyproject.toml
reqs/packaging.txt
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci/skiplist_job_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.github/workflows/ci/skiplist_job_build.txt
.github/workflows/ci/skiplist_job_test_gui_qt.txt
.github/workflows/ci/skiplist_job_test_packaging.txt
.gitignore
LICENSE.txt
Expand All @@ -13,5 +14,6 @@ reqs/build.txt
reqs/dist_*.txt
reqs/packaging.txt
reqs/setup.txt
test/gui_qt/*
windows/*
{EOF}
16 changes: 16 additions & 0 deletions .github/workflows/ci/skiplist_job_test_gui_qt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.github/workflows/ci/skiplist_job_build.txt
.github/workflows/ci/skiplist_job_test.txt
.github/workflows/ci/skiplist_job_test_packaging.txt
.gitignore
LICENSE.txt
linux/*
MANIFEST.in
osx/*_resources
osx/make_app.sh
pyproject.toml
reqs/build.txt
reqs/packaging.txt
reqs/setup.txt
test/test_*
windows/*
{EOF}
2 changes: 1 addition & 1 deletion .github/workflows/ci/skiplist_job_test_packaging.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.github/workflows/ci/skiplist_job_build.txt
.github/workflows/ci/skiplist_job_test.txt
.github/workflows/ci/skiplist_job_test*.txt
.github/workflows/ci/skiplist_os_*.txt
reqs/build.txt
reqs/release.txt
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci/workflow_context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
type: test
reqs: ['dist', 'test']
skiplists: ['job_test', 'os_linux']
test_args: -p no:pytest-qt --ignore=test/gui_qt
- <<: *test
<<: *dist_macos
cache_extra_deps: ['osx/deps.sh']
Expand All @@ -61,6 +62,14 @@ jobs:
variant: Python 3.9
python: '3.9'

# Qt GUI tests.
- <<: *test
type: test_gui_qt
variant: Qt GUI
reqs: ['dist', 'dist_extra_gui_qt', 'test']
skiplists: ['job_test_gui_qt']
test_args: test/gui_qt

# Packaging tests.
- <<: *dist_other
type: test_packaging
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci/workflow_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@ jobs:
<% endif %>

<% endif %>
<% if j.type == 'test' %>
<% if j.type == 'test_gui_qt' %>
- name: Build UI
run: python setup.py build_ui

<% endif %>
<% if j.type in ['test', 'test_gui_qt'] %>
# Test {{{

- name: Run tests
run: run_tests
run: run_tests <@ j.test_args @>


# }}}

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ include plover/messages/*/LC_MESSAGES/*.po
include plover/messages/plover.pot
include plover_build_utils/*.sh
include pyproject.toml
include pytest.ini
include reqs/*.txt
include test/__init__.py
include test/conftest.py
include test/gui_qt/test_*.py
include tox.ini
include windows/*
# Exclude: CI/Git/GitHub specific files,
Expand Down
4 changes: 4 additions & 0 deletions news.d/api/1332.break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The custom `test` command implementation provided by `plover_build_utils.setup.Test` has been removed:
- support for it on setuptools' side has been deprecated since version 41.5.0
- the custom handling of arguments conflicts with the use of some pytest options (e.g. `-m MARKEXPR`)
- the workaround for pytest cache handling is not necessary anymore
6 changes: 6 additions & 0 deletions news.d/feature/1308.ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Improve accessibility:
- Disable tag-key navigation in tables, so focusing a table does not lock global tab-key navigation to it.
- Remove some container widget, tweak focus rules to avoid extra unnecessary steps when using tab-key navigation (like selecting the dictionaries widget outer frame).
- In form layouts, link each widget to its label (like each option in the configuration dialog).
- Set the accessible name / description of focusable widgets.
- Use lists for the dictionaries widget, suggestions widget, and the paper tape.
6 changes: 6 additions & 0 deletions news.d/feature/1332.ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Improve accessibility:
- Disable tag-key navigation in tables, so focusing a table does not lock global tab-key navigation to it.
- Remove some container widget, tweak focus rules to avoid extra unnecessary steps when using tab-key navigation (like selecting the dictionaries widget outer frame).
- In form layouts, link each widget to its label (like each option in the configuration dialog).
- Set the accessible name / description of focusable widgets.
- Use lists for the dictionaries widget, suggestions widget, and the paper tape.
3 changes: 3 additions & 0 deletions plover/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def replace(self, **kwargs):
def from_dict(d):
return DictionaryConfig(**d)

def __repr__(self):
return 'DictionaryConfig(%r, %r)' % (self.short_path, self.enabled)


ConfigOption = namedtuple('ConfigOption', '''
name default
Expand Down
68 changes: 48 additions & 20 deletions plover/gui_qt/add_translation_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
</property>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Dictionary:</string>
</property>
<property name="buddy">
<cstring>dictionary</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
Expand All @@ -42,6 +52,9 @@
<property name="text">
<string>Strokes:</string>
</property>
<property name="buddy">
<cstring>strokes</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
Expand All @@ -52,6 +65,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Strokes</string>
</property>
</widget>
</item>
<item row="2" column="0">
Expand All @@ -65,6 +81,9 @@
<property name="text">
<string>Translation:</string>
</property>
<property name="buddy">
<cstring>translation</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
Expand All @@ -75,17 +94,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Dictionary:</string>
<property name="accessibleName">
<string>Translation</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="dictionary">
<property name="accessibleName">
<string>Dictionary</string>
</property>
<property name="accessibleDescription">
<string>Select the target dictionary for the new translation.</string>
</property>
<property name="editable">
<bool>false</bool>
</property>
Expand All @@ -94,51 +115,58 @@
</layout>
</item>
<item>
<widget class="QLabel" name="strokes_info">
<widget class="QTextEdit" name="strokes_info">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Existing mappings (strokes)</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="text" stdset="0">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="translation_info">
<widget class="QTextEdit" name="translation_info">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Existing mappings (translations)</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="text" stdset="0">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>strokes</tabstop>
<tabstop>translation</tabstop>
<tabstop>strokes_info</tabstop>
<tabstop>translation_info</tabstop>
<tabstop>dictionary</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
Expand Down
15 changes: 14 additions & 1 deletion plover/gui_qt/config_file_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="path"/>
<widget class="QLineEdit" name="path">
<property name="accessibleName">
<string>Log file path.</string>
</property>
<property name="accessibleDescription">
<string>Path to the log file.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
Expand All @@ -31,6 +38,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Browse.</string>
</property>
<property name="accessibleDescription">
<string>Open a file picker to select the log file.</string>
</property>
<property name="text">
<string>Browse</string>
</property>
Expand Down
Loading