Difference between revisions of "Features/Notification System"

From Sugar Labs
Jump to navigation Jump to search
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
This adds a simple notification system for sugar that can be used in activities and by the system/
+
This adds a simple messages notification system for sugar that can be used by the system, journal and activities notifications.
  
 
== Owner ==
 
== Owner ==
 
* Name: [[User:SAMdroid|SAMdroid]]
 
* Name: [[User:SAMdroid|SAMdroid]]
 
* Email: sam.parkinson3@gmail.com
 
* Email: sam.parkinson3@gmail.com
 +
 +
* Name: [[User:tch|tch]]
 +
* Email: tch@sugarlabs.org
  
 
== Current status ==
 
== Current status ==
* Targeted release: Soon
+
* Targeted release: 0.102
 
* Last updated: 8th of Feb
 
* Last updated: 8th of Feb
 
* Percentage of completion: 90%
 
* Percentage of completion: 90%
  
 
== Detailed Description ==
 
== Detailed Description ==
Based off http://wiki.sugarlabs.org/go/Design_Team/Proposals/Notifications
+
[[File:Notifications-001.png | thumb | center | 640px |
 +
 
 +
When a notification is received it displays a pulsing icon, that is specified as part of
 +
 
 +
the notification, at the top left corner of the screen. This icon stays in there for just
  
[[File:Activity_notification_pulsing_courner.png  | thumb | center | 640px |
+
a few seconds.]]
  
When a notification is received it pulses in the top left for 5 seconds. For activities it uses the activity icon with an [!] in the bottom left.]]
+
[[File:Notifications-002.png  | thumb | center | 640px |
  
[[File:Activity_notification_frame.png  | thumb | center | 640px |
+
The received notification can be found at the activities tray. It is represented by a button with a
  
The notification is then placed under it's activity in the frame. If an activity has notifications it has the [!] icon placed in the bottom left, just like the pulsing popup icon.
+
notification badge.]]
  
The palette lists all the notifications below the stop button.
+
[[File:Notifications-003.png  | thumb | center | 640px |
  
Clicking on the activity dismisses all notifications. Clicking on a notification dismiss it individually.]]
+
The button's palette displays, at the bottom of the palette, all the notifications that are related to the same entity.
  
[[File:System_notificaton_pulsing.png  | thumb | center | 640px |
+
Entities can be basically anything, ie., the journal, activities or even scripts running in background.]]
  
System notifications show in the top left corner too.
+
[[File:Notifications-004.png  | thumb | center | 640px |
They can have any icon they want. They still have the pulsing icon and the [!] in the bottom left.]]
 
  
[[File:System_notificaton_frame.png  | thumb | center | 640px |
+
Every notification must belong to an entity. If one notification is sent, that notification
  
System notifications are given their own icon at the end of the frame. This icon has the [!] in the bottom left.
+
should create a new icon if and only if there is not a previous icon for the same entity.]]
Underneath there is the data and a dismiss button.]]
 
  
'''A good video demo''': https://vidd.me/0Lv
+
[[File:Notifications-005.png  | thumb | center | 640px |
  
So basically as the video shows there are 2 types of notifications. Both have a pulsing icon in the top left. Activity notifications show there notification under their icon. System notifications get their own icon per notification. Both modifications icons have a [!] icon.
+
If one entity receives more than 5 notifications, scrolling will be used to limit the space.]]
  
 
== Benefit to Sugar ==
 
== Benefit to Sugar ==
This would be nice for chat, calenders...
+
This would be nice for chat, calenders, and any other kind of even that the user should be aware
It would help bring us into line with the other desktop environs.
+
of. It would help bring us into line with the other desktop environs.
  
 
== Scope ==
 
== Scope ==
The stuff in the shell is done. It probably needs to be improved.
+
The current implementation covers all the building blocks that are required for journal, activities
 
+
and system message notifications. At the moment, only system messages are implemented, using these
I haven't mad any activities use it, so yeah.
+
same building blocks.
  
 
==UI Design==
 
==UI Design==
Line 53: Line 58:
  
 
== How To Test ==
 
