From d36a647698479d13fdb97b79b87d4a470e3ce229 Mon Sep 17 00:00:00 2001 From: Alex Mauer Date: Tue, 13 Sep 2005 21:13:40 +0000 Subject: [PATCH] Show all our resources in the account line tooltip --- src/roster_window.py | 12 +++++------- src/tooltips.py | 5 +++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index fbfd3d250..4f766e4ef 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -665,19 +665,17 @@ class RosterWindow: if model[iter][C_TYPE] == 'contact': account = model[iter][C_ACCOUNT].decode('utf-8') jid = model[iter][C_JID].decode('utf-8') - img = model[iter][C_IMG] 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, gajim.contacts[account][jid]) - if model[iter][C_TYPE] == 'account': + elif 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] + contacts = [] + for resource in gajim.connections[account].connection.getRoster().getResources(jid)+[gajim.config.get_per('accounts', gajim.connections[account].name, 'resource')]: + contact = Contact(jid=jid, name=account, show=gajim.connections[account].get_status(), status=gajim.connections[account].status, resource=resource, keyID = gajim.config.get_per('accounts', gajim.connections[account].name, 'keyid')) + contacts.append(contact) if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: self.tooltip.id = row self.tooltip.timeout = gobject.timeout_add(500, diff --git a/src/tooltips.py b/src/tooltips.py index d3bbfd1ed..09cab3cbd 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -341,8 +341,9 @@ class RosterTooltip(BaseTooltip, StatusTable): info = '' + prim_contact.jid + '' info += '\n' + _('Name: ') + '' + \ gtkgui_helpers.escape_for_pango_markup(prim_contact.name) - info += '\n' + _('Subscription: ') + '' + \ - gtkgui_helpers.escape_for_pango_markup(prim_contact.sub) + if prim_contact.sub: + info += '\n' + _('Subscription: ') + '' + \ + gtkgui_helpers.escape_for_pango_markup(prim_contact.sub) if prim_contact.keyID: keyID = None