X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoCorrelatePhotos.java;h=9b8e1af35acad0d823600151d27b4b04f0f5b45b;hp=39c7a86468fcaffde516767591def878307b6c60;hb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;hpb=3745d70b1427bb8ac1a085e47cbdc566936784e1 diff --git a/tim/prune/undo/UndoCorrelatePhotos.java b/tim/prune/undo/UndoCorrelatePhotos.java index 39c7a86..9b8e1af 100644 --- a/tim/prune/undo/UndoCorrelatePhotos.java +++ b/tim/prune/undo/UndoCorrelatePhotos.java @@ -44,7 +44,7 @@ public class UndoCorrelatePhotos implements UndoOperation */ public String getDescription() { - return I18nManager.getText("undo.correlate") + " (" + _numPhotosCorrelated + ")"; + return I18nManager.getText("undo.correlatephotos") + " (" + _numPhotosCorrelated + ")"; } @@ -60,17 +60,21 @@ public class UndoCorrelatePhotos implements UndoOperation for (int i=0; i<_photoPoints.length; i++) { Photo photo = inTrackInfo.getPhotoList().getPhoto(i); - // Only need to look at connected photos, if they're still tagged then leave them + // Only need to look at connected photos, since correlation wouldn't disconnect if (photo.getCurrentStatus() == Photo.Status.CONNECTED) { - DataPoint point = _photoPoints[i]; - photo.setDataPoint(point); - if (point != null) { - point.setPhoto(photo); + DataPoint prevPoint = _photoPoints[i]; + DataPoint currPoint = photo.getDataPoint(); + photo.setDataPoint(prevPoint); + if (currPoint != null) { + currPoint.setPhoto(null); // disconnect + } + if (prevPoint != null) { + prevPoint.setPhoto(photo); // reconnect to prev point } } } // clear selection inTrackInfo.getSelection().clearAll(); } -} \ No newline at end of file +}