Clipboard Notification

Tomeu Vizoso tomeu at tomeuvizoso.net
Mon Apr 14 06:45:09 EDT 2008


Hi Eric,

2008/4/14 Eric Burns <ericjosephburns at gmail.com>:
> When an activity launches it brings up an instance of the notification icon
> in the activity tray. I'm trying to make it so when someone copies something
> instead of it popping up the frame for a second it shows a pulsing
> notification icon in the top left hand corner.
>  I have disabled the frame popping up in frame.py.
> I am wondering, is it best to implement the notification icon in the
> clipboardservice.py? Is there any documentation on the NotificationIcon?

We have two modules called clipboardservice.py, one inside the shell
D-Bus service, and another inside the sugar library (this one wraps
the service).

None of these modules are a good place to place code that belongs to
the shell UI, as conceptually belong to the model (see
http://en.wikipedia.org/wiki/Model-view-controller).

I recommend first to do something similar to what is done in
activitiestray.py, just create a NotificationIcon when a
ClipboardButton is created. The frame will remove it after some time
has passed.

NotificationIcon is just a very basic implementation right now. Don't
worry if you cannot do everything you'd like yet. And a patch that
added some pydocs to that class would be most welcome!

If the existing code that uses NotificationIcon is not clear to you, I
recommend you to go through the pygtk tutorial first:
http://www.pygtk.org/pygtk2tutorial/index.html

> Any help would be appreciated, thanks

Hope this was of some use. Please keep asking.

Thanks,

Tomeu



More information about the Devel mailing list