Mercurial > libervia-backend
comparison frontends/quick_frontend/quick_chat.py @ 120:1ca5f254ce41
primitivus group chat & misc
primitivus: new widget: SurroundedText (text with a character repeated around it)
primitivus: new decorator LabelLine (like lineBox, but with a label on the top line)
wix & primitivus & quick_app: group chat method move to quick_chat
wix: when new message, window is not raised anymore, but RequestUserAttention is called instead
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 08 Jul 2010 14:12:18 +0800 |
parents | fc7583282d40 |
children | a86607e5cf38 |
comparison
equal
deleted
inserted
replaced
119:ded2431cea5a | 120:1ca5f254ce41 |
---|---|
38 """Set the type of the chat | 38 """Set the type of the chat |
39 @param type: can be 'one2one' for single conversation or 'group' for chat à la IRC | 39 @param type: can be 'one2one' for single conversation or 'group' for chat à la IRC |
40 """ | 40 """ |
41 self.type = type | 41 self.type = type |
42 | 42 |
43 def setPresents(self, nicks): | |
44 """Set the users presents in the contact list for a group chat | |
45 @param nicks: list of nicknames | |
46 """ | |
47 debug (_("Adding users %s to room") % nicks) | |
48 if self.type != "group": | |
49 error (_("[INTERNAL] trying to set presents nicks for a non group chat window")) | |
50 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here | |
51 | |
52 def replaceUser(self, nick): | |
53 """Add user if it is not in the group list""" | |
54 debug (_("Replacing user %s") % nick) | |
55 if self.type != "group": | |
56 error (_("[INTERNAL] trying to replace user for a non group chat window")) | |
57 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here | |
58 | |
43 def setUserNick(self, nick): | 59 def setUserNick(self, nick): |
44 """Set the nick of the user, usefull for e.g. change the color of the user""" | 60 """Set the nick of the user, usefull for e.g. change the color of the user""" |
45 self.nick = nick | 61 self.nick = nick |
62 | |
63 def removeUser(self, nick): | |
64 """Remove a user from the group list""" | |
65 debug(_("Removing user %s") % nick) | |
66 if self.type != "group": | |
67 error (_("[INTERNAL] trying to remove user for a non group chat window")) | |
68 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here | |
69 | |
70 def setSubject(self, subject): | |
71 """Set title for a group chat""" | |
72 debug(_("Setting subject to %s") % subject) | |
73 if self.type != "group": | |
74 error (_("[INTERNAL] trying to set subject for a non group chat window")) | |
75 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here | |
46 | 76 |
47 def historyPrint(self, size=20, keep_last=False, profile='@NONE@'): | 77 def historyPrint(self, size=20, keep_last=False, profile='@NONE@'): |
48 """Print the initial history""" | 78 """Print the initial history""" |
49 debug (_("now we print history")) | 79 debug (_("now we print history")) |
50 history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.target, 20) | 80 history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.target, 20) |