From efc4165f8ecc6fca102f4be3c749aaa3834ef020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Sun, 30 Dec 2018 13:38:02 +0000 Subject: [PATCH 1/5] Make it easier to grasp the handle for adding points --- src/tim/prune/gui/map/MapCanvas.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tim/prune/gui/map/MapCanvas.java b/src/tim/prune/gui/map/MapCanvas.java index aa25dbc..4055399 100644 --- a/src/tim/prune/gui/map/MapCanvas.java +++ b/src/tim/prune/gui/map/MapCanvas.java @@ -92,7 +92,7 @@ public class MapCanvas extends JPanel implements MouseListener, MouseMotionListe WpIconDefinition _waypointIconDefinition = null; /** Constant for click sensitivity when selecting nearest point */ - private static final int CLICK_SENSITIVITY = 10; + private static final int CLICK_SENSITIVITY = 30; /** Constant for pan distance from key presses */ private static final int PAN_DISTANCE = 20; /** Constant for pan distance from autopan */ From 5c06b99e67bb936f64dc11da1946b188fd2e3229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Sun, 29 Sep 2019 16:28:38 +0100 Subject: [PATCH 2/5] Show minutes for durations > 1 day --- src/tim/prune/gui/DisplayUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tim/prune/gui/DisplayUtils.java b/src/tim/prune/gui/DisplayUtils.java index 25640d8..2300296 100644 --- a/src/tim/prune/gui/DisplayUtils.java +++ b/src/tim/prune/gui/DisplayUtils.java @@ -36,7 +36,8 @@ public static String buildDurationString(long inNumSecs) if (inNumSecs < 86400L) return "" + (inNumSecs / 60 / 60) + I18nManager.getText("display.range.time.hours") + " " + ((inNumSecs / 60) % 60) + I18nManager.getText("display.range.time.mins"); if (inNumSecs < 432000L) return "" + (inNumSecs / 86400L) + I18nManager.getText("display.range.time.days") - + " " + (inNumSecs / 60 / 60) % 24 + I18nManager.getText("display.range.time.hours"); + + " " + (inNumSecs / 60 / 60) % 24 + I18nManager.getText("display.range.time.hours") + + " " + ((inNumSecs / 60) % 60) + I18nManager.getText("display.range.time.mins"); if (inNumSecs < 86400000L) return "" + (inNumSecs / 86400L) + I18nManager.getText("display.range.time.days"); return "big"; } From 16c6ce41acb9e0c4ebb22c5eb76723a1a8b8871b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Sun, 24 Nov 2019 14:05:07 +0000 Subject: [PATCH 3/5] Abort build on error --- buildtools/build.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 buildtools/build.sh diff --git a/buildtools/build.sh b/buildtools/build.sh old mode 100644 new mode 100755 index b38e2ce..c7fcf3d --- a/buildtools/build.sh +++ b/buildtools/build.sh @@ -1,3 +1,4 @@ +set -e # Build script # Version number PRUNENAME=gpsprune_19.2 From 07a0b0905dba057361e45f09d1a3ac990cd0cb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Sun, 6 Oct 2019 09:27:09 +0100 Subject: [PATCH 4/5] Ignore .class files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e9e794 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.class +*.jar From b84283f50ae0e2d1db1bdea1be2dac12660768a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Sun, 30 Dec 2018 13:39:17 +0000 Subject: [PATCH 5/5] Duplicate point before converting it to waypoint --- src/tim/prune/function/edit/PointEditor.java | 13 +++++++++++ .../prune/function/edit/PointNameEditor.java | 22 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/tim/prune/function/edit/PointEditor.java b/src/tim/prune/function/edit/PointEditor.java index c66201b..546a65e 100644 --- a/src/tim/prune/function/edit/PointEditor.java +++ b/src/tim/prune/function/edit/PointEditor.java @@ -307,10 +307,23 @@ private void confirmEdit() if (_model.getChanged(i)) { Field field = fieldList.getField(i); + if (field == field.WAYPT_NAME) { + if (wasNameAdded(_model.getValue(i))) { + _app.createPoint(_point.clonePoint()); + } + } editList.addEdit(new FieldEdit(field, _model.getValue(i))); undoList.addEdit(new FieldEdit(field, _point.getFieldValue(field))); } } _app.completePointEdit(editList, undoList); } + + private boolean wasNameAdded(String newName) + { + String prevName = _point.getWaypointName(); + boolean prevNull = (prevName == null || prevName.equals("")); + boolean newNull = (newName == null || newName.equals("")); + return (prevNull && !newNull); + } } diff --git a/src/tim/prune/function/edit/PointNameEditor.java b/src/tim/prune/function/edit/PointNameEditor.java index 53e1f83..ca5771d 100644 --- a/src/tim/prune/function/edit/PointNameEditor.java +++ b/src/tim/prune/function/edit/PointNameEditor.java @@ -206,7 +206,14 @@ private void confirmEdit() // Check whether name has really changed if (hasNameChanged()) { - // Make lists for edit and undo, and add the changed field + // If a new name has been added, changing the point + // from trackpoint to waypoint, duplicate it + if (wasNameAdded()) + { + _app.createPoint(_point.clonePoint()); + } + + // make lists for edit and undo, and add the changed field FieldEditList editList = new FieldEditList(); FieldEditList undoList = new FieldEditList(); editList.addEdit(new FieldEdit(Field.WAYPT_NAME, _nameField.getText().trim())); @@ -231,4 +238,17 @@ private boolean hasNameChanged() || (!prevNull && newNull) || (!prevNull && !newNull && !prevName.equals(newName)); } + + /** + * Check whether a new name has been added + * @return true if it has indeed + */ + private boolean wasNameAdded() + { + String prevName = _point.getWaypointName(); + String newName = _nameField.getText().trim(); + boolean prevNull = (prevName == null || prevName.equals("")); + boolean newNull = (newName == null || newName.equals("")); + return (prevNull && !newNull); + } }