Skip to content

Commit d4979a2

Browse files
authored
Merge bd98e0f into 3ac42fe
2 parents 3ac42fe + bd98e0f commit d4979a2

5 files changed

Lines changed: 93 additions & 58 deletions

File tree

source/documentationUtils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
3-
# Copyright (C) 2006-2022 NV Access Limited, Łukasz Golonka
3+
# Copyright (C) 2006-2023 NV Access Limited, Łukasz Golonka
44
# This file may be used under the terms of the GNU General Public License, version 2 or later.
55
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
66

7+
from typing import Optional
78
import os
89

910
import globalVars
1011
import languageHandler
1112
import NVDAState
1213

1314

14-
15-
def getDocFilePath(fileName, localized=True):
15+
def getDocFilePath(fileName: str, localized: bool = True) -> Optional[str]:
1616
if not getDocFilePath.rootPath:
1717
if NVDAState.isRunningAsSource():
1818
getDocFilePath.rootPath = os.path.join(globalVars.appDir, "..", "user_docs")

source/gui/__init__.py

Lines changed: 85 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def quit():
8989
### Constants
9090
NVDA_PATH = globalVars.appDir
9191
ICON_PATH=os.path.join(NVDA_PATH, "images", "nvda.ico")
92-
DONATE_URL = "http://www.nvaccess.org/donate/"
92+
DONATE_URL = f"{versionInfo.url}/donate/"
9393

9494
### Globals
9595
mainFrame: Optional["MainFrame"] = None
@@ -548,46 +548,9 @@ def __init__(self, frame: MainFrame):
548548
# Translators: The label for the Tools submenu in NVDA menu.
549549
self.menu.AppendSubMenu(menu_tools, _("&Tools"))
550550

551-
menu_help = self.helpMenu = wx.Menu()
552-
if not globalVars.appArgs.secure:
553-
# Translators: The label of a menu item to open NVDA user guide.
554-
item = menu_help.Append(wx.ID_ANY, _("&User Guide"))
555-
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("userGuide.html")), item)
556-
# Translators: The label of a menu item to open the Commands Quick Reference document.
557-
item = menu_help.Append(wx.ID_ANY, _("Commands &Quick Reference"))
558-
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("keyCommands.html")), item)
559-
# Translators: The label for the menu item to open What's New document.
560-
item = menu_help.Append(wx.ID_ANY, _("What's &new"))
561-
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("changes.html")), item)
562-
item = menu_help.Append(wx.ID_ANY, _("NVDA &web site"))
563-
self.Bind(wx.EVT_MENU, lambda evt: os.startfile("http://www.nvda-project.org/"), item)
564-
# Translators: The label for the menu item to view NVDA License document.
565-
item = menu_help.Append(wx.ID_ANY, _("L&icense"))
566-
self.Bind(
567-
wx.EVT_MENU,
568-
lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("copying.txt", False)),
569-
item
570-
)
571-
# Translators: The label for the menu item to view NVDA Contributors list document.
572-
item = menu_help.Append(wx.ID_ANY, _("C&ontributors"))
573-
self.Bind(
574-
wx.EVT_MENU,
575-
lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("contributors.txt", False)),
576-
item
577-
)
578-
# Translators: The label for the menu item to open NVDA Welcome Dialog.
579-
item = menu_help.Append(wx.ID_ANY, _("We&lcome dialog..."))
580-
self.Bind(wx.EVT_MENU, lambda evt: WelcomeDialog.run(), item)
581-
menu_help.AppendSeparator()
582-
if updateCheck:
583-
# Translators: The label of a menu item to manually check for an updated version of NVDA.
584-
item = menu_help.Append(wx.ID_ANY, _("&Check for update..."))
585-
self.Bind(wx.EVT_MENU, frame.onCheckForUpdateCommand, item)
586-
# Translators: The label for the menu item to open About dialog to get information about NVDA.
587-
item = menu_help.Append(wx.ID_ABOUT, _("&About..."), _("About NVDA"))
588-
self.Bind(wx.EVT_MENU, frame.onAboutCommand, item)
589-
# Translators: The label for the Help submenu in NVDA menu.
590-
self.menu.AppendSubMenu(menu_help,_("&Help"))
551+
self._appendDocsSubMenu()
552+
553+
self._appendHelpSubMenu(frame)
591554

592555
self._appendConfigManagementSection(frame)
593556

@@ -596,13 +559,9 @@ def __init__(self, frame: MainFrame):
596559
# Translators: The label for the menu item to open donate page.
597560
item = self.menu.Append(wx.ID_ANY, _("&Donate"))
598561
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(DONATE_URL), item)
599-
self.installPendingUpdateMenuItemPos = self.menu.GetMenuItemCount()
600-
item = self.installPendingUpdateMenuItem = self.menu.Append(wx.ID_ANY,
601-
# Translators: The label for the menu item to run a pending update.
602-
_("Install pending &update"),
603-
# Translators: The description for the menu item to run a pending update.
604-
_("Execute a previously downloaded NVDA update"))
605-
self.Bind(wx.EVT_MENU, frame.onExecuteUpdateCommand, item)
562+
563+
self._appendPendingUpdateSection(frame)
564+
606565
self.menu.AppendSeparator()
607566
item = self.menu.Append(wx.ID_EXIT, _("E&xit"),_("Exit NVDA"))
608567
self.Bind(wx.EVT_MENU, frame.onExitCommand, item)
@@ -632,7 +591,7 @@ def onActivate(self, evt):
632591
appModules.nvda.nvdaMenuIaIdentity = None
633592
mainFrame.postPopup()
634593

635-
def _createSpeechDictsSubMenu(self, frame: wx.Frame) -> wx.Menu:
594+
def _createSpeechDictsSubMenu(self, frame: MainFrame) -> wx.Menu:
636595
subMenu_speechDicts = wx.Menu()
637596
item = subMenu_speechDicts.Append(
638597
wx.ID_ANY,
@@ -664,7 +623,7 @@ def _createSpeechDictsSubMenu(self, frame: wx.Frame) -> wx.Menu:
664623
self.Bind(wx.EVT_MENU, frame.onTemporaryDictionaryCommand, item)
665624
return subMenu_speechDicts
666625

667-
def _appendConfigManagementSection(self, frame: wx.Frame) -> None:
626+
def _appendConfigManagementSection(self, frame: MainFrame) -> None:
668627
self.menu.AppendSeparator()
669628
# Translators: The label for the menu item to open the Configuration Profiles dialog.
670629
item = self.menu.Append(wx.ID_ANY, _("&Configuration profiles..."))
@@ -697,6 +656,82 @@ def _appendConfigManagementSection(self, frame: wx.Frame) -> None:
697656
)
698657
self.Bind(wx.EVT_MENU, frame.onSaveConfigurationCommand, item)
699658

659+
def _appendDocsSubMenu(self) -> None:
660+
if not globalVars.appArgs.secure:
661+
self.docsMenu = wx.Menu()
662+
# Translators: The label of a menu item to open NVDA user guide.
663+
item = self.docsMenu.Append(wx.ID_ANY, _("&User Guide"))
664+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("userGuide.html")), item)
665+
# Translators: The label of a menu item to open the Commands Quick Reference document.
666+
item = self.docsMenu.Append(wx.ID_ANY, _("Commands &Quick Reference"))
667+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("keyCommands.html")), item)
668+
# Translators: The label for the menu item to open What's New document.
669+
item = self.docsMenu.Append(wx.ID_ANY, _("What's &new"))
670+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(getDocFilePath("changes.html")), item)
671+
# Translators: The label for the menu item to view NVDA License document.
672+
item = self.docsMenu.Append(wx.ID_ANY, _("L&icense"))
673+
self.Bind(
674+
wx.EVT_MENU,
675+
lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("copying.txt", False)),
676+
item
677+
)
678+
# Translators: The label for the menu item to view NVDA Contributors list document.
679+
item = self.docsMenu.Append(wx.ID_ANY, _("C&ontributors"))
680+
self.Bind(
681+
wx.EVT_MENU,
682+
lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("contributors.txt", False)),
683+
item
684+
)
685+
686+
# Translators: The label for the documentation submenu in NVDA menu.
687+
self.menu.AppendSubMenu(self.docsMenu, _("Docu&mentation"))
688+
689+
def _appendHelpSubMenu(self, frame: MainFrame) -> None:
690+
menu_help = self.helpMenu = wx.Menu()
691+
if not globalVars.appArgs.secure:
692+
# Translators: The label for the menu item to view the NVDA website
693+
item = menu_help.Append(wx.ID_ANY, _("NV Access &web site"))
694+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(versionInfo.url), item)
695+
# Translators: The label for the menu item to view the NVDA website's get help section
696+
item = menu_help.Append(wx.ID_ANY, _("&Help, training and support"))
697+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(f"{versionInfo.url}/get-help/"), item)
698+
# Translators: The label for the menu item to view the NVDA website's get help section
699+
item = menu_help.Append(wx.ID_ANY, _("NV Access &shop"))
700+
self.Bind(wx.EVT_MENU, lambda evt: os.startfile(f"{versionInfo.url}/shop/"), item)
701+
702+
menu_help.AppendSeparator()
703+
704+
# Translators: The label for the menu item to open NVDA Welcome Dialog.
705+
item = menu_help.Append(wx.ID_ANY, _("We&lcome dialog..."))
706+
self.Bind(wx.EVT_MENU, lambda evt: WelcomeDialog.run(), item)
707+
708+
if updateCheck:
709+
# Translators: The label of a menu item to manually check for an updated version of NVDA.
710+
item = self.menu.Append(wx.ID_ANY, _("&Check for update..."))
711+
self.Bind(wx.EVT_MENU, frame.onCheckForUpdateCommand, item)
712+
713+
714+
# Translators: The label for the menu item to open About dialog to get information about NVDA.
715+
item = menu_help.Append(wx.ID_ABOUT, _("&About..."), _("About NVDA"))
716+
self.Bind(wx.EVT_MENU, frame.onAboutCommand, item)
717+
718+
# Translators: The label for the Help submenu in NVDA menu.
719+
self.menu.AppendSubMenu(menu_help, _("&Help"))
720+
721+
def _appendPendingUpdateSection(self, frame: MainFrame) -> None:
722+
if not globalVars.appArgs.secure and updateCheck:
723+
# installPendingUpdateMenuItemPos is later toggled based on if an update is available.
724+
self.installPendingUpdateMenuItemPos = self.menu.GetMenuItemCount()
725+
item = self.installPendingUpdateMenuItem = self.menu.Append(
726+
wx.ID_ANY,
727+
# Translators: The label for the menu item to run a pending update.
728+
_("Install pending &update"),
729+
# Translators: The description for the menu item to run a pending update.
730+
_("Execute a previously downloaded NVDA update")
731+
)
732+
self.Bind(wx.EVT_MENU, frame.onExecuteUpdateCommand, item)
733+
734+
700735
def initialize():
701736
global mainFrame
702737
if mainFrame:

source/versionInfo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@
99
To access version information for programmatic version checks before languageHandler.initialize, use the buildVersion module which contains all the non-localizable version information such as major and minor version, and version string etc.
1010
"""
1111

12-
import os
1312
from buildVersion import *
1413

1514
longName = _("NonVisual Desktop Access")
1615
description = _("A free and open source screen reader for Microsoft Windows")
17-
url = "https://www.nvaccess.org/"
16+
url = "https://www.nvaccess.org"
1817
copyrightYears = "2006-2024"
1918
copyright = _("Copyright (C) {years} NVDA Contributors").format(
2019
years=copyrightYears)
2120
aboutMessage = _(
2221
# Translators: "About NVDA" dialog box message
23-
u"""{longName} ({name})
22+
"""{longName} ({name})
2423
Version: {version} ({version_detailed})
2524
URL: {url}
2625
{copyright}

tests/checkPot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2017-2021 NV Access Limited, Ethan Holliger, Dinesh Kaushal, Leonard de Ruijter,
2+
# Copyright (C) 2017-2023 NV Access Limited, Ethan Holliger, Dinesh Kaushal, Leonard de Ruijter,
33
# Joseph Lee, Julien Cochuyt, Łukasz Golonka
44
# This file may be used under the terms of the GNU General Public License, version 2 or later.
55
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
@@ -56,7 +56,6 @@
5656
'Display',
5757
'left',
5858
'right',
59-
'NVDA &web site',
6059
'E&xit',
6160
'Error renaming profile.',
6261
'Use this profile for:',

user_docs/en/changes.t2t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ This option now announces additional relevant information about an object when t
2424
- When requesting formatting information on Excel cells, borders and background will only be reported if there is such formatting. (#15560, @CyrilleB79)
2525
- The command to toggle the screen curtain now has a default gesture: ``NVDA+control+escape``. (#10560, @CyrilleB79)
2626
- NVDA will again no longer report unlabelled groupings such as in recent versions of Microsoft Office 365 menus. (#15638)
27+
- The "Help" submenu of the NVDA menu has been split up into "Documentation" and "Help".
28+
New items have beeen added to "Help" for the NV Access "Get Help" page and Shop. (#14631)
2729
- Braille viewer and speech viewer are now disabled in secure mode. (#15680)
2830
-
2931

0 commit comments

Comments
 (0)