Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/threshold' into threshold_py3_st…

…aging

Resolved Conflicts:
	readme.md
	source/NVDAObjects/IAccessible/__init__.py
	source/brailleDisplayDrivers/handyTech.py
	source/gui/settingsDialogs.py
	source/pythonConsole.py
  • Loading branch information...
feerrenrut committed Jul 5, 2019
2 parents 2a260be + 053d63a commit 3ab902404fba01e56002fe1d0adb744f4cee9019
Showing with 9,226 additions and 4,382 deletions.
  1. +47 −1 contributors.txt
  2. +7 −3 developerGuide.t2t
  3. +1 −1 include/espeak
  4. +4 −0 source/IAccessibleHandler.py
  5. +20 −2 source/NVDAHelper.py
  6. +6 −1 source/NVDAObjects/IAccessible/__init__.py
  7. +53 −3 source/NVDAObjects/IAccessible/mscandui.py
  8. +33 −10 source/NVDAObjects/UIA/winConsoleUIA.py
  9. +2 −0 source/_UIAHandler.py
  10. +10 −0 source/appModules/code.py
  11. +3 −2 source/appModules/dllhost.py
  12. +4 −3 source/appModules/explorer.py
  13. +1 −2 source/appModules/kindle.py
  14. +1 −1 source/appModules/powerpnt.py
  15. +3 −0 source/bdDetect.py
  16. +82 −0 source/brailleDisplayDrivers/handyTech.py
  17. +1 −1 source/browseMode.py
  18. +1 −1 source/compoundDocuments.py
  19. +3 −0 source/editableText.py
  20. +1 −1 source/globalCommands.py
  21. +9 −0 source/gui/settingsDialogs.py
  22. +1,067 −324 source/locale/an/LC_MESSAGES/nvda.po
  23. +11 −11 source/locale/ar/LC_MESSAGES/nvda.po
  24. +159 −41 source/locale/bg/LC_MESSAGES/nvda.po
  25. +154 −34 source/locale/cs/LC_MESSAGES/nvda.po
  26. +147 −34 source/locale/da/LC_MESSAGES/nvda.po
  27. +115 −115 source/locale/de/LC_MESSAGES/nvda.po
  28. +1 −1 source/locale/de/characterDescriptions.dic
  29. +1 −1 source/locale/de/symbols.dic
  30. +156 −35 source/locale/el/LC_MESSAGES/nvda.po
  31. +11 −11 source/locale/es/LC_MESSAGES/nvda.po
  32. +14 −14 source/locale/fa/LC_MESSAGES/nvda.po
  33. +11 −12 source/locale/fi/LC_MESSAGES/nvda.po
  34. +11 −11 source/locale/fr/LC_MESSAGES/nvda.po
  35. +10 −11 source/locale/gl/LC_MESSAGES/nvda.po
  36. +141 −33 source/locale/he/LC_MESSAGES/nvda.po
  37. +1,593 −1,925 source/locale/hi/LC_MESSAGES/nvda.po
  38. +10 −10 source/locale/hr/LC_MESSAGES/nvda.po
  39. +148 −33 source/locale/hu/LC_MESSAGES/nvda.po
  40. +154 −36 source/locale/it/LC_MESSAGES/nvda.po
  41. +10 −10 source/locale/ja/LC_MESSAGES/nvda.po
  42. +2 −2 source/locale/ja/characterDescriptions.dic
  43. +26 −14 source/locale/ja/symbols.dic
  44. +154 −39 source/locale/ko/LC_MESSAGES/nvda.po
  45. +543 −153 source/locale/mn/LC_MESSAGES/nvda.po
  46. +153 −37 source/locale/nl/LC_MESSAGES/nvda.po
  47. +16 −16 source/locale/pl/LC_MESSAGES/nvda.po
  48. +10 −10 source/locale/pt_BR/LC_MESSAGES/nvda.po
  49. +11 −11 source/locale/pt_PT/LC_MESSAGES/nvda.po
  50. +10 −12 source/locale/ro/LC_MESSAGES/nvda.po
  51. +18 −32 source/locale/ru/LC_MESSAGES/nvda.po
  52. +146 −35 source/locale/sk/LC_MESSAGES/nvda.po
  53. +11 −11 source/locale/sl/LC_MESSAGES/nvda.po
  54. +151 −33 source/locale/sr/LC_MESSAGES/nvda.po
  55. +200 −80 source/locale/ta/LC_MESSAGES/nvda.po
  56. +9 −9 source/locale/tr/LC_MESSAGES/nvda.po
  57. +150 −34 source/locale/uk/LC_MESSAGES/nvda.po
  58. +93 −94 source/locale/vi/LC_MESSAGES/nvda.po
  59. +21 −20 source/locale/zh_CN/LC_MESSAGES/nvda.po
  60. +5 −5 source/locale/zh_CN/characterDescriptions.dic
  61. +143 −35 source/locale/zh_HK/LC_MESSAGES/nvda.po
  62. +236 −129 source/locale/zh_TW/LC_MESSAGES/nvda.po
  63. +180 −180 source/locale/zh_TW/characterDescriptions.dic
  64. +91 −15 source/pythonConsole.py
  65. +10 −6 source/speech/__init__.py
  66. +63 −0 user_docs/an/changes.t2t
  67. +72 −18 user_docs/an/userGuide.t2t
  68. +71 −4 user_docs/ar/changes.t2t
  69. +5 −6 user_docs/ar/userGuide.t2t
  70. +72 −0 user_docs/bg/changes.t2t
  71. +76 −22 user_docs/bg/userGuide.t2t
  72. +46 −57 user_docs/da/changes.t2t
  73. +67 −13 user_docs/da/userGuide.t2t
  74. +47 −27 user_docs/de/changes.t2t
  75. +5 −6 user_docs/de/userGuide.t2t
  76. +15 −20 user_docs/en/changes.t2t
  77. +11 −5 user_docs/es/changes.t2t
  78. +1 −3 user_docs/es/userGuide.t2t
  79. +63 −0 user_docs/fa/changes.t2t
  80. +116 −62 user_docs/fa/userGuide.t2t
  81. +5 −1 user_docs/fi/changes.t2t
  82. +8 −10 user_docs/fi/userGuide.t2t
  83. +21 −7 user_docs/fr/changes.t2t
  84. +2 −4 user_docs/fr/userGuide.t2t
  85. +11 −5 user_docs/gl/changes.t2t
  86. +1 −3 user_docs/gl/userGuide.t2t
  87. +16 −12 user_docs/hr/changes.t2t
  88. +1 −3 user_docs/hr/userGuide.t2t
  89. +59 −1 user_docs/hu/changes.t2t
  90. +65 −0 user_docs/it/changes.t2t
  91. +65 −10 user_docs/it/userGuide.t2t
  92. +72 −1 user_docs/ja/changes.t2t
  93. +5 −7 user_docs/ja/userGuide.t2t
  94. +69 −0 user_docs/ko/changes.t2t
  95. +101 −33 user_docs/nl/changes.t2t
  96. +62 −5 user_docs/nl/userGuide.t2t
  97. +67 −0 user_docs/pl/changes.t2t
  98. +60 −6 user_docs/pl/userGuide.t2t
  99. +12 −7 user_docs/pt_BR/changes.t2t
  100. +61 −7 user_docs/pt_BR/userGuide.t2t
  101. +10 −0 user_docs/pt_PT/changes.t2t
  102. +96 −38 user_docs/pt_PT/userGuide.t2t
  103. +72 −0 user_docs/ro/changes.t2t
  104. +55 −14 user_docs/ro/userGuide.t2t
  105. +72 −0 user_docs/ru/changes.t2t
  106. +73 −19 user_docs/ru/userGuide.t2t
  107. +64 −0 user_docs/sk/changes.t2t
  108. +62 −8 user_docs/sk/userGuide.t2t
  109. +1 −3 user_docs/sl/userGuide.t2t
  110. +67 −0 user_docs/sr/changes.t2t
  111. +62 −8 user_docs/sr/userGuide.t2t
  112. +191 −137 user_docs/ta/userGuide.t2t
  113. +6 −0 user_docs/tr/changes.t2t
  114. +1 −3 user_docs/tr/userGuide.t2t
  115. +66 −10 user_docs/uk/userGuide.t2t
  116. +5 −0 user_docs/vi/changes.t2t
  117. +12 −11 user_docs/vi/userGuide.t2t
  118. +134 −10 user_docs/zh_CN/changes.t2t
  119. +8 −10 user_docs/zh_CN/userGuide.t2t
  120. +71 −0 user_docs/zh_TW/changes.t2t
