Mercurial > libervia-backend
comparison frontends/primitivus/contact_list.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 | ded2431cea5a |
children | 03d8bcc67182 |
comparison
equal
deleted
inserted
replaced
119:ded2431cea5a | 120:1ca5f254ce41 |
---|---|
19 along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 """ | 20 """ |
21 | 21 |
22 import urwid | 22 import urwid |
23 from quick_frontend.quick_contact_list import QuickContactList | 23 from quick_frontend.quick_contact_list import QuickContactList |
24 from custom_widgets import Password,List,InputDialog,ConfirmDialog,Alert | 24 from custom_widgets import Password,List,InputDialog,ConfirmDialog,Alert,LabelLine,SurroundedText |
25 | 25 |
26 | 26 |
27 class ContactList(urwid.WidgetWrap, QuickContactList): | 27 class ContactList(urwid.WidgetWrap, QuickContactList): |
28 signals = ['click','change'] | 28 signals = ['click','change'] |
29 | 29 |
33 self.list_wid = List([], style=['single','no_first_select'], align='left', on_click=self.__contactClicked, on_change=on_change) | 33 self.list_wid = List([], style=['single','no_first_select'], align='left', on_click=self.__contactClicked, on_change=on_change) |
34 | 34 |
35 #we now build the widget | 35 #we now build the widget |
36 body_content = urwid.SimpleListWalker([self.list_wid]) | 36 body_content = urwid.SimpleListWalker([self.list_wid]) |
37 frame_body = urwid.ListBox(body_content) | 37 frame_body = urwid.ListBox(body_content) |
38 frame = urwid.Frame(frame_body,urwid.AttrMap(urwid.Text(_("Contacts"),align='center'),'title')) | 38 frame = urwid.Frame(frame_body) #,urwid.AttrMap(urwid.Text(_("Contacts"),align='center'),'title')) |
39 self.main_widget = urwid.LineBox(frame) | 39 self.main_widget = LabelLine(frame,SurroundedText(_("Contacts"))) |
40 urwid.WidgetWrap.__init__(self, self.main_widget) | 40 urwid.WidgetWrap.__init__(self, self.main_widget) |
41 if on_click: | 41 if on_click: |
42 urwid.connect_signal(self, 'click', on_click, user_data) | 42 urwid.connect_signal(self, 'click', on_click, user_data) |
43 if on_change: | 43 if on_change: |
44 urwid.connect_signal(self, 'change', on_change, user_data) | 44 urwid.connect_signal(self, 'change', on_change, user_data) |