Changeset 9657 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
- Timestamp:
- 2016-01-27T22:18:36+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
r9496 r9657 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Component; 6 7 import java.util.ArrayList; 7 8 import java.util.List; … … 111 112 Main.main.undoRedo.add(new ChangeCommand(editor.getRelation(), editedRelation)); 112 113 layer.data.fireSelectionChanged(); 113 // this will refresh the snapshot and update the dialog title114 //115 editor.setRelation(editor.getRelation());116 114 } 117 115 … … 166 164 // Do nothing 167 165 } 166 167 protected boolean applyChanges() { 168 if (editor.getRelation() == null) { 169 applyNewRelation(tagModel); 170 } else if (isEditorDirty()) { 171 if (editor.isDirtyRelation()) { 172 if (confirmClosingBecauseOfDirtyState()) { 173 if (layer.getConflicts().hasConflictForMy(editor.getRelation())) { 174 warnDoubleConflict(); 175 return false; 176 } 177 applyExistingConflictingRelation(tagModel); 178 hideEditor(); 179 } else 180 return false; 181 } else { 182 applyExistingNonConflictingRelation(tagModel); 183 } 184 } 185 editor.setRelation(editor.getRelation()); 186 return true; 187 } 188 189 protected void hideEditor() { 190 if (editor instanceof Component) { 191 ((Component) editor).setVisible(false); 192 } 193 } 194 195 protected boolean isEditorDirty() { 196 Relation snapshot = editor.getRelationSnapshot(); 197 return (snapshot != null && !memberTableModel.hasSameMembersAs(snapshot)) || tagModel.isDirty(); 198 } 168 199 }
Note:
See TracChangeset
for help on using the changeset viewer.