comparison frontends/primitivus/chat.py @ 125:8d611eb9ae48

primitivus: contact list enhancement - primitivus: contact list now display groups and sexy name (instead of bare jid) - primitivus: contact list now show an alert when somebody want to contact you, and its chat window is not on the screen - primitivus: cursor is now visible when going to chat window (useful to go back in logs)
author Goffi <goffi@goffi.org>
date Mon, 12 Jul 2010 17:50:00 +0800
parents 961e0898271f
children 1b33b681ebd8
comparison
equal deleted inserted replaced
124:961e0898271f 125:8d611eb9ae48
46 46
47 def rows(self,size,focus=False): 47 def rows(self,size,focus=False):
48 return self.display_widget(size, focus).rows(size, focus) 48 return self.display_widget(size, focus).rows(size, focus)
49 49
50 def render(self, size, focus=False): 50 def render(self, size, focus=False):
51 return self.display_widget(size, focus).render(size, focus) 51 canvas = urwid.CompositeCanvas(self.display_widget(size, focus).render(size, focus))
52 if focus:
53 canvas.set_cursor(self.get_cursor_coords(size))
54 return canvas
55
56 def get_cursor_coords(self, size):
57 #(maxcol,) = size
58 return 0, 0
52 59
53 def display_widget(self, size, focus): 60 def display_widget(self, size, focus):
54 my_mess = (self.from_jid.resource == self.parent.nick) if self.parent.type == "group" else (self.from_jid.short == self.my_jid.short) #mymess = True if message comes from local user 61 my_mess = (self.from_jid.resource == self.parent.nick) if self.parent.type == "group" else (self.from_jid.short == self.my_jid.short) #mymess = True if message comes from local user
55 render_txt = [] 62 render_txt = []
56 if self.parent.show_timestamp: 63 if self.parent.show_timestamp:
132 main_widget = self.columns 139 main_widget = self.columns
133 self._w = main_widget 140 self._w = main_widget
134 141
135 142
136 def __buildPresentList(self): 143 def __buildPresentList(self):
137 self.present_wid = custom_widgets.GenericList([],option_type = custom_widgets.UnselectableText) 144 self.present_wid = custom_widgets.GenericList([],option_type = custom_widgets.ClickableText)
138 return self.present_wid 145 return self.present_wid
139 146
140 def __appendPresentPanel(self): 147 def __appendPresentPanel(self):
141 self.columns.widget_list.append(self.present_panel) 148 self.columns.widget_list.append(self.present_panel)
142 self.columns.column_types.append(('weight', 2)) 149 self.columns.column_types.append(('weight', 2))