Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 1125:d6c3fea5ecfe
quick_frontend, primitivus: add primitivus command ":history [limit]" (default value for limit is 50)
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 23 Aug 2014 20:26:04 +0200 |
parents | 7ee18dbfb661 |
children | 75025461141f |
comparison
equal
deleted
inserted
replaced
1124:7ee18dbfb661 | 1125:d6c3fea5ecfe |
---|---|
36 from sat_frontends.primitivus import xmlui | 36 from sat_frontends.primitivus import xmlui |
37 from sat_frontends.primitivus.progress import Progress | 37 from sat_frontends.primitivus.progress import Progress |
38 from sat_frontends.primitivus.notify import Notify | 38 from sat_frontends.primitivus.notify import Notify |
39 from sat_frontends.tools.misc import InputHistory | 39 from sat_frontends.tools.misc import InputHistory |
40 from sat_frontends.constants import Const as commonConst # FIXME | 40 from sat_frontends.constants import Const as commonConst # FIXME |
41 from sat.tools.jid import JID | 41 from sat.tools.jid import JID |
42 from os.path import join | 42 from os.path import join |
43 | 43 |
44 | 44 |
45 class ChatList(QuickChatList): | 45 class ChatList(QuickChatList): |
46 """This class manage the list of chat windows""" | 46 """This class manage the list of chat windows""" |
131 elif command == 'status': | 131 elif command == 'status': |
132 if args: | 132 if args: |
133 self.app.status_bar.onChange(user_data=sat_widgets.AdvancedEdit(args[0])) | 133 self.app.status_bar.onChange(user_data=sat_widgets.AdvancedEdit(args[0])) |
134 else: | 134 else: |
135 self.app.status_bar.onStatusClick() | 135 self.app.status_bar.onStatusClick() |
136 elif command == 'history': | |
137 try: | |
138 limit = int(args[0]) | |
139 except (IndexError, ValueError): | |
140 limit = 50 | |
141 win = self.app.chat_wins[JID(self.app.contact_list.selected).bare] | |
142 win.clearHistory() | |
143 if limit > 0: | |
144 win.historyPrint(size=limit, profile=self.app.profile) | |
136 else: | 145 else: |
137 return | 146 return |
138 self.set_edit_text('') | 147 self.set_edit_text('') |
139 | 148 |
140 def keypress(self, size, key): | 149 def keypress(self, size, key): |