Hey devs:

While bored while perusing some of the Panel code looking for more
documentation to write, I came across an old note in AboutPanel that the
function for launching the user's web browser to bring them to
FreeCol-related sites needed to be broken out into its own class.

I created src\net\sf\freecol\common\util\OSUtils.java for this purpose.

Currently it only has two methods, both static. LaunchBrowser() is a void
that runs the command to launch the browser and GetBrowser() returns a
String[] that can be fed into LaunchBrowser(). Both are static as it seems
this class doesn't really need a state. It does not rely on any FreeCol
classes, just java.* classes for Logging and Exception handling.

It implements the Logger at FINEST to make a note of a failure to launch
the browser. I tested the update in Windows 8 and it works fine, but I have
no way to test on Linux, Unix or Mac OS.

I created a GitHub repository to store this change until there is enough
testing to make sure it works and then it can be brought back into the main
SourceForge repo.

The link to this specific commits are
https://github.com/Calebrw/freecol/commit/6d21dc66ba9795389a2740bdb0e1b1421cb2e486
and some clean up in
https://github.com/Calebrw/freecol/commit/52670e8cb71b7c9696b2f21cbc1385221a749d49

Additionally, this branch contains another commit which cleans up a bunch
of "==" operators that could be more strictly implemented using either
Equals() or .equals(). That commit fully passed the JUnit testing although
the change did break an AI test, so no changes to any AI files were
committed.

Thanks,

-- 

*Caleb R. Williams*
------------------------------------------------------------------------------
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to