Ignore:
Timestamp:
2017-02-25T14:05:29+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #14123 - On first startup: Registered toolbar action overwritten

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r11452 r11611  
    449449     */
    450450    public JoinAreasAction() {
    451         super(tr("Join overlapping Areas"), "joinareas", tr("Joins areas that overlap each other"),
    452         Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")),
    453             KeyEvent.VK_J, Shortcut.SHIFT), true);
     451        this(true);
     452    }
     453
     454    /**
     455     * Constructs a new {@code JoinAreasAction} with optional shortcut.
     456     * @param addShortcut controls whether the shortcut should be registered or not
     457     * @since 11611
     458     */
     459    public JoinAreasAction(boolean addShortcut) {
     460        super(tr("Join overlapping Areas"), "joinareas", tr("Joins areas that overlap each other"), addShortcut ?
     461        Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")), KeyEvent.VK_J, Shortcut.SHIFT)
     462        : null, true);
    454463    }
    455464
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r11553 r11611  
    5353 *
    5454 * This action is undo-able. In order not to break previous commands in the
    55  * undo buffer, we must re-add the identical object (and not semantically
    56  * equal ones).
     55 * undo buffer, we must re-add the identical object (and not semantically equal ones).
     56 *
     57 * @since 3431
    5758 */
    5859public class PurgeAction extends JosmAction {
     
    6869    protected transient Set<OsmPrimitive> toPurgeChecked;
    6970    /**
    70      * Subset of toPurgeChecked. Marks primitives that remain in the
    71      * dataset, but incomplete.
     71     * Subset of toPurgeChecked. Marks primitives that remain in the dataset, but incomplete.
    7272     */
    7373    protected transient Set<OsmPrimitive> makeIncomplete;
     
    8181     */
    8282    public PurgeAction() {
     83        this(true);
     84    }
     85
     86    /**
     87     * Constructs a new {@code PurgeAction} with optional shortcut.
     88     * @param addShortcut controls whether the shortcut should be registered or not
     89     * @since 11611
     90     */
     91    public PurgeAction(boolean addShortcut) {
    8392        /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */
    84         super(tr("Purge..."), "purge", tr("Forget objects but do not delete them on server when uploading."),
    85                 Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")),
    86                 KeyEvent.VK_P, Shortcut.CTRL_SHIFT),
    87                 true);
     93        super(tr("Purge..."), "purge", tr("Forget objects but do not delete them on server when uploading."), addShortcut ?
     94                Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.CTRL_SHIFT)
     95                : null, true);
    8896        putValue("help", HelpUtil.ht("/Action/Purge"));
    8997    }
Note: See TracChangeset for help on using the changeset viewer.