Changeset 17552 in josm


Ignore:
Timestamp:
2021-03-05T22:50:02+01:00 (3 years ago)
Author:
wiktorn
Message:

Do not allow adding WMS imagery when no layer is selected

When no layer is selected (or the layer that is selected has no name, only
title) - do not treat this selection as valid and prevent adding such imagery
(as the Layer= parameter will be empty then and layer will not work).

Closes: #20565

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r17543 r17552  
    207207            return false;
    208208        }
    209         if (setDefaultLayers.isSelected() && (tree == null || tree.getSelectedLayers().isEmpty())) {
     209        /*
     210         * We need selection of the layers in following situations:
     211         * * endpoint is not selected (and we don't care about setDefault layers as it's disabled anyway)
     212         * * endpoint is selected and setDefultLayers is selected
     213         */
     214        if ((!endpoint.isSelected() || setDefaultLayers.isSelected()) && (tree == null || tree.getSelectedLayers().isEmpty())) {
    210215            return false;
    211216        }
Note: See TracChangeset for help on using the changeset viewer.