Re: [Davmail-users] [PATCH] Growl support
Brought to you by:
mguessan
|
From: Jeff S. <je...@sq...> - 2010-04-15 21:37:25
|
Mickael -- any thoughts on this patch, perchance? Thanks! On Wed, Apr 7, 2010 at 10:00 PM, Jeff Squyres <je...@sq...> wrote: > > Attached is a preliminary patch to add Growl support for OS X users. > I'm not entirely happy with it, but wanted to let you look at it > before I proceeded any further: > > - See if you are interested in this functionality at all > - If so, get some advice on how to make the patch better > > I freely admit my newbie-ness as a Java programmer; I'm sure it will > be obvious when looking at this patch. :-) > > First, since Growl has deprecated their official Java bindings > (because Apple deprecated something that they were depending on), I > used some simple 3rd party Growl bindings that I found here: > http://forums.cocoaforge.com/viewtopic.php?f=6&t=17320. They compile > to Growl.jar and libgrowl.jnilib, which I placed in the DavMail lib > dir. > > I then added several things to the DavMail code base: > > - A "Use Growl" checkbox in the settings panel, right below the "Show > initial banner" checkbox (it defaults to "no" on non-OS X platforms) > - Added logic in FrameGatewayTray, AwtGatewayTray, and SwtGatewayTray > to optionally use Growl instead of their native tray display routines. > - If Growl is unavailable, the *GatewayTray displayMessages() should > gracefully fall back on their native methods (I could only test > AwtGatewayTray on my Snow Leopard Mac, though). > - To make the notifications be nicely classified in Growl, > BundleMessage grew a new method, key(), that returns the String key. > And DavGatewayTrayInterface.displayMessage() now takes a String key > parameter. > > It generally seems to work -- all my info/warning/error messages are > now reported by Growl instead of (somewhat annoying) popups that must > be clicked on to dismiss in OS X. > > However, there are several things about it that I don't like: > > - The isOSX() function is repeated several times in the code base. > Should it be centralized? > - The *GatewayTray implementations are somewhat repetitive (w.r.t. > their Growl usage). > - BundleMessage now pretty much directly exports its private key String > > ...there's probably some un-Java-ish like behavior in there, too. > > Thoughts? Suggestions? > > -- > {+} Jeff Squyres -- {+} Jeff Squyres |