Changeset 11031 in josm


Ignore:
Timestamp:
2016-09-20T11:32:04+02:00 (8 years ago)
Author:
simon04
Message:

see #12224 - Search menu item: make shortcut work when MOTD is focused

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

Legend:

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

    r10601 r11031  
    2323public class DownloadPrimitiveAction extends JosmAction {
    2424
     25    public static final Shortcut SHORTCUT = Shortcut.registerShortcut("system:download_primitive", tr("File: {0}", tr("Download object...")),
     26            KeyEvent.VK_O, Shortcut.CTRL_SHIFT);
     27
    2528    /**
    2629     * Constructs a new {@code DownloadPrimitiveAction}.
     
    2831    public DownloadPrimitiveAction() {
    2932        super(tr("Download object..."), "downloadprimitive", tr("Download OSM object by ID."),
    30                 Shortcut.registerShortcut("system:download_primitive", tr("File: {0}", tr("Download object...")),
    31                         KeyEvent.VK_O, Shortcut.CTRL_SHIFT), true);
     33                SHORTCUT, true);
    3234        putValue("help", ht("/Action/DownloadObject"));
    3335    }
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r10881 r11031  
    2323
    2424import org.openstreetmap.josm.Main;
     25import org.openstreetmap.josm.actions.DownloadPrimitiveAction;
    2526import org.openstreetmap.josm.data.Version;
    2627import org.openstreetmap.josm.gui.datatransfer.OpenTransferHandler;
     28import org.openstreetmap.josm.gui.dialogs.MenuItemSearchDialog;
    2729import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
    2830import org.openstreetmap.josm.gui.preferences.server.ProxyPreferenceListener;
     
    123125        lg = new LinkGeneral("<html>" + STYLE + "<h1>" + "JOSM - " + tr("Java OpenStreetMap Editor")
    124126                + "</h1><h2 align=\"center\">" + tr("Downloading \"Message of the day\"") + "</h2></html>");
    125         // clear the build-in command ctrl+shift+O, because it is used as shortcut in JOSM
    126         lg.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK), "none");
     127        // clear the build-in command ctrl+shift+O, ctrl+space because it is used as shortcut in JOSM
     128        lg.getInputMap(JComponent.WHEN_FOCUSED).put(DownloadPrimitiveAction.SHORTCUT.getKeyStroke(), "none");
     129        lg.getInputMap(JComponent.WHEN_FOCUSED).put(MenuItemSearchDialog.Action.SHORTCUT.getKeyStroke(), "none");
    127130        lg.setTransferHandler(null);
    128131
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java

    r10611 r11031  
    113113    public static class Action extends JosmAction {
    114114
     115        public static final Shortcut SHORTCUT = Shortcut.registerShortcut("help:search-items", "Search menu items", KeyEvent.VK_SPACE, Shortcut.CTRL);
     116
    115117        public Action() {
    116118            super(tr("Search menu items"), "dialogs/search", null,
    117                     Shortcut.registerShortcut("help:search-items", "Search menu items", KeyEvent.VK_SPACE, Shortcut.CTRL),
     119                    SHORTCUT,
    118120                    true, "dialogs/search-items", false);
    119121        }
Note: See TracChangeset for help on using the changeset viewer.