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

Avoid reopening the serial monitor during upload

avoidMultipleOperations becomes false with a 10 seconds timeout after pressing the compile button.

The new code introduced by 99f6043ced didn't take this into account, so the port was being reopened before staring the actual upload.

Also, make uploading variable static to avoid preferences confusion (this should be solved in a saner way giving every Editor instance its own set of properties, but it will hopefully fixes by the cli integration and workspace concept)
This commit is contained in:
Martino Facchin 2019-07-19 12:20:36 +02:00
parent e659825058
commit 13b74f5ccb
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
suspend();
}
} else {
if (closed && (Editor.avoidMultipleOperations == false)) {
if (closed && (Editor.isUploading() == false)) {
resume(boardPort);
}
}

View File

@ -219,7 +219,7 @@ public class Editor extends JFrame implements RunnerListener {
private JMenuItem saveAsMenuItem;
//boolean presenting;
private boolean uploading;
static private boolean uploading;
// undo fellers
private JMenuItem undoItem;
@ -2110,6 +2110,10 @@ public class Editor extends JFrame implements RunnerListener {
}
}
static public boolean isUploading() {
return uploading;
}
private void resumeOrCloseSerialMonitor() {
// Return the serial monitor window to its initial state
if (serialMonitor != null) {