Skip to content

Commit 6c57edc

Browse files
committed
Add check for secure desktop and avoid settings if that is the case. Settings allows you to go to the web, which is a security risk
1 parent 4ad2531 commit 6c57edc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

NVDA-addon/addon/globalPlugins/MathCAT/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ def __init__(self, *args, **kwargs):
2828
self.add_MathCAT_menu()
2929

3030
def add_MathCAT_menu(self):
31-
self.toolsMenu = mainFrame.sysTrayIcon.toolsMenu
32-
self.settings = self.toolsMenu.Append(wx.ID_ANY, _("&MathCAT Settings..."))
33-
mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.on_settings, self.settings)
31+
if not globalVars.appArgs.secure:
32+
self.preferencesMenu = mainFrame.sysTrayIcon.preferencesMenu
33+
self.settings = self.preferencesMenu.Append(wx.ID_ANY, _("&MathCAT Settings..."))
34+
mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.on_settings, self.settings)
3435

3536
def on_settings(self, evt):
3637
mainFrame._popupSettingsDialog(UserInterface)
3738

3839
def terminate(self):
3940
try:
40-
self.toolsMenu.Remove(self.settings)
41+
if not globalVars.appArgs.secure:
42+
self.preferencesMenu.Remove(self.settings)
4143
except (AttributeError, RuntimeError):
4244
pass
4345

0 commit comments

Comments
 (0)