Skip to content

Commit

Permalink
Automatic say all when a browse mode page loads has now been made opt…
Browse files Browse the repository at this point in the history
…ional via a setting in the Browse Mode settings dialog. Its currently still on by default. VirtualBuffer.event_treeInterceptor_gainFocus has been reordered a bit to make this possible. Fixes #414.
  • Loading branch information
michaelDCurran committed Sep 5, 2011
1 parent 094ca26 commit d3008b6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions source/config/__init__.py
Expand Up @@ -128,6 +128,7 @@ def validateConfig(configObj,validator,validationResult=None,keyList=None):
autoPassThroughOnFocusChange = boolean(default=true)
autoPassThroughOnCaretMove = boolean(default=false)
passThroughAudioIndication = boolean(default=true)
autoSayAllOnPageLoad = boolean(default=true)
#Settings for document reading (such as MS Word and wordpad)
[documentFormatting]
Expand Down
4 changes: 4 additions & 0 deletions source/gui/settingsDialogs.py
Expand Up @@ -695,6 +695,9 @@ def makeSettings(self, settingsSizer):
self.useScreenLayoutCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Use &screen layout (when supported)"))
self.useScreenLayoutCheckBox.SetValue(config.conf["virtualBuffers"]["useScreenLayout"])
settingsSizer.Add(self.useScreenLayoutCheckBox,border=10,flag=wx.BOTTOM)
self.autoSayAllCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Automatic &Say All on page load"))
self.autoSayAllCheckBox.SetValue(config.conf["virtualBuffers"]["autoSayAllOnPageLoad"])
settingsSizer.Add(self.autoSayAllCheckBox,border=10,flag=wx.BOTTOM)
self.layoutTablesCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Report l&ayout tables"))
self.layoutTablesCheckBox.SetValue(config.conf["documentFormatting"]["includeLayoutTables"])
settingsSizer.Add(self.layoutTablesCheckBox,border=10,flag=wx.BOTTOM)
Expand Down Expand Up @@ -726,6 +729,7 @@ def onOk(self,evt):
if newPageLines >=5 and newPageLines <=150:
config.conf["virtualBuffers"]["linesPerPage"]=newPageLines
config.conf["virtualBuffers"]["useScreenLayout"]=self.useScreenLayoutCheckBox.IsChecked()
config.conf["virtualBuffers"]["autoSayAllOnPageLoad"]=self.autoSayAllCheckBox.IsChecked()
config.conf["documentFormatting"]["includeLayoutTables"]=self.layoutTablesCheckBox.IsChecked()
config.conf["virtualBuffers"]["autoPassThroughOnFocusChange"]=self.autoPassThroughOnFocusChangeCheckBox.IsChecked()
config.conf["virtualBuffers"]["autoPassThroughOnCaretMove"]=self.autoPassThroughOnCaretMoveCheckBox.IsChecked()
Expand Down
12 changes: 7 additions & 5 deletions source/virtualBuffers/__init__.py
Expand Up @@ -633,6 +633,7 @@ def event_treeInterceptor_gainFocus(self):
This event is only fired upon entering this buffer when it was not the current buffer before.
This is different to L{event_gainFocus}, which is fired when an object inside this buffer gains focus, even if that object is in the same buffer.
"""
doSayAll=False
if not self._hadFirstGainFocus:
# This buffer is gaining focus for the first time.
# Fake a focus event on the focus object, as the buffer may have missed the actual focus event.
Expand All @@ -647,14 +648,15 @@ def event_treeInterceptor_gainFocus(self):
self.selection = self.makeTextInfo(initialPos)
speech.cancelSpeech()
reportPassThrough(self)
doSayAll=config.conf['virtualBuffers']['autoSayAllOnPageLoad']
self._hadFirstGainFocus = True

if not self.passThrough:
if doSayAll:
speech.speakObjectProperties(self.rootNVDAObject,name=True,states=True,reason=speech.REASON_FOCUS)
info=self.makeTextInfo(textInfos.POSITION_CARET)
sayAllHandler.readText(info,sayAllHandler.CURSOR_CARET)
self._hadFirstGainFocus = True

else:
# This buffer has had focus before.
if not self.passThrough:
else:
# Speak it like we would speak focus on any other document object.
speech.speakObject(self.rootNVDAObject, reason=speech.REASON_FOCUS)
info = self.selection
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -18,6 +18,7 @@
== Changes ==
- Some information displayed in braille has been abbreviated. (#1288)
- the Read active window script (NVDA+b) has been improved to filter out unuseful controls and also is now much more easy to silence. (#1499)
- Automatic say all when a browse mode document loads is now optional via a setting in the Browse Mode settings dialog. (#414)


== Bug Fixes ==
Expand Down
4 changes: 4 additions & 0 deletions user_docs/en/userGuide.t2t
Expand Up @@ -756,6 +756,10 @@ Key: NVDA+v

This option allows you to specify whether content in browse mode should place content such as links and other fields on their own line, or if it should keep them in the flow of text as it is visually shown. If the option is enabled then things will stay as they are visually shown, but if it is disabled then fields will be placed on their own line.

==== Automatic Say All on page load ====
This checkbox toggles the automatic reading of a page after it loads in browse mode.
This option is enabled by default.

==== Report layout tables ====
When disabled this option makes NVDA only report tables that contain tabular data (where it makes sense to know that this is a table).
But if enabled, NVDA will also report tables used purely for visual presentation.
Expand Down

0 comments on commit d3008b6

Please sign in to comment.