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/gui/dialogs/relation/actions/AbstractRelationEditorAction.java

    r12933 r13486  
    88import javax.swing.event.TableModelListener;
    99
     10import org.openstreetmap.josm.Main;
     11import org.openstreetmap.josm.data.osm.DataSet;
     12import org.openstreetmap.josm.data.osm.DataSet.DownloadPolicy;
    1013import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    1114import org.openstreetmap.josm.gui.dialogs.relation.MemberTable;
    1215import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel;
    1316import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     17import org.openstreetmap.josm.io.OnlineResource;
    1418
    1519/**
     
    4953
    5054    protected abstract void updateEnabledState();
     55
     56    protected final boolean canDownload() {
     57        DataSet ds = editor.getRelation().getDataSet();
     58        return !Main.isOffline(OnlineResource.OSM_API)
     59            && ds != null && !ds.isLocked() && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
     60    }
    5161}
Note: See TracChangeset for help on using the changeset viewer.