Skip to content

Commit e9f5118

Browse files
authored
Merge e7ba08d into 4c50375
2 parents 4c50375 + e7ba08d commit e9f5118

7 files changed

Lines changed: 27 additions & 14 deletions

File tree

source/appModules/eclipse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# This file is covered by the GNU General Public License.
33
# See the file COPYING for more details.
4-
# Copyright (C) 2010-2023 NV Access Limited, Cyrille Bougot
4+
# Copyright (C) 2010-2024 NV Access Limited, Cyrille Bougot
55

66
import controlTypes
77
import appModuleHandler
@@ -57,6 +57,7 @@ def script_closeAutocompleter(self, gesture):
5757
description=_("Tries to read documentation for the selected autocompletion item."),
5858
gesture="kb:nvda+d",
5959
category=SCRCAT_ECLIPSE,
60+
speakOnDemand=True,
6061
)
6162
def script_readDocumentation(self, gesture):
6263
rootDocumentationWindow = None

source/documentBase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2017-2022 NV Access Limited
2+
# Copyright (C) 2017-2024 NV Access Limited, Cyrille Bougot
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -473,7 +473,7 @@ def nextLineFunc(info: textInfos.TextInfo) -> textInfos.TextInfo:
473473
trueCol=oldSelection.trueCol if bothAxesRow else cell.col,
474474
colSpan=oldSelection.colSpan if bothAxesRow else cell.colSpan,
475475
)
476-
sayAll.SayAllHandler.readText(sayAll.CURSOR.TABLE, info, nextLineFunc, updateCaret)
476+
sayAll.SayAllHandler.readText(sayAll.CURSOR.TABLE, info, nextLineFunc, updateCaret, startedFromScript=True)
477477

478478
def script_nextRow(self, gesture):
479479
self._tableMovementScriptHelper(axis=_Axis.ROW, movement=_Movement.NEXT)

source/globalCommands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ def script_showGui(self, gesture):
23442344
def script_review_sayAll(self, gesture: inputCore.InputGesture):
23452345
# This script is available on the lock screen via getSafeScripts
23462346
# SayAll.nextLine ensures insecure text is not announced.
2347-
sayAll.SayAllHandler.readText(sayAll.CURSOR.REVIEW)
2347+
sayAll.SayAllHandler.readText(sayAll.CURSOR.REVIEW, startedFromScript=True)
23482348

23492349
@script(
23502350
# Translators: Input help mode message for say all with system caret command.
@@ -2354,7 +2354,7 @@ def script_review_sayAll(self, gesture: inputCore.InputGesture):
23542354
speakOnDemand=True,
23552355
)
23562356
def script_sayAll(self, gesture: inputCore.InputGesture):
2357-
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET)
2357+
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET, startedFromScript=True)
23582358

23592359
def _reportFormattingHelper(self, info, browseable=False):
23602360
# Report all formatting-related changes regardless of user settings
@@ -2916,7 +2916,7 @@ def script_title(self, gesture: inputCore.InputGesture):
29162916
def script_speakForeground(self, gesture):
29172917
obj = api.getForegroundObject()
29182918
if obj:
2919-
sayAll.SayAllHandler.readObjects(obj)
2919+
sayAll.SayAllHandler.readObjects(obj, startedFromScript=True)
29202920

29212921
@script(
29222922
gesture="kb(desktop):NVDA+control+f2",

source/scriptHandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2007-2023 NV Access Limited, Babbage B.V., Julien Cochuyt, Leonard de Ruijter, Cyrille Bougot
2+
# Copyright (C) 2007-2024 NV Access Limited, Babbage B.V., Julien Cochuyt, Leonard de Ruijter, Cyrille Bougot
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -302,7 +302,7 @@ def executeScript(script, gesture):
302302
finally:
303303
_isScriptRunning = False
304304
if resumeSayAllMode is not None:
305-
sayAll.SayAllHandler.readText(resumeSayAllMode)
305+
sayAll.SayAllHandler.readText(resumeSayAllMode, startedFromScript=None)
306306

307307

308308
def getLastScriptRepeatCount():

source/speech/sayAll.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# This file is covered by the GNU General Public License.
33
# See the file COPYING for more details.
4-
# Copyright (C) 2006-2022 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
5-
# Julien Cochuyt
4+
# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
5+
# Julien Cochuyt, Cyrille Bougot
66

77
from abc import ABCMeta, abstractmethod
88
from enum import IntEnum
@@ -93,7 +93,9 @@ def isRunning(self):
9393
"""
9494
return bool(self._getActiveSayAll())
9595

96-
def readObjects(self, obj: "NVDAObjects.NVDAObject"):
96+
def readObjects(self, obj: "NVDAObjects.NVDAObject", startedFromScript: bool = False):
97+
if startedFromScript is not None:
98+
self.startedFromScript = startedFromScript
9799
reader = _ObjectsReader(self, obj)
98100
self._getActiveSayAll = weakref.ref(reader)
99101
reader.next()
@@ -104,8 +106,11 @@ def readText(
104106
startPos: Optional[textInfos.TextInfo] = None,
105107
nextLineFunc: Optional[Callable[[textInfos.TextInfo], textInfos.TextInfo]] = None,
106108
shouldUpdateCaret: bool = True,
109+
startedFromScript: bool = False,
107110
) -> None:
108111
self.lastSayAllMode = cursor
112+
if startedFromScript is not None:
113+
self.startedFromScript = startedFromScript
109114
try:
110115
if cursor == CURSOR.CARET:
111116
reader = _CaretTextReader(self)

source/speech/speech.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# This file is covered by the GNU General Public License.
33
# See the file COPYING for more details.
4-
# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
4+
# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
55
# Julien Cochuyt, Derek Riemer, Cyrille Bougot, Leonard de Ruijter, Łukasz Golonka
66

77
"""High-level functions to speak information."""
@@ -1087,11 +1087,16 @@ def speak( # noqa: C901
10871087
from .sayAll import SayAllHandler
10881088

10891089
script = getCurrentScript()
1090-
if not (
1090+
if (
10911091
(script and getattr(script, "speakOnDemand", False))
10921092
or inputCore.manager.isInputHelpActive
1093-
or SayAllHandler.isRunning()
1093+
or (
1094+
SayAllHandler.isRunning()
1095+
and SayAllHandler.startedFromScript
1096+
)
10941097
):
1098+
pass # Do nothing and continue
1099+
else:
10951100
return
10961101
_speechState.beenCanceled = False
10971102
# Filter out redundant LangChangeCommand objects

user_docs/en/changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bug Fixes
1010

11+
* In on-demand speech mode, NVDA does not talk anymore when a message is opened in Outlook, when a new page is loaded in a browser or during the slideshow in PowerPoint. (#16825, @CyrilleB79)
12+
1113
### Changes for Developers
1214

1315
Please refer to [the developer guide](https://www.nvaccess.org/files/nvda/documentation/developerGuide.html#API) for information on NVDA's API deprecation and removal process.

0 commit comments

Comments
 (0)