1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Disable serial monitor for non-SSH network ports

This commit is contained in:
Sandeep Mistry 2017-03-17 12:04:34 -04:00 committed by Cristian Maglie
parent 40e7b1db39
commit 3e9448d34b
2 changed files with 15 additions and 1 deletions

View File

@ -37,7 +37,13 @@ public class MonitorFactory {
public AbstractMonitor newMonitor(BoardPort port) {
if ("network".equals(port.getProtocol())) {
return new NetworkMonitor(port);
if ("yes".equals(port.getPrefs().get("ssh_upload"))) {
// the board is SSH capable
return new NetworkMonitor(port);
} else {
// SSH not supported, no monitor support
return null;
}
}
return new SerialMonitor(port);

View File

@ -2318,6 +2318,14 @@ public class Editor extends JFrame implements RunnerListener {
}
serialMonitor = new MonitorFactory().newMonitor(port);
if (serialMonitor == null) {
String board = port.getPrefs().get("board");
String boardName = BaseNoGui.getPlatform().resolveDeviceByBoardID(BaseNoGui.packages, board);
statusError(I18n.format(tr("Serial monitor is not supported on network ports such as {0} for the {1} in this release"), PreferencesData.get("serial.port"), boardName));
return;
}
Base.setIcon(serialMonitor);
// If currently uploading, disable the monitor (it will be later