Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'toolchains/arduino/org.eclipse.cdt.arduino.ui')
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.ui/META-INF/MANIFEST.MF2
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/remote/ArduinoTargetPropertyPage.java19
2 files changed, 16 insertions, 5 deletions
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.ui/META-INF/MANIFEST.MF b/toolchains/arduino/org.eclipse.cdt.arduino.ui/META-INF/MANIFEST.MF
index 7562afd7b4..a5ccd7a50d 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.ui/META-INF/MANIFEST.MF
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.arduino.ui;singleton:=true
-Bundle-Version: 2.1.100.qualifier
+Bundle-Version: 2.1.200.qualifier
Bundle-Activator: org.eclipse.cdt.arduino.ui.internal.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.expressions,
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/remote/ArduinoTargetPropertyPage.java b/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/remote/ArduinoTargetPropertyPage.java
index 366277381f..c5dc9a2855 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/remote/ArduinoTargetPropertyPage.java
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/remote/ArduinoTargetPropertyPage.java
@@ -55,11 +55,20 @@ public class ArduinoTargetPropertyPage extends PropertyPage implements IWorkbenc
portSelector.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
String currentPort = arduinoRemote.getPortName();
- portSelector.setText(currentPort);
try {
- for (String port : SerialPort.list()) {
+ int i = 0;
+ int portIdx = -1;
+ String[] ports = SerialPort.list();
+ for (String port : ports) {
portSelector.add(port);
+ if (port.equals(currentPort))
+ portIdx = i;
+ ++i;
}
+ if (portIdx >= 0)
+ portSelector.select(portIdx);
+ if (ports.length == 0)
+ portSelector.setText(Messages.ArduinoTargetPropertyPage_1);
} catch (IOException e) {
Activator.log(e);
}
@@ -100,8 +109,10 @@ public class ArduinoTargetPropertyPage extends PropertyPage implements IWorkbenc
ArduinoBoard board = boards[boardSelector.getSelectionIndex()];
ArduinoRemoteConnection.setBoardId(workingCopy, board);
- String portName = portSelector.getItem(portSelector.getSelectionIndex());
- ArduinoRemoteConnection.setPortName(workingCopy, portName);
+ int idx = portSelector.getSelectionIndex();
+ if (idx >= 0) {
+ ArduinoRemoteConnection.setPortName(workingCopy, portSelector.getItem(idx));
+ }
try {
workingCopy.save();

Back to the top