Mercurial > libervia-backend
comparison frontends/primitivus/primitivus @ 124:961e0898271f
primitivus chat window
- management of one 2 one / group chat
- timestamp displayed
- added shortcuts for showing/hiding panels
- color used
- fixed vcard bug (contact displayed even if not from current profile if vcard changed/not in cache)
- added VerticalSeparator widget
- *List widgets can now use an other widget than SelectableText
- new UnselectableText widget
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 08 Jul 2010 19:47:54 +0800 |
parents | 1ca5f254ce41 |
children | 8d611eb9ae48 |
comparison
equal
deleted
inserted
replaced
123:34766e0cf970 | 124:961e0898271f |
---|---|
58 const_PALETTE = [('title', 'black', 'light gray', 'standout,underline'), | 58 const_PALETTE = [('title', 'black', 'light gray', 'standout,underline'), |
59 ('selected', 'default', 'dark red'), | 59 ('selected', 'default', 'dark red'), |
60 ('selected_focus', 'default,bold', 'dark red'), | 60 ('selected_focus', 'default,bold', 'dark red'), |
61 ('default', 'default', 'default'), | 61 ('default', 'default', 'default'), |
62 ('default_focus', 'default,bold', 'default'), | 62 ('default_focus', 'default,bold', 'default'), |
63 ('date', 'light gray', 'default'), | |
64 ('my_nick', 'dark red,bold', 'default'), | |
65 ('other_nick', 'dark cyan,bold', 'default'), | |
63 ] | 66 ] |
64 | 67 |
65 class ChatList(QuickChatList): | 68 class ChatList(QuickChatList): |
66 """This class manage the list of chat windows""" | 69 """This class manage the list of chat windows""" |
67 | 70 |
106 elif input == 'ctrl d' and 'D' in self.bridge.getVersion(): #Debug only for dev versions | 109 elif input == 'ctrl d' and 'D' in self.bridge.getVersion(): #Debug only for dev versions |
107 self.debug() | 110 self.debug() |
108 elif input == 'meta j': #user wants to join a room | 111 elif input == 'meta j': #user wants to join a room |
109 pop_up_widget = InputDialog(_("Entering a MUC room"), _("Please enter MUC's JID"), default_txt = 'test@conference.necton2.int', cancel_cb=self.removePopUp, ok_cb=self.onJoinRoom) | 112 pop_up_widget = InputDialog(_("Entering a MUC room"), _("Please enter MUC's JID"), default_txt = 'test@conference.necton2.int', cancel_cb=self.removePopUp, ok_cb=self.onJoinRoom) |
110 self.showPopUp(pop_up_widget) | 113 self.showPopUp(pop_up_widget) |
114 elif input == 'f2': #user wants to (un)hide the contact_list | |
115 try: | |
116 center_widgets = self.center_part.widget_list | |
117 if self.contactList in center_widgets: | |
118 self.center_part.set_focus(0) #necessary as the focus change to the next object, we can go out of range if we are on the last object of self.center_part | |
119 center_widgets.remove(self.contactList) | |
120 del self.center_part.column_types[0] | |
121 else: | |
122 center_widgets.insert(0, self.contactList) | |
123 self.center_part.column_types.insert(0, ('weight', 2)) | |
124 except AttributeError: | |
125 #The main widget is not built (probably in Profile Manager) | |
126 pass | |
127 | |
128 | |
111 | 129 |
112 def __buildMainWidget(self): | 130 def __buildMainWidget(self): |
113 self.contactList = ContactList(self, self.CM, on_click = self.contactSelected, on_change=lambda w: self.redraw()) | 131 self.contactList = ContactList(self, self.CM, on_click = self.contactSelected, on_change=lambda w: self.redraw()) |
114 #self.center_part = urwid.Columns([('weight',2,self.contactList),('weight',8,Chat('',self))]) | 132 #self.center_part = urwid.Columns([('weight',2,self.contactList),('weight',8,Chat('',self))]) |
115 self.center_part = urwid.Columns([('weight',2,self.contactList), ('weight',8,urwid.Filler(urwid.Text('')))]) | 133 self.center_part = urwid.Columns([('weight',2,self.contactList), ('weight',8,urwid.Filler(urwid.Text('')))]) |