Changeset 17063 in josm
- Timestamp:
- 2020-09-27T14:55:21+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r16657 r17063 364 364 */ 365 365 public void applyToRelation(Relation relation) { 366 relation.setMembers(members.stream() 367 .filter(rm -> !rm.getMember().isDeleted()).collect(Collectors.toList())); 366 relation.setMembers( 367 members.stream().filter(rm -> !rm.getMember().isDeleted() && rm.getMember().getDataSet() != null) 368 .collect(Collectors.toList())); 368 369 } 369 370 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java
r15586 r17063 68 68 @Override 69 69 public void updateEnabledState() { 70 Relation relation = editorAccess.getEditor().getRelation();71 70 Relation snapshot = editorAccess.getEditor().getRelationSnapshot(); 72 setEnabled(snapshot != null && ( 73 !relation.hasEqualTechnicalAttributes(snapshot) || 74 !relation.hasEqualSemanticAttributes(snapshot) 75 )); 71 setEnabled((!getMemberTableModel().hasSameMembersAs(snapshot) || getTagModel().isDirty()) 72 && !(snapshot == null && getTagModel().getTags().isEmpty())); 76 73 } 77 74 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
r16438 r17063 5 5 6 6 import java.awt.Component; 7 import java.util.List;8 import java.util.stream.Collectors;9 7 10 8 import javax.swing.JOptionPane; … … 18 16 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 19 17 import org.openstreetmap.josm.data.osm.Relation; 20 import org.openstreetmap.josm.data.osm.RelationMember;21 18 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 22 19 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; … … 51 48 tagEditorModel.applyToPrimitive(newRelation); 52 49 getMemberTableModel().applyToRelation(newRelation); 53 List<RelationMember> newMembers = newRelation.getMembers().stream()54 .filter(rm -> !rm.getMember().isDeleted())55 .collect(Collectors.toList());56 if (newRelation.getMembersCount() != newMembers.size()) {57 newRelation.setMembers(newMembers);58 String msg = tr("One or more members of this new relation have been deleted while the relation editor\n" +59 "was open. They have been removed from the relation members list.");60 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), msg, tr("Warning"), JOptionPane.WARNING_MESSAGE);61 }62 50 // If the user wanted to create a new relation, but hasn't added any members or 63 51 // tags, don't add an empty relation
Note:
See TracChangeset
for help on using the changeset viewer.