Changeset 14319 in josm


Ignore:
Timestamp:
2018-10-13T02:11:26+02:00 (5 weeks ago)
Author:
Don-vip
Message:

fix #16831 - disable "Apply preset" button when no matching object is selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r14290 r14319  
    483483            return DIALOG_ANSWER_CANCEL;
    484484        } else if (p.getComponentCount() != 0 && (sel.isEmpty() || p.hasElements)) {
    485             String title = trn("Change {0} object", "Change {0} objects", sel.size(), sel.size());
    486             if (!showNewRelation && sel.isEmpty()) {
     485            int size = sel.size();
     486            String title = trn("Change {0} object", "Change {0} objects", size, size);
     487            if (!showNewRelation && size == 0) {
    487488                if (originalSelectionEmpty) {
    488489                    title = tr("Nothing selected!");
     
    492493            }
    493494
    494             boolean disableApply = false;
    495             if (!sel.isEmpty()) {
     495            boolean disableApply = size == 0;
     496            if (!disableApply) {
    496497                OsmData<?, ?, ?, ?> ds = sel.iterator().next().getDataSet();
    497498                disableApply = ds != null && ds.isLocked();
Note: See TracChangeset for help on using the changeset viewer.