Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_chat.py @ 250:ff1efdeff53f
core: notifs can now have a custom icon and be clickable:
- new host.doAction method, to open a specific widget/target (chat only for now)
- when adding a notif, symbol can now be specified
- an action can be linked to a notification
- notifs design improvments
- plugins contact list and chat use the new doAction/notif action
- if None is given as old widget in SwitchWidget, the new getWidgetToSwitch method is used to select one to switch.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 26 Jan 2019 20:24:48 +0100 |
parents | 5bd94bc08f5c |
children | 145c29b5f2b5 |
comparison
equal
deleted
inserted
replaced
249:5d69e4cab925 | 250:ff1efdeff53f |
---|---|
525 notif_msg, | 525 notif_msg, |
526 title=_(u"private message")) | 526 title=_(u"private message")) |
527 if not is_visible: | 527 if not is_visible: |
528 G.host.addNote( | 528 G.host.addNote( |
529 _(u"private message"), | 529 _(u"private message"), |
530 notif_msg | 530 notif_msg, |
531 symbol = u"chat", | |
532 action = { | |
533 "action": u'chat', | |
534 "target": self.target, | |
535 "profiles": self.profiles} | |
531 ) | 536 ) |
532 else: | 537 else: |
533 if mess_data.mention and not mess_data.history: | 538 if mess_data.mention and not mess_data.history: |
534 notif_msg = self._get_notif_msg(mess_data) | 539 notif_msg = self._get_notif_msg(mess_data) |
535 G.host.addNote( | 540 G.host.addNote( |
536 _(u"mention"), | 541 _(u"mention"), |
537 notif_msg | 542 notif_msg, |
543 symbol = u"chat", | |
544 action = { | |
545 "action": u'chat', | |
546 "target": self.target, | |
547 "profiles": self.profiles} | |
538 ) | 548 ) |
539 if not Window.focus: | 549 if not Window.focus: |
540 G.host.desktop_notif( | 550 G.host.desktop_notif( |
541 notif_msg, | 551 notif_msg, |
542 title=_(u"mention ({room_jid})").format( | 552 title=_(u"mention ({room_jid})").format( |