[tpatnoe] add In and Out comment in XML console. Fixes #4977

This commit is contained in:
Yann Leboulanger 2009-04-22 08:43:04 +00:00
parent 8ccba78a15
commit 27ea3d9f14

View file

@ -2506,9 +2506,14 @@ class XMLConsoleWindow:
self.tagIn = buffer_.create_tag('incoming')
color = gajim.config.get('inmsgcolor')
self.tagIn.set_property('foreground', color)
self.tagInComment = buffer_.create_tag('in_comment')
self.tagInComment.set_property('foreground', color)
self.tagOut = buffer_.create_tag('outgoing')
color = gajim.config.get('outmsgcolor')
self.tagOut.set_property('foreground', color)
self.tagOutComment = buffer_.create_tag('out_comment')
self.tagOutComment.set_property('foreground', color)
self.enabled = False
@ -2562,6 +2567,13 @@ class XMLConsoleWindow:
if end_rect.y <= (visible_rect.y + visible_rect.height):
at_the_end = True
end_iter = buffer.get_end_iter()
if kind == 'incoming':
buffer.insert_with_tags_by_name(end_iter, '<!-- In -->\n',
'in_comment')
elif kind == 'outgoing':
buffer.insert_with_tags_by_name(end_iter, '<!-- Out -->\n',
'out_comment')
end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') + \
'\n\n', kind)
if at_the_end: