changeset b372293ffb6a in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=b372293ffb6a
description: whiteboard plugin: print disconnection reason in chat control
diffstat:
plugins/whiteboard/plugin.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (35 lines):
diff -r a1b1b74e51ea -r b372293ffb6a plugins/whiteboard/plugin.py
--- a/plugins/whiteboard/plugin.py Fri Nov 05 11:08:06 2010 +0100
+++ b/plugins/whiteboard/plugin.py Fri Nov 05 11:09:33 2010 +0100
@@ -188,7 +188,7 @@
def _nec_jingle_disconnected(self, obj):
for base in self.controls:
if base.sid == obj.sid:
- base.stop_whiteboard()
+ base.stop_whiteboard(reason = obj.reason)
@log_calls('WhiteboardPlugin')
def _nec_raw_message(self, obj):
@@ -332,17 +332,20 @@
jingle.add_content('xhtml', content)
jingle.start_session()
- def stop_whiteboard(self):
+ def stop_whiteboard(self, reason=None):
conn = gajim.connections[self.chat_control.account]
self.sid = None
session = conn.get_jingle_session(self.jid, media='xhtml')
if session:
session.end_session()
+ self.button.set_active(False)
+ if reason:
+ txt = _('Whiteboard stopped: %(reason)s') % {'reason': reason}
+ self.chat_control.print_conversation(txt, 'info')
if not self.whiteboard:
return
hbox = self.chat_control.xml.get_object('chat_control_hbox')
if self.whiteboard.hbox in hbox.get_children():
- self.button.set_active(False)
if hasattr(self.whiteboard, 'hbox'):
hbox.remove(self.whiteboard.hbox)
self.whiteboard = None
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits