Removed 2secs wait while using IDE from command line

This commit is contained in:
Cristian Maglie 2012-12-23 15:30:10 +01:00
parent 730f81e8ba
commit 739ab8c873
2 changed files with 16 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}
}