From 98a36ea67393aa4e0d336049233ad3d82db71084 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Tue, 17 Dec 2024 08:41:34 -0700 Subject: [PATCH] Fix shortcut for JOSM scripts Signed-off-by: Taylor Smock --- .../mapillary/gui/imageinfo/ImageInfoPanel.java | 2 +- .../mapillary/gui/imageinfo/WebLinkAction.java | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java index 9f95ea72e..3d5ed0924 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java @@ -120,7 +120,7 @@ private ImageInfoPanel() { imgKeyValue = new HtmlPanel(); - imgLinkAction = new WebLinkAction(marktr("View in browser"), null); + imgLinkAction = new WebLinkAction(); /* SHORTCUT(Mapillary: Copy URL, mapillary:copy_to_clipboard_Copy_URL, CHAR_UNDEFINED, NONE) */ copyImgUrlAction = new ClipboardAction(marktr("Copy URL"), tr("Copied URL to clipboard …"), null); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/WebLinkAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/WebLinkAction.java index 4211d133a..600035629 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/WebLinkAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/WebLinkAction.java @@ -28,16 +28,12 @@ public class WebLinkAction extends MapillaryAction { /** * Create a new action - * - * @param name The name to show users (use {@link I18n#marktr(String)}) - * @param uri The original URI to open */ - public WebLinkAction(final String name, final URI uri) { - super(tr(name), "link", tr("Open in browser"), - Shortcut.registerShortcut("mapillary:open_in_browser_" + name.replace(' ', '_'), - tr("Mapillary: Open {0} in browser", tr(name)), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), - false, "mapillary:open_in_browser_" + name.replace(' ', '_'), false); - setURI(uri); + public WebLinkAction() { + super(tr("View in browser"), "link", tr("Open in browser"), + Shortcut.registerShortcut("mapillary:open_in_browser_View_in_browser", + tr("Mapillary: Open {0} in browser", tr("View in browser")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), + false, "mapillary:open_in_browser_View_in_browser", false); } /**