Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 507:f98bef71a918
frontends, core, plugin XEP-0045: leave implementation + better nick change
- memory: individual entity cache can be deleted
- plugin XEP-0045: nick change are now detected and userChangedNick signal is sent instead of joined/left
- plugin XEP-0045: leave implementation
- frontends: userChangedNick signal management
- Primitivus: an alert is shown in notification bar in case of error in sendMessage
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 28 Sep 2012 00:26:24 +0200 |
parents | 10119c2a9d33 |
children | 886754295efe |
comparison
equal
deleted
inserted
replaced
506:2e43c74815ad | 507:f98bef71a918 |
---|---|
68 urwid.connect_signal(self.notBar,'change',self.onNotification) | 68 urwid.connect_signal(self.notBar,'change',self.onNotification) |
69 self.progress_wid = Progress(self) | 69 self.progress_wid = Progress(self) |
70 urwid.connect_signal(self.notBar.progress,'click',lambda x:self.addWindow(self.progress_wid)) | 70 urwid.connect_signal(self.notBar.progress,'click',lambda x:self.addWindow(self.progress_wid)) |
71 self.__saved_overlay = None | 71 self.__saved_overlay = None |
72 | 72 |
73 self.notify = Notify() | 73 self.x_notify = Notify() |
74 | 74 |
75 def debug(self): | 75 def debug(self): |
76 """convenient method to reset screen and launch p(u)db""" | 76 """convenient method to reset screen and launch p(u)db""" |
77 try: | 77 try: |
78 import pudb | 78 import pudb |
297 def onTextEntered(self, editBar): | 297 def onTextEntered(self, editBar): |
298 """Called when text is entered in the main edit bar""" | 298 """Called when text is entered in the main edit bar""" |
299 contact = self.contact_list.getContact() ###Based on the fact that there is currently only one contact selectableat once | 299 contact = self.contact_list.getContact() ###Based on the fact that there is currently only one contact selectableat once |
300 if contact: | 300 if contact: |
301 chat = self.chat_wins[contact] | 301 chat = self.chat_wins[contact] |
302 self.bridge.sendMessage(contact, | 302 try: |
303 self.bridge.sendMessage(contact, | |
303 editBar.get_edit_text(), | 304 editBar.get_edit_text(), |
304 mess_type = "groupchat" if chat.type == 'group' else "chat", | 305 mess_type = "groupchat" if chat.type == 'group' else "chat", |
305 profile_key=self.profile) | 306 profile_key=self.profile) |
307 except: | |
308 self.notify(_("Error while sending message")) | |
306 editBar.set_edit_text('') | 309 editBar.set_edit_text('') |
307 | 310 |
308 def newMessage(self, from_jid, msg, type, to_jid, profile): | 311 def newMessage(self, from_jid, msg, type, to_jid, profile): |
309 if not self.check_profile(profile): | 312 if not self.check_profile(profile): |
310 return | 313 return |