Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove contributors file from NVDA, read license as HTML #17600

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions contributors.txt
Original file line number Diff line number Diff line change
@@ -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.
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
This list is now archived.
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
seanbudd marked this conversation as resolved.
Show resolved Hide resolved

NV Access Limited
Michael Curran
Expand Down
37 changes: 24 additions & 13 deletions copying.txt
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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 http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode.
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
All applicable licenses are included below.

## GNU GENERAL PUBLIC LICENSE
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -306,31 +306,42 @@ 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.


## Microsoft Distributable Code

This applies to the following files:
- mfc*.dll
- Microsoft.VC*.manifest
- msvc*.dll

* mfc*.dll
* Microsoft.VC*.manifest
* msvc*.dll
seanbudd marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down
28 changes: 24 additions & 4 deletions source/documentationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
# 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
import languageHandler
import NVDAState
Expand All @@ -16,7 +19,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")
Expand Down Expand Up @@ -47,8 +50,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)
Expand All @@ -75,3 +78,20 @@ def reportNoDocumentation(fileName: str, useMsgBox: bool = False) -> None:
)
else:
queueHandler.queueFunction(queueHandler.eventQueue, ui.message, noDocMessage)


@lru_cache(maxsize=1)
def _getSanitizedHtmlLicense() -> str:
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
licenseFilename: str = getDocFilePath("copying.txt", False)
with open(licenseFilename, "r", encoding="utf-8") as licenseFile:
htmlLicense = markdown.markdown(licenseFile.read())
return nh3.clean(htmlLicense)
seanbudd marked this conversation as resolved.
Show resolved Hide resolved


def displayLicense():
ui.browseableMessage(
_getSanitizedHtmlLicense(),
# Translators: The title of the dialog to show the NVDA License.
_("NVDA License"),
isHtml=True,
)
25 changes: 6 additions & 19 deletions source/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -804,23 +804,6 @@ def _appendHelpSubMenu(self, frame: MainFrame) -> None:

self.helpMenu.AppendSeparator()

# Translators: The label for the menu item to view NVDA License document.
item = self.helpMenu.Append(wx.ID_ANY, _("L&icense"))
self.Bind(
wx.EVT_MENU,
lambda evt: systemUtils._displayTextFileWorkaround(getDocFilePath("copying.txt", False)),
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
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()

# Translators: The label for the menu item to open NVDA Welcome Dialog.
item = self.helpMenu.Append(wx.ID_ANY, _("We&lcome dialog..."))
self.Bind(wx.EVT_MENU, lambda evt: WelcomeDialog.run(), item)
Expand All @@ -834,6 +817,10 @@ def _appendHelpSubMenu(self, frame: MainFrame) -> None:
item = self.helpMenu.Append(wx.ID_ABOUT, _("&About..."), _("About NVDA"))
self.Bind(wx.EVT_MENU, frame.onAboutCommand, item)

# 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: displayLicense(), item)

# Translators: The label for the Help submenu in NVDA menu.
self.menu.AppendSubMenu(self.helpMenu, _("&Help"))

Expand Down
51 changes: 22 additions & 29 deletions source/gui/startupDialogs.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# -*- 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

from typing import Set
import weakref
import wx
import wx.html2

import config
from config.configFlags import NVDAKey
import core
from documentationUtils import getDocFilePath
from documentationUtils import _getSanitizedHtmlLicense
import globalVars
import gui
from gui.dpiScalingHelper import DpiScalingHelperMixinWithoutInit
import gui.guiHelper
import keyboardHandler
from logHandler import log
import versionInfo
Expand Down Expand Up @@ -173,7 +175,7 @@ class LauncherDialog(

helpId = "InstallingNVDA"

def __init__(self, parent):
def __init__(self, parent: wx.Window | None):
super().__init__(
parent,
title=f"{versionInfo.name} {_('Launcher')}",
Expand All @@ -184,12 +186,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.
Expand Down Expand Up @@ -221,28 +217,25 @@ def __init__(self, parent):
mainSizer.Fit(self)
self.CentreOnScreen()

def _createLicenseAgreementGroup(self) -> wx.StaticBoxSizer:
def _createLicenseAgreementGroup(self) -> wx.BoxSizer:
sizer = wx.BoxSizer(wx.VERTICAL)

# 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)
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
# 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,
)
groupText = wx.StaticText(self, label=groupLabel)
sizer.Add(groupText, border=gui.guiHelper.SPACE_BETWEEN_ASSOCIATED_CONTROL_VERTICAL)

licenseView: wx.html2.WebView = wx.html2.WebView.New(self, size=self.scaleSize((500, 400)))
sizer.Add(licenseView, border=gui.guiHelper.SPACE_BETWEEN_ASSOCIATED_CONTROL_VERTICAL)
licenseView.SetPage(_getSanitizedHtmlLicense(), "")

# 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):
Expand Down
2 changes: 1 addition & 1 deletion source/setup.py
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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")),
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ To use this feature, "allow NVDA to control the volume of other applications" mu
* 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 was removed from the NVDA menu. (#16922)
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
* The NVDA license is now formatted as an HTML browseable message to improve readability. (#17600)
seanbudd marked this conversation as resolved.
Show resolved Hide resolved

### Bug Fixes

Expand Down
6 changes: 3 additions & 3 deletions user_docs/en/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ The year and version changes between updates to reflect the current release.
1. Run the downloaded file.
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.
1. The NVDA Launcher window appears with the license agreement button.
Press the "View license" button and `downArrow` to read the license agreement.
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
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.

Expand Down Expand Up @@ -5202,7 +5202,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.
Expand Down