diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIAction.java index 78cde01..e29f25f 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIAction.java @@ -34,7 +34,7 @@ public class MapWithAIAction extends JosmAction { super(tr("{0}: Download data", MapWithAIPlugin.NAME), "mapwithai", tr("Get data from {0}", MapWithAIPlugin.NAME), Shortcut.registerShortcut("data:mapWithAI", tr("Data: {0}", MapWithAIPlugin.NAME), KeyEvent.VK_R, Shortcut.CTRL), - true); + true, "mapwithai:downloadData", true); setHelpId(ht("Plugin/MapWithAI#BasicUsage")); } 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 3a76e50..d57f101 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 @@ -185,10 +185,10 @@ public final class MapWithAIDataUtils { monitor.close(); } } else { - final Notification noUrls = MapWithAIPreferenceHelper.getMapWithAIUrl().isEmpty() - ? new Notification(tr( + final Notification noUrls = GuiHelper.runInEDTAndWaitAndReturn( + () -> MapWithAIPreferenceHelper.getMapWithAIUrl().isEmpty() ? new Notification(tr( "There are no defined URLs. Attempting to add the appropriate servers.\nPlease try again.")) - : new Notification(tr("No URLS are enabled")); + : new Notification(tr("No URLS are enabled"))); noUrls.setDuration(Notification.TIME_DEFAULT); noUrls.setIcon(JOptionPane.INFORMATION_MESSAGE); noUrls.setHelpTopic(ht("Plugin/MapWithAI#Preferences")); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIMoveAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIMoveAction.java index 77238ed..97c20ff 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIMoveAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIMoveAction.java @@ -37,7 +37,7 @@ public class MapWithAIMoveAction extends JosmAction { public MapWithAIMoveAction() { super(tr("{0}: Add selected data", MapWithAIPlugin.NAME), "mapwithai", - tr("Add data from {0}", MapWithAIPlugin.NAME), obtainShortcut(), true); + tr("Add data from {0}", MapWithAIPlugin.NAME), obtainShortcut(), true, "mapwithai:movedata", true); setHelpId(ht("Plugin/MapWithAI#BasicUsage")); } diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MergeDuplicateWaysAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MergeDuplicateWaysAction.java index b5732d9..7448862 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MergeDuplicateWaysAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MergeDuplicateWaysAction.java @@ -29,7 +29,7 @@ public class MergeDuplicateWaysAction extends JosmAction { super(tr("{0}: ".concat(DESCRIPTION), MapWithAIPlugin.NAME), "mapwithai", tr(DESCRIPTION), Shortcut.registerShortcut("data:attemptmergeway", tr(DESCRIPTION), KeyEvent.VK_EXCLAMATION_MARK, Shortcut.ALT_CTRL_SHIFT), - true); + true, "mapwithai:attemptmergeway", true); setHelpId(ht("Plugin/MapWithAI")); }