Ignore:
Timestamp:
2018-03-03T17:59:48+01:00 (5 months ago)
Author:
Don-vip
Message:

fix #8039, see #10456 - fix bugs with non-downloadable layers

File:
1 edited

Legend:

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

    r11922 r13486  
    77import javax.swing.AbstractAction;
    88
     9import org.openstreetmap.josm.Main;
    910import org.openstreetmap.josm.actions.OsmPrimitiveAction;
     11import org.openstreetmap.josm.data.osm.DataSet;
     12import org.openstreetmap.josm.data.osm.DataSet.DownloadPolicy;
    1013import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1114import org.openstreetmap.josm.data.osm.Relation;
     15import org.openstreetmap.josm.io.OnlineResource;
    1216import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    1317
     
    4650        setEnabled(!relations.isEmpty());
    4751    }
     52
     53    protected final boolean canDownload() {
     54        if (relations.isEmpty()) {
     55            return false;
     56        }
     57        DataSet ds = relations.iterator().next().getDataSet();
     58        return !Main.isOffline(OnlineResource.OSM_API)
     59            && ds != null && !ds.isLocked() && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
     60    }
    4861}
Note: See TracChangeset for help on using the changeset viewer.