- String[] commands = {"gpsbabel", null, "-i", _formatField.getText(), "-f", _deviceField.getText(), "-o", "gpx", "-F", "-"};
- commands[1] = inWaypoints?"-w":"-t";
+ String[] commands = null;
+ if (inWaypoints && inTracks) {
+ // Both waypoints and track points selected
+ commands = new String[] {"gpsbabel", "-w", "-t", "-i", _formatField.getText(),
+ "-f", _deviceField.getText(), "-o", "gpx", "-F", "-"};
+ }
+ else
+ {
+ // Only waypoints OR track points selected
+ commands = new String[] {"gpsbabel", "-w", "-i", _formatField.getText(),
+ "-f", _deviceField.getText(), "-o", "gpx", "-F", "-"};
+ if (inTracks) {
+ commands[1] = "-t";
+ }
+ }