PDA

View Full Version : Gui-11


jblume
June 18th, 2006, 03:51 PM
I would like to try myself on the small bounty for the "expanding themes on demand" project. A first version of my patch can be found here (http://www.limewire.org/wiki/index.php?title=Program.Wishlist.SmallBountyThemes OnDemand).

The new behaviour is that a LWTP file is only extracted from themes.jar when that theme is used and the corresponding theme-directory doesn't exist yet.
When the jar is newer than an existing LWTP which is also inside the jar, the LWTP file gets deleted on program start (and re-extracted when necessary).
The themes menu is now populated with both the extracted (or downloaded) LWTP files on disk and the themes inside the jar file. If a theme is both extracted and in the jar (and the jar is older than the LWTP file), the LWTP file has precedence.

Sam
June 19th, 2006, 03:24 PM
Thanks for adding this patch, jblume. This particular feature has been one that's bugged me for awhile, because unzipping all the themes takes forever and it makes new users get the impression that LimeWire is very slow to load.

We'll take a look at this as soon as possible. Our main priority right now is getting a release out the door, and there's one annoying but persistent bug that we're trying to track down. Once that's out of the way, I'll look over your patch and give some feedback.

Sam
June 21st, 2006, 01:23 PM
I'm gonna take a look over your patch today, jblume. Would you be able to sign up for LimeWire's JIRA (https://www.limewire.org/jira/secure/Dashboard.jspa) and let me know what your username is? I'll assign this themes issue (https://www.limewire.org/jira/browse/GUI-11) to you.

jblume
June 21st, 2006, 05:14 PM
I just signed up to JIRA and my username is, creatively enough, jblume (https://www.limewire.org/jira/secure/ViewProfile.jspa?name=jblume).

Sam
June 21st, 2006, 08:47 PM
So the patch looks good in that it definitely doesn't expand the themes on startup, but I can't get it to expand the themes on demand. To test it, I deleted the themes directory from my preferences directory and then started LimeWire (to simulate a new installation). It correctly listed all potential themes and didn't expand them immediately, but when I tried switching to another theme (from Windows to LimeWire), it gave an error.

This seems to be caused by an extraneous ! in ThemeMediator.changeTheme(File, String, boolean). I think the check for ThemeSettings.JAR_THEME_NAMES.contains(newTheme.ge tName()) is reversed -- it currently is checking for not that.

If that's indeed just reversed logic, and there isn't some other reason for having that, then this patch looks amazing and I'll incorporate it straight away. (I made some other minor modifications to refactor some static initializers into separate methods, but they're no big deal.)

Thanks!

jblume
June 21st, 2006, 10:16 PM
The error was indeed only caused by that errornous ! in ThemeMediator.changeTheme(File, String, boolean). I just copy-pasted the condition from my change in ThemeFileHandler.reload(boolean force) and accidentally inverted the logic (and forgot to test everything one more time after this last small change to my patch).

The patch should be good with that fixed.

Sam
June 21st, 2006, 10:22 PM
Great, I've applied the patch. Send me an email at sam at limewire dot com and I'll make sure we get the bounty sent to you!