Skip to content

Commit 16e1eb8

Browse files
authored
Merge fc7fb6f into 6f211a1
2 parents 6f211a1 + fc7fb6f commit 16e1eb8

2 files changed

Lines changed: 52 additions & 17 deletions

File tree

source/gui/settingsDialogs.py

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,15 +2680,42 @@ 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
2692+
# version of NVDA, UIA will be used in known good implementations
2693+
# when this option is selected.
2694+
_("Automatic (legacy)"),
2695+
# Translators: A choice in a combo box in the advanced settings
2696+
# panel to have NVDA use UIA in the Windows Console when available.
2697+
_("UIA when available"),
2698+
# Translators: A choice in a combo box in the advanced settings
2699+
# panel to have NVDA use its legacy Windows Console support
2700+
# in all cases.
2701+
_("Legacy")
2702+
]
2703+
#: The possible console config values, in the order they appear
2704+
#: in the combo box.
2705+
self.consoleVals = (
2706+
"auto",
2707+
"UIA",
2708+
"legacy"
2709+
)
2710+
self.consoleCombo = UIAGroup.addLabeledControl(consoleComboText, wx.Choice, choices=consoleChoices)
2711+
self.bindHelpEvent("AdvancedSettingsConsoleUIA", self.consoleCombo)
2712+
curChoice = self.consoleVals.index(
2713+
config.conf['UIA']['winConsoleImplementation']
2714+
)
2715+
self.consoleCombo.SetSelection(curChoice)
2716+
self.consoleCombo.defaultValue = self.consoleVals.index(
2717+
self._getDefaultValue(["UIA", "winConsoleImplementation"])
2718+
)
26922719

26932720
label = pgettext(
26942721
"advanced.uiaWithChromium",
@@ -2980,7 +3007,7 @@ def haveConfigDefaultsBeenRestored(self):
29803007
)
29813008
and self.UIAInMSWordCombo.GetSelection() == self.UIAInMSWordCombo.defaultValue
29823009
and self.UIAInMSExcelCheckBox.IsChecked() == self.UIAInMSExcelCheckBox.defaultValue
2983-
and self.ConsoleUIACheckBox.IsChecked() == (self.ConsoleUIACheckBox.defaultValue == 'UIA')
3010+
and self.consoleCombo.GetSelection() == self.consoleCombo.defaultValue
29843011
and self.cancelExpiredFocusSpeechCombo.GetSelection() == self.cancelExpiredFocusSpeechCombo.defaultValue
29853012
and self.UIAInChromiumCombo.GetSelection() == self.UIAInChromiumCombo.defaultValue
29863013
and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue
@@ -3000,7 +3027,7 @@ def restoreToDefaults(self):
30003027
self.selectiveUIAEventRegistrationCheckBox.SetValue(self.selectiveUIAEventRegistrationCheckBox.defaultValue)
30013028
self.UIAInMSWordCombo.SetSelection(self.UIAInMSWordCombo.defaultValue)
30023029
self.UIAInMSExcelCheckBox.SetValue(self.UIAInMSExcelCheckBox.defaultValue)
3003-
self.ConsoleUIACheckBox.SetValue(self.ConsoleUIACheckBox.defaultValue == 'UIA')
3030+
self.consoleCombo.SetSelection(self.consoleCombo.defaultValue == 'auto')
30043031
self.UIAInChromiumCombo.SetSelection(self.UIAInChromiumCombo.defaultValue)
30053032
self.cancelExpiredFocusSpeechCombo.SetSelection(self.cancelExpiredFocusSpeechCombo.defaultValue)
30063033
self.winConsoleSpeakPasswordsCheckBox.SetValue(self.winConsoleSpeakPasswordsCheckBox.defaultValue)
@@ -3020,10 +3047,10 @@ def onSave(self):
30203047
config.conf["UIA"]["selectiveEventRegistration"] = self.selectiveUIAEventRegistrationCheckBox.IsChecked()
30213048
config.conf["UIA"]["allowInMSWord"] = self.UIAInMSWordCombo.GetSelection()
30223049
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"
3050+
consoleChoice = self.consoleCombo.GetSelection()
3051+
config.conf['UIA']['winConsoleImplementation'] = (
3052+
self.consoleVals[consoleChoice]
3053+
)
30273054
config.conf["featureFlag"]["cancelExpiredFocusSpeech"] = self.cancelExpiredFocusSpeechCombo.GetSelection()
30283055
config.conf["UIA"]["allowInChromium"] = self.UIAInChromiumCombo.GetSelection()
30293056
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)