Skip to content

Commit

Permalink
version 4.9.0
Browse files Browse the repository at this point in the history
Added an option to change the behavior when pressing the up arrow in an empty message edit field. You can choose from the following options: activate the function of editing the last sent message, move the focus to the last message in the chat or do nothing.
Fixed answering and rejecting calls using hotkeys.
Fixed minor issues such as the ALT+H key combination not working And an issue when the message to which the reply was written was not spoken when pressing the left arrow.
Fixed display of some elements.
  • Loading branch information
unknown committed Jul 15, 2023
1 parent 8f8d5c6 commit 6e6f423
Show file tree
Hide file tree
Showing 33 changed files with 2,390 additions and 1,796 deletions.
29 changes: 29 additions & 0 deletions 4.9.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"addonId": "unigramPlus",
"displayName": "UnigramPlus",
"URL": "",
"description": "This add-on adds a lot of hotkeys for quick navigation through the main elements of the Unigram application, convenient interaction with Chat messages, and also adds many small improvements that make working in Unigram much easier",
"sha256": "73cf081f8930693474e86f87b080b32949650d21868137366a642f2e1cddbcee",
"homepage": "https://github.com/Kostya-Gladkiy/UnigramPlus",
"addonVersionName": "4.9.0",
"addonVersionNumber": {
"major": 4,
"minor": 9,
"patch": 0
},
"minNVDAVersion": {
"major": 2021,
"minor": 2,
"patch": 0
},
"lastTestedVersion": {
"major": 2023,
"minor": 1,
"patch": 0
},
"channel": "stable",
"publisher": "",
"sourceURL": "https://github.com/Kostya-Gladkiy/UnigramPlus",
"license": "GPL 2",
"licenseURL": "https://www.gnu.org/licenses/gpl-2.0.html"
}
24 changes: 21 additions & 3 deletions addon/GlobalPlugins/UnigramPlus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,29 @@ def script_open_settings_dialog(self, gesture, arg = False):
@script(description=_("Accept call"), gesture="kb:ALT+Y")
def script_answeringCall(self, gesture):
desctop = api.getDesktopObject()
notification = next((item.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "PriorityToastView"), False)
if not notification: return
# notification = next((item.firstChild.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "PriorityToastView"), False)
notification = next((item.firstChild.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "ToastCenterScrollViewer"), False)
if not notification:
print("Панелі з дзвінком не знайдено")
return
button = next((item for item in notification.children if item.UIAAutomationId == "VerbButton"), None)
if button: button.doAction()
else: print("Кнопку не знайдено")

# End a call, decline call, or leave a voice chat
@script(description=_("Press \"Decline call\" button if there is an incoming call, \"End call\" button if a call is in progress or leave voice chat if it is active."), gesture="kb:ALT+N")
def script_callCancellation(self, gesture):
desctop = api.getDesktopObject()
notification = next((item.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "PriorityToastView"), False)
# notification = next((item.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "PriorityToastView"), False)
notification = next((item.firstChild.firstChild for item in desctop.children if item.firstChild and hasattr(item.firstChild, "UIAAutomationId") and item.firstChild.UIAAutomationId == "ToastCenterScrollViewer"), False)
button = None
if notification:
button = next((item.next for item in notification.children if item.UIAAutomationId == "VerbButton"), None)
else: print("Панель не знайдено")
if button:
button.doAction()
return
print("Кнопку не знайдено")
AppModule.script_callCancellation(AppModule, gesture)


Expand All @@ -177,6 +184,12 @@ class UnigramPlusSettings(gui.SettingsPanel):
"received": _("Only in received messages"),
"all": _("In all messages")
}
list_actions_when_pressing_up_arrow_in_text_field = {
"block": _("Do nothing"),
"normal": _("Activate editing of last sent message"),
"to_messages": _("Move focus to the last message in a chat"),
}

def makeSettings(self, settingsSizer):
settingsSizerHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
# Selecting an interface language
Expand All @@ -189,6 +202,10 @@ def makeSettings(self, settingsSizer):
# Message sender announcement
self.saySenderName = settingsSizerHelper.addLabeledControl(_("Say the sender's name in:"), wx.Choice, choices=[self.listSaySenderName[item] for item in self.listSaySenderName])
self.saySenderName.SetStringSelection(self.listSaySenderName[conf.get("saySenderName")])
# Selecting the action when pressing the up arrow in the text editor
self.action_when_pressing_up_arrow_in_text_field = settingsSizerHelper.addLabeledControl(
_("Action when pressing the up arrow in the message edit field"), wx.Choice, choices=list(self.list_actions_when_pressing_up_arrow_in_text_field.values()))
self.action_when_pressing_up_arrow_in_text_field.SetStringSelection(self.list_actions_when_pressing_up_arrow_in_text_field[conf.get("action_when_pressing_up_arrow_in_text_field")])
# Report not seen before message content
self.unreadBeforeMessageContent = settingsSizerHelper.addItem(wx.CheckBox(self, label=_("Speak \"Not Seen\" before reading contents of a message")))
self.unreadBeforeMessageContent.SetValue(conf.get("unreadBeforeMessageContent"))
Expand Down Expand Up @@ -253,6 +270,7 @@ def onSave(self):
conf.set("voiceMessageRecordingIndicator", self.get_key(self.listVoiceMessageRecordingIndicator, self.voiceMessageRecordingIndicator.GetStringSelection()))
conf.set("voicingPerformanceIndicators", self.get_key(self.listVoicingPerformanceIndicators, self.voicingPerformanceIndicators.GetStringSelection()))
conf.set("lang", self.get_key(listLanguages, self.lang.GetStringSelection()))
conf.set("action_when_pressing_up_arrow_in_text_field", self.get_key(self.list_actions_when_pressing_up_arrow_in_text_field, self.action_when_pressing_up_arrow_in_text_field.GetStringSelection()))
conf.set("actionDescriptionForLinks", self.actionDescriptionForLinks.IsChecked())
conf.set("voiceFullDescriptionOfLinkToYoutube", self.voiceFullDescriptionOfLinkToYoutube.IsChecked())
# conf.set("isAnnouncesAnswers", self.isAnnouncesAnswers.IsChecked())
Expand Down
1 change: 1 addition & 0 deletions addon/appModules/cnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"automatically announce new messages = boolean(default=False)",
"automatically announce activity in chats = boolean(default=False)",
"notify administrators in messages = boolean(default=True)",
"action_when_pressing_up_arrow_in_text_field = string(default=normal)",
)

class cnf:
Expand Down
Loading

0 comments on commit 6e6f423

Please sign in to comment.