Skip to content

Commit 05958c4

Browse files
authored
Merge 256cdb3 into 6f211a1
2 parents 6f211a1 + 256cdb3 commit 05958c4

2 files changed

Lines changed: 50 additions & 17 deletions

File tree

source/gui/settingsDialogs.py

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,15 +2680,40 @@ def __init__(self, parent):
26802680
self.bindHelpEvent("UseUiaForExcel", self.UIAInMSExcelCheckBox)
26812681
self.UIAInMSExcelCheckBox.SetValue(config.conf["UIA"]["useInMSExcelWhenAvailable"])
26822682
self.UIAInMSExcelCheckBox.defaultValue = self._getDefaultValue(["UIA", "useInMSExcelWhenAvailable"])
2683-
2684-
# Translators: This is the label for a checkbox in the
2685-
# Advanced settings panel.
2686-
label = _("Use UI Automation to access the Windows C&onsole when available")
2687-
consoleUIADevMap = True if config.conf['UIA']['winConsoleImplementation'] == 'UIA' else False
2688-
self.ConsoleUIACheckBox = UIAGroup.addItem(wx.CheckBox(UIABox, label=label))
2689-
self.bindHelpEvent("AdvancedSettingsConsoleUIA", self.ConsoleUIACheckBox)
2690-
self.ConsoleUIACheckBox.SetValue(consoleUIADevMap)
2691-
self.ConsoleUIACheckBox.defaultValue = self._getDefaultValue(["UIA", "winConsoleImplementation"])
2683+
# Translators: This is the label for a combo box for selecting the
2684+
# active console implementation in the advanced settings panel.
2685+
# Choices are automatic, UIA when available, and legacy.
2686+
consoleComboText = _("Windows C&onsole support:")
2687+
consoleChoices = [
2688+
# Translators: A choice in a combo box in the advanced settings
2689+
# panel to have NVDA determine its Windows Console implementation
2690+
# automatically.
2691+
# This option is currently equivalent to "legacy", but in a future version of NVDA, UIA will be used in known good implementations when this option is selected.
2692+
_("Automatic (legacy)"),
2693+
# Translators: A choice in a combo box in the advanced settings
2694+
# panel to have NVDA use UIA in the Windows Console when available.
2695+
_("UIA when available"),
2696+
# Translators: A choice in a combo box in the advanced settings
2697+
# panel to have NVDA use its legacy Windows Console support
2698+
# in all cases.
2699+
_("Legacy")
2700+
]
2701+
#: The possible console config values, in the order they appear
2702+
#: in the combo box.
2703+
self.consoleVals = (
2704+
"auto",
2705+
"UIA",
2706+
"legacy"
2707+
)
2708+
self.consoleCombo = UIAGroup.addLabeledControl(consoleComboText, wx.Choice, choices=consoleChoices)
2709+
self.bindHelpEvent("AdvancedSettingsConsoleUIA", self.consoleCombo)
2710+
curChoice = self.consoleVals.index(
2711+
config.conf['UIA']['winConsoleImplementation']
2712+
)
2713+
self.consoleCombo.SetSelection(curChoice)
2714+
self.consoleCombo.defaultValue = self.consoleVals.index(
2715+
self._getDefaultValue(["UIA", "winConsoleImplementation"])
2716+
)
26922717

