|
4 | 4 | # See the file COPYING for more details. |
5 | 5 | # Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Rui Batista, Joseph Lee, |
6 | 6 | # Leonard de Ruijter, Derek Riemer, Babbage B.V., Davy Kager, Ethan Holliger, Łukasz Golonka, Accessolutions, |
7 | | -# Julien Cochuyt, Jakub Lukowicz, Bill Dengler, Cyrille Bougot, Rob Meredith, Luke Davis |
| 7 | +# Julien Cochuyt, Jakub Lukowicz, Bill Dengler, Cyrille Bougot, Rob Meredith, Luke Davis, |
| 8 | +# Burman's Computer and Education Ltd. |
8 | 9 |
|
9 | 10 | import itertools |
10 | 11 | from typing import ( |
|
35 | 36 | import gui |
36 | 37 | import wx |
37 | 38 | import config |
38 | | -from config.configFlags import TetherTo |
| 39 | +from config.configFlags import ( |
| 40 | + TetherTo, |
| 41 | + ShowMessages, |
| 42 | +) |
39 | 43 | import winUser |
40 | 44 | import appModuleHandler |
41 | 45 | import winKernel |
@@ -3260,6 +3264,31 @@ def script_braille_cycleCursorShape(self, gesture): |
3260 | 3264 | # Translators: Reports which braille cursor shape is activated. |
3261 | 3265 | ui.message(_("Braille cursor %s") % shapeMsg) |
3262 | 3266 |
|
| 3267 | + @script( |
| 3268 | + # Translators: Input help mode message for toggle braille show messages command. |
| 3269 | + description=_("Cycle through the braille show messages modes"), |
| 3270 | + category=SCRCAT_BRAILLE |
| 3271 | + ) |
| 3272 | + def script_braille_cycleShowMessages(self, gesture): |
| 3273 | + """Set next state of braille show messages and reports it with ui.message.""" |
| 3274 | + values = [x.value for x in ShowMessages] |
| 3275 | + index = values.index( |
| 3276 | + config.conf["braille"]["showMessages"] |
| 3277 | + ) |
| 3278 | + newIndex = (index + 1) % len(values) |
| 3279 | + newValue = values[newIndex] |
| 3280 | + config.conf["braille"]["showMessages"] = newValue |
| 3281 | + # Translators: Reports which show braille message mode is used |
| 3282 | + # (disabled, timeout or indefinitely). |
| 3283 | + ui.message( |
| 3284 | + _( |
| 3285 | + "Braille show messages %s" |
| 3286 | + ) |
| 3287 | + % ShowMessages( |
| 3288 | + newValue |
| 3289 | + ).displayString |
| 3290 | + ) |
| 3291 | + |
3263 | 3292 | @script( |
3264 | 3293 | # Translators: Input help mode message for report clipboard text command. |
3265 | 3294 | description=_("Reports the text on the Windows clipboard"), |
|
0 commit comments