diff 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
line wrap: on
line diff
--- a/frontends/src/primitivus/contact_list.py	Wed Sep 03 20:54:14 2014 +0200
+++ b/frontends/src/primitivus/contact_list.py	Thu Sep 04 19:05:57 2014 +0200
@@ -21,10 +21,12 @@
 import urwid
 from urwid_satext import sat_widgets
 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
-from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
+from sat_frontends.quick_frontend.quick_utils import unescapePrivate
 from sat_frontends.tools.jid import JID
 from sat_frontends.primitivus.status import StatusBar
 from sat_frontends.primitivus.constants import Const
+from sat_frontends.primitivus.keys import action_key_map as a_key
+
 
 class ContactList(urwid.WidgetWrap, QuickContactList):
     signals = ['click','change']
@@ -63,10 +65,10 @@
         self.update()
 
     def keypress(self, size, key):
-        if key == "meta s": #user wants to (un)hide contacts' statuses
+        if key == a_key['STATUS_HIDE']: #user wants to (un)hide contacts' statuses
             self.show_status = not self.show_status
             self.update()
-        elif key == "meta d": #user wants to (un)hide disconnected contacts
+        elif key == a_key['DISCONNECTED_HIDE']: #user wants to (un)hide disconnected contacts
             self.show_disconnected = not self.show_disconnected
             self.update()
         return super(ContactList, self).keypress(size, key)