diff frontends/src/primitivus/chat.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 cae023216bba
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py	Wed Sep 03 20:54:14 2014 +0200
+++ b/frontends/src/primitivus/chat.py	Thu Sep 04 19:05:57 2014 +0200
@@ -26,6 +26,7 @@
 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
 from sat_frontends.primitivus import xmlui
 from sat_frontends.primitivus.constants import Const as C
+from sat_frontends.primitivus.keys import action_key_map as a_key
 import time
 from sat_frontends.tools.jid  import JID
 
@@ -95,26 +96,26 @@
         self.subject = None
 
     def keypress(self, size, key):
-        if key == "meta p": #user wants to (un)hide the presents panel
+        if key == a_key['OCCUPANTS_HIDE']: #user wants to (un)hide the presents panel
             if self.type == 'group':
                 widgets = [widget for (widget, options) in self.chat_colums.contents]
                 if self.present_panel in widgets:
                     self.__removePresentPanel()
                 else:
                     self.__appendPresentPanel()
-        elif key == "meta t": #user wants to (un)hide timestamp
+        elif key == a_key['TIMESTAMP_HIDE']: #user wants to (un)hide timestamp
             self.show_timestamp = not self.show_timestamp
             for wid in self.content:
                 wid._invalidate()
-        elif key == "meta n": #user wants to (not) use short nick
+        elif key == a_key['SHORT_NICKNAME']: #user wants to (not) use short nick
             self.show_short_nick = not self.show_short_nick
             for wid in self.content:
                 wid._invalidate()
-        elif key == "meta l": #user wants to (un)hide widget decoration
+        elif key == a_key['DECORATION_HIDE']: #user wants to (un)hide widget decoration
             show = not isinstance(self._w, sat_widgets.LabelLine)
             self.showDecoration(show)
             self._invalidate()
-        elif key == "meta s": #user wants to (un)hide group's subject or change its apperance
+        elif key == a_key['SUBJECT_SWITCH']: #user wants to (un)hide group's subject or change its apperance
             if self.subject:
                 self.show_title = (self.show_title + 1) % 3
                 if self.show_title == 0: