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
This commit is contained in:
parent
a21a658c33
commit
dbb3520a4f
1 changed files with 113 additions and 31 deletions
|
|
@ -128,10 +128,7 @@ class Chat(wx.Frame, QuickChat):
|
|||
"""Set the users presents in the contact list for a group chat
|
||||
@param nicks: list of nicknames
|
||||
"""
|
||||
debug (_("Adding users %s to room") % nicks)
|
||||
if self.type != "group":
|
||||
error (_("[INTERNAL] trying to set presents nicks for a non group chat window"))
|
||||
return
|
||||
QuickChat.setPresents(self, nicks)
|
||||
for nick in nicks:
|
||||
self.present_panel.presents.replace(nick)
|
||||
self.occupants.add(nick)
|
||||
|
|
@ -143,27 +140,19 @@ class Chat(wx.Frame, QuickChat):
|
|||
if self.type != "group":
|
||||
error (_("[INTERNAL] trying to replace user for a non group chat window"))
|
||||
return
|
||||
self.present_panel.presents.replace(nick)
|
||||
self.occupants.add(nick)
|
||||
|
||||
QuickChat.replaceUser(self, nick)
|
||||
|
||||
def removeUser(self, nick):
|
||||
"""Remove a user from the group list"""
|
||||
debug(_("Removing user %s") % nick)
|
||||
if self.type != "group":
|
||||
error (_("[INTERNAL] trying to remove user for a non group chat window"))
|
||||
return
|
||||
QuickChat.removeUser(self, nick)
|
||||
self.present_panel.presents.remove(nick)
|
||||
self.occupants.remove(nick)
|
||||
|
||||
def setSubject(self, subject):
|
||||
"""Set title for a group chat"""
|
||||
debug(_("Setting subject to %s") % subject)
|
||||
if self.type != "group":
|
||||
error (_("[INTERNAL] trying to set subject for a non group chat window"))
|
||||
return
|
||||
QuickChat.setSubject(self, subject)
|
||||
self.subjectBox.SetValue(subject)
|
||||
|
||||
|
||||
def __eraseMenus(self):
|
||||
"""erase all menus"""
|
||||
menuBar = self.GetMenuBar()
|
||||
|
|
@ -228,7 +217,10 @@ class Chat(wx.Frame, QuickChat):
|
|||
self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font))
|
||||
self.chatWindow.AppendText("%s\n" % msg)
|
||||
if not mymess:
|
||||
self.Raise() #FIXME: too intrusive
|
||||
#TODO: use notification system
|
||||
self.RequestUserAttention() #FIXME: do this only if in background.
|
||||
self.Show() #gof: FIXME: to check
|
||||
#self.Raise() #FIXME: too intrusive
|
||||
|
||||
### events ###
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue