Ignore:
Timestamp:
2010-05-15T18:59:10+02:00 (14 years ago)
Author:
jttt
Message:

Fix #2234: Translation can cause JosmActions to illegally handle shortcuts

File:
1 edited

Legend:

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

    r3244 r3252  
    77
    88import javax.swing.AbstractAction;
    9 import javax.swing.JComponent;
    109
    1110import org.openstreetmap.josm.Main;
     
    7271        sc = shortcut;
    7372        if (sc != null) {
    74             Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
    75             Main.contentPane.getActionMap().put(name, this);
     73            Main.registerActionShortcut(this, sc);
    7674        }
    7775        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
     
    9088    public void destroy() {
    9189        if (sc != null) {
    92             Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke());
    93             Main.contentPane.getActionMap().remove(sc.getKeyStroke());
     90            Main.unregisterActionShortcut(sc);
    9491        }
    9592        MapView.removeLayerChangeListener(layerChangeAdapter);
Note: See TracChangeset for help on using the changeset viewer.