Mercurial > libervia-backend
comparison frontends/src/primitivus/chat.py @ 2022:88c41a195728
primitivus (chat): added :topic (and :subject and :title aliases) to change subject with a dialog (/!\ urwid SàText need to be updated)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 24 Jul 2016 19:00:50 +0200 |
parents | f67da1cab6d3 |
children | 01aff34e8873 |
comparison
equal
deleted
inserted
replaced
2021:6c51e8f17c92 | 2022:88c41a195728 |
---|---|
601 super(Chat, self).onChatState(from_jid, state, profile) | 601 super(Chat, self).onChatState(from_jid, state, profile) |
602 if self.type == C.CHAT_ONE2ONE: | 602 if self.type == C.CHAT_ONE2ONE: |
603 self.title_dynamic = C.CHAT_STATE_ICON[state] | 603 self.title_dynamic = C.CHAT_STATE_ICON[state] |
604 self.host.redraw() # FIXME: should not be necessary | 604 self.host.redraw() # FIXME: should not be necessary |
605 | 605 |
606 def _onSubjectDialogCb(self, button, dialog): | |
607 self.changeSubject(dialog.text) | |
608 self.host.removePopUp(dialog) | |
609 | |
610 def onSubjectDialog(self, new_subject=None): | |
611 dialog = sat_widgets.InputDialog( | |
612 _(u'Change title'), | |
613 _(u'Enter the new title'), | |
614 default_txt=new_subject if new_subject is not None else self.subject) | |
615 dialog.setCallback('ok', self._onSubjectDialogCb, dialog) | |
616 dialog.setCallback('cancel', lambda dummy: self.host.removePopUp(dialog)) | |
617 self.host.showPopUp(dialog) | |
618 | |
606 quick_widgets.register(quick_chat.QuickChat, Chat) | 619 quick_widgets.register(quick_chat.QuickChat, Chat) |
607 quick_widgets.register(quick_games.Tarot, game_tarot.TarotGame) | 620 quick_widgets.register(quick_games.Tarot, game_tarot.TarotGame) |