@@ -1,6 +1,11 @@
NV Access Limited
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

NV Access Limited
Michael Curran
James Teh
Reef Turner
Quentin Christensen
Peter Vágner
Aleksey Sadovoy
Victor Tsaran
@@ -185,3 +190,44 @@ Eurobraille
Bachir Benanou
Arnold Loubriat
Mozilla Corporation
Adriani Botez
Karl Eick
Dang Manh Cuong
Christopher Toth
Bill Dengler
Aron Ocsvari
Josiel Santos
Karol Pecyna
Blake Oliver
Robert Haenggi
Mikolaj Holysz
André-Abush Clause
Łukasz Golonka
Ralf Kefferpuetz
Daniel Mayr
Kostadin Kolev
Francisco R. Del Roio
Tony Malykh
Laura Cornwell
Austin Pinto
Chris Leo
Alberto Buffolino
Hrvoje Katic
Minako Nonogaki
Carter Temm
Javi Dominguez
Cyrille Bougot
Adriano Barbieri
Ricardo M. Leonarczyk
Paul Bering
Yannick Plassiard
Oriol Gómez
James Scholes
Brian Gaff
Damien Garwood
Jose Manuel Delicado
Oliver Edholm
Abdel
Luke Davis
Larry Wang
Doug Lee
@@ -764,14 +764,18 @@ See [Snapshot Variables #PythonConsoleSnapshotVariables] for more details.
-

The console is similar to the standard interactive Python interpreter.
Input is accepted one line at a time.
The current line is processed when enter is pressed.
Input is accepted one line at a time and processed when enter is pressed.
Multiple lines can be pasted at once from the clipboard and will be processed one by one.
You can navigate through the history of previously entered lines using the up and down arrow keys.

Output (responses from the interpreter) will be spoken when enter is pressed.
The f6 key toggles between the input and output controls.

Closing the console window simply hides it.
The result of the last executed command is stored in the "_" global variable.
This shadows the gettext function which is stored as a built-in with the same name.
It can be unshadowed by executing "del _" and avoided altogether by executing "_ = _".

Closing the console window (with escape or alt+F4) simply hides it.
This allows the user to return to the session as it was left when it was closed, including history and variables.

++ Namespace ++[PythonConsoleNamespace]
@@ -569,6 +569,10 @@ def winEventCallback(handle,eventID,window,objectID,childID,threadID,timestamp):
window=tempWindow

windowClassName=winUser.getClassName(window)
# Modern IME candidate list windows fire menu events which confuse us
# and can't be used properly in conjunction with input composition support.
if windowClassName=="Microsoft.IME.UIManager.CandidateWindow.Host" and eventID in MENU_EVENTIDS:
return
#At the moment we can't handle show, hide or reorder events on Mozilla Firefox Location bar,as there are just too many of them
#Ignore show, hide and reorder on MozillaDropShadowWindowClass windows.
if windowClassName.startswith('Mozilla') and eventID in (winUser.EVENT_OBJECT_SHOW,winUser.EVENT_OBJECT_HIDE,winUser.EVENT_OBJECT_REORDER) and childID<0:
@@ -145,7 +145,7 @@ def handleInputCompositionEnd(result):
import speech
import characterProcessing
from NVDAObjects.inputComposition import InputComposition
from NVDAObjects.behaviors import CandidateItem
from NVDAObjects.IAccessible.mscandui import ModernCandidateUICandidateItem
focus=api.getFocusObject()
result=result.lstrip(u'\u3000 ')
curInputComposition=None
@@ -159,6 +159,22 @@ def handleInputCompositionEnd(result):
#Candidate list is still up
curInputComposition=focus.parent
focus.parent=focus.parent.parent
if isinstance(focus, ModernCandidateUICandidateItem):
# Correct focus for ModernCandidateUICandidateItem
# Find the InputComposition object and
# correct focus to its parent
if isinstance(focus.container, InputComposition):
curInputComposition=focus.container
newFocus=curInputComposition.parent
else:
# Sometimes InputCompositon object is gone
# Correct to container of CandidateItem
newFocus=focus.container
oldSpeechMode=speech.speechMode
speech.speechMode=speech.speechMode_off
eventHandler.executeEvent("gainFocus",newFocus)
speech.speechMode=oldSpeechMode

if curInputComposition and not result:
result=curInputComposition.compositionString.lstrip(u'\u3000 ')
if result:
@@ -194,13 +210,15 @@ def handleInputCompositionStart(compositionString,selectionStart,selectionEnd,is
@WINFUNCTYPE(c_long,c_wchar_p,c_int,c_int,c_int)
def nvdaControllerInternal_inputCompositionUpdate(compositionString,selectionStart,selectionEnd,isReading):
from NVDAObjects.inputComposition import InputComposition
from NVDAObjects.IAccessible.mscandui import ModernCandidateUICandidateItem
if selectionStart==-1:
queueHandler.queueFunction(queueHandler.eventQueue,handleInputCompositionEnd,compositionString)
return 0
focus=api.getFocusObject()
if isinstance(focus,InputComposition):
focus.compositionUpdate(compositionString,selectionStart,selectionEnd,isReading)
else:
# Eliminate InputCompositionStart events from Microsoft Pinyin to avoid reading composition string instead of candidates
elif not isinstance(focus,ModernCandidateUICandidateItem):
queueHandler.queueFunction(queueHandler.eventQueue,handleInputCompositionStart,compositionString,selectionStart,selectionEnd,isReading)
return 0

@@ -473,7 +473,12 @@ def findOverlayClasses(self,clsList):
parentWindow=winUser.getAncestor(self.windowHandle,winUser.GA_PARENT)
if parentWindow and winUser.getClassName(parentWindow)=="Frame Notification Bar":
clsList.append(IENotificationBar)
if windowClassName.lower().startswith('mscandui'):
if (
windowClassName.lower().startswith('mscandui')
or windowClassName in (
"Microsoft.IME.CandidateWindow.View",
"Microsoft.IME.UIManager.CandidateWindow.Host"
)):
from . import mscandui
mscandui.findExtraOverlayClasses(self,clsList)
elif windowClassName=="GeckoPluginWindow" and self.event_objectID==0 and self.IAccessibleChildID==0:
@@ -3,13 +3,12 @@
import queueHandler
import eventHandler
import controlTypes
import characterProcessing
import config
import api
import ui
import speech
import winUser
import mouseHandler
import NVDAObjects.window
from . import IAccessible
from NVDAObjects.behaviors import CandidateItem as CandidateItemBehavior

@@ -213,10 +212,61 @@ def event_show(self):
item=MSCandUIWindow_candidateListItem(IAccessibleObject=self.IAccessibleObject,IAccessibleChildID=3)
reportSelectedCandidate(item)

class ModernCandidateUICandidateItem(BaseCandidateItem):

def _get_parent(self):
# Candidate list in Microsoft Quick cannot be obtained in IAccessible _get_parent.
# Use _get_parent in NVDAObject.window.
parent=NVDAObjects.window.Window._get_parent(self)
return parent

def _get_candidateCharacters(self):
return super(BaseCandidateItem,self).name

_candidateNumber=""

_visibleCandidateItemsText=""

def refreshCandidateList(self):
textList=[]
candidateItems = super(ModernCandidateUICandidateItem,self).parent.children
for child in candidateItems:
if not isinstance(child,ModernCandidateUICandidateItem) or controlTypes.STATE_SELECTABLE not in child.states:
continue
textList.append(child.candidateCharacters)
if not len(textList)<=1:
self._visibleCandidateItemsText=(u", ".join(textList))+u", "
try:
self._candidateNumber = textList.index(self.candidateCharacters)+1
except ValueError:
pass


def _get_candidateNumber(self):
if not self._candidateNumber:
self.refreshCandidateList()
return self._candidateNumber

def _get_visibleCandidateItemsText(self):
if not self._visibleCandidateItemsText:
self.refreshCandidateList()
return self._visibleCandidateItemsText

def event_stateChange(self):
if controlTypes.STATE_SELECTED in self.states:
reportSelectedCandidate(self)

def findExtraOverlayClasses(obj,clsList):
windowClassName=obj.windowClassName
role=obj.IAccessibleRole
if windowClassName=="MSCandUIWindow_Candidate":
if (
windowClassName=="Microsoft.IME.CandidateWindow.View"
and (
obj.role==controlTypes.ROLE_BUTTON
or obj.role==controlTypes.ROLE_LISTITEM
)):
clsList.append(ModernCandidateUICandidateItem)
elif windowClassName=="MSCandUIWindow_Candidate":
if role==oleacc.ROLE_SYSTEM_CLIENT:
clsList.append(MSCandUIWindow)
elif role==oleacc.ROLE_SYSTEM_LISTITEM:
@@ -21,19 +21,25 @@

class consoleUIATextInfo(UIATextInfo):
#: At least on Windows 10 1903, expanding then collapsing the text info
#: causes review to get stuck, so disable it.
#: caused review to get stuck, so disable it.
#: There may be no need to disable this anymore, but doing so doesn't seem
#: to do much good either.
_expandCollapseBeforeReview = False

def __init__(self, obj, position, _rangeObj=None):
super(consoleUIATextInfo, self).__init__(obj, position, _rangeObj)
if position == textInfos.POSITION_CARET and isWin10(1903, atLeast=False):
# The UIA implementation in 1903 causes the caret to be
# off-by-one, so move it one position to the right
# to compensate.
self._rangeObj.MoveEndpointByUnit(
def collapse(self,end=False):
"""Works around a UIA bug on Windows 10 1903 and later."""
if not isWin10(1903):
return super(consoleUIATextInfo, self).collapse(end=end)
# When collapsing, consoles seem to incorrectly push the start of the
# textRange back one character.
# Correct this by bringing the start back up to where the end is.
oldInfo=self.copy()
super(consoleUIATextInfo,self).collapse()
if not end:
self._rangeObj.MoveEndpointByRange(
UIAHandler.TextPatternRangeEndpoint_Start,
UIAHandler.NVDAUnitsToUIAUnits[textInfos.UNIT_CHARACTER],
1
oldInfo._rangeObj,
UIAHandler.TextPatternRangeEndpoint_Start
)

def move(self, unit, direction, endPoint=None):
@@ -139,6 +145,17 @@ def expand(self, unit):
else:
return super(consoleUIATextInfo, self).expand(unit)

def _get_isCollapsed(self):
"""Works around a UIA bug on Windows 10 1903 and later."""
if not isWin10(1903):
return super(consoleUIATextInfo, self)._get_isCollapsed()
# Even when a console textRange's start and end have been moved to the
# same position, the console incorrectly reports the end as being
# past the start.
# Therefore to decide if the textRange is collapsed,
# Check if it has no text.
return not bool(self._rangeObj.getText(1))

def _getCurrentOffsetInThisLine(self, lineInfo):
"""
Given a caret textInfo expanded to line, returns the index into the
@@ -187,6 +204,10 @@ def _getWordOffsetsInThisLine(self, offset, lineInfo):
min(end.value, max(1, len(lineText) - 2))
)

def __ne__(self,other):
"""Support more accurate caret move detection."""
return not self==other


class consoleUIAWindow(Window):
def _get_focusRedirect(self):
@@ -215,6 +236,8 @@ class WinConsoleUIA(Terminal):
#: Whether the console got new text lines in its last update.
#: Used to determine if typed character/word buffers should be flushed.
_hasNewLines = False
#: the caret in consoles can take a while to move on Windows 10 1903 and later.
_caretMovementTimeoutMultiplier = 1.5

def _reportNewText(self, line):
# Additional typed character filtering beyond that in LiveText
@@ -45,6 +45,8 @@
]

badUIAWindowClassNames=[
# UIA events of candidate window interfere with MSAA events.
"Microsoft.IME.CandidateWindow.View",
"SysTreeView32",
"WuDuiListView",
"ComboBox",
@@ -0,0 +1,10 @@
#appModules/code.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2019 NV Access Limited, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

import appModuleHandler

class AppModule(appModuleHandler.AppModule):
disableBrowseModeByDefault = True
@@ -1,6 +1,6 @@
# -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2018 NV Access Limited, Łukasz Golonka
# Copyright (C) 2018-2019 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

@@ -10,11 +10,12 @@
"""

import appModuleHandler
import controlTypes
from .explorer import ReadOnlyEditBox

class AppModule(appModuleHandler.AppModule):

def chooseNVDAObjectOverlayClasses(self, obj, clsList):
windowClass = obj.windowClassName
if windowClass == "Edit":
if windowClass == "Edit" and controlTypes.STATE_READONLY in obj.states:
clsList.insert(0, ReadOnlyEditBox)
@@ -1,6 +1,7 @@
# -*- coding: UTF-8 -*-
#appModules/explorer.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2018 NV Access Limited, Joseph Lee
#Copyright (C) 2006-2019 NV Access Limited, Joseph Lee, Łukasz Golonka
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

@@ -172,7 +173,7 @@ class ReadOnlyEditBox(IAccessible):

def _get_windowText(self):
windowText = super(ReadOnlyEditBox, self).windowText
if windowText is not None and controlTypes.STATE_READONLY in self.states:
if windowText is not None:
return windowText.replace(CHAR_LTR_MARK,'').replace(CHAR_RTL_MARK,'')
return windowText

@@ -200,7 +201,7 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
clsList.insert(0, NotificationArea)
return

if windowClass == "Edit":
if windowClass == "Edit" and controlTypes.STATE_READONLY in obj.states:
clsList.insert(0, ReadOnlyEditBox)
return # Optimization: return early to avoid comparing class names and roles that will never match.

@@ -137,8 +137,7 @@ def script_showSelectionOptions(self, gesture):
# so retrieve and report the selection from Kindle.
# we can't just use self.makeTextInfo, as that will use our fake selection.
realSel = self.rootNVDAObject.makeTextInfo(textInfos.POSITION_SELECTION)
# Translators: Announces selected text. %s is replaced with the text.
speech.speakSelectionMessage(_("selected %s"), realSel.text)
speech.speakSelectedText(realSel.text)
# Remove our virtual selection and move the caret to the active end.
fakeSel.innerTextInfo = realSel
fakeSel.collapse(end=not self._lastSelectionMovedStart)
@@ -1081,7 +1081,7 @@ def event_treeInterceptor_gainFocus(self):
else:
info = self.selection
if not info.isCollapsed:
speech.speakSelectionMessage(_("selected %s"), info.text)
speech.speakSelectedText(info.text)
else:
info.expand(textInfos.UNIT_LINE)
speech.speakTextInfo(info, reason=controlTypes.REASON_CARET, unit=textInfos.UNIT_LINE)

0 comments on commit 3ab9024

Please sign in to comment.
You can’t perform that action at this time.