Skip to content

Commit 6fa74cf

Browse files
committed
Serial prompt fixes.
Not showing the serial prompt if no serial ports are available. Showing the serial prompt for verbose upload, too.
1 parent 544cfaf commit 6fa74cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/processing/app/Editor.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,6 @@ public boolean handleSaveAs() {
22332233

22342234

22352235
public boolean serialPrompt() {
2236-
populateSerialMenu();
22372236
int count = serialMenu.getItemCount();
22382237
Object[] names = new Object[count];
22392238
for (int i = 0; i < count; i++) {
@@ -2298,7 +2297,9 @@ public void run() {
22982297
// error message will already be visible
22992298
}
23002299
} catch (SerialNotFoundException e) {
2301-
if (serialPrompt()) run();
2300+
populateSerialMenu();
2301+
if (serialMenu.getItemCount() == 0) statusError(e);
2302+
else if (serialPrompt()) run();
23022303
else statusNotice("Upload canceled.");
23032304
} catch (RunnerException e) {
23042305
//statusError("Error during upload.");
@@ -2329,6 +2330,11 @@ public void run() {
23292330
} else {
23302331
// error message will already be visible
23312332
}
2333+
} catch (SerialNotFoundException e) {
2334+
populateSerialMenu();
2335+
if (serialMenu.getItemCount() == 0) statusError(e);
2336+
else if (serialPrompt()) run();
2337+
else statusNotice("Upload canceled.");
23322338
} catch (RunnerException e) {
23332339
//statusError("Error during upload.");
23342340
//e.printStackTrace();

0 commit comments

Comments
 (0)