26932718
label = pgettext(
26942719
"advanced.uiaWithChromium",
@@ -2980,7 +3005,7 @@ def haveConfigDefaultsBeenRestored(self):
29803005
)
29813006
and self.UIAInMSWordCombo.GetSelection() == self.UIAInMSWordCombo.defaultValue
29823007
and self.UIAInMSExcelCheckBox.IsChecked() == self.UIAInMSExcelCheckBox.defaultValue
2983-
and self.ConsoleUIACheckBox.IsChecked() == (self.ConsoleUIACheckBox.defaultValue == 'UIA')
3008+
and self.consoleCombo.GetSelection() == self.consoleCombo.defaultValue
29843009
and self.cancelExpiredFocusSpeechCombo.GetSelection() == self.cancelExpiredFocusSpeechCombo.defaultValue
29853010
and self.UIAInChromiumCombo.GetSelection() == self.UIAInChromiumCombo.defaultValue
29863011
and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue
@@ -3000,7 +3025,7 @@ def restoreToDefaults(self):
30003025
self.selectiveUIAEventRegistrationCheckBox.SetValue(self.selectiveUIAEventRegistrationCheckBox.defaultValue)
30013026
self.UIAInMSWordCombo.SetSelection(self.UIAInMSWordCombo.defaultValue)
30023027
self.UIAInMSExcelCheckBox.SetValue(self.UIAInMSExcelCheckBox.defaultValue)
3003-
self.ConsoleUIACheckBox.SetValue(self.ConsoleUIACheckBox.defaultValue == 'UIA')
3028+
self.consoleCombo.SetSelection(self.consoleCombo.defaultValue == 'auto')
30043029
self.UIAInChromiumCombo.SetSelection(self.UIAInChromiumCombo.defaultValue)
30053030
self.cancelExpiredFocusSpeechCombo.SetSelection(self.cancelExpiredFocusSpeechCombo.defaultValue)
30063031
self.winConsoleSpeakPasswordsCheckBox.SetValue(self.winConsoleSpeakPasswordsCheckBox.defaultValue)
@@ -3020,10 +3045,10 @@ def onSave(self):
30203045
config.conf["UIA"]["selectiveEventRegistration"] = self.selectiveUIAEventRegistrationCheckBox.IsChecked()
30213046
config.conf["UIA"]["allowInMSWord"] = self.UIAInMSWordCombo.GetSelection()
30223047
config.conf["UIA"]["useInMSExcelWhenAvailable"] = self.UIAInMSExcelCheckBox.IsChecked()
3023-
if self.ConsoleUIACheckBox.IsChecked():
3024-
config.conf['UIA']['winConsoleImplementation'] = "UIA"
3025-
else:
3026-
config.conf['UIA']['winConsoleImplementation'] = "auto"
3048+
consoleChoice = self.consoleCombo.GetSelection()
3049+
config.conf['UIA']['winConsoleImplementation'] = (
3050+
self.consoleVals[consoleChoice]
3051+
)
30273052
config.conf["featureFlag"]["cancelExpiredFocusSpeech"] = self.cancelExpiredFocusSpeechCombo.GetSelection()
30283053
config.conf["UIA"]["allowInChromium"] = self.UIAInChromiumCombo.GetSelection()
30293054
config.conf["terminals"]["speakPasswords"] = self.winConsoleSpeakPasswordsCheckBox.IsChecked()

user_docs/en/userGuide.t2t

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,8 +1888,16 @@ This setting contains the following values:
18881888
- Always: where ever UI automation is available in Microsoft word (no matter how complete).
18891889
-
18901890

1891-
==== Use UI Automation to access the Windows Console when available ====[AdvancedSettingsConsoleUIA]
1892-
When this option is enabled, NVDA will use a new, work in progress version of its support for Windows Console which takes advantage of [accessibility improvements made by Microsoft https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/]. This feature is highly experimental and is still incomplete, so its use is not yet recommended. However, once completed, it is anticipated that this new support will become the default, improving NVDA's performance and stability in Windows command consoles.
1891+
==== Windows Console support ====[AdvancedSettingsConsoleUIA]
1892+
This option selects how NVDA interacts with the Windows Console used by command prompt, PowerShell, and the Windows Subsystem for Linux.
1893+
It does not affect the modern Windows Terminal.
1894+
In Windows 10 version 1709, Microsoft [added support for its UI Automation API to the console https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/], bringing vastly improved performance and stability for screen readers that support it.
1895+
In situations where UI Automation is unavailable or known to result in an inferior user experience, NVDA's legacy console support is available as a fallback.
1896+
The Windows Console support combo box has three options:
1897+
- Automatic: This option is currently equivalent to "legacy". However, with this option selected, NVDA will begin using UI Automation in consoles automatically in a future version once it has become stable and suitable for wider use.
1898+
- UIA when available: Uses UI Automation in consoles if available, even for versions with incomplete or buggy implementations. Though not yet fully stable, UI Automation may provide a superior user experience in some scenarios, especially in the Windows 11 Sun Valley 2 (22H2) update.
1899+
- Legacy: UI Automation in the Windows Console will be completely disabled, so the legacy fallback will always be used even in situations where UI Automation would provide a superior user experience. Therefore, selecting this option is not recommended unless you know what you are doing.
1900+
-
18931901

18941902
==== Use UIA with Microsoft Edge and other Chromium based browsers when available ====[ChromiumUIA]
18951903
Allows specifying when UIA will be used when it is available in Chromium based browsers such as Microsoft Edge.

0 commit comments

Comments
 (0)