Skip to content

Commit 6004b35

Browse files
authored
Merge a5860ce into 3abcc51
2 parents 3abcc51 + a5860ce commit 6004b35

14 files changed

Lines changed: 212 additions & 42 deletions

File tree

source/NVDAObjects/window/excel.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ def script_elementsList(self,gesture):
575575

576576
class ElementsListDialog(browseMode.ElementsListDialog):
577577

578+
helpId = "ExcelElementsList"
579+
578580
ELEMENT_TYPES=(
579581
# Translators: The label of a radio button to select the type of element
580582
# in the browse mode Elements List dialog.
@@ -593,6 +595,14 @@ class ElementsListDialog(browseMode.ElementsListDialog):
593595
("sheet", _("&Sheets")),
594596
)
595597

598+
599+
class EditCommentDialog(
600+
gui.ContextHelpMixin,
601+
wx.TextEntryDialog, # wxPython does not seem to call base class initializer, put last in MRO
602+
):
603+
helpId = "ExcelReportingComments"
604+
605+
596606
class ExcelBase(Window):
597607
"""A base that all Excel NVDAObjects inherit from, which contains some useful methods."""
598608

@@ -1433,7 +1443,7 @@ def script_reportComment(self,gesture):
14331443
gesture="kb:shift+f2")
14341444
def script_editComment(self,gesture):
14351445
commentObj=self.excelCellObject.comment
1436-
d = wx.TextEntryDialog(
1446+
d = EditCommentDialog(
14371447
gui.mainFrame,
14381448
# Translators: Dialog text for the note editing dialog
14391449
_("Editing note for cell {address}").format(address=self.cellCoordsText),

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/cursorManager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@
2929
import ui
3030
from textInfos import DocumentWithPageTurns
3131

32-
class FindDialog(wx.Dialog):
32+
class FindDialog(
33+
gui.ContextHelpMixin,
34+
wx.Dialog, # wxPython does not seem to call base class initializer, put last in MRO
35+
):
3336
"""A dialog used to specify text to find in a cursor manager.
3437
"""
38+
39+
helpId = "SearchingForText"
3540

3641
def __init__(self, parent, cursorManager, text, caseSensitivity):
3742
# Translators: Title of a dialog to find text.
38-
super(FindDialog, self).__init__(parent, wx.ID_ANY, _("Find"))
43+
super().__init__(parent, wx.ID_ANY, _("Find"))
3944
# Have a copy of the active cursor manager, as this is needed later for finding text.
4045
self.activeCursorManager = cursorManager
4146
mainSizer = wx.BoxSizer(wx.VERTICAL)

source/gui/__init__.py

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

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

10721078
def __init__(self, parent):
10731079
# Translators: The title of the dialog asking if usage data can be collected
1074-
super(AskAllowUsageStatsDialog, self).__init__(parent, title=_("NVDA Usage Data Collection"))
1080+
super().__init__(parent, title=_("NVDA Usage Data Collection"))
10751081
mainSizer = wx.BoxSizer(wx.VERTICAL)
10761082
sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
10771083

source/gui/addonGui.py

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

664-
class IncompatibleAddonsDialog(wx.Dialog, DpiScalingHelperMixin):
664+
665+
class IncompatibleAddonsDialog(
666+
DpiScalingHelperMixinWithoutInit,
667+
gui.ContextHelpMixin,
668+
wx.Dialog # wxPython does not seem to call base class initializer, put last in MRO
669+
):
665670
"""A dialog that lists incompatible addons, and why they are not compatible"""
666671
@classmethod
667672
def _instance(cls):
@@ -671,6 +676,8 @@ def _instance(cls):
671676
"""
672677
return None
673678

679+
helpId = "IncompatibleAddonsManager"
680+
674681
def __new__(cls, *args, **kwargs):
675682
instance = IncompatibleAddonsDialog._instance()
676683
if instance is None:
@@ -698,14 +705,12 @@ def __init__(
698705
# this dialog is not designed to show an empty list.
699706
raise RuntimeError("No incompatible addons.")
700707

701-
wx.Dialog.__init__(
702-
self,
708+
super().__init__(
703709
parent,
704710
# Translators: The title of the Incompatible Addons Dialog
705711
title=_("Incompatible Add-ons"),
706712
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX,
707713
)
708-
DpiScalingHelperMixin.__init__(self, self.GetHandle())
709714

710715
mainSizer=wx.BoxSizer(wx.VERTICAL)
711716
settingsSizer=wx.BoxSizer(wx.VERTICAL)

source/gui/configProfiles.py

Lines changed: 15 additions & 2 deletions
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

@@ -220,7 +227,7 @@ def onRename(self, evt):
220227
index = self.profileList.Selection
221228
oldName = self.profileNames[index]
222229
while True:
223-
with wx.TextEntryDialog(
230+
with RenameProfileDialog(
224231
self,
225232
# Translators: The label of a field to enter a new name for a configuration profile.
226233
_("New name:"),
@@ -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.
@@ -527,3 +534,9 @@ def onTriggerChoice(self, evt):
527534
self.profileName.Value = name
528535
self.profileName.SelectAll()
529536
self.autoProfileName = name
537+
538+
class RenameProfileDialog(
539+
gui.ContextHelpMixin,
540+
wx.TextEntryDialog, # wxPython does not seem to call base class initializer, put last in MRO
541+
):
542+
helpId = "ProfilesBasicManagement"

source/gui/installerGui.py

Lines changed: 33 additions & 9 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,20 @@ def doSilentInstall(startAfterInstall=True):
102103
startAfterInstall=startAfterInstall
103104
)
104105

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

107115
def __init__(self, parent, isUpdate):
108116
self.isUpdate=isUpdate
109117
self.textWrapWidth = 600
110118
# Translators: The title of the Install NVDA dialog.
111-
wx.Dialog.__init__(self, parent, title=_("Install NVDA"))
112-
DpiScalingHelperMixin.__init__(self, self.GetHandle())
119+
super().__init__(parent, title=_("Install NVDA"))
113120

114121
import addonHandler
115122
shouldAskAboutAddons = any(addonHandler.getIncompatibleAddons(
@@ -146,6 +153,7 @@ def __init__(self, parent, isUpdate):
146153
# available, will be disabled after installation.
147154
label=_("I understand that these incompatible add-ons will be disabled")
148155
))
156+
self.bindHelpEvent("InstallWithIncompatibleAddons", self.confirmationCheckbox)
149157
self.confirmationCheckbox.SetFocus()
150158

151159
optionsSizer = guiHelper.BoxSizerHelper(self, sizer=sHelper.addItem(wx.StaticBoxSizer(
@@ -160,6 +168,7 @@ def __init__(self, parent, isUpdate):
160168
# Translators: The label of a checkbox option in the Install NVDA dialog.
161169
startOnLogonText = _("Use NVDA during sign-in")
162170
self.startOnLogonCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=startOnLogonText))
171+
self.bindHelpEvent("StartAtWindowsLogon", self.startOnLogonCheckbox)
163172
if globalVars.appArgs.enableStartOnLogon is not None:
164173
self.startOnLogonCheckbox.Value = globalVars.appArgs.enableStartOnLogon
165174
else:
@@ -176,11 +185,13 @@ def __init__(self, parent, isUpdate):
176185
# this change must also be reflected here.
177186
createShortcutText = _("Create &desktop icon and shortcut key (control+alt+n)")
178187
self.createDesktopShortcutCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=createShortcutText))
188+
self.bindHelpEvent("CreateDesktopShortcut", self.createDesktopShortcutCheckbox)
179189
self.createDesktopShortcutCheckbox.Value = shortcutIsPrevInstalled if self.isUpdate else True
180190

181191
# Translators: The label of a checkbox option in the Install NVDA dialog.
182192
createPortableText = _("Copy &portable configuration to current user account")
183193
self.copyPortableConfigCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=createPortableText))
194+
self.bindHelpEvent("CopyPortableConfigurationToCurrentUserAccount", self.copyPortableConfigCheckbox)
184195
self.copyPortableConfigCheckbox.Value = False
185196
if globalVars.appArgs.launcher:
186197
self.copyPortableConfigCheckbox.Disable()
@@ -189,6 +200,7 @@ def __init__(self, parent, isUpdate):
189200
if shouldAskAboutAddons:
190201
# Translators: The label of a button to launch the add-on compatibility review dialog.
191202
reviewAddonButton = bHelper.addButton(self, label=_("&Review add-ons..."))
203+
self.bindHelpEvent("InstallWithIncompatibleAddons", reviewAddonButton)
192204
reviewAddonButton.Bind(wx.EVT_BUTTON, self.onReviewAddons)
193205

194206
# Translators: The label of a button to continue with the operation.
@@ -227,11 +239,17 @@ def onReviewAddons(self, evt):
227239
)
228240
incompatibleAddons.ShowModal()
229241

230-
class InstallingOverNewerVersionDialog(wx.Dialog, DpiScalingHelperMixin):
242+
class InstallingOverNewerVersionDialog(
243+
DpiScalingHelperMixinWithoutInit,
244+
gui.ContextHelpMixin,
245+
wx.Dialog, # wxPython does not seem to call base class initializer, put last in MRO
246+
):
247+
248+
helpId = "InstallingNVDA"
249+
231250
def __init__(self):
232251
# Translators: The title of a warning dialog.
233-
wx.Dialog.__init__(self, gui.mainFrame, title=_("Warning"))
234-
DpiScalingHelperMixin.__init__(self, self.GetHandle())
252+
super().__init__(gui.mainFrame, title=_("Warning"))
235253

236254
mainSizer = wx.BoxSizer(wx.VERTICAL)
237255
contentSizer = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
@@ -283,11 +301,17 @@ def showInstallGui():
283301
InstallerDialog(gui.mainFrame, previous is not None).Show()
284302
gui.mainFrame.postPopup()
285303

286-
class PortableCreaterDialog(wx.Dialog):
304+
305+
class PortableCreaterDialog(
306+
ContextHelpMixin,
307+
wx.Dialog, # wxPython does not seem to call base class initializer, put last in MRO
308+
):
309+
310+
helpId = "CreatePortableCopy"
287311

288312
def __init__(self, parent):
289313
# Translators: The title of the Create Portable NVDA dialog.
290-
super(PortableCreaterDialog, self).__init__(parent, title=_("Create Portable NVDA"))
314+
super().__init__(parent, title=_("Create Portable NVDA"))
291315
mainSizer = self.mainSizer = wx.BoxSizer(wx.VERTICAL)
292316
sHelper = gui.guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
293317

source/gui/logViewer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@
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+
19+
class LogViewer(
20+
gui.contextHelp.ContextHelpMixin,
21+
wx.Frame # wxPython does not seem to call base class initializer, put last in MRO
22+
):
1823
"""The NVDA log viewer GUI.
1924
"""
25+
26+
helpId = "LogViewer"
2027

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

0 commit comments

Comments
 (0)