Mercurial > libervia-backend
comparison frontends/src/primitivus/contact_list.py @ 1158:c0f15e52695a
primitivus: use of new keys modules from Urwid SàText
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 04 Sep 2014 19:05:57 +0200 |
parents | 75025461141f |
children | f36d7068a44b |
comparison
equal
deleted
inserted
replaced
1157:c4b62e6b7377 | 1158:c0f15e52695a |
---|---|
19 | 19 |
20 from sat.core.i18n import _ | 20 from sat.core.i18n import _ |
21 import urwid | 21 import urwid |
22 from urwid_satext import sat_widgets | 22 from urwid_satext import sat_widgets |
23 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList | 23 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList |
24 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate | 24 from sat_frontends.quick_frontend.quick_utils import unescapePrivate |
25 from sat_frontends.tools.jid import JID | 25 from sat_frontends.tools.jid import JID |
26 from sat_frontends.primitivus.status import StatusBar | 26 from sat_frontends.primitivus.status import StatusBar |
27 from sat_frontends.primitivus.constants import Const | 27 from sat_frontends.primitivus.constants import Const |
28 from sat_frontends.primitivus.keys import action_key_map as a_key | |
29 | |
28 | 30 |
29 class ContactList(urwid.WidgetWrap, QuickContactList): | 31 class ContactList(urwid.WidgetWrap, QuickContactList): |
30 signals = ['click','change'] | 32 signals = ['click','change'] |
31 | 33 |
32 def __init__(self, host, on_click=None, on_change=None, user_data=None): | 34 def __init__(self, host, on_click=None, on_change=None, user_data=None): |
61 | 63 |
62 def update_jid(self, jid): | 64 def update_jid(self, jid): |
63 self.update() | 65 self.update() |
64 | 66 |
65 def keypress(self, size, key): | 67 def keypress(self, size, key): |
66 if key == "meta s": #user wants to (un)hide contacts' statuses | 68 if key == a_key['STATUS_HIDE']: #user wants to (un)hide contacts' statuses |
67 self.show_status = not self.show_status | 69 self.show_status = not self.show_status |
68 self.update() | 70 self.update() |
69 elif key == "meta d": #user wants to (un)hide disconnected contacts | 71 elif key == a_key['DISCONNECTED_HIDE']: #user wants to (un)hide disconnected contacts |
70 self.show_disconnected = not self.show_disconnected | 72 self.show_disconnected = not self.show_disconnected |
71 self.update() | 73 self.update() |
72 return super(ContactList, self).keypress(size, key) | 74 return super(ContactList, self).keypress(size, key) |
73 | 75 |
74 def __contains__(self, jid): | 76 def __contains__(self, jid): |