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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.