Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6162,6 +6162,23 @@ def makeSettings(self, sizer: wx.BoxSizer):
wx.Choice,
choices=[level.displayString for level in LoggingLevel],
)
# Translators: Warning shown when selecting logging levels that may expose sensitive information.
self._logLevelWarningText = generalGroup.addItem(
wx.StaticText(
generalBox,
label=_(
"Warning: Selecting \"Debug warning\", \"Input/output\", or \"Debug\" logging levels "
"may record sensitive information such as typed text, system information, or application data. "
"Only enable these levels if you understand the risks."
),
),
)

# Hide by default
self._logLevelWarningText.Hide()

# Bind change event
self._logLevelCombo.Bind(wx.EVT_CHOICE, self._onLogLevelChanged)
self.bindHelpEvent("GeneralSettingsLogLevel", self._logLevelCombo)
if logHandler.isLogLevelForced():
self._logLevelCombo.Disable()
Expand All @@ -6187,7 +6204,19 @@ def makeSettings(self, sizer: wx.BoxSizer):
if not updateCheck:
self._allowUsageStatsCheckBox.Value = False
self._allowUsageStatsCheckBox.Disable()
def _onLogLevelChanged(self, evt):
selectedLevel = list(LoggingLevel)[self._logLevelCombo.GetSelection()]

if selectedLevel in (
LoggingLevel.DEBUGWARNING,
LoggingLevel.IO,
LoggingLevel.DEBUG,
):
self._logLevelWarningText.Show()
else:
self._logLevelWarningText.Hide()

self.Layout()
def onDiscard(self):
# Restore screen curtain state and setting to the most recently saved baseline,
# in case the user enabled or disabled it without saving.
Expand Down Expand Up @@ -6328,6 +6357,7 @@ def makeSettings(self, settingsSizer):
# Ensure that after the settings dialog is created the name is set correctly
super(NVDASettingsDialog, self).makeSettings(settingsSizer)
self._doOnCategoryChange()
self._onLogLevelChanged(None)
global NvdaSettingsDialogWindowHandle
NvdaSettingsDialogWindowHandle = self.GetHandle()

Expand Down
Loading