From dd04b0b8d940735993c5ea0cf4fbfee333b07a60 Mon Sep 17 00:00:00 2001 From: "taylor.smock" Date: Wed, 18 Sep 2024 20:24:36 +0000 Subject: [PATCH] Fix #23925: Indicate/link to alternative download methods when the user attempts to download too much data git-svn-id: https://josm.openstreetmap.de/svn/trunk@19225 0c6e7542-c601-0410-84e7-c038aed88b3b --- .../openstreetmap/josm/gui/HelpAwareOptionPane.java | 1 + src/org/openstreetmap/josm/tools/ExceptionUtil.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java b/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java index eaad135805f..b979e1c7b76 100644 --- a/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java +++ b/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java @@ -262,6 +262,7 @@ public static int showOptionDialog(Component parentComponent, Object msg, String if (msg instanceof String) { String msgStr = (String) msg; content = new HtmlPanel(msgStr.startsWith("") ? msgStr : "" + msgStr + ""); + ((HtmlPanel) content).enableClickableHyperlinks(); } else { content = msg; } diff --git a/src/org/openstreetmap/josm/tools/ExceptionUtil.java b/src/org/openstreetmap/josm/tools/ExceptionUtil.java index 11ea88e4b10..34711a93b07 100644 --- a/src/org/openstreetmap/josm/tools/ExceptionUtil.java +++ b/src/org/openstreetmap/josm/tools/ExceptionUtil.java @@ -28,6 +28,7 @@ import org.openstreetmap.josm.data.osm.OsmPrimitiveType; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.Way; +import org.openstreetmap.josm.gui.help.HelpUtil; import org.openstreetmap.josm.io.ChangesetClosedException; import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.io.MissingOAuthAccessTokenException; @@ -578,7 +579,16 @@ public static String explainBadRequest(OsmApiException e) { errorHeader.startsWith("You requested too many nodes"))) { message += "
" + tr("The area you tried to download is too big or your request was too large." - + "
Either request a smaller area or use an export file provided by the OSM community."); + + "
Either request a smaller area or use an export file provided by the OSM community." + + "

Downloading a smaller area is recommended!" + + "

Advanced users can use one of the following options:" + + "
", HelpUtil.getHelpTopicUrl("/Help/Action/Download#DownloadfromOverpassAPI"), + "https://www.geofabrik.de/data/download.html", + "https://planet.openstreetmap.org/"); } else if (errorHeader != null) { message += tr("
Error message(untranslated): {0}", errorHeader); }