diff --git a/source/braille.py b/source/braille.py index f572752f22a..c4583cbc41c 100644 --- a/source/braille.py +++ b/source/braille.py @@ -1612,6 +1612,8 @@ def _resetMessageTimer(self): """Reset the message timeout. @precondition: A message is currently being displayed. """ + if config.conf["braille"]["noMessageTimeout"]: + return # Configured timeout is in seconds. timeout = config.conf["braille"]["messageTimeout"] * 1000 if self._messageCallLater: @@ -1626,8 +1628,9 @@ def _dismissMessage(self): """ self.buffer.clear() self.buffer = self.mainBuffer - self._messageCallLater.Stop() - self._messageCallLater = None + if not config.conf["braille"]["noMessageTimeout"]: + self._messageCallLater.Stop() + self._messageCallLater = None self.update() def handleGainFocus(self, obj): diff --git a/source/config/configSpec.py b/source/config/configSpec.py index 5735b7c89f1..55376506f5f 100644 --- a/source/config/configSpec.py +++ b/source/config/configSpec.py @@ -57,6 +57,7 @@ cursorBlink = boolean(default=true) cursorBlinkRate = integer(default=500,min=200,max=2000) cursorShape = integer(default=192,min=1,max=255) + noMessageTimeout = boolean(default=false) messageTimeout = integer(default=4,min=0,max=20) tetherTo = string(default="focus") readByParagraph = boolean(default=false) diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index d3a7442fd2c..6605645c6f1 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -1562,11 +1562,19 @@ def makeSettings(self, settingsSizer): self.shapeList.Disable() # Translators: The label for a setting in braille settings to change how long a message stays on the braille display (in seconds). - messageTimeoutText = _("Message timeout (sec)") + messageTimeoutText = _("Message &timeout (sec)") self.messageTimeoutEdit = sHelper.addLabeledControl(messageTimeoutText, nvdaControls.SelectOnFocusSpinCtrl, min=int(config.conf.getConfigValidationParameter(["braille", "messageTimeout"], "min")), max=int(config.conf.getConfigValidationParameter(["braille", "messageTimeout"], "max")), initial=config.conf["braille"]["messageTimeout"]) + if self.noMessageTimeoutCheckBox.GetValue(): + self.messageTimeoutEdit.Disable() + + # Translators: The label for a setting in braille settings to display a message on the braille display indefinitely. + noMessageTimeoutLabelText = _("No &message timeout") + self.noMessageTimeoutCheckBox = sHelper.addItem(wx.CheckBox(self, label=noMessageTimeoutLabelText)) + self.noMessageTimeoutCheckBox.Bind(wx.EVT_CHECKBOX, self.onNoMessageTimeoutChange) + self.noMessageTimeoutCheckBox.SetValue(config.conf["braille"]["noMessageTimeout"]) # Translators: The label for a setting in braille settings to set whether braille should be tethered to focus or review cursor. tetherListText = _("Braille tethered to:") @@ -1611,6 +1619,7 @@ def onOk(self, evt): config.conf["braille"]["cursorBlink"] = self.cursorBlinkCheckBox.GetValue() config.conf["braille"]["cursorBlinkRate"] = self.cursorBlinkRateEdit.GetValue() config.conf["braille"]["cursorShape"] = self.cursorShapes[self.shapeList.GetSelection()] + config.conf["braille"]["noMessageTimeout"] = self.noMessageTimeoutCheckBox.GetValue() config.conf["braille"]["messageTimeout"] = self.messageTimeoutEdit.GetValue() braille.handler.tether = self.tetherValues[self.tetherList.GetSelection()][0] config.conf["braille"]["readByParagraph"] = self.readByParagraphCheckBox.Value @@ -1650,6 +1659,9 @@ def onShowCursorChange(self, evt): def onBlinkCursorChange(self, evt): self.cursorBlinkRateEdit.Enable(evt.IsChecked()) + def onNoMessageTimeoutChange(self, evt): + self.messageTimeoutEdit.Enable(not evt.IsChecked()) + class AddSymbolDialog(wx.Dialog): def __init__(self, parent): diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index 79017101f80..8035b00ab78 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -931,6 +931,9 @@ The selection indicator is not affected by this option. This option is a numerical field that controls how long NVDA messages are displayed on the braille display. Specifying 0 disables displaying of these messages completely. +==== No Message Timeout ==== +This option allows NVDA messages to be displayed on the braille display indefinitely. + %kc:setting ==== Braille Tethered to ====[BrailleTether] Key: NVDA+control+t