From 286b7ad674b79132c743d96f5a8e662e1401a791 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Thu, 23 Apr 2020 11:45:30 -0600 Subject: [PATCH] Attempt to auto populate the MapWithAI default servers Signed-off-by: Taylor Smock --- .../josm/plugins/mapwithai/backend/MapWithAIDataUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java index 51c0a3d..e0b6f38 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java @@ -188,6 +188,10 @@ public final class MapWithAIDataUtils { final Notification noUrls = MapWithAIPreferenceHelper.getMapWithAIUrl().isEmpty() ? new Notification(tr( "There are no defined URLs. To add sources, go to Preferences -> MapWithAI -> Servers and add the appropriate servers")) : new Notification(tr("No URLS are enabled")); + if (MapWithAIPreferenceHelper.getMapWithAIUrl().isEmpty() + && MapWithAILayerInfo.instance.getDefaultLayers().isEmpty()) { + MapWithAILayerInfo.instance.loadDefaults(true, MainApplication.worker, false, () -> getData(bbox)); + } noUrls.setDuration(Notification.TIME_DEFAULT); noUrls.setIcon(JOptionPane.INFORMATION_MESSAGE); noUrls.setHelpTopic(ht("Plugin/MapWithAI#Preferences"));