Use icons from IconTheme in HistoryWindow
This commit is contained in:
parent
cb90d46996
commit
2c2e946a88
|
@ -140,11 +140,11 @@ def get_completion_liststore(entry):
|
||||||
(Pixbuf, Text) rows
|
(Pixbuf, Text) rows
|
||||||
"""
|
"""
|
||||||
completion = Gtk.EntryCompletion()
|
completion = Gtk.EntryCompletion()
|
||||||
liststore = Gtk.ListStore(GdkPixbuf.Pixbuf, str)
|
liststore = Gtk.ListStore(str, str)
|
||||||
|
|
||||||
render_pixbuf = Gtk.CellRendererPixbuf()
|
render_pixbuf = Gtk.CellRendererPixbuf()
|
||||||
completion.pack_start(render_pixbuf, False)
|
completion.pack_start(render_pixbuf, False)
|
||||||
completion.add_attribute(render_pixbuf, 'pixbuf', 0)
|
completion.add_attribute(render_pixbuf, 'icon_name', 0)
|
||||||
|
|
||||||
render_text = Gtk.CellRendererText()
|
render_text = Gtk.CellRendererText()
|
||||||
completion.pack_start(render_text, True)
|
completion.pack_start(render_text, True)
|
||||||
|
|
|
@ -169,10 +169,8 @@ class HistoryWindow:
|
||||||
for account in self.accounts_seen_online:
|
for account in self.accounts_seen_online:
|
||||||
completion_dict.update(helpers.get_contact_dict_for_account(account))
|
completion_dict.update(helpers.get_contact_dict_for_account(account))
|
||||||
|
|
||||||
muc_active_img = gtkgui_helpers.load_icon('muc_active')
|
muc_active_icon = gtkgui_helpers.get_iconset_name_for('muc-active')
|
||||||
contact_img = app.interface.jabber_state_images['16']['online']
|
online_icon = gtkgui_helpers.get_iconset_name_for('online')
|
||||||
muc_active_pix = muc_active_img.get_pixbuf()
|
|
||||||
contact_pix = contact_img.get_pixbuf()
|
|
||||||
|
|
||||||
keys = list(completion_dict.keys())
|
keys = list(completion_dict.keys())
|
||||||
# Move the actual jid at first so we load history faster
|
# Move the actual jid at first so we load history faster
|
||||||
|
@ -204,7 +202,7 @@ class HistoryWindow:
|
||||||
|
|
||||||
if app.logger.jid_is_room_jid(completed) or\
|
if app.logger.jid_is_room_jid(completed) or\
|
||||||
app.logger.jid_is_from_pm(completed):
|
app.logger.jid_is_from_pm(completed):
|
||||||
pix = muc_active_pix
|
icon = muc_active_icon
|
||||||
if app.logger.jid_is_from_pm(completed):
|
if app.logger.jid_is_from_pm(completed):
|
||||||
# It's PM. Make it easier to find
|
# It's PM. Make it easier to find
|
||||||
room, nick = app.get_room_and_nick_from_fjid(completed)
|
room, nick = app.get_room_and_nick_from_fjid(completed)
|
||||||
|
@ -214,11 +212,11 @@ class HistoryWindow:
|
||||||
completed2 = info_completion2
|
completed2 = info_completion2
|
||||||
info_name = nick
|
info_name = nick
|
||||||
else:
|
else:
|
||||||
pix = contact_pix
|
icon = online_icon
|
||||||
|
|
||||||
if len(completed) > 70:
|
if len(completed) > 70:
|
||||||
completed = completed[:70] + '[\u2026]'
|
completed = completed[:70] + '[\u2026]'
|
||||||
liststore.append((pix, completed))
|
liststore.append((icon, completed))
|
||||||
self.completion_dict[key] = (info_jid, info_acc, info_name,
|
self.completion_dict[key] = (info_jid, info_acc, info_name,
|
||||||
info_completion)
|
info_completion)
|
||||||
self.completion_dict[completed] = (info_jid, info_acc,
|
self.completion_dict[completed] = (info_jid, info_acc,
|
||||||
|
@ -226,7 +224,7 @@ class HistoryWindow:
|
||||||
if completed2:
|
if completed2:
|
||||||
if len(completed2) > 70:
|
if len(completed2) > 70:
|
||||||
completed2 = completed2[:70] + '[\u2026]'
|
completed2 = completed2[:70] + '[\u2026]'
|
||||||
liststore.append((pix, completed2))
|
liststore.append((icon, completed2))
|
||||||
self.completion_dict[completed2] = (info_jid, info_acc,
|
self.completion_dict[completed2] = (info_jid, info_acc,
|
||||||
info_name, info_completion2)
|
info_name, info_completion2)
|
||||||
if key == actual_jid:
|
if key == actual_jid:
|
||||||
|
|
Loading…
Reference in New Issue