Skip to content

Commit 15f0b89

Browse files
authored
Merge 2802b68 into 2b2f347
2 parents 2b2f347 + 2802b68 commit 15f0b89

12 files changed

Lines changed: 143 additions & 67 deletions

File tree

source/NVDAObjects/IAccessible/winword.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ def script_caret_moveByCell(self,gesture):
275275
speech.speakTextInfo(info, reason=controlTypes.OutputReason.FOCUS)
276276
braille.handler.handleCaretMove(self)
277277

278+
@script(
279+
# Translators: a description for a script
280+
description=_("Reports the text of the comment where the System caret is located."),
281+
gesture="kb:NVDA+alt+c",
282+
speakOnDemand=True,
283+
)
278284
def script_reportCurrentComment(self,gesture):
279285
info=self.makeTextInfo(textInfos.POSITION_CARET)
280286
info.expand(textInfos.UNIT_CHARACTER)
@@ -294,8 +300,6 @@ def script_reportCurrentComment(self,gesture):
294300
return
295301
# Translators: a message when there is no comment to report in Microsoft Word
296302
ui.message(_("No comments"))
297-
# Translators: a description for a script
298-
script_reportCurrentComment.__doc__=_("Reports the text of the comment where the System caret is located.")
299303

300304
def _moveInTable(self,row=True,forward=True):
301305
info=self.makeTextInfo(textInfos.POSITION_CARET)
@@ -423,7 +427,6 @@ def focusOnActiveDocument(self, officeChartObject):
423427
"kb:alt+end":"caret_moveByCell",
424428
"kb:alt+pageUp":"caret_moveByCell",
425429
"kb:alt+pageDown":"caret_moveByCell",
426-
"kb:NVDA+alt+c":"reportCurrentComment",
427430
}
428431

429432

source/NVDAObjects/UIA/wordDocument.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ def _caretMoveBySentenceHelper(self, gesture, direction):
600600
@script(
601601
gesture="kb:NVDA+alt+c",
602602
# Translators: a description for a script that reports the comment at the caret.
603-
description=_("Reports the text of the comment where the System caret is located.")
603+
description=_("Reports the text of the comment where the System caret is located."),
604+
speakOnDemand=True,
604605
)
605606
def script_reportCurrentComment(self,gesture):
606607
caretInfo=self.makeTextInfo(textInfos.POSITION_CARET)

source/NVDAObjects/window/excel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,9 @@ def _get_positionInfo(self):
16711671
@script(
16721672
# Translators: the description for a script for Excel
16731673
description=_("Reports the note on the current cell"),
1674-
gesture="kb:NVDA+alt+c")
1674+
gesture="kb:NVDA+alt+c",
1675+
speakOnDemand=True,
1676+
)
16751677
def script_reportComment(self,gesture):
16761678
commentObj=self.excelCellObject.comment
16771679
text=commentObj.text() if commentObj else None

source/appModules/foobar2000.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# Copyright (C) 2009-2023 NV Access Limited, Aleksey Sadovoy, James Teh, Joseph Lee, Tuukka Ojala,
3-
# Bram Duvigneau
3+
# Bram Duvigneau, Cyrille Bougot
44
# This file is covered by the GNU General Public License.
55
# See the file COPYING for more details.
66

@@ -19,6 +19,7 @@
1919
from logHandler import log
2020
import ui
2121
from utils.localisation import TimeOutputFormat
22+
from scriptHandler import script
2223

2324
if TYPE_CHECKING:
2425
from inputCore import InputGesture # noqa: F401
@@ -146,6 +147,13 @@ def getElapsedAndTotalIfPlaying(self) -> _StatusBarTimes:
146147
ui.message(_("No track playing"))
147148
return elapsedAndTotalTime
148149

150+
@script(
151+
# Translators: The description of an NVDA command for reading the remaining time of the currently playing
152+
# track in Foobar 2000.
153+
description=_("Reports the remaining time of the currently playing track, if any"),
154+
gesture="kb:control+shift+r",
155+
speakOnDemand=True,
156+
)
149157
def script_reportRemainingTime(self, gesture: "InputGesture"):
150158
elapsedTime, totalTime = self.getElapsedAndTotalIfPlaying()
151159
parsedElapsedTime = None
@@ -163,9 +171,13 @@ def script_reportRemainingTime(self, gesture: "InputGesture"):
163171
# Translators: Reported if the remaining time can not be calculated in Foobar2000
164172
ui.message(_("Remaining time not available"))
165173

166-
# Translators: The description of an NVDA command for reading the remaining time of the currently playing track in Foobar 2000.
167-
script_reportRemainingTime.__doc__ = _("Reports the remaining time of the currently playing track, if any")
168-
174+
@script(
175+
# Translators: The description of an NVDA command for reading the elapsed time of the currently playing
176+
# track in Foobar 2000.
177+
description=_("Reports the elapsed time of the currently playing track, if any"),
178+
gesture="kb:control+shift+e",
179+
speakOnDemand=True,
180+
)
169181
def script_reportElapsedTime(self, gesture: "InputGesture"):
170182
elapsedTime = self.getElapsedAndTotalIfPlaying().elapsed
171183
if elapsedTime:
@@ -177,9 +189,13 @@ def script_reportElapsedTime(self, gesture: "InputGesture"):
177189
# Translators: Reported if the elapsed time is not available in Foobar2000
178190
ui.message(_("Elapsed time not available"))
179191

180-
# Translators: The description of an NVDA command for reading the elapsed time of the currently playing track in Foobar 2000.
181-
script_reportElapsedTime.__doc__ = _("Reports the elapsed time of the currently playing track, if any")
182-
192+
@script(
193+
# Translators: The description of an NVDA command for reading the length of the currently playing track in
194+
# Foobar 2000.
195+
description=_("Reports the length of the currently playing track, if any"),
196+
gesture="kb:control+shift+t",
197+
speakOnDemand=True,
198+
)
183199
def script_reportTotalTime(self, gesture: "InputGesture"):
184200
totalTime = self.getElapsedAndTotalIfPlaying().total
185201
if totalTime:
@@ -190,12 +206,3 @@ def script_reportTotalTime(self, gesture: "InputGesture"):
190206
else:
191207
# Translators: Reported if the total time is not available in Foobar2000
192208
ui.message(_("Total time not available"))
193-
194-
# Translators: The description of an NVDA command for reading the length of the currently playing track in Foobar 2000.
195-
script_reportTotalTime.__doc__ = _("Reports the length of the currently playing track, if any")
196-
197-
__gestures = {
198-
"kb:control+shift+r": "reportRemainingTime",
199-
"kb:control+shift+e": "reportElapsedTime",
200-
"kb:control+shift+t": "reportTotalTime",
201-
}

source/appModules/miranda32.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# -*- coding: UTF-8 -*-
2-
#appModules/miranda32.py
3-
#A part of NonVisual Desktop Access (NVDA)
4-
#Copyright (C) 2006-2019 NV Access Limited, Aleksey Sadovoy, Peter Vágner, Joseph Lee, Bill Dengler
5-
#This file is covered by the GNU General Public License.
6-
#See the file COPYING for more details.
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2006-2023 NV Access Limited, Aleksey Sadovoy, Peter Vágner, Joseph Lee, Bill Dengler,
3+
# Cyrille Bougot
4+
# This file is covered by the GNU General Public License.
5+
# See the file COPYING for more details.
76

87
import ui
98
import config
@@ -16,7 +15,7 @@
1615
import speech
1716
import braille
1817
import controlTypes
19-
from scriptHandler import isScriptWaiting
18+
from scriptHandler import isScriptWaiting, script
2019
import api
2120
import mouseHandler
2221
import oleacc
@@ -110,15 +109,18 @@ def event_NVDAObject_init(self,obj):
110109
elif (obj.windowControlID in ANSILOGS) and (obj.windowClassName=="RichEdit20A"):
111110
obj._isWindowUnicode=False
112111

112+
@script(
113+
# Translators: The description of an NVDA command to view one of the recent messages.
114+
description=_("Displays one of the recent messages"),
115+
speakOnDemand=True,
116+
)
113117
def script_readMessage(self,gesture):
114118
num=int(gesture.mainKeyName[-1])
115119
if len(self.lastMessages)>num-1:
116120
ui.message(self.lastMessages[num-1])
117121
else:
118122
# Translators: This is presented to inform the user that no instant message has been received.
119123
ui.message(_("No message yet"))
120-
# Translators: The description of an NVDA command to view one of the recent messages.
121-
script_readMessage.__doc__=_("Displays one of the recent messages")
122124

123125
def __init__(self, *args, **kwargs):
124126
super(AppModule, self).__init__(*args, **kwargs)

source/appModules/poedit.py

Lines changed: 5 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) 2012-2023 Mesar Hameed, NV Access Limited, Leonard de Ruijter, Rui Fontes
4+
# Copyright (C) 2012-2023 Mesar Hameed, NV Access Limited, Leonard de Ruijter, Rui Fontes, Cyrille Bougot
55

66
"""App module for Poedit 3.4+.
77
"""
@@ -146,6 +146,7 @@ def _reportControlScriptHelper(self, obj: Window, description: str):
146146
"Reports any notes for translators. If pressed twice, presents the notes in browse mode",
147147
),
148148
gesture="kb:control+shift+a",
149+
speakOnDemand=True,
149150
)
150151
def script_reportAutoCommentsWindow(self, gesture):
151152
self._reportControlScriptHelper(
@@ -171,6 +172,7 @@ def _get__commentObj(self) -> Window | None:
171172
"If pressed twice, presents the comment in browse mode",
172173
),
173174
gesture="kb:control+shift+c",
175+
speakOnDemand=True,
174176
)
175177
def script_reportCommentsWindow(self, gesture):
176178
self._reportControlScriptHelper(
@@ -195,6 +197,7 @@ def _get__oldSourceTextObj(self) -> Window | None:
195197
"Reports the old source text, if any. If pressed twice, presents the text in browse mode",
196198
),
197199
gesture="kb:control+shift+o",
200+
speakOnDemand=True,
198201
)
199202
def script_reportOldSourceText(self, gesture):
200203
self._reportControlScriptHelper(
@@ -217,6 +220,7 @@ def _get__translationWarningObj(self) -> Window | None:
217220
"Reports a translation warning, if any. If pressed twice, presents the warning in browse mode",
218221
),
219222
gesture="kb:control+shift+w",
223+
speakOnDemand=True,
220224
)
221225
def script_reportTranslationWarning(self, gesture):
222226
self._reportControlScriptHelper(

source/appModules/vipmud.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#appModules/vipmud.py
2-
#A part of NonVisual Desktop Access (NVDA)
3-
#Copyright (C) 2011 Willem Venter and Rynhardt Kruger
4-
#This file is covered by the GNU General Public License.
5-
#See the file COPYING for more details.
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2011-2023 Willem Venter and Rynhardt Kruger, Cyrille Bougot
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
65

76
from NVDAObjects.window import edit
87
import ui
98
import appModuleHandler
109
import controlTypes
10+
from scriptHandler import script
1111

1212
"""
1313
App module for VIP Mud
@@ -25,13 +25,18 @@ def __init__(self, *args, **kwargs):
2525
super(AppModule, self).__init__(*args, **kwargs)
2626
for n in range(1, self.historyLength +1):
2727
self.bindGesture("kb:control+%s" % n, "readMessage")
28+
29+
@script(
30+
# Translators: The description of an NVDA command to view one of the recent messages.
31+
description=_("Displays one of the recent messages"),
32+
speakOnDemand=True,
33+
)
2834
def script_readMessage(self,gesture):
2935
num=int(gesture.mainKeyName[-1])
3036
try:
3137
ui.message(self.msgs[num-1])
3238
except IndexError:
3339
ui.message(_("No message yet"))
34-
script_readMessage.__doc__=_("Displays one of the recent messages")
3540

3641

3742
class MudText(edit.Edit):

0 commit comments

Comments
 (0)