diff frontends/src/primitivus/primitivus @ 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 f09562b0704d
children 046449cc2bff
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Sun Jul 24 18:59:02 2016 +0200
+++ b/frontends/src/primitivus/primitivus	Sun Jul 24 19:00:50 2016 +0200
@@ -138,6 +138,14 @@
             # FIXME: Q&D way, need to be more generic
             if isinstance(widget, quick_chat.QuickChat):
                 widget.setFilter(args)
+        elif command in ('topic', 'suject', 'title'):
+            try:
+                new_title = args[0].strip()
+            except IndexError:
+                new_title = None
+            widget = self.host.selected_widget
+            if isinstance(widget, quick_chat.QuickChat) and widget.type == C.CHAT_GROUP:
+                widget.onSubjectDialog(new_title)
         else:
             return
         self.set_edit_text('')