Skip to content

Commit 8dc7a35

Browse files
authored
Merge a2a0ba2 into b880d36
2 parents b880d36 + a2a0ba2 commit 8dc7a35

4 files changed

Lines changed: 16 additions & 25 deletions

File tree

source/config/configSpec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#possible log levels are DEBUG, IO, DEBUGWARNING, INFO
2828
loggingLevel = string(default="INFO")
2929
showWelcomeDialogAtStartup = boolean(default=true)
30-
preventDisplayTurnOff = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="enabled")
30+
preventDisplayTurningOff = boolean(default=true)
3131
3232
# Speech settings
3333
[speech]

source/gui/settingsDialogs.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -983,18 +983,14 @@ def makeSettings(self, settingsSizer):
983983
if globalVars.appArgs.secure:
984984
mirrorBox.Disable()
985985

986-
self.preventDisplayTurnOffCombo: nvdaControls.FeatureFlagCombo = (
987-
settingsSizerHelper.addLabeledControl(
988-
labelText=_(
989-
# Translators: This is a label for a combo-box in the general settings panel.
990-
"Prevent &display from turning off during say all or reading with braille",
991-
),
992-
wxCtrlClass=nvdaControls.FeatureFlagCombo,
993-
keyPath=["general", "preventDisplayTurnOff"],
994-
conf=config.conf,
995-
)
986+
item = self.preventDisplayTurningOffCheckBox = wx.CheckBox(
987+
self,
988+
# Translators: The label of a checkbox in general settings.
989+
label="Prevent &display from turning off during say all or reading with braille",
996990
)
997-
self.bindHelpEvent("PreventDisplayTurnOff", self.preventDisplayTurnOffCombo)
991+
self.bindHelpEvent("PreventDisplayTurningOff", self.preventDisplayTurningOffCheckBox)
992+
item.Value = config.conf["general"]["preventDisplayTurningOff"]
993+
settingsSizerHelper.addItem(item)
998994

999995
def onChangeMirrorURL(self, evt: wx.CommandEvent | wx.KeyEvent):
1000996
"""Show the dialog to change the update mirror URL, and refresh the dialog in response to the URL being changed."""
@@ -1117,7 +1113,7 @@ def onSave(self):
11171113
updateCheck.terminate()
11181114
updateCheck.initialize()
11191115

1120-
self.preventDisplayTurnOffCombo.saveCurrentValueToConf()
1116+
config.conf["general"]["preventDisplayTurningOff"] = self.preventDisplayTurningOffCheckBox.IsChecked()
11211117

11221118
def onPanelActivated(self):
11231119
if updateCheck:

source/systemUtils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@ def run(self):
247247
log.debugWarning("task had errors", exc_info=True)
248248

249249

250-
def preventSystemIdle(preventDisplayTurnOff: bool | None = None, persistent: bool = False) -> None:
250+
def preventSystemIdle(preventDisplayTurningOff: bool | None = None, persistent: bool = False) -> None:
251251
"""
252252
Prevent the system from locking the screen or going to sleep.
253-
:param preventDisplayTurnOff: If `True`, keep the display awake as well.
253+
:param preventDisplayTurningOff: If `True`, keep the display awake as well.
254254
if `False`, only avoid system sleep.
255255
if `None`, the general setting "prevent display turn off" will be used.
256256
:param persistent: If `True`, the state will be maintained until calling :func:`resetThreadExecutionState` is called.
257257
"""
258-
if preventDisplayTurnOff is None:
258+
if preventDisplayTurningOff is None:
259259
import config
260260

261-
preventDisplayTurnOff = bool(config.conf["general"]["preventDisplayTurnOff"])
261+
preventDisplayTurningOff = config.conf["general"]["preventDisplayTurningOff"]
262262
windll.kernel32.SetThreadExecutionState(
263263
winKernel.ES_SYSTEM_REQUIRED
264-
| (winKernel.ES_DISPLAY_REQUIRED if preventDisplayTurnOff else 0)
264+
| (winKernel.ES_DISPLAY_REQUIRED if preventDisplayTurningOff else 0)
265265
| (winKernel.ES_CONTINUOUS if persistent else 0),
266266
)
267267

user_docs/en/userGuide.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,18 +1846,13 @@ If you wish to change the update mirror, press the "Change..." button to open th
18461846
Please note that when using an update mirror, the operator of the mirror has access to all [information sent with update checks](#GeneralSettingsCheckForUpdates).
18471847
Contact the operator of the update mirror for details of their data handling policies to ensure you are comfortable with the way your information will be handled before setting an update mirror.
18481848

1849-
##### Prevent display from turning off during say all or reading with braille {#PreventDisplayTurnOff}
1849+
##### Prevent display from turning off during say all or reading with braille {#PreventDisplayTurningOff}
18501850

1851-
This option ensures that the display stays on when reading with say all or with braille (e.g. when pressing scroll buttons).
1851+
This check box, when enabled, ensures that the display stays on when reading with say all or with braille (e.g. when pressing scroll buttons).
18521852
This avoids the situation where the screen unexpectedly locks during a say all.
18531853
This option is enabled by default.
18541854
Consider disabling this option if you are suffering from a shorter battery life.
18551855

1856-
| . {.hideHeaderRow} |.|
1857-
|---|---|
1858-
|Options |Default (Enabled), Disabled, Enabled|
1859-
|Default |Enabled|
1860-
18611856
#### Speech Settings {#SpeechSettings}
18621857

18631858
<!-- KC:setting -->

0 commit comments

Comments
 (0)