Integrate basic braille viewer#10173
Conversation
Missing super call on AutoPropertyObject children no longer causes failure for CachedGetter properties. Previously a class that inherits from AutoPropertyObject and forgot to call super in the __init__ function, would result in a failure for CachedGetter properties.
…ewer This implementation of brailleViewerTool relies on #7833 being fixed
Callbacks inform the dependents of brailleViewer of creation and destruction.
…magic properties, as it causes issues
…i7788-integrateBrailleViewer
This reverts commit 2c7c4a2.
- Introduce several more unit tests. - Try to clarify intent of existing unit tests. - Add logic to allow handlers to have "required parameters". These are parameters with no default value set. - Add logic to catch and raise an exception when: - The required parameters are not supplied (either through positional args or keyword args) - The handler does not accept enough positional args.
Merge remote-tracking branch 'origin/pr/8208' into i7788-integrateBrailleViewer
Creating multiple dialogs at the same time seems to cause a crash in wx with the dialogs are destroyed.
Frame gives a taskbar icon, and an item in alt+tab menu.
The brailleViewer impl of the brailleDriver did not satisfy the requirements of the base class in lots of ways.
|
Could you have a look at the extension points I created in the braille module as part of #9917? In short:
note that in its current form, the braille viewer is very likely to conflict with how braille is handled in NVDA Remote. Both would be able to work seamlessly with these extension points. |
Integrate brailleviewer into braille.handler, displaySize and enabled now contain logic to check for brailleViewer.
LeonarddeR
left a comment
There was a problem hiding this comment.
Apart from my comment about resizing the gui when going from no display with braille viewer (40 cells) to a display with 80 cells, this looks ok to me.
|
Why do you don't use Consolas for both lines? Consolas is much easier to read instead of Courier New. |
Rename private vars, and add more comments.
…lleViewer Conflicts: source/braille.py
|
PR introduces Flake8 errors 😲 See test results for Failed build of commit f4c73faaef |
Mostly this came down to trying to find a font that would align the braille characters with the raw text characters. At the time Courier New was the closest match I could find. I have done some further investigation on this, I think that the braille was always falling back to using Segoe UI font. Instead, I have included a custom font, which has a monospace variation with Braille symbol support. This font, "Free mono", had some it's own issues with braille symbols, but being GPL3 I was able to modify and fix them. Because we are using the same monospace font for both the braille and the raw text, the widths of the characters will match, reducing the number of things that will make them out of alignment. There is still the problem of cells used to indicate numbers or capitals (excuse my ignorance of terminology here please), but I think these should be left as a problem to solve another day. @LeonarddeR @JulienCochuyt I think I have fixed the issues with changing the number of cells now. If you are able to test this again please? I would like to merge this next week. |
LeonarddeR
left a comment
There was a problem hiding this comment.
I think overall, this looks ok.
Re alligning the braille dots with the text, this shouldn't be that difficult when using brailleToRawPos and rawToBraillePos properly. Makes sense to do that in a follow up pr, though
onBrailleViewerChangedState relies on the frame.sysTrayIcon member variable which we are in the process of constructing. Instead, we can just set the checked state at construction time based on whether the brailleViewer is active rather than using the callback.
Link to issue number:
#7788
Summary of the issue:
Having a braille viewer tool integrated into NVDA is quite helpful for developers who wish to test with braille but do not have a braille device. This tool may also be useful when two people are using a computer, one with braille and one sighted (for instance a parent, reading with their child)
Description of how this pull request fixes the issue:
Introduces a simple braille viewer tool.
Testing performed:
Tested permutations of:
As per #7788 (comment) tested an empty message no longer results in an error.
Not tested
Using the brailleViewer in conjunction with another display. I expect this to work, and the output should match.
Known issues with pull request:
Scrolling gestures (braille_scroll_forward, braille_scroll_back) must be set manually, there are no buttons in the GUI to do this. Scrolling with buttons on the GUI will be quite a lot of work and won't be covered in this PR.
Routing is not supported, for similar reasons to buttons on the GUI for scrolling.
Change log entry:
New features: