Repository: nvaccess/nvda

Issue:
enhance documentation for Message Timeout in user guide
**Reported by bdorer on 2015-01-30 22:56**
If you press any routing key on a NVDA message it will be dismissed. If you press a navigation key on the display the timeout starts new.

I think this should be noted in the userguide.



Discussion:
CC @jcsteh
@bdorer I am not sure if this should really be documented. Because it depends may which keys you have assigned and I guess it can also depend on which braille display you use. We would need much more testing with several braille displays to see if it occurs systematically.

Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -32,6 +32,7 @@
 from . import Window
 from .. import NVDAObjectTextInfo
 import scriptHandler
+from scriptHandler import script
 import browseMode
 import inputCore
 import ctypes
@@ -321,7 +322,8 @@ def __init__( self , nodeType , document , formulaObject , formulaCollection ):
 
 class ExcelQuicknavIterator(object):
 	"""
-	Allows iterating over an MS excel collection (e.g. Comments, Formulas or charts) emitting L{QuickNavItem} objects.
+	Allows iterating over an MS excel collection
+	(e.g. notes, Formulas or charts) emitting L{QuickNavItem} objects.
 	"""
 
 	def __init__(self, itemType , document , direction , includeCurrent):
@@ -337,7 +339,8 @@ def __init__(self, itemType , document , direction , includeCurrent):
 
 	def collectionFromWorksheet(self,worksheetObject):
 		"""
-		Fetches a Microsoft Excel collection object from a Microsoft excel worksheet object. E.g. charts, comments, or formula.
+		Fetches a Microsoft Excel collection object from a Microsoft excel worksheet object.
+		E.g. charts, notes, or formula.
 		@param worksheetObject: a Microsoft excel worksheet object.
 		@return: a Microsoft excel collection object.
 		"""
@@ -504,27 +507,35 @@ def navigationHelper(self,direction):
 		cellPosition.Activate()
 		eventHandler.executeEvent('gainFocus',obj)
 
+	@script(gesture="kb:leftArrow")
 	def script_moveLeft(self,gesture):
 		self.navigationHelper("left")
 
+	@script(gesture="kb:rightArrow")
 	def script_moveRight(self,gesture):
 		self.navigationHelper("right")
 
+	@script(gesture="kb:upArrow")
 	def script_moveUp(self,gesture):
 		self.navigationHelper("up")
 
+	@script(gesture="kb:downArrow")
 	def script_moveDown(self,gesture):
 		self.navigationHelper("down")
 
+	@script(gesture="kb:control+upArrow")
 	def script_startOfColumn(self,gesture):
 		self.navigationHelper("startcol")
 
+	@script(gesture="kb:control+leftArrow")
 	def script_startOfRow(self,gesture):
 		self.navigationHelper("startrow")
 
+	@script(gesture="kb:control+rightArrow")
 	def script_endOfRow(self,gesture):
 		self.navigationHelper("endrow")
 
+	@script(gesture="kb:control+downArrow")
 	def script_endOfColumn(self,gesture):
 		self.navigationHelper("endcol")
 
@@ -562,17 +573,6 @@ def script_elementsList(self,gesture):
 	script_elementsList.__doc__ = _("Lists various types of elements in this spreadsheet")
 	script_elementsList.ignoreTreeInterceptorPassThrough=True
 
-	__gestures = {
-		"kb:upArrow": "moveUp",
-		"kb:downArrow":"moveDown",
-		"kb:leftArrow":"moveLeft",
-		"kb:rightArrow":"moveRight",
-		"kb:control+upArrow":"startOfColumn",
-		"kb:control+downArrow":"endOfColumn",
-		"kb:control+leftArrow":"startOfRow",
-		"kb:control+rightArrow":"endOfRow",
-	}
-
 class ElementsListDialog(browseMode.ElementsListDialog):
 
 	ELEMENT_TYPES=(
@@ -581,7 +581,7 @@ class ElementsListDialog(browseMode.ElementsListDialog):
 		("chart", _("&Charts")),
 		# Translators: The label of a radio button to select the type of element
 		# in the browse mode Elements List dialog.
-		("comment", _("C&omments")),
+		("comment", _("N&otes")),
 		# Translators: The label of a radio button to select the type of element
 		# in the browse mode Elements List dialog.
 		("formula", _("Fo&rmulas")),
@@ -930,6 +930,7 @@ def _get_states(self):
 		"kb:control+v",
 		"kb:shift+f11",
 	), canPropagate=True)
+
 	def script_changeSelection(self,gesture):
 		oldSelection=api.getFocusObject()
 		gesture.send()
@@ -1176,6 +1177,10 @@ def _get_columnHeaderText(self):
 	def _get_rowHeaderText(self):
 		return self.parent.fetchAssociatedHeaderCellText(self,columnHeader=False)
 
+	@script(
+		# Translators: the description  for a script for Excel
+		description=_("opens a dropdown item at the current cell"),
+		gesture="kb:alt+downArrow")
 	def script_openDropdown(self,gesture):
 		gesture.send()
 		d=None
@@ -1198,6 +1203,10 @@ def script_openDropdown(self,gesture):
 		d.parent=self
 		eventHandler.queueEvent("gainFocus",d)
 
+	@script(
+		# Translators: the description  for a script for Excel
+		description=_("Sets the current cell as start of column header"),
+		gesture="kb:NVDA+shift+c")
 	def script_setColumnHeader(self,gesture):
 		scriptCount=scriptHandler.getLastScriptRepeatCount()
 		if not config.conf['documentFormatting']['reportTableHeaders']:
@@ -1220,6 +1229,10 @@ def script_setColumnHeader(self,gesture):
 				ui.message(_("Cannot find {address}    in column headers").format(address=self.cellCoordsText))
 	script_setColumnHeader.__doc__=_("Pressing once will set this cell as the first column header for any cells lower and to the right of it within this region. Pressing twice will forget the current column header for this cell.")
 
+	@script(
+		# Translators: the description  for a script for Excel
+		description=_("sets the current cell as start of row header"),
+		gesture="kb:NVDA+shift+r")
 	def script_setRowHeader(self,gesture):
 		scriptCount=scriptHandler.getLastScriptRepeatCount()
 		if not config.conf['documentFormatting']['reportTableHeaders']:
@@ -1399,24 +1412,33 @@ def _get_positionInfo(self):
 		level=max(self.excelCellInfo.outlineLevel-1,0) or None
 		return {'level':level}
 
+	# In Office 2016, 365 and newer, comments are now called notes.
+	# Thus, messages dialog title and so on should refer to notes.
+	@script(
+		# Translators: the description  for a script for Excel
+		description=_("Reports the note on the current cell"),
+		gesture="kb:NVDA+alt+c")
 	def script_reportComment(self,gesture):
 		commentObj=self.excelCellObject.comment
 		text=commentObj.text() if commentObj else None
 		if text:
 			ui.message(text)
 		else:
-			# Translators: A message in Excel when there is no comment
-			ui.message(_("Not on a comment"))
-	# Translators: the description  for a script for Excel
-	script_reportComment.__doc__=_("Reports the comment on the current cell")
+			# Translators: A message in Excel when there is no note
+			ui.message(_("Not on a note"))
 
+	@script(
+		# Translators: the description  for a script for Excel
+		description=_("Opens the note editing dialog"),
+		gesture="kb:shift+f2")
 	def script_editComment(self,gesture):
 		commentObj=self.excelCellObject.comment
