Do not show the idle time in the tooltip, unless it's meaningful

This commit is contained in:
Alexander Cherniuk 2010-04-03 18:37:41 +03:00
parent ab0353a13c
commit 63d1ef9e43
1 changed files with 8 additions and 4 deletions

View File

@ -621,10 +621,14 @@ class RosterTooltip(NotificationAreaTooltip):
else:
formatted = last_active.strftime("%c")
cs = "<span foreground='#888A85'>%s</span>"
properties.append((str(), None))
properties.append(((cs % _("Idle since %s")) % formatted, None))
properties.append(((cs % _("Idle for %s")) % str(diff), None))
# Do not show the "Idle since" and "Idle for" items if there
# is no meaningful difference between last activity time and
# current time.
if diff.days > 0 and diff.seconds > 0:
cs = "<span foreground='#888A85'>%s</span>"
properties.append((str(), None))
properties.append(((cs % _("Idle since %s")) % formatted, None))
properties.append(((cs % _("Idle for %s")) % str(diff), None))
while properties:
property_ = properties.pop(0)