From aca268653c5b8ecb469a537eccd4e8c90340db17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20St=C3=B6cker?= Date: Fri, 28 Apr 2023 11:58:08 +0200 Subject: [PATCH] hints for Shortcut extract --- .../josm/plugins/maproulette/actions/IgnoreAction.java | 7 +++++-- .../josm/plugins/maproulette/api/enums/TaskStatus.java | 5 +++++ .../maproulette/gui/task/current/TaskStatusAction.java | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/maproulette/actions/IgnoreAction.java b/src/main/java/org/openstreetmap/josm/plugins/maproulette/actions/IgnoreAction.java index 7499aee..b4cdc27 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/maproulette/actions/IgnoreAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/maproulette/actions/IgnoreAction.java @@ -38,7 +38,7 @@ public class IgnoreAction extends JosmAction { */ public IgnoreAction(IgnoreType type) { super(tr(type.getButtonText()), "dialogs/fix", tr(type.getButtonText()), - Shortcut.registerShortcut("maproulette:ignore." + type.name().toLowerCase(Locale.ROOT), + Shortcut.registerShortcut(/* NO-SHORTCUT */ "maproulette:ignore." + type.name().toLowerCase(Locale.ROOT), tr("MapRoulette: {0}", tr(type.getButtonText())), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false); this.type = type; @@ -67,7 +67,10 @@ public void actionPerformed(ActionEvent e) { * The ignore type */ public enum IgnoreType { - IGNORE_TASK(marktr("Ignore Task")), IGNORE_CHALLENGE(marktr("Ignore Challenge")); + /* SHORTCUT("maproulette:ignore.task", "MapRoulette: Ignore Task", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ + IGNORE_TASK(marktr("Ignore Task")), + /* SHORTCUT("maproulette:ignore.challenge", "MapRoulette: Ignore Challenge", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ + IGNORE_CHALLENGE(marktr("Ignore Challenge")); private final String buttonText; diff --git a/src/main/java/org/openstreetmap/josm/plugins/maproulette/api/enums/TaskStatus.java b/src/main/java/org/openstreetmap/josm/plugins/maproulette/api/enums/TaskStatus.java index 9cf4533..25457ab 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/maproulette/api/enums/TaskStatus.java +++ b/src/main/java/org/openstreetmap/josm/plugins/maproulette/api/enums/TaskStatus.java @@ -56,14 +56,19 @@ public enum TaskStatus { public String description() { return switch (this) { case CREATED -> tr("Created"); + /* SHORTCUT("maproulette:fixed", "MapRoulette: Fixed", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ case FIXED -> tr("Fixed"); case DELETED -> tr("Deleted"); + /* SHORTCUT("maproulette:skipped", "MapRoulette: Skipped", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ case SKIPPED -> tr("Skipped"); case ANSWERED -> tr("Answered"); case DISABLED -> tr("Disabled"); + /* SHORTCUT("maproulette:too_hard", "MapRoulette: Too Hard / Cannot see", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ case TOO_HARD -> tr("Too Hard / Cannot see"); case VALIDATED -> tr("Validated"); + /* SHORTCUT("maproulette:already_fixed", "MapRoulette: Mark Task as Already Fixed / Not an Issue", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ case ALREADY_FIXED -> tr("Already Fixed / Not an Issue"); + /* SHORTCUT("maproulette:false_positive", "MapRoulette: Mark Task as False Positive", KeyEvent.CHAR_UNDEFINED, Shortcut.NONE) */ case FALSE_POSITIVE -> tr("False Positive"); }; } diff --git a/src/main/java/org/openstreetmap/josm/plugins/maproulette/gui/task/current/TaskStatusAction.java b/src/main/java/org/openstreetmap/josm/plugins/maproulette/gui/task/current/TaskStatusAction.java index 80294b1..e98e280 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/maproulette/gui/task/current/TaskStatusAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/maproulette/gui/task/current/TaskStatusAction.java @@ -74,7 +74,7 @@ class TaskStatusAction extends CurrentTaskPanel.InnerAction { TaskStatusAction(TaskStatus status, Supplier currentTaskProvider, Supplier currentDocumentProvider) { super(status.description(), getIconName(status), status.description(), - Shortcut.registerShortcut("maproulette:" + status.name().toLowerCase(Locale.ENGLISH), + Shortcut.registerShortcut(/* NO-SHORTCUT */ "maproulette:" + status.name().toLowerCase(Locale.ENGLISH), tr("MapRoulette: Mark Task as {0}", status.description()), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false);