Changeset 9258 in josm for trunk


Ignore:
Timestamp:
2016-01-02T14:38:01+01:00 (9 years ago)
Author:
simon04
Message:

Attempt to fix some shortcut parse issues

See wiki:DevelopersGuide/ShortcutsList

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r9226 r9258  
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    5 import static org.openstreetmap.josm.tools.I18n.marktr;
    65import static org.openstreetmap.josm.tools.I18n.tr;
    76
     
    3433public final class DistributeAction extends JosmAction {
    3534
    36     private static final String ACTION_SHORT_NAME = marktr("Distribute Nodes");
    37 
    3835    /**
    3936     * Constructs a new {@code DistributeAction}.
    4037     */
    4138    public DistributeAction() {
    42         super(tr(ACTION_SHORT_NAME), "distribute",
     39        super(tr("Distribute Nodes"), "distribute",
    4340              tr("Distribute the selected nodes to equal distances along a line."),
    44               Shortcut.registerShortcut("tools:distribute", tr("Tool: {0}", tr(ACTION_SHORT_NAME)), KeyEvent.VK_B, Shortcut.SHIFT),
     41              Shortcut.registerShortcut("tools:distribute", tr("Tool: {0}", tr("Distribute Nodes")), KeyEvent.VK_B, Shortcut.SHIFT),
    4542              true);
    4643        putValue("help", ht("/Action/DistributeNodes"));
     
    10097
    10198        // Do it!
    102         Main.main.undoRedo.add(new SequenceCommand(tr(ACTION_SHORT_NAME), cmds));
     99        Main.main.undoRedo.add(new SequenceCommand(tr("Distribute Nodes"), cmds));
    103100        Main.map.repaint();
    104101    }
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r7937 r9258  
    66
    77import java.awt.event.ActionEvent;
     8import java.awt.event.KeyEvent;
    89import java.util.Collection;
    910import java.util.HashSet;
     
    1920import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2021import org.openstreetmap.josm.tools.ImageProvider;
     22import org.openstreetmap.josm.tools.Shortcut;
    2123
    2224/**
     
    3335        putValue(SHORT_DESCRIPTION, tr("Call relation editor for selected relation"));
    3436        putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     37        Main.registerActionShortcut(this,
     38                Shortcut.registerShortcut("relations:edit", tr("Edit relation"), KeyEvent.VK_X, Shortcut.ALT));
    3539    }
    3640
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r9246 r9258  
    138138    }
    139139
    140     private final transient Shortcut[] visibilityToggleShortcuts = new Shortcut[10];
     140    private final transient Shortcut[] visibilityToggleShortcuts = new Shortcut[]{
     141            Shortcut.registerShortcut("subwindow:layers:toggleLayer1", tr("Toggle visibility of layer: {0}", 1), KeyEvent.VK_1, Shortcut.ALT),
     142            Shortcut.registerShortcut("subwindow:layers:toggleLayer2", tr("Toggle visibility of layer: {0}", 2), KeyEvent.VK_2, Shortcut.ALT),
     143            Shortcut.registerShortcut("subwindow:layers:toggleLayer3", tr("Toggle visibility of layer: {0}", 3), KeyEvent.VK_3, Shortcut.ALT),
     144            Shortcut.registerShortcut("subwindow:layers:toggleLayer4", tr("Toggle visibility of layer: {0}", 4), KeyEvent.VK_4, Shortcut.ALT),
     145            Shortcut.registerShortcut("subwindow:layers:toggleLayer5", tr("Toggle visibility of layer: {0}", 5), KeyEvent.VK_5, Shortcut.ALT),
     146            Shortcut.registerShortcut("subwindow:layers:toggleLayer6", tr("Toggle visibility of layer: {0}", 6), KeyEvent.VK_6, Shortcut.ALT),
     147            Shortcut.registerShortcut("subwindow:layers:toggleLayer7", tr("Toggle visibility of layer: {0}", 7), KeyEvent.VK_7, Shortcut.ALT),
     148            Shortcut.registerShortcut("subwindow:layers:toggleLayer8", tr("Toggle visibility of layer: {0}", 8), KeyEvent.VK_8, Shortcut.ALT),
     149            Shortcut.registerShortcut("subwindow:layers:toggleLayer9", tr("Toggle visibility of layer: {0}", 9), KeyEvent.VK_9, Shortcut.ALT),
     150            Shortcut.registerShortcut("subwindow:layers:toggleLayer10", tr("Toggle visibility of layer: {0}", 10), KeyEvent.VK_0, Shortcut.ALT),
     151    };
    141152    private final ToggleLayerIndexVisibility[] visibilityToggleActions = new ToggleLayerIndexVisibility[10];
    142153
     
    146157     */
    147158    private void createVisibilityToggleShortcuts() {
    148         final int[] k = {
    149                 KeyEvent.VK_1, KeyEvent.VK_2, KeyEvent.VK_3, KeyEvent.VK_4, KeyEvent.VK_5,
    150                 KeyEvent.VK_6, KeyEvent.VK_7, KeyEvent.VK_8, KeyEvent.VK_9, KeyEvent.VK_0};
    151 
    152159        for (int i = 0; i < 10; i++) {
    153             visibilityToggleShortcuts[i] = Shortcut.registerShortcut("subwindow:layers:toggleLayer" + (i+1),
    154                     tr("Toggle visibility of layer: {0}", i+1), k[i], Shortcut.ALT);
    155160            visibilityToggleActions[i] = new ToggleLayerIndexVisibility(i);
    156161            Main.registerActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
Note: See TracChangeset for help on using the changeset viewer.