Changeset 17062 in josm


Ignore:
Timestamp:
2020-09-26T19:06:40+02:00 (4 years ago)
Author:
Klumbumbus
Message:

fix #19850 - Add possibility to add a shortcut for more actions and toggle dialogs, fix shortcut display name of some selection menu entries

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

Legend:

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

    r16704 r17062  
    66
    77import java.awt.event.ActionEvent;
     8import java.awt.event.KeyEvent;
    89
    910import org.openstreetmap.josm.data.osm.OsmData;
     11import org.openstreetmap.josm.tools.Shortcut;
    1012
    1113/**
     
    1820     */
    1921    public InvertSelectionAction() {
    20         super(tr("Invert Selection"), "invert_selection", tr("Invert Selection"), null, true);
    21         setHelpId(ht("/Action/InvertSelection"));
     22        super(tr("Invert Selection"), "invert_selection", tr("Invert Selection"),
     23                Shortcut.registerShortcut("selection:invertselection",
     24                tr("Selection: {0}", tr("Invert Selection")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true);
     25                setHelpId(ht("/Action/InvertSelection"));
    2226    }
    2327
  • trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java

    r16509 r17062  
    77import java.awt.GridBagLayout;
    88import java.awt.event.ActionEvent;
     9import java.awt.event.KeyEvent;
    910import java.util.Collections;
    1011import java.util.Optional;
     
    2425import org.openstreetmap.josm.tools.Logging;
    2526import org.openstreetmap.josm.tools.Utils;
     27import org.openstreetmap.josm.tools.Shortcut;
    2628
    2729/**
     
    3537    /** Constructs a new note search action */
    3638    public SearchNotesDownloadAction() {
    37         super(tr("Search Notes..."), "note_search", tr("Download notes from the note search API"), null, false, false);
     39        super(tr("Search Notes..."), "note_search", tr("Download notes from the note search API"),
     40                Shortcut.registerShortcut("file:notesearch",
     41                tr("File: {0}", tr("Search Notes...")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false, false);
    3842    }
    3943
  • trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java

    r16509 r17062  
    2121    public SelectAllAction() {
    2222        super(tr("Select All"), "selectall", tr("Select all undeleted objects in the data layer. This selects incomplete objects too."),
    23                 Shortcut.registerShortcut("system:selectall", tr("Edit: {0}", tr("Select All")), KeyEvent.VK_A, Shortcut.CTRL), true);
     23                Shortcut.registerShortcut("system:selectall", tr("Selection: {0}", tr("Select All")), KeyEvent.VK_A, Shortcut.CTRL), true);
    2424        setHelpId(ht("/Action/SelectAll"));
    2525    }
  • trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequencesAction.java

    r16509 r17062  
    2424                "way-select",
    2525                tr("Select non-branching sequences of ways"),
    26                 Shortcut.registerShortcut("wayselector:wayselect", tr("Non-branching way sequences"), KeyEvent.VK_W, Shortcut.SHIFT),
     26                Shortcut.registerShortcut("wayselector:wayselect", tr("Selection: {0}", tr("Non-branching way sequences")),
     27                    KeyEvent.VK_W, Shortcut.SHIFT),
    2728                true);
    2829    }
  • trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java

    r16509 r17062  
    2020    public UnselectAllAction() {
    2121        super(tr("Unselect All"), "unselectall", tr("Unselect all objects."),
    22             Shortcut.registerShortcut("edit:unselectall", tr("Edit: {0}",
     22            Shortcut.registerShortcut("edit:unselectall", tr("Selection: {0}",
    2323            tr("Unselect All")), KeyEvent.VK_ESCAPE, Shortcut.DIRECT), true);
    2424
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r16436 r17062  
    1212import java.awt.event.MouseAdapter;
    1313import java.awt.event.MouseEvent;
     14import java.awt.event.KeyEvent;
    1415import java.util.Arrays;
    1516import java.util.Collection;
     
    6364import org.openstreetmap.josm.tools.OpenBrowser;
    6465import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
     66import org.openstreetmap.josm.tools.Shortcut;
    6567
    6668/**
     
    251253                "changesetdialog",
    252254                tr("Open the list of changesets in the current layer."),
    253                 null, /* no keyboard shortcut */
     255                Shortcut.registerShortcut("subwindow:changesets", tr("Toggle: {0}", tr("Changesets")),
     256                    KeyEvent.CHAR_UNDEFINED, Shortcut.NONE),
    254257                200, /* the preferred height */
    255258                false, /* don't show if there is no preference */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MinimapDialog.java

    r14300 r17062  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.event.KeyEvent;
    67import java.beans.PropertyChangeEvent;
    78import java.beans.PropertyChangeListener;
     
    1415import org.openstreetmap.josm.gui.bbox.BBoxChooser;
    1516import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
     17import org.openstreetmap.josm.tools.Shortcut;
    1618
    1719/**
     
    2729     */
    2830    public MinimapDialog() {
    29         super(tr("Mini map"), "minimap", tr("Displays a small map of the current edit location"), null, 150);
     31        super(tr("Mini map"), "minimap", tr("Displays a small map of the current edit location"),
     32                Shortcut.registerShortcut("subwindow:minimap", tr("Toggle: {0}", tr("Mini map")),
     33                KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), 150);
    3034    }
    3135
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r15385 r17062  
    99import java.awt.event.MouseAdapter;
    1010import java.awt.event.MouseEvent;
     11import java.awt.event.KeyEvent;
    1112import java.text.DateFormat;
    1213import java.util.ArrayList;
     
    5152import org.openstreetmap.josm.tools.OpenBrowser;
    5253import org.openstreetmap.josm.tools.date.DateUtils;
     54import org.openstreetmap.josm.tools.Shortcut;
    5355
    5456/**
     
    7476    /** Creates a new toggle dialog for notes */
    7577    public NotesDialog() {
    76         super(tr("Notes"), "notes/note_open", tr("List of notes"), null, 150);
     78        super(tr("Notes"), "notes/note_open", tr("List of notes"),
     79                Shortcut.registerShortcut("subwindow:notes", tr("Toggle: {0}", tr("Notes")),
     80                KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), 150);
    7781        addCommentAction = new AddCommentAction();
    7882        closeAction = new CloseAction();
Note: See TracChangeset for help on using the changeset viewer.