X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoDeletePhoto.java;h=45be6addcb5040fa2844caad22f0c236ddd6fa91;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=cfc166271131eec1f41f6a79ba3bcfe8dd29a354;hpb=5625a1abadb5f2ca5f017fe7dbda1d5141cb637b;p=GpsPrune.git diff --git a/tim/prune/undo/UndoDeletePhoto.java b/tim/prune/undo/UndoDeletePhoto.java index cfc1662..45be6ad 100644 --- a/tim/prune/undo/UndoDeletePhoto.java +++ b/tim/prune/undo/UndoDeletePhoto.java @@ -1,6 +1,7 @@ package tim.prune.undo; import tim.prune.I18nManager; +import tim.prune.UpdateMessageBroker; import tim.prune.data.DataPoint; import tim.prune.data.Photo; import tim.prune.data.TrackInfo; @@ -8,7 +9,7 @@ import tim.prune.data.TrackInfo; /** * Operation to undo a delete of a single photo, either with or without point */ -public class UndoDeletePhoto implements UndoOperation +public class UndoDeletePhoto extends UndoDeleteOperation { private int _photoIndex = -1; private Photo _photo = null; @@ -37,7 +38,7 @@ public class UndoDeletePhoto implements UndoOperation */ public String getDescription() { - String desc = I18nManager.getText("undo.deletephoto") + " " + _photo.getFile().getName(); + String desc = I18nManager.getText("undo.removephoto") + " " + _photo.getName(); return desc; } @@ -57,16 +58,17 @@ public class UndoDeletePhoto implements UndoOperation { throw new UndoException(getDescription()); } + // Change the current point/range selection if required + modifySelection(inTrackInfo, _pointIndex, _pointIndex); } else { // update needed if not already triggered by track update - inTrackInfo.triggerUpdate(); + UpdateMessageBroker.informSubscribers(); } // Ensure that photo is associated with point and vice versa _photo.setDataPoint(_point); - if (_point != null) - { + if (_point != null) { _point.setPhoto(_photo); } }