X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoLoad.java;h=c9aee483868cac1d4f4c20b2e481331f112c18bf;hp=8bf22183c5162c787fa8c7350f602a1da2c5f4df;hb=da0b1f449260a0b4a94318006382a9039726ef3e;hpb=312fec956e43f5d0a38617da5d0add9c62563e2c diff --git a/tim/prune/undo/UndoLoad.java b/tim/prune/undo/UndoLoad.java index 8bf2218..c9aee48 100644 --- a/tim/prune/undo/UndoLoad.java +++ b/tim/prune/undo/UndoLoad.java @@ -2,6 +2,7 @@ package tim.prune.undo; import tim.prune.I18nManager; import tim.prune.data.DataPoint; +import tim.prune.data.PhotoList; import tim.prune.data.TrackInfo; /** @@ -13,6 +14,7 @@ public class UndoLoad implements UndoOperation private int _numLoaded = -1; private DataPoint[] _contents = null; private String _previousFilename = null; + private PhotoList _photoList = null; /** @@ -31,16 +33,18 @@ public class UndoLoad implements UndoOperation /** * Constructor for replacing - * @param inOldTrack track being replaced + * @param inOldTrackInfo track info being replaced * @param inNumLoaded number of points loaded + * @param inPhotoList photo list, if any */ - public UndoLoad(TrackInfo inOldTrackInfo, int inNumLoaded) + public UndoLoad(TrackInfo inOldTrackInfo, int inNumLoaded, PhotoList inPhotoList) { _cropIndex = -1; _numLoaded = inNumLoaded; _contents = inOldTrackInfo.getTrack().cloneContents(); if (inOldTrackInfo.getFileInfo().getNumFiles() == 1) _previousFilename = inOldTrackInfo.getFileInfo().getFilename(); + _photoList = inPhotoList; } @@ -76,6 +80,11 @@ public class UndoLoad implements UndoOperation } else { + // replace photos how they were + if (_photoList != null) + { + inTrackInfo.getPhotoList().restore(_photoList); + } // replace track contents with old if (!inTrackInfo.getTrack().replaceContents(_contents)) {