changeset 201:9e7bc7f09221

Primitivus: fixed alerts on nick in contact_list
author Goffi <goffi@goffi.org>
date Fri, 20 Aug 2010 01:14:18 +0800
parents 7baee9bb37af
children 754e12eaea14
files frontends/primitivus/contact_list.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/primitivus/contact_list.py	Fri Aug 20 01:13:39 2010 +0800
+++ b/frontends/primitivus/contact_list.py	Fri Aug 20 01:14:18 2010 +0800
@@ -95,10 +95,9 @@
             nick = self.CM.getAttr(jid,'nick')
             display = nick or name or jid.node or jid.short
             header = '(*) ' if contact in self.alert_jid else ''
-            widget = custom_widgets.SelectableText(display, selected = contact==self.selected, header=header)
+            widget = custom_widgets.SelectableText(('alert' if contact in self.alert_jid else 'default',display),
+                                                    selected = contact==self.selected, header=header)
             widget.data = contact
-            if contact in self.alert_jid:
-                widget.setAttribute('default','alert')
             content.append(widget)
             urwid.connect_signal(widget, 'change', self.__contactClicked)