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

  • From: thp at perli.net (Thomas Perl)
  • Date: Tue, 25 Dec 2007 16:28:01 +0100

Hello, J?r?me!

Today, I've had some time to review your patch, I've attached my 
modifications. I've changed the file name to "trayicon" to fit better in 
the overall gPodder module naming scheme.

For a first version, it looks good already. There are still some things 
that need to be done:

  * Degrade gracefully when python-notify is not installed
  * "Update feeds" should be possible without the dialog
  * "Download all new episodes" should display only the episode selector
    if the gPodder main window is hidden and not the gPodder main window
  * Configuration options, as metioned in the TODO comments

Tray icon configuration options (a proposal):
   * No tray icon
   * Minimize to tray (only show icon when minimizing the window)
   * Always show tray icon (as it is currently)

Notification configuration options:
   * No notifications (error messages in message dialogs)
   * Notifications when minimized (including error messages)
   * Always use notifications (error messages in notification bubbles)

I've also attached the notification to the tray icon, which looks better 
in my opinion (after all, the tray icon "says" what the message contains).

J?r?me Chabod wrote:
> I send you a new patch (for revison 503):
> Pieter De Decker a ?crit :
>> I have two of things to say about the notifications:
>> - Try to make them a little more descriptive. I'm sure that you've already 
>> thought of that and that you're working on it, but there's more. What if a 
>> certain episode is called "My super duper special podcast episode with a 
>> special guest host for December 21st 2007"? You could solve this by limiting 
>> the episode name to the first 25 (or so) characters, followed by "(...)". 
>> Example: "'My super duper special po(...)' has been downloaded successfully".
> You'll probably like this version. I don't  notify every file download 
> because 
> it's very annoying having to much popup windows, but the tooltip displays 
> during 
> dowload already dowloaded files, and the notify also lists them

Very good idea, I've improved the code a little to be a bit faster 
(''.join() instead of string concatenation).

> nikosapi a ?crit :
>> Attached is a very basic autoupdate addition to your patch. What it does, is 
>> every 20min it runs update_feed_cache. This behaviour is controlled by a 
>> configuration option in the Preferences window.
>>   
> It sound good, but I was unfortunately unable to apply the patch . I just 
> integrated manualy the thinks you modifed in GPodderStatusIcon. Can somebody, 
> merge it with my attached patch?
> Shouldn't also the 20min delay be configurable in the preference window?

Can you re-integrate Nick's patch? I have not yet had time to look into 
it. Maybe the patches should be seperated and one applied independent of 
the other.

> Thomas Perl a ?crit :
>> 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.
>
> I used you code as inspiration but I had my own method for more flexibility 
> (I 
> use a dictionary, it's quite easy to add as status)

Looks good, I've improved and simplified that a little.

>> 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.m
>>   
> I?ll check this
Have you had time looking into this already?

I've simplified some parts of your class so that it hopefully is easier 
to maintain.

What do you think of my modifications and the suggestions above?

Thanks,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpodder_r504_trayicon-notify.patch
Type: text/x-patch
Size: 14795 bytes
Desc: not available
URL: 
<https://lists.berlios.de/pipermail/gpodder-devel/attachments/20071225/8a2b75d1/attachment.bin>

Other related posts: