Skip to content

Commit

Permalink
Bugfixes and blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
mltony committed Nov 1, 2018
1 parent 9e2aabb commit 69cbdab
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions addon/globalPlugins/textNav.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
import ui
import wx

f = open("C:\\users\\tony\\dropbox\\work\\1.txt", "w")
def log(s):
print >>f, str(s)
f.flush()

def myAssert(condition):
if not condition:
raise RuntimeError("Assertion failed")
Expand All @@ -44,6 +39,7 @@ def initConfiguration():
"noNextTextChimeVolume" : "integer( default=50, min=0, max=100)",
"noNextTextMessage" : "boolean( default=False)",
"speakFormatted" : "boolean( default=True)",
"applicationsBlacklist" : "string( default='audacity,')",
}
config.conf.spec["textnav"] = confspec

Expand Down Expand Up @@ -96,11 +92,17 @@ def makeSettings(self, settingsSizer):
label = _("Speak formatted text")
self.speakFormattedCheckbox = sHelper.addItem(wx.CheckBox(self, label=label))
self.speakFormattedCheckbox.Value = getConfig("speakFormatted")
# applicationsBlacklist edit
# Translators: Label for blacklisted applications edit box
self.applicationsBlacklistEdit = gui.guiHelper.LabeledControlHelper(self, _("Disable TextNav in applications (comma-separated list)"), wx.TextCtrl).control
self.applicationsBlacklistEdit.Value = getConfig("applicationsBlacklist")

def onOk(self, evt):
config.conf["textnav"]["crackleVolume"] = self.crackleVolumeSlider.Value
config.conf["textnav"]["noNextTextChimeVolume"] = self.noNextTextChimeVolumeSlider.Value
config.conf["textnav"]["noNextTextMessage"] = self.noNextTextMessageCheckbox.Value
config.conf["textnav"]["speakFormatted"] = self.speakFormattedCheckbox.Value
config.conf["textnav"]["applicationsBlacklist"] = self.applicationsBlacklistEdit.Value
super(SettingsDialog, self).onOk(evt)


Expand Down Expand Up @@ -180,7 +182,7 @@ def moveToText(self, gesture, increment, errorMsg="Error"):
textInfo.updateCaret()
self.simpleCrackle(distance, getConfig("crackleVolume"))
if getConfig("speakFormatted"):
speech.speakTextInfo(textInfo)
speech.speakTextInfo(textInfo, reason=controlTypes.REASON_CARET)
else:
speech.speakText(text)
break
Expand Down

0 comments on commit 69cbdab

Please sign in to comment.