From 522b8d3d13ff66c9f9a9550afa7ee25ece9e9f1e Mon Sep 17 00:00:00 2001 From: Nikita Tseykovets Date: Sat, 30 Dec 2023 17:20:32 +0300 Subject: [PATCH 1/4] If command for report the note on the current Excel cell pressed twice, presents the information in browse mode --- source/NVDAObjects/window/excel.py | 16 +++++++++++++--- user_docs/en/changes.t2t | 3 +++ user_docs/en/userGuide.t2t | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py index 9d3c3b97e0c..d0c4acdd77c 100755 --- a/source/NVDAObjects/window/excel.py +++ b/source/NVDAObjects/window/excel.py @@ -1679,8 +1679,11 @@ def _get_positionInfo(self): # 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"), + description=_( + # Translators: the description for a script for Excel + "Reports the note on the current cell. " + "If pressed twice, presents the information in browse mode" + ), gesture="kb:NVDA+alt+c", category=SCRCAT_SYSTEMCARET, speakOnDemand=True, @@ -1689,7 +1692,14 @@ def script_reportComment(self,gesture): commentObj=self.excelCellObject.comment text=commentObj.text() if commentObj else None if text: - ui.message(text) + if repeats == 0: + ui.message(text) + elif repeats == 1: + ui.browseableMessage( + text, + # Translators: title for note on the current Excel cell dialog. + _("Note") + ) else: # Translators: A message in Excel when there is no note ui.message(_("Not on a note")) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 07e132d739f..1183cfb5e9b 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -10,6 +10,9 @@ What's New in NVDA == Changes == +- Microsoft Office: + - When command for report the note on the current Excel cell (NVDA+Alt+C) pressed twice, presents the information in browse mode. +- == Bug Fixes == diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index eccc021d68e..a67dbd3fccf 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -1255,7 +1255,7 @@ Selecting a form field and pressing enter or the Move to button moves to that fi +++ Reporting Notes +++[ExcelReportingComments] %kc:beginInclude -To report any notes for the currently focused cell, press NVDA+alt+c. +To report any notes for the currently focused cell, press NVDA+alt+c. Pressing twice shows the information in a window. In Microsoft 2016, 365 and newer, the classic comments in Microsoft Excel have been renamed to "notes". %kc:endInclude All notes for the worksheet can also be listed in the NVDA Elements List after pressing NVDA+f7. From 6d1dad4237470d8c127e75197093c6114f8274a8 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 2 Jan 2024 11:18:18 +1100 Subject: [PATCH 2/4] Apply suggestions from code review --- source/NVDAObjects/window/excel.py | 2 +- user_docs/en/changes.t2t | 3 ++- user_docs/en/userGuide.t2t | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py index d0c4acdd77c..88b268d1072 100755 --- a/source/NVDAObjects/window/excel.py +++ b/source/NVDAObjects/window/excel.py @@ -1680,7 +1680,7 @@ def _get_positionInfo(self): # Thus, messages dialog title and so on should refer to notes. @script( description=_( - # Translators: the description for a script for Excel + # Translators: the description for a script for Excel "Reports the note on the current cell. " "If pressed twice, presents the information in browse mode" ), diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 1183cfb5e9b..9ebc53ad69d 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -11,7 +11,8 @@ What's New in NVDA == Changes == - Microsoft Office: - - When command for report the note on the current Excel cell (NVDA+Alt+C) pressed twice, presents the information in browse mode. + - When the command to report the note of the current Excel cell is located is pressed twice (``NVDA+alt+c``), the information is presented browse mode. + - - diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index a67dbd3fccf..5499adb9f75 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -1255,7 +1255,8 @@ Selecting a form field and pressing enter or the Move to button moves to that fi +++ Reporting Notes +++[ExcelReportingComments] %kc:beginInclude -To report any notes for the currently focused cell, press NVDA+alt+c. Pressing twice shows the information in a window. +To report any notes for the currently focused cell, press ``NVDA+alt+c``. +Pressing twice shows the information in a window. In Microsoft 2016, 365 and newer, the classic comments in Microsoft Excel have been renamed to "notes". %kc:endInclude All notes for the worksheet can also be listed in the NVDA Elements List after pressing NVDA+f7. From 3db86363fcbf7a977ca0b26c81de34b30a3ba220 Mon Sep 17 00:00:00 2001 From: Nikita Tseykovets Date: Tue, 2 Jan 2024 21:46:15 +0300 Subject: [PATCH 3/4] Fix a bug with handling script repeats --- source/NVDAObjects/window/excel.py | 1 + user_docs/en/changes.t2t | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py index 88b268d1072..dff6ec38ee4 100755 --- a/source/NVDAObjects/window/excel.py +++ b/source/NVDAObjects/window/excel.py @@ -1692,6 +1692,7 @@ def script_reportComment(self,gesture): commentObj=self.excelCellObject.comment text=commentObj.text() if commentObj else None if text: + repeats = scriptHandler.getLastScriptRepeatCount() if repeats == 0: ui.message(text) elif repeats == 1: diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 9ebc53ad69d..24f2be9aab9 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -11,7 +11,7 @@ What's New in NVDA == Changes == - Microsoft Office: - - When the command to report the note of the current Excel cell is located is pressed twice (``NVDA+alt+c``), the information is presented browse mode. + - When the command to report the note of the current Excel cell is located is pressed twice (``NVDA+alt+c``), the information is presented browse mode. (#15986, @tseykovets) - - From 9232132a42bec83ed7cf02478e93bf398ba8255d Mon Sep 17 00:00:00 2001 From: Nikita Tseykovets Date: Wed, 17 Jan 2024 10:48:45 +0300 Subject: [PATCH 4/4] Reformulate the description of the changes --- user_docs/en/changes.t2t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 24f2be9aab9..98579455ab5 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -11,7 +11,7 @@ What's New in NVDA == Changes == - Microsoft Office: - - When the command to report the note of the current Excel cell is located is pressed twice (``NVDA+alt+c``), the information is presented browse mode. (#15986, @tseykovets) + - Excel: When "report any notes for the currently focused cell" (NVDA+alt+c) is pressed twice, the information is shown in a window. (#15986, @tseykovets) - -