comparison frontends/src/primitivus/primitivus @ 530:6c07127ad2ed

primitivus: fixed edit bar's captions encoding (could cause crashes)
author Goffi <goffi@goffi.org>
date Sun, 28 Oct 2012 17:58:47 +0100
parents 0bb595eff25b
children 3eeb6c865e4d
comparison
equal deleted inserted replaced
529:c18e0e108925 530:6c07127ad2ed
213 def __buildMainWidget(self): 213 def __buildMainWidget(self):
214 self.contact_list = ContactList(self, on_click = self.contactSelected, on_change=lambda w: self.redraw()) 214 self.contact_list = ContactList(self, on_click = self.contactSelected, on_change=lambda w: self.redraw())
215 #self.center_part = urwid.Columns([('weight',2,self.contact_list),('weight',8,Chat('',self))]) 215 #self.center_part = urwid.Columns([('weight',2,self.contact_list),('weight',8,Chat('',self))])
216 self.center_part = urwid.Columns([('weight',2,self.contact_list), ('weight',8,urwid.Filler(urwid.Text('')))]) 216 self.center_part = urwid.Columns([('weight',2,self.contact_list), ('weight',8,urwid.Filler(urwid.Text('')))])
217 217
218 modes = {None: ('NORMAL', ''), 218 modes = {None: ('NORMAL', u''),
219 'i': ('INSERTION','> '), 219 'i': ('INSERTION', u'> '),
220 ':': ('COMMAND',':')} 220 ':': ('COMMAND', u':')} #XXX: captions *MUST* be unicode
221 self.editBar = sat_widgets.ModalEdit(modes) 221 self.editBar = sat_widgets.ModalEdit(modes)
222 self.editBar.setCompletionMethod(self._text_completion) 222 self.editBar.setCompletionMethod(self._text_completion)
223 urwid.connect_signal(self.editBar,'click',self.onTextEntered) 223 urwid.connect_signal(self.editBar,'click',self.onTextEntered)
224 self.menu_roller = self.__buildMenuRoller() 224 self.menu_roller = self.__buildMenuRoller()
225 self.main_widget = sat_widgets.FocusFrame(self.center_part, header=self.menu_roller, footer=self.editBar, focus_part='footer') 225 self.main_widget = sat_widgets.FocusFrame(self.center_part, header=self.menu_roller, footer=self.editBar, focus_part='footer')