diff --git a/src/dialogs.py b/src/dialogs.py
index b592ba099..df2204da8 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -565,12 +565,7 @@ class RosterTooltip(gtk.Window):
self.hide()
self.path = None
- def populate(self, contacts, img):
- if img:
- self.image.set_from_pixbuf(img.get_pixbuf())
- else:
- self.image.set_from_pixbuf(None)
- #self.image = img # why this doesn't work? MYSTERY! [maybe I need to sleep]
+ def populate(self, contacts, path):
if not contacts or len(contacts) == 0:
return
# default resource of the contact
@@ -579,6 +574,16 @@ class RosterTooltip(gtk.Window):
if prim_contact == None or contact.priority > prim_contact.priority:
prim_contact = contact
+ # try to find the image for the contact status
+ state_file = prim_contact.show.replace(' ', '_')
+ files = []
+ files.append(path + state_file + '.gif')
+ files.append(path + state_file + '.png')
+ for file in files:
+ if os.path.exists(file):
+ self.image.set_from_file(file)
+ break
+
info = '' + prim_contact.jid + ''
info += '\n' + _('Name: ') + '' + \
prim_contact.name
diff --git a/src/roster_window.py b/src/roster_window.py
index 8d73417a7..9548ec085 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -576,7 +576,7 @@ class RosterWindow:
if self.tooltip.timeout == 0 or self.tooltip.path != props[0]:
self.tooltip.path = row
self.tooltip.timeout = gobject.timeout_add(500,
- self.show_tooltip, self.contacts[account][jid], img)
+ self.show_tooltip, self.contacts[account][jid], self.path)
def on_agent_logging(self, widget, jid, state, account):
'''When an agent is requested to log in or off'''
@@ -935,7 +935,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
def on_roster_treeview_button_press_event(self, widget, event):
'''popup contact's, group's or agent's menu'''
- # hide tooltip, whichever button is pressed
+ # hide tooltip, no matter the button is pressed
self.tooltip.hide_tooltip()
if event.button == 3: # Right click
try: