changeset d02b76c94c5e in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=d02b76c94c5e description: print timestamp as invisible in history window when we don't want to see it so we can search for it. See #3939
diffstat:
src/history_window.py | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diffs (33 lines):
diff -r 7eb2b43c233d -r d02b76c94c5e src/history_window.py --- a/src/history_window.py Sun Apr 03 21:32:53 2016 +0200 +++ b/src/history_window.py Sun Apr 17 20:31:19 2016 +0200 @@ -73,6 +73,7 @@ scrolledwindow.add(self.history_textview.tv) self.history_buffer = self.history_textview.tv.get_buffer() self.history_buffer.create_tag('highlight', background = 'yellow') + self.history_buffer.create_tag('invisible', invisible=True) self.checkbutton = xml.get_object('log_history_checkbutton') self.checkbutton.connect('toggled', self.on_log_history_checkbutton_toggled) @@ -421,6 +422,12 @@ tim = time.strftime('%X ', time.localtime(float(tim))) buf.insert_with_tags_by_name(end_iter, tim + '\n', 'time_sometimes') + else: # don't print time. So we print it as invisible to be able to + # search for it + timestamp_str = gajim.config.get('time_stamp') + timestamp_str = helpers.from_one_line(timestamp_str) + tim = time.strftime(timestamp_str, time.localtime(float(tim))) + buf.insert_with_tags_by_name(end_iter, tim, 'invisible')
tag_name = '' tag_msg = '' @@ -618,7 +625,7 @@ timestamp_str = gajim.config.get('time_stamp') timestamp_str = helpers.from_one_line(timestamp_str) tim = time.strftime(timestamp_str, local_time) - result = start_iter.forward_search(tim, gtk.TEXT_SEARCH_VISIBLE_ONLY, + result = start_iter.forward_search(tim, gtk.TEXT_SEARCH_TEXT_ONLY, None) if result is not None: match_start_iter, match_end_iter = result