Skip to content

Commit

Permalink
Auto-suggestions: either play a sound or do nothing. re nvaccess#6241.
Browse files Browse the repository at this point in the history
Comments from Mick Curran and Jamie Teh (NV Access): no need for a separate message option when announcing appearance of auto-suggestions, as the sound cue will let the user of this fact. However, braille users should be notified of this regardless of this flag being turned on (deaf-blind users should be notified of this).
User guide and settings dialog: changed the control type and label for auto-suggestions setting to reflect change in behavior.
  • Loading branch information
josephsl committed Jan 19, 2017
1 parent f088b1b commit 7f80407
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 49 deletions.
24 changes: 8 additions & 16 deletions source/NVDAObjects/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,25 +648,17 @@ def event_suggestionsOpened(self):
Subclasses should provide custom implementations if possible.
By default NVDA will announce appearance of suggestions using speech, braille or a sound will be played.
"""
reportAutoSuggestions = config.conf["presentation"]["reportAutoSuggestions"]
if reportAutoSuggestions in ("message", "sound"):
# Translators: Announced when suggestions appear when search term is entered in various search fields such as Start search box in Windows 10.
braille.handler.message(_("Suggestions"))
if reportAutoSuggestions == "message":
speech.speakMessage(_("Suggestions"))
elif reportAutoSuggestions == "sound":
nvwave.playWaveFile(r"waves\suggestionsOpened.wav")
# Translators: Announced in braille when suggestions appear when search term is entered in various search fields such as Start search box in Windows 10.
braille.handler.message(_("Suggestions"))
if config.conf["presentation"]["reportAutoSuggestionsWithSound"]:
nvwave.playWaveFile(r"waves\suggestionsOpened.wav")

def event_suggestionsClosed(self):
"""Called when suggestions list or container is closed.
Subclasses should provide custom implementations if possible.
By default NVDA will announce this via speech, braille or via a sound.
"""
reportAutoSuggestions = config.conf["presentation"]["reportAutoSuggestions"]
if reportAutoSuggestions in ("message", "sound"):
# Translators: Announced when suggestions disappear when search term is entered in various search fields such as Start search box in Windows 10.
braille.handler.message(_("Suggestions closed"))
if reportAutoSuggestions == "message":
speech.speakMessage(_("Suggestions closed"))
elif reportAutoSuggestions == "sound":
nvwave.playWaveFile(r"waves\suggestionsClosed.wav")
# Translators: Announced in braille when suggestions disappear when search term is entered in various search fields such as Start search box in Windows 10.
braille.handler.message(_("Suggestions closed"))
if config.conf["presentation"]["reportAutoSuggestionsWithSound"]:
nvwave.playWaveFile(r"waves\suggestionsClosed.wav")
29 changes: 4 additions & 25 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,23 +887,6 @@ class ObjectPresentationDialog(SettingsDialog):
("both", _("Speak and beep")),
)

autoSuggestionsLabels = (
# Translators: An option for auto-suggestions output in the Object Presentation dialog
# which disables reporting of appearance of suggestions.
# See Report auto-suggestions in the Object Presentation Settings section of the User Guide.
("off", _("off")),
# Translators: An option for auto-suggestions output in the Object Presentation dialog
# which disables reporting of appearance of suggestions.
# See Report auto-suggestions in the Object Presentation Settings section of the User Guide.

# which announces appearance of suggestions via speech and braille.
("message", _("Message")),
# Translators: An option for auto-suggestions output in the Object Presentation dialog
# which reports appearance of suggestions via a sound.
# See Report auto-suggestions in the Object Presentation Settings section of the User Guide.
("sound", _("Sound")),
)

def makeSettings(self, settingsSizer):
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
# Translators: This is the label for a checkbox in the
Expand Down Expand Up @@ -968,13 +951,9 @@ def makeSettings(self, settingsSizer):

# Translators: This is the label for a combobox in the
# object presentation settings dialog.
autoSuggestionsLabelText = _("&Auto-suggestions notification:")
autoSuggestionsChoices = [name for setting, name in self.autoSuggestionsLabels]
self.autoSuggestionsList=sHelper.addLabeledControl(autoSuggestionsLabelText, wx.Choice,choices=autoSuggestionsChoices)
for index, (setting, name) in enumerate(self.autoSuggestionsLabels):
if setting == config.conf["presentation"]["reportAutoSuggestions"]:
self.autoSuggestionsList.SetSelection(index)
break
autoSuggestionsLabelText = _("Play a sound when &auto-suggestions appear")
self.autoSuggestionSoundsCheckBox=sHelper.addItem(wx.CheckBox(self,label=autoSuggestionsLabelText))
self.autoSuggestionSoundsCheckBox.SetValue(config.conf["presentation"]["reportAutoSuggestionsWithSound"])

def postInit(self):
self.tooltipCheckBox.SetFocus()
Expand All @@ -989,7 +968,7 @@ def onOk(self,evt):
config.conf["presentation"]["progressBarUpdates"]["progressBarOutputMode"]=self.progressLabels[self.progressList.GetSelection()][0]
config.conf["presentation"]["progressBarUpdates"]["reportBackgroundProgressBars"]=self.reportBackgroundProgressBarsCheckBox.IsChecked()
config.conf["presentation"]["reportDynamicContentChanges"]=self.dynamicContentCheckBox.IsChecked()
config.conf["presentation"]["reportAutoSuggestions"]=self.autoSuggestionsLabels[self.autoSuggestionsList.GetSelection()][0]
config.conf["presentation"]["reportAutoSuggestionsWithSound"]=self.autoSuggestionSoundsCheckBox.IsChecked()
super(ObjectPresentationDialog, self).onOk(evt)

class BrowseModeDialog(SettingsDialog):
Expand Down
10 changes: 2 additions & 8 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1120,19 +1120,13 @@ Key: NVDA+5

Toggles the announcement of new content in particular objects such as terminals and the history control in chat programs.

==== Auto-suggestions notification ====
This option allows you to configure how NVDA will notify you of appearance of auto-suggestions.
==== Play a sound when auto-suggestions appear ====
Toggles announcement of appearance of auto-suggestions, and if enabled, NVDA will play a sound to indicate this.
Auto-suggestions are lists of suggested entries based on text entered into certain edit fields and documents.
For example, when you enter text into the search box in Start menu in Windows Vista and later, Windows displays a list of suggestions based on what you typed.
For some edit fields such as search fields in various Windows 10 apps, NVDA can notify you that a list of suggestions has appeared when you type text.
The auto-suggestions list will close once you move away from the edit field, and for some fields, NVDA can notify you of this when this happens.

The ways in which NVDA can notify you of appearance of auto-suggestions are:
- Off: Appearance of suggestions will not be announced.
- Message: NVDA will speak or braille a message when suggestions appear.
- Sound: NVDA will play a sound when suggestions appear.
-

+++ Input Composition Settings +++
The Input Composition Settings dialog can be found under the Preferences menu.
This dialog allows you to control how NVDA reports the input of Asian characters, such as with IME or Text Service input methods.
Expand Down

0 comments on commit 7f80407

Please sign in to comment.