Skip to content

Commit

Permalink
Fix up of nvaccess#15867 and other issues found during its investigat…
Browse files Browse the repository at this point in the history
…ion (nvaccess#15906)

I have put various little changes in the same PR. Let me know if I should divide it.

Link to issue number:
Follow-up of nvaccess#15867.

Summary of the issue:
Various issues seen in nvaccess#15867 or while investigating on it (e.g. looking at usages of gesture.send()):

Script BrowseModeTreeInterceptor.script_passThrough in browseMode.py has a description. It should not since: 1. It is only dedicated to specific key which should not be remapped; 2. There should not be any input help associated to it, since this "pass through" should be transparent to users.
In Eclipse, when no selected auto-completion item can be found, NVDA+D should not pass the gesture through. Indeed gesture.send() should not be used since NVDA+D is not a native gesture of this IDE. An error message should be reported instead.
The PowerPoint script does not show up in its category, whereas it was the goal in Adding command gesture categories for appmodules nvaccess#15867.
With 15867, scripts to set headers of rows or columns in Excel or Word have their description shortened and the details of its usage (e.g. 1 press, 2 presses) is not reported anymore in input help. This is not consistent with other scripts. It's better to keep more details in input help as for other scripts.
  • Loading branch information
CyrilleB79 authored and Adriani90 committed Mar 13, 2024
1 parent d9b981d commit 0393dc0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
15 changes: 11 additions & 4 deletions source/NVDAObjects/IAccessible/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ def fetchAssociatedHeaderCellText(self,cell,columnHeader=False):

@script(
gesture="kb:NVDA+shift+c",
# Translators: The label of a shortcut of NVDA.
description=_("Set column header"),
description=_(
# Translators: The label of a shortcut of NVDA.
"Set column header. Pressing once will set this cell as the first column header for any cell lower and "
"to the right of it within this table. Pressing twice will forget the current column header for this "
"cell."
),
category=SCRCAT_SYSTEMCARET
)
def script_setColumnHeader(self,gesture):
Expand Down Expand Up @@ -243,8 +247,11 @@ def script_setColumnHeader(self,gesture):

@script(
gesture="kb:NVDA+shift+r",
# Translators: The label of a shortcut of NVDA.
description=_("Set row header."),
description=_(
# Translators: The label of a shortcut of NVDA.
"Set row header. Pressing once will set this cell as the first row header for any cell lower and to the "
"right of it within this table. Pressing twice will forget the current row header for this cell."
),
category=SCRCAT_SYSTEMCARET
)
def script_setRowHeader(self,gesture):
Expand Down
16 changes: 12 additions & 4 deletions source/NVDAObjects/window/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,12 @@ def script_openDropdown(self,gesture):
eventHandler.queueEvent("gainFocus",d)

@script(
# Translators: the description for a script for Excel
description=_("Sets the current cell as start of column header"),
description=_(
# Translators: the description for a script for Excel
"Sets the current cell as start of column header. Pressing once will set this cell as the first column "
"header for any cell lower and to the right of it within this region. Pressing twice will forget the "
"current column header for this cell."
),
gesture="kb:NVDA+shift+c",
category=SCRCAT_SYSTEMCARET
)
Expand All @@ -1485,8 +1489,12 @@ def script_setColumnHeader(self,gesture):
ui.message(_("Cannot find {address} in column headers").format(address=self.cellCoordsText))

@script(
# Translators: the description for a script for Excel
description=_("sets the current cell as start of row header"),
description=_(
# Translators: the description for a script for Excel
"Sets the current cell as start of row headers. Pressing once will set this cell as the first row header "
"for any cell lower and to the right of it within this region. Pressing twice will forget the current "
"row header for this cell."
),
gesture="kb:NVDA+shift+r",
category=SCRCAT_SYSTEMCARET
)
Expand Down
6 changes: 4 additions & 2 deletions source/appModules/eclipse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2010-2022 NV Access Limited
# Copyright (C) 2010-2023 NV Access Limited, Cyrille Bougot

import controlTypes
import appModuleHandler
Expand Down Expand Up @@ -63,7 +63,9 @@ def script_readDocumentation(self, gesture):

# If there aren't any suggestion selected, there is no way to find quick documentation
if not self.appModule.selectedItem:
gesture.send()
# Translators: When trying to read the documentation but there is no selected autocompletion item in
# Eclipse
ui.message(_("No selection"))
return

# Try to locate the documentation document
Expand Down
10 changes: 8 additions & 2 deletions source/appModules/powerpnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,11 +1182,17 @@ def reportNewSlide(self):
self.makeTextInfo(textInfos.POSITION_FIRST).updateCaret()
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET)

@scriptHandler.script(
description=_(
# Translators: The description for a script
"Toggles between reporting the speaker notes or the actual slide content. This does not change"
" what is visible on-screen, but only what the user can read with NVDA"
),
category=SCRCAT_POWERPOINT,
)
def script_toggleNotesMode(self,gesture):
self.rootNVDAObject.notesMode=not self.rootNVDAObject.notesMode
self.rootNVDAObject.handleSlideChange()
# Translators: The description for a script
script_toggleNotesMode.__doc__=_("Toggles between reporting the speaker notes or the actual slide content. This does not change what is visible on-screen, but only what the user can read with NVDA")

def script_slideChange(self,gesture):
gesture.send()
Expand Down
4 changes: 1 addition & 3 deletions source/browseMode.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2007-2023 NV Access Limited, Babbage B.V., James Teh, Leonard de Ruijter,
# Thomas Stivers, Accessolutions, Julien Cochuyt
# Thomas Stivers, Accessolutions, Julien Cochuyt, Cyrille Bougot
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

Expand Down Expand Up @@ -604,8 +604,6 @@ def script_passThrough(self,gesture):
self._focusLastFocusableObject()
api.processPendingEvents(processEventQueue=True)
gesture.send()
# Translators: the description for the passThrough script on browseMode documents.
script_passThrough.__doc__ = _("Passes gesture through to the application")

def script_disablePassThrough(self, gesture):
if not self.passThrough or self.disableAutoPassThrough:
Expand Down

0 comments on commit 0393dc0

Please sign in to comment.