@@ -31,17 +31,26 @@ public class IgnoreAction extends JosmAction {
31
31
*/
32
32
private final IgnoreType type ;
33
33
34
+ /**
35
+ * Generate shortcuts in a manner friendly for the ShortcutsList
36
+ * @param type The type
37
+ * @return The shortcut
38
+ */
39
+ private static Shortcut generateShortcut (IgnoreType type ) {
40
+ return switch (type ) {
41
+ case IGNORE_TASK -> Shortcut .registerShortcut ("maproulette:ignore.ignore_task" , tr ("MapRoulette: Ignore Task" ), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE );
42
+ case IGNORE_CHALLENGE -> Shortcut .registerShortcut ("maproulette:ignore.ignore_challenge" , tr ("MapRoulette: Ignore Challenge" ), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE );
43
+ };
44
+ }
45
+
34
46
/**
35
47
* Create a new action object
36
48
*
37
49
* @param type The type of object we are ignoring
38
50
*/
39
51
public IgnoreAction (IgnoreType type ) {
40
52
super (tr (type .getButtonText ()), "dialogs/fix" , tr (type .getButtonText ()),
41
- Shortcut .registerShortcut (
42
- /* NO-SHORTCUT */ "maproulette:ignore." + type .name ().toLowerCase (Locale .ROOT ),
43
- tr ("MapRoulette: {0}" , tr (type .getButtonText ())), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE ),
44
- false );
53
+ generateShortcut (type ), false );
45
54
this .type = type ;
46
55
}
47
56
@@ -68,9 +77,7 @@ public void actionPerformed(ActionEvent e) {
68
77
* The ignore type
69
78
*/
70
79
public enum IgnoreType {
71
- /* SHORTCUT(MapRoulette: Ignore Task, maproulette:ignore.task, NONE, UNDEFINED) */
72
80
IGNORE_TASK (marktr ("Ignore Task" )),
73
- /* SHORTCUT(MapRoulette: Ignore Challenge, maproulette:ignore.challenge, NONE, UNDEFINED) */
74
81
IGNORE_CHALLENGE (marktr ("Ignore Challenge" ));
75
82
76
83
private final String buttonText ;
0 commit comments