[MessageTray] handle "urgent" notifications specially

Urgent notifications jump to the front of the tray's notification
queue, and come up pre-expanded.

https://bugzilla.gnome.org/show_bug.cgi?id=611612
This commit is contained in:
Dan Winship
2010-04-28 15:34:27 -04:00
parent 077f0c56f1
commit 263261cc86
2 changed files with 23 additions and 5 deletions

View File

@ -151,8 +151,11 @@ NotificationDaemon.prototype = {
return id;
}
// Source may be null if we have never received a notification from
// this app or if all notifications from this app have been acknowledged.
hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true);
// Source may be null if we have never received a notification
// from this app or if all notifications from this app have
// been acknowledged.
if (source == null) {
source = new Source(this._sourceId(appName), icon, hints);
Main.messageTray.add(source);
@ -211,6 +214,8 @@ NotificationDaemon.prototype = {
notification.connect('action-invoked', Lang.bind(this, this._actionInvoked, source, id));
}
notification.setUrgent(hints.urgency == Urgency.CRITICAL);
source.notify(notification);
return id;
},
@ -290,8 +295,6 @@ Source.prototype = {
},
update: function(icon, hints) {
hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true);
this._icon = icon;
this._iconData = hints.icon_data;
this._urgency = hints.urgency;