Ticket #20024: 20024.patch
| File 20024.patch, 1.5 KB (added by , 5 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
401 401 public void showAndApply(Collection<OsmPrimitive> primitives) { 402 402 // Display dialog even if no data layer (used by preset-tagging-tester plugin) 403 403 Collection<OsmPrimitive> sel = createSelection(primitives); 404 int answer = showDialog(sel, supportsRelation()); 404 boolean showNewRelation = supportsRelation() && 405 primitives.stream().allMatch(prim -> roles.roles.stream() 406 .anyMatch(role -> role.types.contains(TaggingPresetType.forPrimitive(prim)))); 405 407 408 int answer = showDialog(sel, showNewRelation); 409 406 410 if (!sel.isEmpty() && answer == DIALOG_ANSWER_APPLY) { 407 411 Command cmd = createCommand(sel, getChangedTags()); 408 412 if (cmd != null) { … … 492 496 PresetPanel p = createPanel(sel); 493 497 494 498 int answer = 1; 495 boolean canCreateRelation = types == null || types.contains(TaggingPresetType.RELATION);499 boolean canCreateRelation = supportsRelation(); 496 500 if (originalSelectionEmpty && !canCreateRelation) { 497 501 new Notification( 498 502 tr("The preset <i>{0}</i> cannot be applied since nothing has been selected!", getLocaleName()))
