Tooltip for account line in roster

This commit is contained in:
Alex Mauer 2005-09-13 18:46:21 +00:00
parent 50a179b301
commit 4c990ccb1e
3 changed files with 19 additions and 1 deletions

View File

@ -1566,6 +1566,9 @@ class Connection:
if self.connection:
self.connection.send(p)
self.dispatch('STATUS', show)
def get_status(self):
return STATUS_LIST[self.connected]
def send_motd(self, jid, subject = '', msg = ''):
if not self.connection:

View File

@ -294,6 +294,9 @@ class Interface:
if gajim.contacts[account].has_key(ji):
#Update existing iter
self.roster.draw_contact(ji, account)
elif jid == gajim.get_jid_from_account(account):
#It's another of our resources. We don't need to see that!
return
elif gajim.contacts[account].has_key(ji):
#It isn't an agent
self.roster.chg_contact_status(user1, array[1], array[2], account)
@ -344,7 +347,7 @@ class Interface:
if self.remote and self.remote.is_enabled():
self.remote.raise_signal('ContactAbsence', (account, array))
# stop non active file transfers
elif self.windows[account]['gc'].has_key(ji): # ji is then room_jid
#it is a groupchat presence
#FIXME: upgrade the chat instances (for pm)

View File

@ -670,6 +670,18 @@ class RosterWindow:
self.tooltip.id = row
self.tooltip.timeout = gobject.timeout_add(500,
self.show_tooltip, gajim.contacts[account][jid])
if model[iter][C_TYPE] == 'account':
account = model[iter][C_NAME].decode('utf-8')
jid = gajim.get_jid_from_account(account)
self_contact = Contact(jid=jid, name=account, show = gajim.connections[account].get_status(), status=gajim.connections[account].status, resource=gajim.config.get_per('accounts', gajim.connections[account].name, 'resource'), keyID = gajim.config.get_per('accounts', gajim.connections[account].name, 'keyid'))
contacts = [self_contact]
if gajim.contacts[account].has_key(jid):
for contact in gajim.contacts[account][jid]:
contacts = [contact]
if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
self.tooltip.id = row
self.tooltip.timeout = gobject.timeout_add(500,
self.show_tooltip, contacts)
def on_agent_logging(self, widget, jid, state, account):
'''When an agent is requested to log in or off'''