quick_frontend, primitivus: display the number of alerts for each contact and not only a symbol (*)
This commit is contained in:
parent
288f6aa100
commit
54e9afe5a3
2 changed files with 53 additions and 26 deletions
|
|
@ -98,4 +98,4 @@ class Const(constants.Const):
|
|||
GROUP_DATA_FOLDED = 'folded'
|
||||
|
||||
# contacts and contact list
|
||||
ALERT_HEADER='(*) '
|
||||
ALERT_HEADER='(%i) '
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class ContactList(PrimitivusWidget, QuickContactList):
|
|||
@param selected: boolean returned by the widget, telling if it is selected
|
||||
"""
|
||||
entity = contact_wid.data
|
||||
self.removeAlert(entity, use_bare_jid)
|
||||
self.removeAlerts(entity, use_bare_jid)
|
||||
self.host.modeHint(C.MODE_INSERTION)
|
||||
self._emit('click', entity)
|
||||
|
||||
|
|
@ -163,10 +163,8 @@ class ContactList(PrimitivusWidget, QuickContactList):
|
|||
"""
|
||||
markup = []
|
||||
if use_bare_jid:
|
||||
alerts = {entity.bare for entity in self._alerts}
|
||||
selected = {entity.bare for entity in self._selected}
|
||||
else:
|
||||
alerts = self._alerts
|
||||
selected = self._selected
|
||||
if keys is None:
|
||||
entity_txt = entity
|
||||
|
|
@ -191,9 +189,10 @@ class ContactList(PrimitivusWidget, QuickContactList):
|
|||
else:
|
||||
entity_attr = 'default'
|
||||
|
||||
if with_alert and entity in alerts:
|
||||
alerts_count = self.getAlerts(entity, use_bare_jid=use_bare_jid)
|
||||
if with_alert and alerts_count:
|
||||
entity_attr = 'alert'
|
||||
header = C.ALERT_HEADER
|
||||
header = C.ALERT_HEADER % alerts_count
|
||||
else:
|
||||
header = ''
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue