GNOME Bugzilla – Bug 731623
GNotification: add support for a priority setting
Last modified: 2014-06-28 18:07:25 UTC
A common use case for notifications is to provide background or contextual information. Examples of this kind of notification include weather information, stock prices, currency conversions, travel information, or birthdays of contacts. The key difference between background and other types of notifications is that attention is that they can be read at a time that suits the user - there is no urgency for them to be attended to immediately. In the case of GNOME Shell, background notifications would not be shown as a banner, and would only be displayed in the Message Tray. As a point of reference, the Android notification API allows notifications to be set as background/contextual through their priority setting: http://developer.android.com/design/patterns/notifications.html Using a priority setting for this might make the API a little more generic. Being able to set a notification as high-priority could also open interesting possibilities.
Having discussed this with Lars on IRC, it seems that there might be a reasonable need to support a priority setting with the following categories: * URGENT - eg. calls, emergency alerts. * HIGH - eg. chat messages, SMS. * NORMAL - the default setting. * BACKGROUND - examples described in the original report above. Urgent would be used for events that require attention to the level where other notifications can be ignored. Examples include incoming calls or emergency alerts. High priority notifications would be used for time sensitive events, such as chat messages or SMS.
Created attachment 278484 [details] [review] GNotification: add priority I don't know if we want to keep it the way we discussed, but here's a first implementation.
Review of attachment 278484 [details] [review]: Looks fine to me.
One thing I'm not sure about is the name for the lowest priority, as BACKGROUND seems a bit too tied to the UI we're building. Using a more generic name would give us more flexibility, and could possibly help with cross-platform issues. What if we later decide that we want to bring background notifications into the foreground, for example? LOW or MINIMUM could be alternatives to BACKGROUND.
True. LOW sounds fine to me.
Created attachment 278980 [details] [review] GNotification: add priority Rename the 'background' priority to 'low' and fix GNotificationPriority's doc string. I'm not sure if we still need all four of those priorities. It's getting a bit hard to explain the difference between them in the documentation string.
Created attachment 278982 [details] [review] GNotification: add priority Clarify priority documentation. Thanks Allan!
Review of attachment 278982 [details] [review]: Still looks fine to me
Attachment 278982 [details] pushed as 01098e3 - GNotification: add priority