diff --git a/source/gui/exit.py b/source/gui/exit.py index 53d95425458..e24184f871b 100644 --- a/source/gui/exit.py +++ b/source/gui/exit.py @@ -1,5 +1,5 @@ # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Mesar Hameed, Joseph Lee, +# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Mesar Hameed, Joseph Lee, # Thomas Stivers, Babbage B.V., Accessolutions, Julien Cochuyt, Cyrille Bougot # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html @@ -32,6 +32,7 @@ class _ExitAction(DisplayStringEnum): EXIT = auto() RESTART = auto() + RESTART_WITH_ADDONS_DISABLED_AND_DEBUG_LOGGING_ENABLED = auto() RESTART_WITH_ADDONS_DISABLED = auto() RESTART_WITH_DEBUG_LOGGING_ENABLED = auto() INSTALL_PENDING_UPDATE = auto() @@ -43,8 +44,14 @@ def _displayStringLabels(self): self.EXIT: _("Exit"), # Translators: An option in the combo box to choose exit action. self.RESTART: _("Restart"), - # Translators: An option in the combo box to choose exit action. - self.RESTART_WITH_ADDONS_DISABLED: _("Restart with add-ons disabled"), + self.RESTART_WITH_ADDONS_DISABLED_AND_DEBUG_LOGGING_ENABLED: _( + # Translators: An option in the combo box to choose exit action. + "Restart with add-ons disabled and debug logging enabled", + ), + self.RESTART_WITH_ADDONS_DISABLED: _( + # Translators: An option in the combo box to choose exit action. + "Restart with add-ons disabled", + ), # Translators: An option in the combo box to choose exit action. self.RESTART_WITH_DEBUG_LOGGING_ENABLED: _("Restart with debug logging enabled"), # Translators: An option in the combo box to choose exit action. @@ -98,11 +105,17 @@ def __init__(self, parent): allowedActions = list(_ExitAction) # Windows Store version of NVDA does not support add-ons yet. if config.isAppX: - allowedActions.remove(_ExitAction.RESTART_WITH_ADDONS_DISABLED) + allowedActions.remove(_ExitAction.RESTART_WITH_ADDONS_DISABLED_AND_DEBUG_LOGGING_ENABLED) # Changing debug level on secure screen is not allowed. # Logging on secure screens could allow keylogging of passwords and retrieval from the SYSTEM user. if globalVars.appArgs.secure: allowedActions.remove(_ExitAction.RESTART_WITH_DEBUG_LOGGING_ENABLED) + try: + allowedActions.remove(_ExitAction.RESTART_WITH_ADDONS_DISABLED_AND_DEBUG_LOGGING_ENABLED) + except ValueError: # If already removed before + pass + else: + allowedActions.remove(_ExitAction.RESTART_WITH_ADDONS_DISABLED) # Installing updates should not happen in secure mode. if globalVars.appArgs.secure or not (updateCheck and updateCheck.isPendingUpdate()): allowedActions.remove(_ExitAction.INSTALL_PENDING_UPDATE) @@ -134,7 +147,18 @@ def onOk(self, evt): elif action == _ExitAction.RESTART: queueHandler.queueFunction(queueHandler.eventQueue, core.restart) elif action == _ExitAction.RESTART_WITH_ADDONS_DISABLED: - queueHandler.queueFunction(queueHandler.eventQueue, core.restart, disableAddons=True) + queueHandler.queueFunction( + queueHandler.eventQueue, + core.restart, + disableAddons=True, + ) + elif action == _ExitAction.RESTART_WITH_ADDONS_DISABLED_AND_DEBUG_LOGGING_ENABLED: + queueHandler.queueFunction( + queueHandler.eventQueue, + core.restart, + disableAddons=True, + debugLogging=True, + ) elif action == _ExitAction.RESTART_WITH_DEBUG_LOGGING_ENABLED: queueHandler.queueFunction(queueHandler.eventQueue, core.restart, debugLogging=True) elif action == _ExitAction.INSTALL_PENDING_UPDATE: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index a54bf95498b..07276751878 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -8,6 +8,10 @@ * In Mozilla Firefox, NVDA will report the highlighted text when a URL containing a text fragment is visited. (#16910, @jcsteh) +### Changes + +* The exit dialog now allows you to restart NVDA with add-ons disabled and debug logging enabled simultaneously. (#11538, @CyrilleB79) + ### Bug Fixes * Native support for the Dot Pad tactile graphics device from Dot Inc as a multiline braille display. (#17007) diff --git a/user_docs/en/userGuide.md b/user_docs/en/userGuide.md index 389230d8661..b24972322e5 100644 --- a/user_docs/en/userGuide.md +++ b/user_docs/en/userGuide.md @@ -1755,7 +1755,13 @@ This option is a checkbox that, when checked, tells NVDA to automatically save t ##### Show exit options when exiting NVDA {#GeneralSettingsShowExitOptions} This option is a checkbox that allows you to choose whether or not a dialog appears when you exit NVDA that asks what action you want to perform. -When checked, a dialog will appear when you attempt to exit NVDA asking whether you want to exit, restart, restart with add-ons disabled or install pending updates (if any). +When checked, a dialog will appear when you attempt to exit NVDA, offering the following possibilities: +* exit +* restart +* restart with add-ons disabled and debug logging enabled +* restart with debug logging enabled +* install pending updates (if any). + When unchecked, NVDA will exit immediately. ##### Play sounds when starting or exiting NVDA {#GeneralSettingsPlaySounds}