Ignore:
Timestamp:
2017-03-09T22:49:28+01:00 (3 years ago)
Author:
bastiK
Message:

fixed #12731 - Add an option to completely prevent upload of a layer : e.g. "never" to upload=true/false

to set this option, add XML attribute upload='never' to .osm file

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

Legend:

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

    r11708 r11709  
    3232        super(tr("Discourage upload"), ImageProvider.get("no_upload"));
    3333        this.layer = layer;
     34        setEnabled(layer.isUploadable());
    3435    }
    3536
     
    4344    public Component createMenuComponent() {
    4445        JCheckBoxMenuItem item = new JCheckBoxMenuItem(this);
    45         item.setSelected(layer.isUploadDiscouraged());
     46        item.setSelected(layer.isUploadDiscouraged() || !layer.isUploadable());
    4647        return item;
    4748    }
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r11385 r11709  
    141141    @Override
    142142    protected void updateEnabledState() {
    143         setEnabled(getLayerManager().getEditLayer() != null);
     143        OsmDataLayer editLayer = getLayerManager().getEditLayer();
     144        setEnabled(editLayer != null && editLayer.isUploadable());
    144145    }
    145146
Note: See TracChangeset for help on using the changeset viewer.