Changeset 16149 in josm for trunk/src


Ignore:
Timestamp:
2020-03-16T00:07:51+01:00 (5 years ago)
Author:
simon04
Message:

fix #15931 - Add a preference to use external browser instead of the Help Browser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r16148 r16149  
    3434
    3535import org.openstreetmap.josm.actions.JosmAction;
     36import org.openstreetmap.josm.data.preferences.BooleanProperty;
    3637import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    3738import org.openstreetmap.josm.gui.MainApplication;
     
    5253public class HelpBrowser extends JFrame implements IHelpBrowser {
    5354
     55    private static final BooleanProperty USE_EXTERNAL_BROWSER = new BooleanProperty("help.use-external-browser", false);
     56
    5457    /** the unique instance */
    5558    private static HelpBrowser instance;
     
    103106    public static void setUrlForHelpTopic(final String helpTopic) {
    104107        final HelpBrowser browser = getInstance();
     108        if (Boolean.TRUE.equals(USE_EXTERNAL_BROWSER.get())) {
     109            SwingUtilities.invokeLater(() -> {
     110                browser.loadRelativeHelpTopic(helpTopic);
     111                OpenBrowser.displayUrl(browser.url);
     112            });
     113            return;
     114        }
    105115        SwingUtilities.invokeLater(() -> {
    106116            browser.openHelpTopic(helpTopic);
Note: See TracChangeset for help on using the changeset viewer.