Skip to content

NVDAObjects.UIA: handle UIA notification event if enabled by users #11590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
41b0980
Config: add 'report UIA notifications' key to presentation section. R…
josephsl Sep 10, 2020
f9d5d3f
NVDAObjects/UIA: do not handle UIA notification events unl3ess told t…
josephsl Sep 10, 2020
8cb7fe2
Object presentation settings panel: add accessible event notification…
josephsl Sep 10, 2020
13923e7
Report accessible events: disable this setting if using Windows relea…
josephsl Sep 10, 2020
eb44729
User guide: add a paragraph on report accessible event notifications …
josephsl Sep 10, 2020
d814cfc
Merge branch 'master' into UIANotificationToggle
josephsl Oct 10, 2020
0c4ba6e
Confspec: change UIA notification announcement setting to an option. …
josephsl Oct 10, 2020
787d2c5
NVDAObjects.UIA: do not announce notifications if the setting is off …
josephsl Oct 10, 2020
3912874
Object presentation settings: convert 'report accessible event notifi…
josephsl Oct 10, 2020
28a34e6
User guide: update accessible event notifications section to include …
josephsl Oct 10, 2020
902eff7
Merge branch 'master' into UIANotificationToggle
josephsl Oct 12, 2020
e167041
Confspec: 'report accessible event notifications' default value is no…
josephsl Oct 12, 2020
149ed42
NvDAObjects.UIA: swap notification condition checks for focused app. …
josephsl Oct 12, 2020
4d3e461
Object presentation settings: 'focused app' -> 'when application in f…
josephsl Oct 12, 2020
0b3008f
User guide: focused app -> when application in foreground to align wi…
josephsl Oct 13, 2020
473a160
Merge branch 'master' into UIANotificationToggle
josephsl Dec 9, 2020
e8b857d
NVDAObjects/UIA: clarify focused app check syntax. Re #10956.
josephsl Dec 9, 2020
8245f7f
NVDAObjects/UIA: lint
josephsl Dec 9, 2020
8fa4bf6
Merge branch 'master' into UIANotificationToggle
josephsl Jan 2, 2021
323eab7
Update copyright year
josephsl Jan 2, 2021
a2da0c9
Merge branch 'master' into UIANotificationToggle
josephsl Jan 27, 2021
699e19f
Merge branch 'master' of https://github.com/nvaccess/nvda into UIANot…
josephsl Feb 4, 2021
3d8570a
Settings/UIA notification: contextualize UIA notification event optio…
josephsl Feb 4, 2021
75f09d8
Object presentation and user guide: report accessible event notificat…
josephsl Feb 4, 2021
0aa4260
Merge branch 'master' into UIANotificationToggle
josephsl Feb 5, 2021
917029f
Confspec: introduce a dedicated app notification flags to object pres…
josephsl Feb 6, 2021
76ccf57
NVDAObjects.UIA: use new app notifications settings to handle UIA not…
josephsl Feb 6, 2021
35ac01d
GUI/object presentation panel: rename notification values to 'app not…
josephsl Feb 6, 2021
077756e
Object presentation panel/report notifications: checkbox -> checkable…
josephsl Feb 6, 2021
aa66d37
Object presentation panel: rename 'report accessible event notificati…
josephsl Feb 6, 2021
3a123b9
Object presentation panel: redesign onSave routine for report notific…
josephsl Feb 6, 2021
eb4fc3a
User guide: rewrite report notifications/report app notifications sec…
josephsl Feb 6, 2021
5198769
Object presentation panel: lint
josephsl Feb 6, 2021
59fab8d
Merge branch 'master' into UIANotificationToggle
josephsl May 31, 2021
f514059
Merge branch 'master' into UIANotificationToggle
josephsl Jun 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,12 +1814,21 @@ def event_UIA_systemAlert(self):
def event_UIA_notification(self, notificationKind=None, notificationProcessing=UIAHandler.NotificationProcessing_CurrentThenMostRecent, displayString=None, activityId=None):
"""
Introduced in Windows 10 Fall Creators Update (build 16299).
This base implementation announces all notifications from the UIA element.
This base implementation announces all notifications from the UIA element if enabled from NVDA.
Unlike other events, the text to be announced is not the name of the object, and parameters control how the incoming notification should be processed.
Subclasses can override this event and can react to notification processing instructions.
"""
# Do not announce notifications from background apps.
if self.appModule != api.getFocusObject().appModule:
# #10956: ignore this altogether if NVDA should not handle this event
# either always or from background apps.
appNotificationsFromAllApps = config.conf['presentation']["appNotificationsFromAllApps"]
if (
not config.conf['presentation']['reportAppNotifications']
or (
appNotificationsFromAllApps == "focusedApp"
and self.appModule != api.getFocusObject().appModule
)
):
return
if displayString:
if notificationProcessing in (UIAHandler.NotificationProcessing_ImportantMostRecent, UIAHandler.NotificationProcessing_MostRecent):
Expand Down
2 changes: 2 additions & 0 deletions source/config/configSpec.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
guessObjectPositionInformationWhenUnavailable = boolean(default=false)
reportTooltips = boolean(default=false)
reportHelpBalloons = boolean(default=true)
reportAppNotifications = boolean(default=true)
appNotificationsFromAllApps = option("always", "focusedApp", default="focusedApp")
reportObjectDescriptions = boolean(default=True)
reportDynamicContentChanges = boolean(default=True)
reportAutoSuggestionsWithSound = boolean(default=True)
Expand Down
71 changes: 65 additions & 6 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,14 @@ class ObjectPresentationPanel(SettingsPanel):
# See Progress bar output in the Object Presentation Settings section of the User Guide.
("both", _("Speak and beep")),
)
appNotificationLabels = (
# Translators: one of the app notification choices
# to always announce notifications.
("always", pgettext("app notification", "all apps")),
# Translators: one of the app notification choices
# to announce notifications from focused app.
("focusedApp", pgettext("app notification", "foreground app")),
)

def makeSettings(self, settingsSizer):
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
Expand All @@ -1923,12 +1931,47 @@ def makeSettings(self, settingsSizer):
self.bindHelpEvent("ObjectPresentationReportToolTips", self.tooltipCheckBox)
self.tooltipCheckBox.SetValue(config.conf["presentation"]["reportTooltips"])

# Translators: This is the label for a checkbox in the
# Translators: This is the label for a checkable list in the
# object presentation settings panel.
balloonText = _("Report &notifications")
self.balloonCheckBox=sHelper.addItem(wx.CheckBox(self,label=balloonText))
self.bindHelpEvent("ObjectPresentationReportNotifications", self.balloonCheckBox)
self.balloonCheckBox.SetValue(config.conf["presentation"]["reportHelpBalloons"])
notificationsText = _("Report &notifications")
self.reportNotificationChoices = [
# Translators: This is the label for a notification setting in
# report notifications list.
_("help balloons and toasts"),
# Translators: This is the label for a notification setting in
# report notifications list.
_("app notifications")
]
self.notificationsList = sHelper.addLabeledControl(
notificationsText,
nvdaControls.CustomCheckListBox,
choices=self.reportNotificationChoices
)
notificationSettings = ("reportHelpBalloons", "reportAppNotifications")
self.notificationsList.CheckedItems = [
notificationSettings.index(setting) for setting in notificationSettings
if config.conf["presentation"][setting]
]
# Enable/disable app notification list if app notifications checkbox is checked/unchecked.
self.Bind(wx.EVT_CHECKLISTBOX, self.onNotificationToggle)
self.bindHelpEvent("ObjectPresentationReportNotifications", self.notificationsList)
self.notificationsList.Select(0)

# Translators: This is the label for a combo box in the
# object presentation settings panel.
appNotificationText = _("Report &app notifications:")
notificationChoices = [label for setting, label in self.appNotificationLabels]
self.appNotificationList = sHelper.addLabeledControl(
appNotificationText, wx.Choice, choices=notificationChoices
)
self.bindHelpEvent("ObjectPresentationAppNotifications", self.appNotificationList)
notificationSettings = [setting for setting, label in self.appNotificationLabels]
try:
selection = notificationSettings.index(config.conf["presentation"]["appNotificationsFromAllApps"])
except ValueError:
selection = 0
self.appNotificationList.SetSelection(selection)
self.appNotificationList.Enable(config.conf["presentation"]["reportAppNotifications"])

