fix newline in history textview and timestamp in conversation textview

This commit is contained in:
Denis Fomin 2013-01-08 13:22:33 +04:00
parent a9464b4cf6
commit 402e1e241d
2 changed files with 13 additions and 6 deletions

View File

@ -1233,8 +1233,11 @@ class ConversationTextview(GObject.GObject):
if current_print_time == 'always' and kind != 'info' and not simple:
timestamp_str = self.get_time_to_show(tim)
timestamp = time.strftime(timestamp_str, tim)
buffer_.insert_with_tags_by_name(end_iter, timestamp,
*other_tags_for_time)
if other_tags_for_time:
buffer_.insert_with_tags_by_name(end_iter, timestamp,
*other_tags_for_time)
else:
buffer_.insert (end_iter, timestamp)
elif current_print_time == 'sometimes' and kind != 'info' and not simple:
every_foo_seconds = 60 * gajim.config.get(
'print_ichat_every_foo_minutes')
@ -1248,7 +1251,7 @@ class ConversationTextview(GObject.GObject):
else:
tim_format = self.get_time_to_show(tim)
buffer_.insert_with_tags_by_name(end_iter, tim_format + '\n',
'time_sometimes')
'time_sometimes')
# If there's a displaymarking, print it here.
if displaymarking:
self.print_displaymarking(displaymarking)

View File

@ -472,8 +472,10 @@ class HistoryWindow:
after_str = gajim.config.get('after_nickname')
after_str = helpers.from_one_line(after_str)
format = before_str + contact_name + after_str + ' '
buf.insert_with_tags_by_name(end_iter, format, tag_name)
if tag_name:
buf.insert_with_tags_by_name(end_iter, format, tag_name)
else:
buf.insert(end_iter, format)
if subject:
message = _('Subject: %s\n') % subject + message
xhtml = None
@ -486,7 +488,9 @@ class HistoryWindow:
else:
self.history_textview.print_real_text(message, name=contact_name,
xhtml=xhtml)
self.history_textview.print_real_text('\n')
buffer_ = self.history_textview.tv.get_buffer()
eob = buffer_.get_end_iter()
buffer_.insert_with_tags_by_name(eob, '\n', 'eol')
def on_search_entry_activate(self, widget):
text = self.search_entry.get_text()