-		d = wx.TextEntryDialog(gui.mainFrame, 
-			# Translators: Dialog text for 
-			_("Editing comment for cell {address}").format(address=self.cellCoordsText),
-			# Translators: Title of a dialog edit an Excel comment 
-			_("Comment"),
+		d = wx.TextEntryDialog(
+			gui.mainFrame,
+			# Translators: Dialog text for the note editing dialog
+			_("Editing note for cell {address}").format(address=self.cellCoordsText),
+			# Translators: Title for the note editing  dialog
+			_("Note"),
 			value=commentObj.text() if commentObj else u"",
 			style=wx.TE_MULTILINE|wx.OK|wx.CANCEL)
 		def callback(result):
@@ -1447,14 +1469,6 @@ def reportFocus(self):
 			speech.speak(sequence)
 		super(ExcelCell,self).reportFocus()
 
-	__gestures = {
-		"kb:NVDA+shift+c": "setColumnHeader",
-		"kb:NVDA+shift+r": "setRowHeader",
-		"kb:shift+f2":"editComment",
-		"kb:alt+downArrow":"openDropdown",
-		"kb:NVDA+alt+c":"reportComment",
-	}
-
 class ExcelSelection(ExcelBase):
 
 	role=controlTypes.ROLE_TABLECELL
@@ -1572,29 +1586,19 @@ def _get_selection(self):
 			if controlTypes.STATE_SELECTED in child.states:
 				return child
 
+	@script(
+		gestures=("kb:downArrow", "kb:upArrow", "kb:leftArrow", "kb:rightArrow", "kb:home", "kb:end"),
+		canPropagate=True)
 	def script_selectionChange(self,gesture):
 		gesture.send()
 		newFocus=self.selection or self
 		if eventHandler.lastQueuedFocusObject is newFocus: return
 		eventHandler.queueEvent("gainFocus",newFocus)
-	script_selectionChange.canPropagate=True
 
+	@script(gestures=("kb:escape", "kb:enter", "kb:space"), canPropagate=True)
 	def script_closeDropdown(self,gesture):
 		gesture.send()
 		eventHandler.queueEvent("gainFocus",self.parent)
-	script_closeDropdown.canPropagate=True
-
-	__gestures={
-		"kb:downArrow":"selectionChange",
-		"kb:upArrow":"selectionChange",
-		"kb:leftArrow":"selectionChange",
-		"kb:rightArrow":"selectionChange",
-		"kb:home":"selectionChange",
-		"kb:end":"selectionChange",
-		"kb:escape":"closeDropdown",
-		"kb:enter":"closeDropdown",
-		"kb:space":"closeDropdown",
-	}
 
 	def event_gainFocus(self):
 		child=self.selection
@@ -1723,9 +1727,9 @@ def _getFormControlScreenCoordinates(self):
 			screenBottomRightY=int(Y + (bottomRightCellHeight/2+ bottomRightAddress.Top) * zoomRatio * py / pointsPerInch)
 			return (int(0.5*(screenTopLeftX+screenBottomRightX)), int(0.5*(screenTopLeftY+screenBottomRightY)))
 
+	@script(gestures=("kb:enter", "kb:space", "kb(desktop):numpadEnter"), canPropagate=True)
 	def script_doAction(self,gesture):
 		self.doAction()
-	script_doAction.canPropagate=True
 
 	def doAction(self):
 		(x,y)=self._getFormControlScreenCoordinates()
@@ -1736,12 +1740,6 @@ def doAction(self):
 		self.invalidateCache()
 		wx.CallLater(100,eventHandler.executeEvent,"stateChange",self)
 
-	__gestures= {
-				"kb:enter":"doAction",
-				"kb:space":"doAction",
-				"kb(desktop):numpadEnter":"doAction",
-				}
-
 class ExcelFormControlQuickNavItem(ExcelQuickNavItem):
 
 	def __init__( self , nodeType , document , formControlObject , formControlCollection, treeInterceptorObj ):
@@ -1892,6 +1890,7 @@ def _get_lastChild(self):
 		if self.listSize>0:
 			return self.getChildAtIndex(self.listSize-1)
 
+	@script(gesture="kb:upArrow", canPropagate=True)
 	def script_moveUp(self, gesture):
 		if self.selectedItemIndex > 1:
 			self.selectedItemIndex= self.selectedItemIndex - 1
@@ -1903,8 +1902,8 @@ def script_moveUp(self, gesture):
 			child=self.getChildAtIndex(self.selectedItemIndex-1)
 			if child:
 				eventHandler.queueEvent("gainFocus",child)
-	script_moveUp.canPropagate=True
 
+	@script(gesture="kb:downArrow", canPropagate=True)
 	def script_moveDown(self, gesture):
 		if self.selectedItemIndex < self.listSize:
 			self.selectedItemIndex= self.selectedItemIndex + 1
@@ -1916,7 +1915,6 @@ def script_moveDown(self, gesture):
 			child=self.getChildAtIndex(self.selectedItemIndex-1)
 			if child:
 				eventHandler.queueEvent("gainFocus",child)
-	script_moveDown.canPropagate=True
 
 	def doAction(self):
 		if self.isMultiSelectable:
@@ -1928,11 +1926,6 @@ def doAction(self):
 			child=self.getChildAtIndex(self.selectedItemIndex-1)
 			eventHandler.queueEvent("gainFocus",child)
 
-	__gestures= {
-		"kb:upArrow": "moveUp",
-		"kb:downArrow":"moveDown",
-	}
-
 class ExcelFormControlDropDown(ExcelFormControl):
 
 	def __init__(self,windowHandle=None,parent=None,excelFormControlObject=None):
@@ -1946,29 +1939,24 @@ def __init__(self,windowHandle=None,parent=None,excelFormControlObject=None):
 		except:
 			self.selectedItemIndex=0
 
+	@script(gesture="kb:upArrow", canPropagate=True)
 	def script_moveUp(self, gesture):
 		if self.selectedItemIndex > 1:
 			self.selectedItemIndex= self.selectedItemIndex - 1
 			self.excelOLEFormatObject.Selected[self.selectedItemIndex] = True
 			eventHandler.queueEvent("valueChange",self)
-	script_moveUp.canPropagate=True
 
+	@script(gesture="kb:downArrow", canPropagate=True)
 	def script_moveDown(self, gesture):
 		if self.selectedItemIndex < self.listSize:
 			self.selectedItemIndex= self.selectedItemIndex + 1
 			self.excelOLEFormatObject.Selected[self.selectedItemIndex] = True
 			eventHandler.queueEvent("valueChange",self)
-	script_moveDown.canPropagate=True
 
 	def _get_value(self):
 		if self.selectedItemIndex < self.listSize:
 			return str(self.excelOLEFormatObject.List(self.selectedItemIndex))
 
-	__gestures= {
-		"kb:upArrow": "moveUp",
-		"kb:downArrow":"moveDown",
-	}
-
 class ExcelFormControlScrollBar(ExcelFormControl):
 
 	def __init__(self,windowHandle=None,parent=None,excelFormControlObject=None):
@@ -2008,21 +1996,18 @@ def moveValue(self,up=False,large=False):
 		self.excelControlFormatObject.value=newValue
 		eventHandler.queueEvent("valueChange",self)
 
+	@script(gesture="kb:upArrow")
 	def script_moveUpSmall(self,gesture):
 		self.moveValue(True,False)
 
+	@script(gesture="kb:downArrow")
 	def script_moveDownSmall(self,gesture):
 		self.moveValue(False,False)
 
+	@script(gesture="kb:pageUp")
 	def script_moveUpLarge(self,gesture):
 		self.moveValue(True,True)
 
+	@script(gesture="kb:pageDown")
 	def script_moveDownLarge(self,gesture):
 		self.moveValue(False,True)
-
-	__gestures={
-		"kb:upArrow":"moveUpSmall",
-		"kb:downArrow":"moveDownSmall",
-		"kb:pageUp":"moveUpLarge",
-		"kb:pageDown":"moveDownLarge",
-	}
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -2007,7 +2007,7 @@ def makeSettings(self, settingsSizer):
 
 		# Translators: This is the label for a checkbox in the
 		# document formatting settings panel.
-		commentsText = _("Co&mments")
+		commentsText = _("No&tes and comments")
 		self.commentsCheckBox=docInfoGroup.addItem(wx.CheckBox(self,label=commentsText))
 		self.commentsCheckBox.SetValue(config.conf["documentFormatting"]["reportComments"])
 


Test patch: