diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index f54b26569..40e9c64bb 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -331,13 +331,18 @@ public class Base { System.out.println(_("Can't open source sketch!")); System.exit(2); } - Thread.sleep(2000); + // Set verbosity for command line build Preferences.set("build.verbose", "" + doVerbose); Preferences.set("upload.verbose", "" + doVerbose); - // Do board selection if requested Editor editor = editors.get(0); + + // Wait until editor is initialized + while (!editor.status.isInitialized()) + Thread.sleep(10); + + // Do board selection if requested if (selectBoard != null) selectBoard(selectBoard, editor); diff --git a/app/src/processing/app/EditorStatus.java b/app/src/processing/app/EditorStatus.java index 57b7fba0f..b757b013b 100644 --- a/app/src/processing/app/EditorStatus.java +++ b/app/src/processing/app/EditorStatus.java @@ -72,6 +72,7 @@ public class EditorStatus extends JPanel /*implements ActionListener*/ { //Thread promptThread; int response; + boolean initialized = false; public EditorStatus(Editor editor) { this.editor = editor; @@ -237,7 +238,10 @@ public class EditorStatus extends JPanel /*implements ActionListener*/ { public void paintComponent(Graphics screen) { //if (screen == null) return; - if (okButton == null) setup(); + if (!initialized) { + setup(); + initialized = true; + } //System.out.println("status.paintComponent"); @@ -500,4 +504,8 @@ public class EditorStatus extends JPanel /*implements ActionListener*/ { } } } + + public boolean isInitialized() { + return initialized; + } }