use the blinking when systray holds pending events [only new api/only in windows atm]

This commit is contained in:
Nikos Kouremenos 2006-12-05 18:45:02 +00:00
parent 12c5820a6b
commit 330ebb9c09
3 changed files with 5 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -219,7 +219,7 @@ class Events:
return first_account, first_jid, first_event
def get_nb_systray_events(self, types = []):
'''returns the number of events displayedin roster'''
'''returns the number of events displayed in roster'''
return self._get_nb_events(attribute = 'systray', types = types)
def get_systray_events(self):

View File

@ -26,8 +26,6 @@ class StatusIcon(systray.Systray):
#NOTE: gtk api does NOT allow:
# leave, enter motion notify
# and can't do cool tooltips we use
# and we could use blinking instead of unsupported animation
# or we could emulate animation by every foo ms chaning the image
def __init__(self):
systray.Systray.__init__(self)
self.status_icon = gtk.StatusIcon()
@ -55,9 +53,12 @@ class StatusIcon(systray.Systray):
text = helpers.get_notification_icon_tooltip_text()
self.status_icon.set_tooltip(text)
if gajim.events.get_nb_systray_events():
state = 'message'
state = 'message' # FIXME: this state should be called event, not message
self.status_icon.props.blinking = True
else:
state = self.status
self.status_icon.props.blinking = False
#FIXME: do not always use 16x16 (ask actually used size and use that)
image = gajim.interface.roster.jabber_state_images['16'][state]
if image.get_storage_type() == gtk.IMAGE_PIXBUF: