Use one focus_out_line pixbuf for all conv_textview instances

This commit is contained in:
Jean-Marie Traissard 2007-02-08 23:00:27 +00:00
parent 2d55775f85
commit 578fd59361
1 changed files with 7 additions and 5 deletions

View File

@ -35,6 +35,10 @@ from common.exceptions import GajimGeneralException
class ConversationTextview: class ConversationTextview:
'''Class for the conversation textview (where user reads already said messages) '''Class for the conversation textview (where user reads already said messages)
for chat/groupchat windows''' for chat/groupchat windows'''
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'muc_separator.png')
FOCUS_OUT_LINE_PIXBUF = gtk.gdk.pixbuf_new_from_file(path_to_file)
def __init__(self, account, used_in_history_window = False): def __init__(self, account, used_in_history_window = False):
'''if used_in_history_window is True, then we do not show '''if used_in_history_window is True, then we do not show
Clear menuitem in context menu''' Clear menuitem in context menu'''
@ -138,11 +142,8 @@ class ConversationTextview:
self.focus_out_end_iter_offset = None self.focus_out_end_iter_offset = None
self.line_tooltip = tooltips.BaseTooltip() self.line_tooltip = tooltips.BaseTooltip()
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'muc_separator.png')
self.focus_out_line_pixbuf = gtk.gdk.pixbuf_new_from_file(path_to_file)
# use it for hr too # use it for hr too
self.tv.focus_out_line_pixbuf = self.focus_out_line_pixbuf self.tv.focus_out_line_pixbuf = ConversationTextview.FOCUS_OUT_LINE_PIXBUF
def del_handlers(self): def del_handlers(self):
for i in self.handlers.keys(): for i in self.handlers.keys():
@ -239,7 +240,8 @@ class ConversationTextview:
# add the new focus out line # add the new focus out line
end_iter = buffer.get_end_iter() end_iter = buffer.get_end_iter()
buffer.insert(end_iter, '\n') buffer.insert(end_iter, '\n')
buffer.insert_pixbuf(end_iter, self.focus_out_line_pixbuf) buffer.insert_pixbuf(end_iter,
ConversationTextview.FOCUS_OUT_LINE_PIXBUF)
end_iter = buffer.get_end_iter() end_iter = buffer.get_end_iter()
before_img_iter = end_iter.copy() before_img_iter = end_iter.copy()