X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2FRemovePhotoFunction.java;h=86f3ae80621281ad1ec8a1b3498b84be38875c1a;hb=a6197ddcaac11c0b943183da7d46169742d024af;hp=b09ae102958eddc8b7d19b8705629f6f2fd71502;hpb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;p=GpsPrune.git diff --git a/tim/prune/function/RemovePhotoFunction.java b/tim/prune/function/RemovePhotoFunction.java index b09ae10..86f3ae8 100644 --- a/tim/prune/function/RemovePhotoFunction.java +++ b/tim/prune/function/RemovePhotoFunction.java @@ -48,8 +48,11 @@ public class RemovePhotoFunction extends GenericFunction else { // point is attached, so need to confirm point deletion + final int pointIndex = _app.getTrackInfo().getTrack().getPointIndex(currentPhoto.getDataPoint()); undoAction = new UndoDeletePhoto(currentPhoto, _app.getTrackInfo().getSelection().getCurrentPhotoIndex(), - currentPhoto.getDataPoint(), _app.getTrackInfo().getTrack().getPointIndex(currentPhoto.getDataPoint())); + currentPhoto.getDataPoint(), pointIndex); + undoAction.setAtBoundaryOfSelectedRange(pointIndex == _app.getTrackInfo().getSelection().getStart() || + pointIndex == _app.getTrackInfo().getSelection().getEnd()); int response = JOptionPane.showConfirmDialog(_app.getFrame(), I18nManager.getText("dialog.deletephoto.deletepoint"), I18nManager.getText("dialog.deletephoto.title"), @@ -62,7 +65,7 @@ public class RemovePhotoFunction extends GenericFunction } // Add undo information to stack if necessary if (photoDeleted) { - _app.completeFunction(undoAction, currentPhoto.getFile().getName() + " " + I18nManager.getText("confirm.media.removed")); + _app.completeFunction(undoAction, currentPhoto.getName() + " " + I18nManager.getText("confirm.media.removed")); } } }