From a58b1a82f91d1c6b1d0169d0251a5f34755e3464 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Tue, 19 Jun 2018 20:56:05 -0700 Subject: [PATCH 1/3] UIA handler: just assume UIA is available, but keep the UIA enabled key. Re #8415. UIA support in NVDA assumes Windows 7 or later. Because NVDA supports Windows 7 (SP1) and later, just assume UIA is available. However, for cases where UIA should be turned off, turn this on if UIA enabled key (from config) is on. --- source/UIAHandler.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/UIAHandler.py b/source/UIAHandler.py index 83b7fb734b0..1eedf4ec0dc 100644 --- a/source/UIAHandler.py +++ b/source/UIAHandler.py @@ -1,10 +1,9 @@ #UIAHandler.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2008-2016 NV Access Limited +#Copyright (C) 2008-2018 NV Access Limited, Joseph Lee #This file is covered by the GNU General Public License. #See the file COPYING for more details. -import winVersion from comtypes import COMError import config from logHandler import log @@ -13,14 +12,13 @@ isUIAAvailable=False if config.conf and config.conf["UIA"]["enabled"]: - winver=winVersion.winVersion.major+(winVersion.winVersion.minor/10.0) - if winver>=config.conf["UIA"]["minWindowsVersion"]: - try: - from _UIAHandler import * - isUIAAvailable=True - except ImportError: - log.debugWarning("Unable to import _UIAHandler",exc_info=True) - pass + # Because Windows 7 SP1 (NT 6.1) or later is supported, just assume UIA can be used unless told otherwise. + try: + from _UIAHandler import * + isUIAAvailable=True + except ImportError: + log.debugWarning("Unable to import _UIAHandler",exc_info=True) + pass def initialize(): global handler From 7af9b1016e165fdc33e005cbb973afc3d6244b3e Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Tue, 19 Jun 2018 20:59:20 -0700 Subject: [PATCH 2/3] Config: remove minWinVersion key for UIA. Re #8415. As NVDA supports Windows 7 (SP1) and later, there's no need to check if min Windows version is 7 anymore, thus the coresponding key in Config manager/UIA section is no longer applicable. --- source/config/configSpec.py | 1 - 1 file changed, 1 deletion(-) diff --git a/source/config/configSpec.py b/source/config/configSpec.py index ba3459267c7..5019cf9c9b9 100644 --- a/source/config/configSpec.py +++ b/source/config/configSpec.py @@ -181,7 +181,6 @@ followMouse = boolean(default=False) [UIA] - minWindowsVersion = float(default=6.1) enabled = boolean(default=true) useInMSWordWhenAvailable = boolean(default=false) From f43b698db9bad6e1ca4f8f9046d080644aa254f8 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Tue, 19 Jun 2018 21:05:06 -0700 Subject: [PATCH 3/3] UIA constants: remove constants added in current interface that ships with NVDA. Re #8416. In the old days, when UIA handler supported Windows 7 and 8.x (IUIA1 through IUIA3), there were constants that were not part of the interface file that came with NVDA. now that iUIA5 is supported (and in the future, IUIA6), it makes no sense to continue to include constants that are now part of the interface itself. Thus constants included in latest UIA interface are no longer part of NVDA's own UIA handler module (not all are gone, however). --- source/_UIAHandler.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/source/_UIAHandler.py b/source/_UIAHandler.py index 45972c2b408..423b43f3f8d 100644 --- a/source/_UIAHandler.py +++ b/source/_UIAHandler.py @@ -26,22 +26,9 @@ from comtypes.gen.UIAutomationClient import * -#Some new win8 UIA constants that could be missing -UIA_StyleIdAttributeId=40034 -UIA_AnnotationAnnotationTypeIdPropertyId=30113 -UIA_AnnotationTypesAttributeId=40031 -AnnotationType_SpellingError=60001 -UIA_AnnotationObjectsAttributeId=40032 -StyleId_Heading1=70001 -StyleId_Heading9=70009 +#Some newer UIA constants that could be missing ItemIndex_Property_GUID=GUID("{92A053DA-2969-4021-BF27-514CFC2E4A69}") ItemCount_Property_GUID=GUID("{ABBF5C45-5CCC-47b7-BB4E-87CB87BBD162}") -UIA_FullDescriptionPropertyId=30159 -UIA_LevelPropertyId=30154 -UIA_PositionInSetPropertyId=30152 -UIA_SizeOfSetPropertyId=30153 -UIA_LocalizedLandmarkTypePropertyId=30158 -UIA_LandmarkTypePropertyId=30157 HorizontalTextAlignment_Left=0 HorizontalTextAlignment_Centered=1