Features/Notification System

From Sugar Labs
< Features
Revision as of 17:07, 14 February 2014 by SAMdroid (talk | contribs)
Jump to navigation Jump to search

Summary

This adds a simple notification system for sugar that can be used in activities and by the system/

Owner

  • Name: SAMdroid
  • Email: sam.parkinson3@gmail.com

Current status

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

Detailed Description

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

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.
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. The palette lists all the notifications below the stop button. Clicking on the activity dismisses all notifications. Clicking on a notification dismiss it individually.
System notifications show in the top left corner too. They can have any icon they want. They still have the pulsing icon and the [!] in the bottom left.
System notifications are given their own icon at the end of the frame. This icon has the [!] in the bottom left. Underneath there is the data and a dismiss button.

A good video demo: https://vidd.me/0Lv

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.

Benefit to Sugar

This would be nice for chat, calenders... It would help bring us into line with the other desktop environs.

Scope

The stuff in the shell is done. It probably needs to be improved.

I haven't mad any activities use it, so yeah.

UI Design

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

How To Test

Here is an example activity: https://git.sugarlabs.org/~samdroid/hello-world/hello-notification-world 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
   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("HelloWorld", 0, , "Summary", "Body", [], {'x-sugar-icon-name': 'activity-journal'}, -1)
   #You can change the icon above

User Experience

I think this is usable?

Contingency Plan

WORK HARDER

Documentation

I've added the doc strings, see sugar3.activity.activity.notify


Comments and Discussion

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