# Translators: This is the label for a checkbox in the
# object presentation settings panel.
Expand Down Expand Up @@ -2001,9 +2044,25 @@ def makeSettings(self, settingsSizer):
)
self.autoSuggestionSoundsCheckBox.SetValue(config.conf["presentation"]["reportAutoSuggestionsWithSound"])

def onNotificationToggle(self, evt):
appNotifications = 1
self.appNotificationList.Enable(
self.notificationsList.IsChecked(appNotifications)
)

def onSave(self):
config.conf["presentation"]["reportTooltips"]=self.tooltipCheckBox.IsChecked()
config.conf["presentation"]["reportHelpBalloons"]=self.balloonCheckBox.IsChecked()
helpBalloonNotifications = 0
config.conf["presentation"]["reportHelpBalloons"] = self.notificationsList.IsChecked(
helpBalloonNotifications
)
appNotifications = 1
config.conf["presentation"]["reportAppNotifications"] = self.notificationsList.IsChecked(
appNotifications
)
config.conf["presentation"]["appNotificationsFromAllApps"] = (
self.appNotificationLabels[self.appNotificationList.GetSelection()][0]
)
config.conf["presentation"]["reportKeyboardShortcuts"]=self.shortcutCheckBox.IsChecked()
config.conf["presentation"]["reportObjectPositionInformation"]=self.positionInfoCheckBox.IsChecked()
config.conf["presentation"]["guessObjectPositionInformationWhenUnavailable"]=self.guessPositionInfoCheckBox.IsChecked()
Expand Down
23 changes: 20 additions & 3 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,26 @@ A checkbox that when checked tells NVDA to report tooltips as they appear.
Many Windows and controls show a small message (or tooltip) when you move the mouse pointer over them, or sometimes when you move the focus to them.

==== Report notifications ====[ObjectPresentationReportNotifications]
This checkbox, when checked, tells NVDA to report help balloons and toast notifications as they appear.
- Help Balloons are like tooltips, but are usually larger in size, and are associated with system events such as a network cable being unplugged, or perhaps to alert you about Windows security issues.
- Toast notifications have been introduced in Windows 10 and appear in the notification centre in the system tray, informing about several events (i.e. if an update has been downloaded, a new e-mail arrived in your inbox, etc.).
Checkboxes in this setting allows you to configure which notifications will be announced.
Notifications can include:
- Help balloons and toasts:
- Help Balloons are like tooltips, but are usually larger in size, and are associated with system events such as a network cable being unplugged, or perhaps to alert you about Windows security issues.
- Toast notifications were introduced in Windows 8 and appear in the notification centre in the system tray, informing about several events (i.e. if an update has been downloaded, a new e-mail arrived in your inbox, etc.).
- Apps: notifications from apps such as page load status in web browsers.
- In Windows 10 Fall creators update (version 1709) or later, app notifications can include UIA accessible event notifications from apps such as Microsoft Edge, microsoft Store, and audio volume changes.
-
-

==== Report app notifications ====[ObjectPresentationAppNotifications]
If app notifications is enabled in [report notifications #ObjectPresentationReportNotifications], this combo box sets which app notifications should be announced.

A special type of app notifications is UIA accessible event notifications, introduced in Windows 10 Fall Creators Update.
Accessible event notifications are used by apps to let assistive technologies such as NVDA announce important information.
These announcements include update check results from Microsoft Store, page load status in Microsoft Edge, and audio volume changes while focused on File Explorer.

The available options are:
- All apps: announce notifications from all apps, including background notifications.
- Foreground app: announce notifications from the app you are using.
-

==== Report Object Shortcut Keys ====[ObjectPresentationShortcutKeys]
Expand Down