File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -331,13 +331,18 @@ public Base(String[] args) throws Exception {
331
331
System .out .println (_ ("Can't open source sketch!" ));
332
332
System .exit (2 );
333
333
}
334
- Thread . sleep ( 2000 );
334
+
335
335
// Set verbosity for command line build
336
336
Preferences .set ("build.verbose" , "" + doVerbose );
337
337
Preferences .set ("upload.verbose" , "" + doVerbose );
338
338
339
- // Do board selection if requested
340
339
Editor editor = editors .get (0 );
340
+
341
+ // Wait until editor is initialized
342
+ while (!editor .status .isInitialized ())
343
+ Thread .sleep (10 );
344
+
345
+ // Do board selection if requested
341
346
if (selectBoard != null )
342
347
selectBoard (selectBoard , editor );
343
348
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ public class EditorStatus extends JPanel /*implements ActionListener*/ {
72
72
//Thread promptThread;
73
73
int response ;
74
74
75
+ boolean initialized = false ;
75
76
76
77
public EditorStatus (Editor editor ) {
77
78
this .editor = editor ;
@@ -237,7 +238,10 @@ public void update(Graphics g) {
237
238
238
239
public void paintComponent (Graphics screen ) {
239
240
//if (screen == null) return;
240
- if (okButton == null ) setup ();
241
+ if (!initialized ) {
242
+ setup ();
243
+ initialized = true ;
244
+ }
241
245
242
246
//System.out.println("status.paintComponent");
243
247
@@ -500,4 +504,8 @@ public void actionPerformed(ActionEvent e) {
500
504
}
501
505
}
502
506
}
507
+
508
+ public boolean isInitialized () {
509
+ return initialized ;
510
+ }
503
511
}
You can’t perform that action at this time.
0 commit comments