Ticket #24444: 24444.patch
| File 24444.patch, 4.1 KB (added by , 7 months ago) |
|---|
-
src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
160 160 * A list of listeners that need to be notified on clipboard content changes. 161 161 */ 162 162 private final ArrayList<FlavorListener> clipboardListeners = new ArrayList<>(); 163 private boolean isSaving; 163 164 164 165 /** 165 166 * Creates a new relation editor for the given relation. The relation will be saved if the user … … 1070 1071 } else if (isDirtyRelation()) { 1071 1072 if (!isDirtyEditor()) { 1072 1073 reloadDataFromRelation(); 1073 } else {1074 } else if (!isSaving) { 1074 1075 new Notification(tr("Relation modified outside of relation editor with pending changes. Conflict resolution required.")) 1075 1076 .setIcon(JOptionPane.WARNING_MESSAGE).show(); 1076 1077 } … … 1085 1086 return (snapshot != null && !memberTableModel.hasSameMembersAs(snapshot)) || 1086 1087 tagEditorPanel.getModel().isDirty() || relation == null || relation.getDataSet() == null; 1087 1088 } 1089 1090 @Override 1091 public void setIsSaving(boolean b) { 1092 isSaving = b; 1093 } 1088 1094 } -
src/org/openstreetmap/josm/gui/dialogs/relation/IRelationEditor.java
66 66 boolean isDirtyEditor(); 67 67 68 68 /** 69 * Set the isSaving flag to the given value 70 * @param b the flag value 71 * @since xxx 72 */ 73 void setIsSaving(boolean b); 74 75 /** 69 76 * Reloads data from relation. 70 77 */ 71 78 void reloadDataFromRelation(); -
src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
115 115 116 116 @Override 117 117 public final void setRelation(Relation relation) { 118 setIsSaving(false); 118 119 setRelationSnapshot((relation == null) ? null : new Relation(relation)); 119 120 Relation oldValue = this.relation; 120 121 this.relation = relation; -
src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
171 171 warnDoubleConflict(); 172 172 return false; 173 173 } 174 getEditor().setIsSaving(true); 174 175 applyExistingConflictingRelation(getTagModel()); 175 176 hideEditor(); 176 177 return false; … … 177 178 } else 178 179 return false; 179 180 } else { 181 getEditor().setIsSaving(true); 180 182 applyExistingNonConflictingRelation(getTagModel()); 181 183 } 182 184 } -
test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
122 122 public OsmDataLayer getLayer() { 123 123 return layer; 124 124 } 125 126 @Override 127 public void setIsSaving(boolean b) { 128 // do nothing 129 } 125 130 }; 126 131 } 127 132
