Changeset 13446 in josm


Ignore:
Timestamp:
2018-02-19T01:14:22+01:00 (7 years ago)
Author:
Don-vip
Message:

see #8039, see #10456 - disable more actions modifying the dataset

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

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

    r13130 r13446  
    4747    @Override
    4848    protected void updateEnabledState() {
    49         setEnabled(!relations.isEmpty() && !Main.isOffline(OnlineResource.OSM_API));
     49        setEnabled(!relations.isEmpty() && !Main.isOffline(OnlineResource.OSM_API)
     50                && !relations.iterator().next().getDataSet().isReadOnly());
    5051    }
    5152}
  • trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java

    r13130 r13446  
    6767    @Override
    6868    protected void updateEnabledState() {
    69         setEnabled(!relations.isEmpty() && !incompleteMembers.isEmpty() && !Main.isOffline(OnlineResource.OSM_API));
     69        setEnabled(!relations.isEmpty() && !incompleteMembers.isEmpty() && !Main.isOffline(OnlineResource.OSM_API)
     70                && !relations.iterator().next().getDataSet().isReadOnly());
    7071    }
    7172}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java

    r11381 r13446  
    4141            int answer = t.showDialog(selection, false);
    4242
    43             if (answer == TaggingPreset.DIALOG_ANSWER_APPLY) {
     43            if (answer == TaggingPreset.DIALOG_ANSWER_APPLY && !selection.iterator().next().getDataSet().isReadOnly()) {
    4444                presetHandler.updateTags(t.getChangedTags());
    4545            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r13434 r13446  
    12711271            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
    12721272            String clipboard = ClipboardUtils.getClipboardStringContent();
    1273             if (sel.isEmpty() || clipboard == null)
     1273            if (sel.isEmpty() || clipboard == null || sel.iterator().next().getDataSet().isReadOnly())
    12741274                return;
    12751275            MainApplication.undoRedo.add(new ChangePropertyCommand(sel, key, Utils.strip(clipboard)));
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r13252 r13446  
    493493
    494494            answer = new PresetDialog(p, title, preset_name_label ? null : (ImageIcon) getValue(Action.SMALL_ICON),
    495                     sel.isEmpty(), showNewRelation).getValue();
     495                    sel.isEmpty() || sel.iterator().next().getDataSet().isReadOnly(), showNewRelation).getValue();
    496496        }
    497497        if (!showNewRelation && answer == 2)
Note: See TracChangeset for help on using the changeset viewer.