Currently, output/input braille tables list shows the list of braille tables based on the order found in braille.TABLES tuple. Although it allows one to reassign braille tables via a simple index operations, it might be more desirable to allow users to go through all tables in sorted order (for example, going from English to French as opposed to English and then Spanish).
To achieve this, a new dictionary named "tables" will be used to replace two lists, with the key being the name of the table and value being filenames. For example, BrailleSettingsDialog.tables["English (U.S.) grade 1"] points to "en-us-g1.ctb".
When loading table names, sort tables.keys.
For OK button handler, look up table names.GetStringSelection and assign the value found for this key.
If this is working for output tables, input tables presentation will be modified accordingly.
How about non-English locales? We can take advantage of the fact that Python is aware of Unicode, hence one can sort using this.
Is current approach acceptable? When one wishes to look at tables loaded with no regard to ordering, yes, as current method displays table names in the order they are declared in the braille module. The sorting part is handy if one wishes to browse through tables in a sorted order, similar to list of braille displays and synthesizers.
GetStringSelection versus GetSelection: GetStringSelection is better in that we can use it as the key to the dictionary. Using GetSelection means looking up the string once more based on its index.
The text was updated successfully, but these errors were encountered:
I remember @Dkager has made major changes to the way braille
table references are stored in #3304. There's also a needs code
review on #3304 which I think might be good to finish before
working on this.
@Dkager: your thoughts?
…ues #2439, #6054, #6113, #6935)
Beyond the main code in brailleInput to support uncontracted/contracted input, this includes the following changes:
* The list of braille tables has been moved out of the braille module into a separate brailleTables module. Braille tables are now added with a function rather than directly adding them to the data structure. Aside from being necessary in order to specify and check whether a table is contracted, this also makes the data about tables more extensible in future.
* As the data structure for braille tables has now changed and is no longer ordered, this was a good opportunity to sort the list of tables alphabetically when displaying them to the user.
* Updated to liblouis master shortly after release 3.2.0. The post 3.2.0 commits include some important back-translation fixes for UEB.
* brailleInput is now notified when reverting config or changing config profiles. This is necessary because brailleInput now maintains some state when the input table is changed.
* brailleInput is now initialised before braille at startup. This is because braille depends on brailleInput to get the currently untranslated input.
* Dot7 and dot8 are now universally bound to braille input specific scripts for erase and enter. Any braille display drivers that had bindings for backspace/enter for braille input have been adjusted accordingly.
* In the User Guide, a "Braille" section has been added above "Application Specific Features". The "Braille Control Types and States" section has been moved to a sub-section of this, and a sub-section on Braille Input has been added.
* Added a Unicode braille input table.