Skip to content

Commit fe7b24c

Browse files
authored
Merge dd72d09 into ac31a79
2 parents ac31a79 + dd72d09 commit fe7b24c

12 files changed

Lines changed: 158 additions & 34 deletions

File tree

source/brailleViewer/brailleViewerGui.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import config
1010
from logHandler import log
1111
import fonts
12+
import gui.contextHelp
1213

1314
BRAILLE_UNICODE_PATTERNS_START = 0x2800
1415
BRAILLE_SPACE_CHARACTER = chr(BRAILLE_UNICODE_PATTERNS_START)
@@ -19,7 +20,12 @@
1920
# Inherit from wx.Frame because these windows show in the alt+tab menu (where miniFrame does not)
2021
# wx.Dialog causes a crash on destruction when multiple were created at the same time (speechViewer
2122
# may start at the same time)
22-
class BrailleViewerFrame(wx.Frame):
23+
class BrailleViewerFrame(
24+
gui.contextHelp.ContextHelpMixin,
25+
wx.Frame # wxPython does not seem to call base class initializer, put last in MRO
26+
):
27+
28+
helpId = "BrailleViewer"
2329

2430
# Translators: The title of the NVDA Braille Viewer tool window.
2531
_title = _("NVDA Braille Viewer")
@@ -39,7 +45,7 @@ def __init__(self, numCells, onDestroyed):
3945
brailleViewSection = config.conf["brailleViewer"]
4046
dialogPos = wx.Point(x=brailleViewSection["x"], y=brailleViewSection["y"])
4147

