Show the real status icon on new message patch by Dimitur Kirov
This commit is contained in:
parent
2aa4f0fa96
commit
ef7c64acf2
2 changed files with 13 additions and 8 deletions
|
@ -565,12 +565,7 @@ class RosterTooltip(gtk.Window):
|
||||||
self.hide()
|
self.hide()
|
||||||
self.path = None
|
self.path = None
|
||||||
|
|
||||||
def populate(self, contacts, img):
|
def populate(self, contacts, path):
|
||||||
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]
|
|
||||||
if not contacts or len(contacts) == 0:
|
if not contacts or len(contacts) == 0:
|
||||||
return
|
return
|
||||||
# default resource of the contact
|
# default resource of the contact
|
||||||
|
@ -579,6 +574,16 @@ class RosterTooltip(gtk.Window):
|
||||||
if prim_contact == None or contact.priority > prim_contact.priority:
|
if prim_contact == None or contact.priority > prim_contact.priority:
|
||||||
prim_contact = contact
|
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 = '<span size="large" weight="bold">' + prim_contact.jid + '</span>'
|
info = '<span size="large" weight="bold">' + prim_contact.jid + '</span>'
|
||||||
info += '\n<span weight="bold">' + _('Name: ') + '</span>' + \
|
info += '\n<span weight="bold">' + _('Name: ') + '</span>' + \
|
||||||
prim_contact.name
|
prim_contact.name
|
||||||
|
|
|
@ -576,7 +576,7 @@ class RosterWindow:
|
||||||
if self.tooltip.timeout == 0 or self.tooltip.path != props[0]:
|
if self.tooltip.timeout == 0 or self.tooltip.path != props[0]:
|
||||||
self.tooltip.path = row
|
self.tooltip.path = row
|
||||||
self.tooltip.timeout = gobject.timeout_add(500,
|
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):
|
def on_agent_logging(self, widget, jid, state, account):
|
||||||
'''When an agent is requested to log in or off'''
|
'''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):
|
def on_roster_treeview_button_press_event(self, widget, event):
|
||||||
'''popup contact's, group's or agent's menu'''
|
'''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()
|
self.tooltip.hide_tooltip()
|
||||||
if event.button == 3: # Right click
|
if event.button == 3: # Right click
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue