@@ -89,7 +89,7 @@ def quit():
8989### Constants
9090NVDA_PATH = globalVars .appDir
9191ICON_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
9595mainFrame : 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+
700735def initialize ():
701736 global mainFrame
702737 if mainFrame :
0 commit comments