--- /dev/null
+*.class
+*.jar
+set -e
# Build script
# Version number
PRUNENAME=gpsprune_19.2
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);
+ }
}
// 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
+ _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()));
|| (!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);
+ }
}
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";
}
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 */