42-
super(BrailleViewerFrame, self).__init__(
48+
super().__init__(
4349
gui.mainFrame,
4450
title=self._title,
4551
pos=dialogPos,

source/gui/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,12 +1066,17 @@ def Notify(self):
10661066
def _isDebug():
10671067
return config.conf["debugLog"]["gui"]
10681068

1069-
class AskAllowUsageStatsDialog(wx.Dialog):
1069+
class AskAllowUsageStatsDialog(
1070+
ContextHelpMixin,
1071+
wx.Dialog # wxPython does not seem to call base class initializer, put last in MRO
1072+
):
10701073
"""A dialog asking if the user wishes to allow NVDA usage stats to be collected by NV Access."""
1074+
1075+
helpId = "UsageStatsDialog"
10711076

10721077
def __init__(self, parent):
10731078
# Translators: The title of the dialog asking if usage data can be collected
1074-
super(AskAllowUsageStatsDialog, self).__init__(parent, title=_("NVDA Usage Data Collection"))
1079+
super().__init__(parent, title=_("NVDA Usage Data Collection"))
10751080
mainSizer = wx.BoxSizer(wx.VERTICAL)
10761081
sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
10771082

source/gui/addonGui.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,11 @@ def _showConfirmAddonInstallDialog(parent, bundle):
661661
showAddonInfoFunction=lambda: _showAddonInfo(bundle)
662662
).ShowModal()
663663

664-
class IncompatibleAddonsDialog(wx.Dialog, DpiScalingHelperMixin):
664+
class IncompatibleAddonsDialog(
665+
DpiScalingHelperMixinWithoutInit,
666+
gui.ContextHelpMixin,
667+
wx.Dialog # wxPython does not seem to call base class initializer, put last in MRO
668+
):
665669
"""A dialog that lists incompatible addons, and why they are not compatible"""
666670
@classmethod
667671
def _instance(cls):
@@ -671,6 +675,8 @@ def _instance(cls):
671675
"""
672676
return None
673677

678+
helpId = "IncompatibleAddonsManager"
679+
674680
def __new__(cls, *args, **kwargs):
675681
instance = IncompatibleAddonsDialog._instance()
676682
if instance is None:
@@ -698,14 +704,12 @@ def __init__(
698704
# this dialog is not designed to show an empty list.
699705
raise RuntimeError("No incompatible addons.")
700706

701-
wx.Dialog.__init__(
702-
self,
707+
super().__init__(
703708
parent,
704709
# Translators: The title of the Incompatible Addons Dialog
705710
title=_("Incompatible Add-ons"),
706711
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX,
707712
)
708-
DpiScalingHelperMixin.__init__(self, self.GetHandle())
709713

710714
mainSizer=wx.BoxSizer(wx.VERTICAL)
711715
settingsSizer=wx.BoxSizer(wx.VERTICAL)

source/gui/configProfiles.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ def __init__(self, parent):
4949
changeProfilesSizer = wx.BoxSizer(wx.VERTICAL)
5050
item = self.profileList = wx.ListBox(self,
5151
choices=[self.getProfileDisplay(name, includeStates=True) for name in self.profileNames])
52+
self.bindHelpEvent("ProfilesBasicManagement", self.profileList)
5253
item.Bind(wx.EVT_LISTBOX, self.onProfileListChoice)
5354
item.Selection = self.profileNames.index(config.conf.profiles[-1].name)
5455
changeProfilesSizer.Add(item, proportion=1.0)
5556

5657
changeProfilesSizer.AddSpacer(guiHelper.SPACE_BETWEEN_BUTTONS_VERTICAL)
5758

5859
self.changeStateButton = wx.Button(self)
60+
self.bindHelpEvent("ConfigProfileManual", self.changeStateButton)
5961
self.changeStateButton.Bind(wx.EVT_BUTTON, self.onChangeState)
6062
self.AffirmativeId = self.changeStateButton.Id
6163
self.changeStateButton.SetDefault()
@@ -67,14 +69,17 @@ def __init__(self, parent):
6769
buttonHelper = guiHelper.ButtonHelper(wx.VERTICAL)
6870
# Translators: The label of a button to create a new configuration profile.
6971
newButton = buttonHelper.addButton(self, label=_("&New"))
72+
self.bindHelpEvent("ProfilesCreating", newButton)
7073
newButton.Bind(wx.EVT_BUTTON, self.onNew)
7174

7275
# Translators: The label of a button to rename a configuration profile.
7376
self.renameButton = buttonHelper.addButton(self, label=_("&Rename"))
77+
self.bindHelpEvent("ProfilesBasicManagement", self.renameButton)
7478
self.renameButton.Bind(wx.EVT_BUTTON, self.onRename)
7579

7680
# Translators: The label of a button to delete a configuration profile.
7781
self.deleteButton = buttonHelper.addButton(self, label=_("&Delete"))
82+
self.bindHelpEvent("ProfilesBasicManagement", self.deleteButton)
7883
self.deleteButton.Bind(wx.EVT_BUTTON, self.onDelete)
7984

8085
profilesListGroupContents.Add(buttonHelper.sizer)
@@ -85,10 +90,12 @@ def __init__(self, parent):
8590
# in the Configuration Profiles dialog.
8691
# See the Configuration Profiles section of the User Guide for details.
8792
triggersButton = wx.Button(self, label=_("&Triggers..."))
93+
self.bindHelpEvent("ConfigProfileTriggers", triggersButton)
8894
triggersButton.Bind(wx.EVT_BUTTON, self.onTriggers)
8995

9096
# Translators: The label of a checkbox in the Configuration Profiles dialog.
9197
self.disableTriggersToggle = wx.CheckBox(self, label=_("Temporarily d&isable all triggers"))
98+
self.bindHelpEvent("ConfigProfileDisablingTriggers", self.disableTriggersToggle)
9299
self.disableTriggersToggle.Value = not config.conf.profileTriggersEnabled
93100
sHelper.addItem(guiHelper.associateElements(triggersButton,self.disableTriggersToggle))
94101

@@ -397,7 +404,7 @@ class NewProfileDialog(
397404
gui.ContextHelpMixin,
398405
wx.Dialog # wxPython does not seem to call base class initializer, put last in MRO
399406
):
400-
helpId = "ConfigurationProfiles"
407+
helpId = "ProfilesCreating"
401408

402409
def __init__(self, parent):
403410
# Translators: The title of the dialog to create a new configuration profile.

source/gui/installerGui.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
from logHandler import log
1919
import gui
2020
from gui import guiHelper
21-
from gui.dpiScalingHelper import DpiScalingHelperMixin
21+
from gui.dpiScalingHelper import DpiScalingHelperMixin, DpiScalingHelperMixinWithoutInit
22+
from .contextHelp import ContextHelpMixin
2223
import tones
2324
import systemUtils
2425

@@ -102,14 +103,19 @@ def doSilentInstall(startAfterInstall=True):
102103
startAfterInstall=startAfterInstall
103104
)
104105

105-
class InstallerDialog(wx.Dialog, DpiScalingHelperMixin):
106+
class InstallerDialog(
107+
DpiScalingHelperMixinWithoutInit,
108+
gui.ContextHelpMixin,
109+
wx.Dialog, # wxPython does not seem to call base class initializer, put last in MRO
110+
):
111+
112+
helpId = "InstallingNVDA"
106113

107114
def __init__(self, parent, isUpdate):
108115
self.isUpdate=isUpdate
109116
self.textWrapWidth = 600
110117
# Translators: The title of the Install NVDA dialog.
111-
wx.Dialog.__init__(self, parent, title=_("Install NVDA"))
112-
DpiScalingHelperMixin.__init__(self, self.GetHandle())
118+
super().__init__(parent, title=_("Install NVDA"))
113119

114120
import addonHandler
115121
shouldAskAboutAddons = any(addonHandler.getIncompatibleAddons(
@@ -146,6 +152,7 @@ def __init__(self, parent, isUpdate):
146152
# available, will be disabled after installation.
147153
label=_("I understand that these incompatible add-ons will be disabled")
148154
))
155+
self.bindHelpEvent("InstallWithIncompatibleAddons", self.confirmationCheckbox)
149156
self.confirmationCheckbox.SetFocus()
150157

151158
optionsSizer = guiHelper.BoxSizerHelper(self, sizer=sHelper.addItem(wx.StaticBoxSizer(
@@ -160,6 +167,7 @@ def __init__(self, parent, isUpdate):
160167
# Translators: The label of a checkbox option in the Install NVDA dialog.
161168
startOnLogonText = _("Use NVDA during sign-in")
162169
self.startOnLogonCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=startOnLogonText))
170+
self.bindHelpEvent("StartAtWindowsLogon", self.startOnLogonCheckbox)
163171
if globalVars.appArgs.enableStartOnLogon is not None:
164172
self.startOnLogonCheckbox.Value = globalVars.appArgs.enableStartOnLogon
165173
else:
@@ -176,11 +184,13 @@ def __init__(self, parent, isUpdate):
176184
# this change must also be reflected here.
177185
createShortcutText = _("Create &desktop icon and shortcut key (control+alt+n)")
178186
self.createDesktopShortcutCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=createShortcutText))
187+
self.bindHelpEvent("CreateDesktopShortcut", self.createDesktopShortcutCheckbox)
179188
self.createDesktopShortcutCheckbox.Value = shortcutIsPrevInstalled if self.isUpdate else True
180189

181190
# Translators: The label of a checkbox option in the Install NVDA dialog.
182191
createPortableText = _("Copy &portable configuration to current user account")
183192
self.copyPortableConfigCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=createPortableText))
193+
self.bindHelpEvent("CopyPortableConfigurationToCurrentUserAccount", self.copyPortableConfigCheckbox)
184194
self.copyPortableConfigCheckbox.Value = False
185195
if globalVars.appArgs.launcher:
186196
self.copyPortableConfigCheckbox.Disable()
@@ -189,6 +199,7 @@ def __init__(self, parent, isUpdate):
189199
if shouldAskAboutAddons:
190200
# Translators: The label of a button to launch the add-on compatibility review dialog.
191201
reviewAddonButton = bHelper.addButton(self, label=_("&Review add-ons..."))
202+
self.bindHelpEvent("InstallWithIncompatibleAddons", reviewAddonButton)
192203
reviewAddonButton.Bind(wx.EVT_BUTTON, self.onReviewAddons)
193204

194205
# Translators: The label of a button to continue with the operation.
@@ -283,11 +294,16 @@ def showInstallGui():
283294
InstallerDialog(gui.mainFrame, previous is not None).Show()
284295
gui.mainFrame.postPopup()
285296

286-
class PortableCreaterDialog(wx.Dialog):
297+
class PortableCreaterDialog(
298+
ContextHelpMixin,
299+
wx.Dialog, # wxPython does not seem to call base class initializer, put last in MRO
300+
):
301+
302+
helpId = "CreatePortableCopy"
287303

288304
def __init__(self, parent):
289305
# Translators: The title of the Create Portable NVDA dialog.
290-
super(PortableCreaterDialog, self).__init__(parent, title=_("Create Portable NVDA"))
306+
super().__init__(parent, title=_("Create Portable NVDA"))
291307
mainSizer = self.mainSizer = wx.BoxSizer(wx.VERTICAL)
292308
sHelper = gui.guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
293309

source/gui/logViewer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
import wx
1111
import globalVars
1212
import gui
13+
import gui.contextHelp
1314

1415
#: The singleton instance of the log viewer UI.
1516
logViewer = None
1617

17-
class LogViewer(wx.Frame):
18+
class LogViewer(
19+
gui.contextHelp.ContextHelpMixin,
20+
wx.Frame # wxPython does not seem to call base class initializer, put last in MRO
21+
):
1822
"""The NVDA log viewer GUI.
1923
"""
24+
25+
helpId = "LogViewer"
2026

2127
def __init__(self, parent):
2228
# Translators: The title of the NVDA log viewer window.

0 commit comments

Comments
 (0)