== How To Test ==
Here is an example activity: https://git.sugarlabs.org/~samdroid/hello-world/hello-notification-world
+
For system notifications you can run this script, ie., from Terminal activity:
This shows you a notification after a delay.
 
 
 
The docs for using notifications in activities are https://github.com/SAMdroid-apps/sugar-toolkit-gtk3/blob/bfadc8648bb0c594d9b12160affdd2c2c8819164/src/sugar3/activity/activity.py#L641
 
 
 
For system notifications you can run this code:
 
  
 
     import dbus
 
     import dbus
Line 67: Line 67:
 
     notify_obj = bus.get_object(BUS_NAME,OBJ_PATH)
 
     notify_obj = bus.get_object(BUS_NAME,OBJ_PATH)
 
     notifications = dbus.Interface(notify_obj,IFACE_NAME)
 
     notifications = dbus.Interface(notify_obj,IFACE_NAME)
     notifications.Notify("HelloWorld", 0, '', "Summary", "Body", [], {'x-sugar-icon-name': 'activity-journal'}, -1)
+
     notifications.Notify("Software Update", 0, '', "New activities are available!", "Please check your activities list", [], {'x-sugar-icon-name': 'module-updater'}, -1)
    #You can change the icon above
 
  
 
== User Experience ==
 
== User Experience ==
I think this is usable?
+
These messages notifications should not distract the user, as they are displayed in each notification area.
  
 
== Contingency Plan ==
 
== Contingency Plan ==
 
WORK HARDER
 
WORK HARDER
 
== Documentation ==
 
I've added the doc strings, see sugar3.activity.activity.notify
 
 
  
 
== Comments and Discussion ==
 
== Comments and Discussion ==
  
 
http://lists.sugarlabs.org/archive/sugar-devel/2014-February/047096.html
 
http://lists.sugarlabs.org/archive/sugar-devel/2014-February/047096.html

Revision as of 07:56, 5 March 2014

Summary

This adds a simple messages notification system for sugar that can be used by the system, journal and activities notifications.

Owner

  • Name: SAMdroid
  • Email: sam.parkinson3@gmail.com
  • Name: tch
  • Email: tch@sugarlabs.org

Current status

  • Targeted release: 0.102
  • Last updated: 8th of Feb
  • Percentage of completion: 90%

Detailed Description

When a notification is received it displays a pulsing icon, that is specified as part of the notification, at the top left corner of the screen. This icon stays in there for just a few seconds.
The received notification can be found at the activities tray. It is represented by a button with a notification badge.
The button's palette displays, at the bottom of the palette, all the notifications that are related to the same entity. Entities can be basically anything, ie., the journal, activities or even scripts running in background.
Every notification must belong to an entity. If one notification is sent, that notification should create a new icon if and only if there is not a previous icon for the same entity.
If one entity receives more than 5 notifications, scrolling will be used to limit the space.

Benefit to Sugar

This would be nice for chat, calenders, and any other kind of even that the user should be aware of. It would help bring us into line with the other desktop environs.

Scope

The current implementation covers all the building blocks that are required for journal, activities and system message notifications. At the moment, only system messages are implemented, using these same building blocks.

UI Design

http://wiki.sugarlabs.org/go/Design_Team/Proposals/Notifications

How To Test

For system notifications you can run this script, ie., from Terminal activity:

   import dbus
   BUS_NAME = 'org.freedesktop.Notifications'
   OBJ_PATH = '/org/freedesktop/Notifications'
   IFACE_NAME = 'org.freedesktop.Notifications'
   bus = dbus.SessionBus()
   notify_obj = bus.get_object(BUS_NAME,OBJ_PATH)
   notifications = dbus.Interface(notify_obj,IFACE_NAME)
   notifications.Notify("Software Update", 0, , "New activities are available!", "Please check your activities list", [], {'x-sugar-icon-name': 'module-updater'}, -1)

User Experience

These messages notifications should not distract the user, as they are displayed in each notification area.

Contingency Plan

WORK HARDER

Comments and Discussion

http://lists.sugarlabs.org/archive/sugar-devel/2014-February/047096.html