Skip to content

Commit

Permalink
Incubate #6777
Browse files Browse the repository at this point in the history
Re Issue: #6669
Merge branch 'dkager-i6669' into next
  • Loading branch information
feerrenrut committed Apr 27, 2017
2 parents 468782a + 4070607 commit 01b0488
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
7 changes: 5 additions & 2 deletions source/braille.py
Expand Up @@ -1384,6 +1384,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:
Expand All @@ -1398,8 +1400,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):
Expand Down
1 change: 1 addition & 0 deletions source/config/configSpec.py
Expand Up @@ -58,6 +58,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)
Expand Down
16 changes: 14 additions & 2 deletions source/gui/settingsDialogs.py
Expand Up @@ -1605,14 +1605,22 @@ 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"])

# Translators: The label for a setting in braille settings to display a message on the braille display indefinitely.
noMessageTimeoutLabelText = _("Show &messages indefinitely")
self.noMessageTimeoutCheckBox = sHelper.addItem(wx.CheckBox(self, label=noMessageTimeoutLabelText))
self.noMessageTimeoutCheckBox.Bind(wx.EVT_CHECKBOX, self.onNoMessageTimeoutChange)
self.noMessageTimeoutCheckBox.SetValue(config.conf["braille"]["noMessageTimeout"])
if self.noMessageTimeoutCheckBox.GetValue():
self.messageTimeoutEdit.Disable()

# 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:")
tetherListText = _("B&raille tethered to:")
# Translators: The value for a setting in the braille settings, to set whether braille should be tethered to focus or review cursor.
self.tetherValues=[("focus",_("focus")),("review",_("review"))]
tetherChoices = [x[1] for x in self.tetherValues]
Expand Down Expand Up @@ -1654,6 +1662,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
Expand Down Expand Up @@ -1693,6 +1702,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):
Expand Down
3 changes: 3 additions & 0 deletions user_docs/en/userGuide.t2t
Expand Up @@ -1037,6 +1037,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.

==== Show Messages Indefinitely ====
This option allows NVDA messages to be displayed on the braille display indefinitely.

%kc:setting
==== Braille Tethered to ====[BrailleTether]
Key: NVDA+control+t
Expand Down

0 comments on commit 01b0488

Please sign in to comment.