[gpodder-devel] [PATCH] systray icon with notification

  • From: thp at perli.net (Thomas Perl)
  • Date: Sat, 22 Dec 2007 11:21:31 +0100

Hello, Jerome!

jerome.chabod at ifrance.com wrote:
> Here it is. After diving into python and gPodder code ( I must say gPodder is 
> often nicely implemented so it wasn't too hard, maybe comments are sometime 
> missing) and spending hours seaking on internet, I'm able to deliver you a 
> patch 
> with a first implentation of a status icon on the sytem tray.
> 
> Please, try it, test it and/or review its code (it should be easy to review 
> since it almost consist of one class), and share you comments, suggestions, 
> critisms with us.

I've just quickly scanned through the diff, and have some comments:

  * You could use python-notify instead of directly accessing d-bus

For the python-notify (pynotify) usage: I think you can then use the 
"set_timeout()" function on a Notification object to add the "coutdown 
timer" to the notification windows, as Pieter De Decker suggested in his 
mail.

> TODO:
> -----
> * status and notification for mp3 device synchronisation

We might be able to to this after the new sync code, which is a bit more 
abstract and doesn't depend on its own dialog.

> * add a status symbol to the icon: dowloading, checking for new episodes, 
> synchronising (if somebody could help here)

get_tree_icon() from gpodder.util could be helpful here. This is the 
function that is used to add the bullet or padlock to the icons in the 
episode list. You could extend this function and be able to get the 
gPodder icon with some "downloading" (e.g. arrow down) or checking (e.g. 
the "refresh" icon) in the lower right-hand corner of the icon.

> * error handling: what to do in case of error? 
>     - critical errors where the use can't help (bug, missing dependency...).
>     - troubleshouting where the user might do something (server down, xml 
> invalid, disk full, ...).

Basically, the user is already notified about errors. What needs to be 
done is to redirect the show_notification() (and probably also 
show_confirmation()?) calls to the tray icon (and therefore libnotify) 
if the gPodder window has been hidden and only the tray icon is visible.

Thanks for your patch so far, I think I'll let it float around on the 
mailing list a bit more to get some more comments and then I'll apply 
the latest version of the patch with all corrections to my working copy 
and maybe do some cosmetic changes before applying it to our SVN repository.


Really great work, btw :)

Thomas


Other related posts: