If I'm correct PCGen is now compiled with Java6. In this case, using the java.awt.Desktop class to handle URL should be used.
The system actually need to manually indicate the browser, which was needed before and can be conserved in case the isDesktopAvailable returns false.
The proposed patch does the following:
– uses Utility.viewInBrowser as the entry point for all call to browser (was only use some times),
– has a new class DesktopBrowserLauncher that tries to use the Desktop class (introduced in Java 6) to browse for an URI. If it fails, it uses the old BrowserLauncher that was used before.
What is not done is:
– i18n of many messages seen in the code.
– Indicate in the Preferences dialog that it is not needed to set the browser in case Desktop and browse action are supported.
– fix the www.e-junkie.com affiliate link (the domain redirect to another, no idea if the affiliate code is working). The URL should probably go into the software properties.
I've applied the patch with a small modification to the docs call including localisation of the error message.
Thanks for the patch!
This is not entirely fixed. I found that there is a preview field in the Spells Known tab and it uses the old pcgen.gui.utils.Utility. I thought I needn’t fix the pcgen.gui.* classes because there were not used anymore.
I tried to remove pcgen.gui from compilation, and it provokes a good chunk of errors because some classes are still uses. Is there a plan to remove all those classes? Or is it needed to update them on top of pcgen.gui2?
Good catch.The intention is to remove the pcgen.gui.* classes after the 6.0 release. There are still some lingering uses of it which will need to be resolved at that time.
I'll raise a separate issue for fixing up the preview code.
Old code excised.