Skip to content

Commit

Permalink
added announcing duration of voice messages
Browse files Browse the repository at this point in the history
  • Loading branch information
beqabeqa473 committed May 12, 2020
1 parent f17885a commit 0a7e6a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addon/appModules/unigram.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import appModuleHandler
import controlTypes
from NVDAObjects.UIA import UIA
import re
import tones
import ui

addonHandler.initTranslation()
Expand All @@ -23,6 +25,10 @@ def event_NVDAObject_init(self, obj):
return
if obj.role == controlTypes.ROLE_LISTITEM:
if obj.parent.UIAElement.CurrentAutomationId == "Messages":
duration = re.compile("^(?:(?:(\d+):)?(\d+):)?(\d+)$")
for child in obj.children:
if child.UIAElement.CurrentAutomationId == "Subtitle" and duration.search(child.name):
obj.name = f"{child.name} - {obj.name}"
return
elif obj.parent.UIAElement.CurrentAutomationId == "ScrollingFiles" or obj.parent.UIAElement.CurrentAutomationId == "ScrollingLinks" or obj.parent.UIAElement.CurrentAutomationId == "ScrollingHost" or obj.parent.UIAElement.CurrentAutomationId == "ScrollingMedia" or obj.parent.UIAElement.CurrentAutomationId == "ScrollingMusic" or obj.parent.UIAElement.CurrentAutomationId == "ScrollingVoice" or obj.parent.UIAElement.CurrentAutomationId == "DialogsSearchListView" or obj.lastChild.UIAElement.CurrentAutomationId == "Label":
name = []
Expand Down

0 comments on commit 0a7e6a0

Please sign in to comment.