diff --git a/contributors.txt b/contributors.txt index 24fb181b97..ce4ffcedd0 100644 --- a/contributors.txt +++ b/contributors.txt @@ -1,5 +1,7 @@ -This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project. For an overview of code contributors, see also -https://github.com/nvaccess/nvda/graphs/contributors +This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project. +This list was archived in January 2025, and is no longer being maintained. +For an overview of code contributors, see also https://github.com/nvaccess/nvda/graphs/contributors. +For a list of active contributors, see the experts list https://github.com/nvaccess/nvda/blob/master/projectDocs/community/expertsList.md NV Access Limited Michael Curran diff --git a/copying.txt b/copying.txt index d8f34d9c99..73a0104106 100644 --- a/copying.txt +++ b/copying.txt @@ -3,20 +3,19 @@ NVDA is available under the GNU General Public License version 2, with two special exceptions. The exceptions are outlined in the sections "Non-GPL Components in Plugins and Drivers" and "Microsoft Distributable Code". NVDA also includes and uses components which are made available under different free and open source licenses. -Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode +Information about how to obtain and build the code for yourself is available at . All applicable licenses are included below. ## GNU GENERAL PUBLIC LICENSE -https://www.gnu.org/licenses/old-licenses/gpl-2.0.html + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ### Preamble @@ -306,8 +305,10 @@ DAMAGES. Plugins and drivers, including those provided by third parties, are considered derivative works of NVDA and must therefore be licensed under the terms of the GNU General Public License version 2. As a special exception, an NVDA plugin or driver (as defined in the NVDA Developer Guide) may use components under other licenses provided that: -a) Any such component does not prevent the NVDA plugin or driver from being licensed under the terms of the GNU General Public License version 2; and -b) Any such component does not directly use and is not directly used by any portion of NVDA outside of that plugin or driver. + +a. Any such component does not prevent the NVDA plugin or driver from being licensed under the terms of the GNU General Public License version 2; and + +b. Any such component does not directly use and is not directly used by any portion of NVDA outside of that plugin or driver. For example, a speech synthesizer driver may use a speech synthesiser under a proprietary license. In contrast, in a plugin providing support for an application, the code which implements any interface provided by NVDA must be licensed under the GNU General Public License version 2. @@ -315,22 +316,31 @@ In contrast, in a plugin providing support for an application, the code which im ## Microsoft Distributable Code This applies to the following files: -- mfc*.dll -- Microsoft.VC*.manifest -- msvc*.dll + +* `mfc*.dll` +* `Microsoft.VC*.manifest` +* `msvc*.dll` As a special exception to the GNU General Public License version 2, these components may be included with binary distributions of NVDA without being subject to the terms of that license. Microsoft Distributable Code is covered by the following terms: You may not -a) alter any copyright, trademark or patent notice in the Distributable Code; -b) use Microsoft's trademarks in your programs' names or in a way that suggests your programs come from or are endorsed by Microsoft; -c) distribute Distributable Code to run on a platform other than the Windows platform; -d) include Distributable Code in malicious, deceptive or unlawful programs; or -e) modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that - i) the code be disclosed or distributed in source code form; or - ii) others have the right to modify it. + +a. alter any copyright, trademark or patent notice in the Distributable Code; + +b. use Microsoft's trademarks in your programs' names or in a way that suggests your programs come from or are endorsed by Microsoft; + +c. distribute Distributable Code to run on a platform other than the Windows platform; + +d. include Distributable Code in malicious, deceptive or unlawful programs; or + +e. modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. +An Excluded License is one that requires, as a condition of use, modification or distribution, that + + i. the code be disclosed or distributed in source code form; or + + ii. others have the right to modify it. ## Third-Party Dependencies @@ -349,4 +359,4 @@ In addition to these dependencies, the following are also included in NVDA: Furthermore, NVDA also utilises some static/binary dependencies, details of which can be found at the following URL: -https://github.com/nvaccess/nvda-misc-deps/tree/master + diff --git a/source/documentationUtils.py b/source/documentationUtils.py index 6ffe7cf882..7d65470b6a 100644 --- a/source/documentationUtils.py +++ b/source/documentationUtils.py @@ -1,13 +1,17 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2024 NV Access Limited, Łukasz Golonka +# Copyright (C) 2006-2025 NV Access Limited, Łukasz Golonka # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html -from typing import Optional +from functools import lru_cache import os +import markdown +import nh3 + import globalVars +from gui import blockAction import languageHandler import NVDAState from logHandler import log @@ -16,7 +20,7 @@ import wx -def getDocFilePath(fileName: str, localized: bool = True) -> Optional[str]: +def getDocFilePath(fileName: str, localized: bool = True) -> str | None: if not getDocFilePath.rootPath: if NVDAState.isRunningAsSource(): getDocFilePath.rootPath = os.path.join(globalVars.appDir, "..", "user_docs") @@ -47,8 +51,8 @@ def getDocFilePath(fileName: str, localized: bool = True) -> Optional[str]: return None else: # Not localized. - if NVDAState.isRunningAsSource() and fileName in ("copying.txt", "contributors.txt"): - # If running from source, these two files are in the root dir. + if NVDAState.isRunningAsSource() and fileName == "copying.txt": + # If running from source, this file is in the root dir. return os.path.join(globalVars.appDir, "..", fileName) else: return os.path.join(getDocFilePath.rootPath, fileName) @@ -75,3 +79,25 @@ def reportNoDocumentation(fileName: str, useMsgBox: bool = False) -> None: ) else: queueHandler.queueFunction(queueHandler.eventQueue, ui.message, noDocMessage) + + +@lru_cache(maxsize=1) +def _getSanitizedHtmlLicense() -> str: + licenseFilename: str = getDocFilePath("copying.txt", False) + with open(licenseFilename, "r", encoding="utf-8") as licenseFile: + htmlLicense = markdown.markdown(licenseFile.read()) + return nh3.clean(htmlLicense) + + +@blockAction.when( + # HTML includes links which shouldn't be accessible + # in secure contexts as it opens a browser. + blockAction.Context.SECURE_MODE, +) +def displayLicense(): + ui.browseableMessage( + _getSanitizedHtmlLicense(), + # Translators: The title of the dialog to show the NVDA License. + _("NVDA License"), + isHtml=True, + ) diff --git a/source/gui/__init__.py b/source/gui/__init__.py index 9c5c12b756..010ac2b428 100644 --- a/source/gui/__init__.py +++ b/source/gui/__init__.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Mesar Hameed, Joseph Lee, +# Copyright (C) 2006-2025 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Mesar Hameed, Joseph Lee, # Thomas Stivers, Babbage B.V., Accessolutions, Julien Cochuyt, Cyrille Bougot, Luke Davis # This file is covered by the GNU General Public License. # See the file COPYING for more details. @@ -15,7 +15,7 @@ import globalVars import tones import ui -from documentationUtils import getDocFilePath, reportNoDocumentation +from documentationUtils import getDocFilePath, displayLicense, reportNoDocumentation from logHandler import log import config import versionInfo @@ -804,22 +804,9 @@ def _appendHelpSubMenu(self, frame: MainFrame) -> None: self.helpMenu.AppendSeparator() - # Translators: The label for the menu item to view NVDA License document. + # Translators: The label for the menu item to view the NVDA License. item = self.helpMenu.Append(wx.ID_ANY, _("L&icense")) - self.Bind( - wx.EVT_MENU, - lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("copying.txt", False)), - item, - ) - # Translators: The label for the menu item to view NVDA Contributors list document. - item = self.helpMenu.Append(wx.ID_ANY, _("C&ontributors")) - self.Bind( - wx.EVT_MENU, - lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("contributors.txt", False)), - item, - ) - - self.helpMenu.AppendSeparator() + self.Bind(wx.EVT_MENU, lambda evt: displayLicense(), item) # Translators: The label for the menu item to open NVDA Welcome Dialog. item = self.helpMenu.Append(wx.ID_ANY, _("We&lcome dialog...")) diff --git a/source/gui/startupDialogs.py b/source/gui/startupDialogs.py index bf3d236a6c..09197806d2 100644 --- a/source/gui/startupDialogs.py +++ b/source/gui/startupDialogs.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2023 NV Access Limited, Łukasz Golonka, Cyrille Bougot +# Copyright (C) 2006-2025 NV Access Limited, Łukasz Golonka, Cyrille Bougot # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html @@ -11,10 +11,11 @@ import config from config.configFlags import NVDAKey import core -from documentationUtils import getDocFilePath +from documentationUtils import displayLicense import globalVars import gui from gui.dpiScalingHelper import DpiScalingHelperMixinWithoutInit +import gui.guiHelper import keyboardHandler from logHandler import log import versionInfo @@ -173,7 +174,7 @@ class LauncherDialog( helpId = "InstallingNVDA" - def __init__(self, parent): + def __init__(self, parent: wx.Window | None): super().__init__( parent, title=f"{versionInfo.name} {_('Launcher')}", @@ -184,12 +185,6 @@ def __init__(self, parent): sHelper.addItem(self._createLicenseAgreementGroup()) - # Translators: The label for a checkbox in NvDA installation program to agree to the license agreement. - agreeText = _("I &agree") - self.licenseAgreeCheckbox = sHelper.addItem(wx.CheckBox(self, label=agreeText)) - self.licenseAgreeCheckbox.Value = False - self.licenseAgreeCheckbox.Bind(wx.EVT_CHECKBOX, self.onLicenseAgree) - sizer = sHelper.addItem(wx.GridSizer(2, 2, 0, 0)) self.actionButtons = [] # Translators: The label of the button in NVDA installation program to install NvDA on the user's computer. @@ -225,24 +220,19 @@ def _createLicenseAgreementGroup(self) -> wx.StaticBoxSizer: # Translators: The label of the license text which will be shown when NVDA installation program starts. groupLabel = _("License Agreement") sizer = wx.StaticBoxSizer(wx.VERTICAL, self, label=groupLabel) - # Create a fake text control to determine appropriate width of license text box - _fakeTextCtrl = wx.StaticText( - self, - label="a" * 80, # The GPL2 text of copying.txt wraps sentences at 80 characters - ) - widthOfLicenseText = _fakeTextCtrl.Size[0] - _fakeTextCtrl.Destroy() - licenseTextCtrl = wx.TextCtrl( - self, - size=(widthOfLicenseText, self.scaleSize(300)), - style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH, - ) - licenseTextCtrl.Value = open(getDocFilePath("copying.txt", False), "r", encoding="UTF-8").read() - sizer.Add( - licenseTextCtrl, - flag=wx.EXPAND, - proportion=1, - ) + + # Translators: The label of a button in NVDA installation process to view the license agreement. + viewLicenseButton = wx.Button(self, label=_("&View License")) + viewLicenseButton.Bind(wx.EVT_BUTTON, lambda evt: displayLicense()) + sizer.Add(viewLicenseButton, border=gui.guiHelper.SPACE_BETWEEN_BUTTONS_VERTICAL) + + # Translators: The label for a checkbox in NVDA installation process to agree to the license agreement. + agreeText = _("I have read and &agree to the license agreement") + self.licenseAgreeCheckbox = wx.CheckBox(self, label=agreeText) + self.licenseAgreeCheckbox.SetValue(False) + self.licenseAgreeCheckbox.Bind(wx.EVT_CHECKBOX, self.onLicenseAgree) + sizer.Add(self.licenseAgreeCheckbox, border=gui.guiHelper.SPACE_BETWEEN_ASSOCIATED_CONTROL_VERTICAL) + return sizer def onLicenseAgree(self, evt): diff --git a/source/setup.py b/source/setup.py index b31ecec65f..f1eed778a9 100755 --- a/source/setup.py +++ b/source/setup.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Joseph Lee +# Copyright (C) 2006-2025 NV Access Limited, Peter Vágner, Joseph Lee # This file is covered by the GNU General Public License. # See the file COPYING for more details. @@ -239,6 +239,8 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: "brailleDisplayDrivers.dotPad", "synthDrivers", "visionEnhancementProviders", + # Required for markdown, markdown implicitly imports this so it isn't picked up + "html.parser", ], "includes": [ "nvdaBuiltin", @@ -250,7 +252,7 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: }, data_files=[ (".", glob("*.dll") + glob("*.manifest") + ["builtin.dic"]), - ("documentation", ["../copying.txt", "../contributors.txt"]), + ("documentation", ["../copying.txt"]), ("lib/%s" % version, glob("lib/*.dll") + glob("lib/*.manifest")), ("lib64/%s" % version, glob("lib64/*.dll") + glob("lib64/*.exe")), ("libArm64/%s" % version, glob("libArm64/*.dll") + glob("libArm64/*.exe")), diff --git a/source/systemUtils.py b/source/systemUtils.py index 3d6bbf85db..1549d6a544 100644 --- a/source/systemUtils.py +++ b/source/systemUtils.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2020-2023 NV Access Limited, Łukasz Golonka, Luke Davis +# Copyright (C) 2020-2025 NV Access Limited, Łukasz Golonka, Luke Davis # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html @@ -35,7 +35,6 @@ import winUser import functools import shlobj -from os import startfile from logHandler import log from NVDAState import WritePaths @@ -188,15 +187,6 @@ def _getDesktopName() -> str: return name.value -def _displayTextFileWorkaround(file: str) -> None: - # os.startfile does not currently (NVDA 2023.1, Python 3.7) work reliably to open .txt files in Notepad under - # Windows 11, if relying on the default behavior (i.e. `operation="open"`). (#14725) - # Using `operation="edit"`, however, has the desired effect--opening the text file in Notepad. (#14816) - # Since this may be a bug in Python 3.7's os.startfile, or the underlying Win32 function, it may be - # possible to deprecate this workaround after a Python upgrade. - startfile(file, operation="edit") - - def _isSystemClockSecondsVisible() -> bool: """ Query the value of 'ShowSecondsInSystemClock' DWORD32 value in the Windows registry under diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 0ac92629dc..b42a4acd4b 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -52,6 +52,8 @@ As a consequence, announcement of first line indent is now supported for LibreOf * Updated CLDR to version 46.0. (#17484, @OzancanKaratas) * Short versions of the most commonly used command line options have been added: `-d` for `--disable-addons` and `-n` for `--lang`. Prefix matching on command line flags, e.g. using `--di` for `--disable-addons` is no longer supported. (#11644, @CyrilleB79) +* The "Contributors" file has been removed from the NVDA menu. (#16922) +* The NVDA license is now formatted in HTML to improve readability. (#17600) * The Browse Mode setting "Automatically set system focus to focusable elements" has been removed, the behaviour is now disabled. (#17598) * Microsoft Speech API version 5 and Microsoft Speech Platform voices now use WASAPI for audio output, which may improve the responsiveness of those voices. (#13284, @gexgd0419) * The keyboard settings for "Speak typed characters" and "Speak typed words" now have three options: Off, Only in edit controls, and Always. (#17505, @Cary-rowen) diff --git a/user_docs/en/userGuide.md b/user_docs/en/userGuide.md index 45d5c0e644..042d30bc63 100644 --- a/user_docs/en/userGuide.md +++ b/user_docs/en/userGuide.md @@ -136,7 +136,7 @@ The year and version changes between updates to reflect the current release. You may need to wait a few seconds while a temporary copy of NVDA loads. Once loaded, NVDA will speak throughout the rest of the process. 1. The NVDA Launcher window appears with the license agreement. -Press `downArrow` to read the license agreement if desired. +Press the `downArrow` to read the license agreement. 1. Press `tab` to move to the "I agree" checkbox, then press the `spacebar` to check it. 1. Press `tab` to move through the options, then press `enter` on the desired option. @@ -5192,7 +5192,7 @@ Secure mode disables: * The [NVDA Python console](#PythonConsole) * The [Log Viewer](#LogViewer) and logging * The [Braille Viewer](#BrailleViewer) and [Speech Viewer](#SpeechViewer) -* Opening external documents from the NVDA menu, such as the user guide or contributors file. +* Opening external documents from the NVDA menu, such as the user guide file. Installed copies of NVDA store their configuration including add-ons in `%APPDATA%\nvda`. To prevent NVDA users from modifying their configuration or add-ons directly, user access to this folder must also be restricted.