print subject first

This commit is contained in:
Nikos Kouremenos 2005-07-08 00:53:50 +00:00
parent 4fe2414534
commit e902eaed7d
1 changed files with 7 additions and 6 deletions

View File

@ -236,7 +236,7 @@ class Chat:
img = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO, img = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,
gtk.ICON_SIZE_MENU) gtk.ICON_SIZE_MENU)
item.set_image(img) item.set_image(img)
item.connect('activate', lambda obj,jid:self.set_active_tab( item.connect('activate', lambda obj, jid:self.set_active_tab(
jid), jid) jid), jid)
menu.append(item) menu.append(item)
@ -832,6 +832,7 @@ class Chat:
def print_conversation_line(self, text, jid, kind, name, tim, def print_conversation_line(self, text, jid, kind, name, tim,
other_tags_for_name = [], other_tags_for_time = [], other_tags_for_name = [], other_tags_for_time = [],
other_tags_for_text = [], count_as_new = True, subject = None): other_tags_for_text = [], count_as_new = True, subject = None):
'''' prints 'chat' type messages '''
textview = self.xmls[jid].get_widget('conversation_textview') textview = self.xmls[jid].get_widget('conversation_textview')
buffer = textview.get_buffer() buffer = textview.get_buffer()
buffer.begin_user_action() buffer.begin_user_action()
@ -886,15 +887,15 @@ class Chat:
# detect urls formatting and if the user has it on emoticons # detect urls formatting and if the user has it on emoticons
index = self.detect_and_print_special_text(text, jid, text_tags) index = self.detect_and_print_special_text(text, jid, text_tags)
if subject: # if we have subject, show it too!
subject = _('Subject: %s\n') % subject
end_iter = buffer.get_end_iter()
buffer.insert(end_iter, subject)
# add the rest of text located in the index and after # add the rest of text located in the index and after
end_iter = buffer.get_end_iter() end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, text[index:], *text_tags) buffer.insert_with_tags_by_name(end_iter, text[index:], *text_tags)
if subject: # if we have subject, send it too!
subject = '\n' + _('Subject: %s') % subject
end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, subject, *text_tags)
#scroll to the end of the textview #scroll to the end of the textview
end = False end = False
if at_the_end or kind == 'outgoing': if at_the_end or kind == 'outgoing':