|
38 | 38 | ReportTableHeaders, |
39 | 39 | ReportCellBorders, |
40 | 40 | OutputMode, |
| 41 | + TypingEcho, |
41 | 42 | ) |
42 | 43 | import languageHandler |
43 | 44 | import speech |
@@ -1981,24 +1982,27 @@ def makeSettings(self, settingsSizer): |
1981 | 1982 | checkedItems.append(n) |
1982 | 1983 | self.modifierList.CheckedItems = checkedItems |
1983 | 1984 | self.modifierList.Select(0) |
1984 | | - |
1985 | 1985 | self.bindHelpEvent("KeyboardSettingsModifiers", self.modifierList) |
1986 | | - # Translators: This is the label for a checkbox in the |
1987 | | - # keyboard settings panel. |
1988 | | - charsText = _("Speak typed &characters") |
1989 | | - self.charsCheckBox = sHelper.addItem(wx.CheckBox(self, label=charsText)) |
1990 | | - self.bindHelpEvent( |
1991 | | - "KeyboardSettingsSpeakTypedCharacters", |
1992 | | - self.charsCheckBox, |
1993 | | - ) |
1994 | | - self.charsCheckBox.SetValue(config.conf["keyboard"]["speakTypedCharacters"]) |
1995 | 1986 |
|
1996 | | - # Translators: This is the label for a checkbox in the |
1997 | | - # keyboard settings panel. |
1998 | | - speakTypedWordsText = _("Speak typed &words") |
1999 | | - self.wordsCheckBox = sHelper.addItem(wx.CheckBox(self, label=speakTypedWordsText)) |
2000 | | - self.bindHelpEvent("KeyboardSettingsSpeakTypedWords", self.wordsCheckBox) |
2001 | | - self.wordsCheckBox.SetValue(config.conf["keyboard"]["speakTypedWords"]) |
| 1987 | + # Translators: This is the label for a combobox in the keyboard settings panel. |
| 1988 | + charsLabelText = _("Speak typed &characters:") |
| 1989 | + charsChoices = [mode.displayString for mode in TypingEcho] |
| 1990 | + self.charsList = sHelper.addLabeledControl(charsLabelText, wx.Choice, choices=charsChoices) |
| 1991 | + self.bindHelpEvent("KeyboardSettingsSpeakTypedCharacters", self.charsList) |
| 1992 | + try: |
| 1993 | + self.charsList.SetSelection(config.conf["keyboard"]["speakTypedCharacters"]) |
| 1994 | + except: |
| 1995 | + log.debugWarning("Could not set characters echo list to current setting", exc_info=True) |
| 1996 | + |
| 1997 | + # Translators: This is the label for a combobox in the keyboard settings panel. |
| 1998 | + wordsLabelText = _("Speak typed &words:") |
| 1999 | + wordsChoices = [mode.displayString for mode in TypingEcho] |
| 2000 | + self.wordsList = sHelper.addLabeledControl(wordsLabelText, wx.Choice, choices=wordsChoices) |
| 2001 | + self.bindHelpEvent("KeyboardSettingsSpeakTypedWords", self.wordsList) |
| 2002 | + try: |
| 2003 | + self.wordsList.SetSelection(config.conf["keyboard"]["speakTypedWords"]) |
| 2004 | + except: |
| 2005 | + log.debugWarning("Could not set words echo list to current setting", exc_info=True) |
2002 | 2006 |
|
2003 | 2007 | # Translators: This is the label for a checkbox in the |
2004 | 2008 | # keyboard settings panel. |
@@ -2098,8 +2102,8 @@ def onSave(self): |
2098 | 2102 | config.conf["keyboard"]["NVDAModifierKeys"] = sum( |
2099 | 2103 | key.value for (n, key) in enumerate(NVDAKey) if self.modifierList.IsChecked(n) |
2100 | 2104 | ) |
2101 | | - config.conf["keyboard"]["speakTypedCharacters"] = self.charsCheckBox.IsChecked() |
2102 | | - config.conf["keyboard"]["speakTypedWords"] = self.wordsCheckBox.IsChecked() |
| 2105 | + config.conf["keyboard"]["speakTypedCharacters"] = self.charsList.GetSelection() |
| 2106 | + config.conf["keyboard"]["speakTypedWords"] = self.wordsList.GetSelection() |
2103 | 2107 | config.conf["keyboard"]["speechInterruptForCharacters"] = ( |
2104 | 2108 | self.speechInterruptForCharsCheckBox.IsChecked() |
2105 | 2109 | ) |
|
0 commit comments