diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 03fc4914f..8fe28418c 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -624,11 +624,12 @@ class ConversationTextview(gtk.TextView): self.print_empty_line() def print_real_text(self, text, text_tags = [], name = None): - '''/me is replaces by name if name is given''' + '''this adds normal and special text. call this to add text''' buffer = self.get_buffer() - # detect urls formatting and if the user has it on emoticons + # /me is replaced by name if name is given if name and text.startswith('/me ') or text.startswith('/me\n'): text = '* ' + name + text[3:] + # detect urls formatting and if the user has it on emoticons index = self.detect_and_print_special_text(text, text_tags) # add the rest of text located in the index and after diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 39bf1bd93..0f03aae8f 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -9025,7 +9025,7 @@ Custom - + True True GTK_POLICY_AUTOMATIC @@ -9034,23 +9034,7 @@ Custom GTK_CORNER_TOP_LEFT - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 0 - 0 - 0 - 0 - 0 - 0 - - + diff --git a/src/history_window.py b/src/history_window.py index 6f5ae8bcb..162c93f0b 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -30,6 +30,7 @@ import time import calendar import gtkgui_helpers +import conversation_textview from common import gajim from common import helpers @@ -65,7 +66,10 @@ class HistoryWindow: self.window = xml.get_widget('history_window') self.calendar = xml.get_widget('calendar') - self.history_buffer = xml.get_widget('history_textview').get_buffer() + scrolledwindow = xml.get_widget('scrolledwindow') + self.history_textview = conversation_textview.ConversationTextview(account) + scrolledwindow.add(self.history_textview) + self.history_buffer = self.history_textview.get_buffer() self.query_entry = xml.get_widget('query_entry') self.search_button = xml.get_widget('search_button') query_builder_button = xml.get_widget('query_builder_button') @@ -114,23 +118,6 @@ class HistoryWindow: # selected month is current month as calendar defaults to selecting # current date self.calendar.emit('month-changed') - - - tag = self.history_buffer.create_tag('incoming') - color = gajim.config.get('inmsgcolor') - tag.set_property('foreground', color) - - tag = self.history_buffer.create_tag('outgoing') - color = gajim.config.get('outmsgcolor') - tag.set_property('foreground', color) - - tag = self.history_buffer.create_tag('status') - color = gajim.config.get('statusmsgcolor') - tag.set_property('foreground', color) - - tag = self.history_buffer.create_tag('time_sometimes') - tag.set_property('foreground', 'grey') - tag.set_property('justification', gtk.JUSTIFY_CENTER) # select and show logs for last date we have logs with contact # and if we don't have logs at all, default to today @@ -297,9 +284,9 @@ class HistoryWindow: message = message + '\n' if tag_msg: - buf.insert_with_tags_by_name(end_iter, message, tag_msg) + self.history_textview.print_real_text(message, tag_msg) else: - buf.insert(end_iter, message) + self.history_textview.print_real_text(message) def set_unset_expand_on_expander(self, widget): '''expander has to have expand to TRUE so scrolledwindow resizes properly