Changeset 13751 in josm


Ignore:
Timestamp:
2018-05-13T12:35:13+02:00 (18 months ago)
Author:
wiktorn
Message:

More precise add imagery verification if all data is provided

See: #16249

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/imagery
Files:
2 edited

Legend:

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

    r13745 r13751  
    148148        registerValidableComponent(rawUrl);
    149149        registerValidableComponent(wmsUrl);
     150        registerValidableComponent(setDefaultLayers);
    150151    }
    151152
     
    199200            return false;
    200201        }
     202        if (setDefaultLayers.isSelected() && (tree == null || tree.getSelectedLayers().isEmpty())) {
     203            return false;
     204        }
    201205        if (endpoint.isSelected()) {
    202206            return !getImageryRawUrl().isEmpty();
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java

    r13746 r13751  
    6262        add(name, GBC.eol().fill(GBC.HORIZONTAL));
    6363        registerValidableComponent(rawUrl);
     64        registerValidableComponent(setDefaultLayer);
    6465
    6566        getLayers.addActionListener(e -> {
     
    116117    @Override
    117118    protected boolean isImageryValid() {
    118         return !getImageryName().isEmpty() && !getImageryRawUrl().isEmpty();
     119        return ((setDefaultLayer.isSelected() && layerTable !=null && layerTable.getSelectedLayer() != null)
     120                || !setDefaultLayer.isSelected()
     121                ) &&  !getImageryName().isEmpty() && !getImageryRawUrl().isEmpty();
    119122    }
    120123
Note: See TracChangeset for help on using the changeset viewer.