X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoEditPoint.java;h=be41ea0d88f92c7ce15ef966a253a607b2fe853f;hb=92dad5df664287acb51728e9ea599f150765d34a;hp=ae368652be0b36b98671c35dbcf213eb5f61c80c;hpb=23959e65a6a0d581e657b07186d18b7a1ac5afeb;p=GpsPrune.git diff --git a/tim/prune/undo/UndoEditPoint.java b/tim/prune/undo/UndoEditPoint.java index ae36865..be41ea0 100644 --- a/tim/prune/undo/UndoEditPoint.java +++ b/tim/prune/undo/UndoEditPoint.java @@ -2,8 +2,9 @@ package tim.prune.undo; import tim.prune.I18nManager; import tim.prune.data.DataPoint; +import tim.prune.data.Field; import tim.prune.data.TrackInfo; -import tim.prune.edit.FieldEditList; +import tim.prune.function.edit.FieldEditList; /** * Operation to undo the edit of a single point @@ -32,8 +33,13 @@ public class UndoEditPoint implements UndoOperation public String getDescription() { String desc = I18nManager.getText("undo.editpoint"); + String newName = null; + if (_undoFieldList.getEdit(0).getField() == Field.WAYPT_NAME) + newName = _undoFieldList.getEdit(0).getValue(); String pointName = _originalPoint.getWaypointName(); - if (pointName != null && !pointName.equals("")) + if (newName != null && !newName.equals("")) + desc = desc + " " + newName; + else if (pointName != null && !pointName.equals("")) desc = desc + " " + pointName; return desc; } @@ -41,16 +47,15 @@ public class UndoEditPoint implements UndoOperation /** * Perform the undo operation on the given Track - * @param inTrack Track object on which to perform the operation + * @param inTrackInfo TrackInfo object on which to perform the operation */ public void performUndo(TrackInfo inTrackInfo) throws UndoException { // Restore contents of point into track - if (!inTrackInfo.getTrack().editPoint(_originalPoint, _undoFieldList)) + if (!inTrackInfo.getTrack().editPoint(_originalPoint, _undoFieldList, true)) { // throw exception if failed throw new UndoException(getDescription()); } - // TODO: Deal with photo if necessary } } \ No newline at end of file