Ignore:
Timestamp:
2018-03-04T15:18:05+01:00 (21 months ago)
Author:
Don-vip
Message:

fix #16051, see #8039, see #10456 - more fixes for download/upload policies and locked status (merge of layers)

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r10382 r13497  
    1111import org.openstreetmap.josm.Main;
    1212import org.openstreetmap.josm.data.osm.DataSet;
     13import org.openstreetmap.josm.data.osm.DataSet.DownloadPolicy;
    1314import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1415import org.openstreetmap.josm.io.OnlineResource;
     
    4647    @Override
    4748    protected void updateEnabledState() {
    48         setEnabled(getLayerManager().getEditDataSet() != null && !Main.isOffline(OnlineResource.OSM_API));
     49        DataSet ds = getLayerManager().getEditDataSet();
     50        setEnabled(ds != null && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy())
     51                && !Main.isOffline(OnlineResource.OSM_API));
    4952    }
    5053
  • trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java

    r13434 r13497  
    6464    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
    6565        updateEnabledStateOnModifiableSelection(selection);
     66        OsmDataLayer editLayer = getLayerManager().getEditLayer();
     67        if (editLayer != null && !editLayer.isUploadable()) {
     68            setEnabled(false);
     69        }
    6670    }
    6771
     
    8993    public void actionPerformed(ActionEvent e) {
    9094        OsmDataLayer editLayer = getLayerManager().getEditLayer();
    91         if (!isEnabled())
     95        if (!isEnabled() || !editLayer.isUploadable())
    9296            return;
    9397        if (editLayer.isUploadDiscouraged() && UploadAction.warnUploadDiscouraged(editLayer)) {
     
    203207                hull.add(w);
    204208                for (Node n: w.getNodes()) {
    205                     // we upload modified nodes even if they aren't in the current
    206                     // selection.
     209                    // we upload modified nodes even if they aren't in the current selection.
    207210                    n.accept(this);
    208211                }
Note: See TracChangeset for help on using the changeset viewer.