Skip to content

Commit ad5666b

Browse files
authored
Show reset config as a menu item in secure mode (#13547)
Summary of the issue: Currently a user can temporarily reset to factory defaults in secure mode by pressing the default input gesture NVDA+control+r 3 times. A user using NVDA in a shared kiosk may find this command helpful to temporarily use NVDA with factory settings, so that they can log in and then use their own settings profile. This is safe, as resetting to factory defaults doesn't save the settings profile to disk. Users can revert to the saved configuration for secure screens by: - using the menu - NVDA+control+r - restarting NVDA The feature "reset configuration to factory defaults" is hidden from the NVDA menu in secure mode, even though it is exposed through a default input gesture. Description of how this pull request fixes the issue: Show "reset configuration to factory defaults" as a menu item in secure mode Testing strategy: Change a preference in NVDA preferences Copy your configuration to secure screens From a secure screen - Note that the menu item is visible - Close the preference dialog - Reset configuration to factory defaults using the menu item - Confirm that the changed preference has been reset to the factory default Restart the machine on the sign-in screen, confirm that the preference has been restored to the saved config - not the factory default
1 parent a8f701c commit ad5666b

3 files changed

Lines changed: 36 additions & 17 deletions

File tree

source/gui/__init__.py

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,10 @@ def __init__(self, frame: MainFrame):
507507
self.Bind(wx.EVT_MENU, frame.onAboutCommand, item)
508508
# Translators: The label for the Help submenu in NVDA menu.
509509
self.menu.AppendSubMenu(menu_help,_("&Help"))
510-
self.menu.AppendSeparator()
511-
# Translators: The label for the menu item to open the Configuration Profiles dialog.
512-
item = self.menu.Append(wx.ID_ANY, _("&Configuration profiles..."))
513-
self.Bind(wx.EVT_MENU, frame.onConfigProfilesCommand, item)
514-
# Translators: The label for the menu item to revert to saved configuration.
515-
item = self.menu.Append(wx.ID_ANY, _("&Revert to saved configuration"),_("Reset all settings to saved state"))
516-
self.Bind(wx.EVT_MENU, frame.onRevertToSavedConfigurationCommand, item)
510+
511+
self._appendConfigManagementSection(frame)
512+
517513
if not globalVars.appArgs.secure:
518-
# Translators: The label for the menu item to reset settings to default settings.
519-
# Here, default settings means settings that were there when the user first used NVDA.
520-
item = self.menu.Append(wx.ID_ANY, _("&Reset configuration to factory defaults"),_("Reset all settings to default state"))
521-
self.Bind(wx.EVT_MENU, frame.onRevertToDefaultConfigurationCommand, item)
522-
# Translators: The label for the menu item to save current settings.
523-
item = self.menu.Append(wx.ID_SAVE, _("&Save configuration"), _("Write the current configuration to nvda.ini"))
524-
self.Bind(wx.EVT_MENU, frame.onSaveConfigurationCommand, item)
525514
self.menu.AppendSeparator()
526515
# Translators: The label for the menu item to open donate page.
527516
item = self.menu.Append(wx.ID_ANY, _("Donate"))
@@ -585,6 +574,38 @@ def _createSpeechDictsSubMenu(self, frame: wx.Frame) -> wx.Menu:
585574
self.Bind(wx.EVT_MENU, frame.onTemporaryDictionaryCommand, item)
586575
return subMenu_speechDicts
587576

577+
def _appendConfigManagementSection(self, frame: wx.Frame) -> None:
578+
self.menu.AppendSeparator()
579+
# Translators: The label for the menu item to open the Configuration Profiles dialog.
580+
item = self.menu.Append(wx.ID_ANY, _("&Configuration profiles..."))
581+
self.Bind(wx.EVT_MENU, frame.onConfigProfilesCommand, item)
582+
item = self.menu.Append(
583+
wx.ID_ANY,
584+
# Translators: The label for the menu item to revert to saved configuration.
585+
_("&Revert to saved configuration"),
586+
# Translators: The help text for the menu item to revert to saved configuration.
587+
_("Reset all settings to saved state")
588+
)
589+
self.Bind(wx.EVT_MENU, frame.onRevertToSavedConfigurationCommand, item)
590+
item = self.menu.Append(
591+
wx.ID_ANY,
592+
# Translators: The label for the menu item to reset settings to default settings.
593+
# Here, default settings means settings that were there when the user first used NVDA.
594+
_("&Reset configuration to factory defaults"),
595+
# Translators: The help text for the menu item to reset settings to default settings.
596+
# Here, default settings means settings that were there when the user first used NVDA.
597+
_("Reset all settings to default state")
598+
)
599+
self.Bind(wx.EVT_MENU, frame.onRevertToDefaultConfigurationCommand, item)
600+
if not globalVars.appArgs.secure:
601+
item = self.menu.Append(
602+
wx.ID_SAVE,
603+
# Translators: The label for the menu item to save current settings.
604+
_("&Save configuration"),
605+
# Translators: The help text for the menu item to save current settings.
606+
_("Write the current configuration to nvda.ini")
607+
)
608+
self.Bind(wx.EVT_MENU, frame.onSaveConfigurationCommand, item)
588609

589610
def initialize():
590611
global mainFrame

tests/checkPot.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@
6161
'right',
6262
'Recognition failed',
6363
'NVDA &web site',
64-
'Reset all settings to saved state',
65-
'Reset all settings to default state',
66-
'Write the current configuration to nvda.ini',
6764
'E&xit',
6865
'Error renaming profile.',
6966
'Use this profile for:',

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ What's New in NVDA
2727
- The cursor does not switch row or column anymore when using table navigation to navigate through merged cells. (#7278)
2828
- NVDA will no longer incorrectly remove text from Java widgets when presenting to the user. (#13102)
2929
- When reading non-interactive PDFs in Adobe Reader, the type and state of form fields (such as checkboxes and radio buttons) are now reported. (#13285)
30+
- "Reset configuration to factory defaults" is now accessible in the NVDA menu during secure mode. (#13547)
3031
-
3132

3233

0 commit comments

Comments
 (0)