Skip to content

Commit

Permalink
Transformed the intro message from a method to a constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Davis authored and Luke Davis committed Sep 9, 2024
1 parent 255106d commit d46fe7d
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions source/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,27 @@ def onInstallCommand(self, evt):

installerGui.showInstallGui()

CRFT_INTRO_MSG: str = _(
# Translators: Explain the COM Registration Fixing tool to users before running
"Welcome to the COM Registration Fixing tool.\n"
"This tool is used by NVDA to fix problems it may have as it tries to interact with various applications, "
"or with Windows itself.\n"
"It examines the system registry for corrupted or missing accessibility entries and will correct them.\n"
"Those entries are sometimes damaged by installing or uninstalling programs, or other system events. This "
'can result in "unknown" or "pane" being spoken instead of the content you were expecting, or previously '
"accessible elements suddenly no longer reading correctly.\n\n"
"You have most likely been asked to run this tool by an experienced user or support worker to investigate "
"and potentially fix an issue with NVDA's behaviour.\n"
"Because it needs to modify the Windows registry, if you have User Account Control (UAC) active, you will "
"be prompted by UAC before this tool can do its job. This is normal and you should follow the UAC's "
"instructions to approve the running of the tool.\n\n"
"Press Continue to try to repair the registry now.\n",
)
"""
Contains the intro dialog contents for the COM Registration Fixing Tool.
Used by gui.MainFrame.onRunCOMRegistrationFixesCommand.
"""

@blockAction.when(
blockAction.Context.SECURE_MODE,
blockAction.Context.MODAL_DIALOG_OPEN,
Expand All @@ -495,7 +516,7 @@ def onRunCOMRegistrationFixesCommand(self, evt: wx.CommandEvent) -> None:
introDialog = ContinueCancelDialog(
self,
genericTitle,
self._CRFTIntroMessage(),
self.CRFT_INTRO_MSG,
)
response: int = introDialog.ShowModal()
if response == wx.CANCEL:
Expand Down Expand Up @@ -550,24 +571,6 @@ def onRunCOMRegistrationFixesCommand(self, evt: wx.CommandEvent) -> None:
wx.OK,
)

def _CRFTIntroMessage(self) -> str:
"""Helper that returns the COM Registration Fixing Tool's introductory statement."""
return _(
# Translators: Explain the COM Registration Fixing tool to users before running
"Welcome to the COM Registration Fixing tool.\n"
"This tool is used by NVDA to fix problems it may have as it tries to interact with various applications, "
"or with Windows itself.\n"
"It examines the system registry for corrupted or missing accessibility entries and will correct them.\n"
"Those entries are sometimes damaged by installing or uninstalling programs, or other system events. This "
'can result in "unknown" or "pane" being spoken instead of the content you were expecting, or previously '
"accessible elements suddenly no longer reading correctly.\n\n"
"You have most likely been asked to run this tool by an experienced user or support worker to investigate and potentially fix an issue with NVDA's behaviour.\n"
"Because it needs to modify the Windows registry, if you have User Account Control (UAC) active, you will "
"be prompted by UAC before this tool can do its job. This is normal and you should follow the UAC "
"instructions to approve the running of the tool.\n\n"
"Press Continue to try to repair the registry now.\n",
)

@blockAction.when(blockAction.Context.MODAL_DIALOG_OPEN)
def onConfigProfilesCommand(self, evt):
self.prePopup()
Expand Down

0 comments on commit d46fe7d

Please sign in to comment.