From 6fa74cf71181dd96be8f6a278eba49f69873ef2d Mon Sep 17 00:00:00 2001 From: David Mellis Date: Thu, 23 Dec 2010 19:28:39 -0500 Subject: [PATCH] Serial prompt fixes. Not showing the serial prompt if no serial ports are available. Showing the serial prompt for verbose upload, too. --- app/src/processing/app/Editor.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 92d6dd83d..3d8bd405b 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -2233,7 +2233,6 @@ public class Editor extends JFrame implements RunnerListener { public boolean serialPrompt() { - populateSerialMenu(); int count = serialMenu.getItemCount(); Object[] names = new Object[count]; for (int i = 0; i < count; i++) { @@ -2298,7 +2297,9 @@ public class Editor extends JFrame implements RunnerListener { // error message will already be visible } } catch (SerialNotFoundException e) { - if (serialPrompt()) run(); + populateSerialMenu(); + if (serialMenu.getItemCount() == 0) statusError(e); + else if (serialPrompt()) run(); else statusNotice("Upload canceled."); } catch (RunnerException e) { //statusError("Error during upload."); @@ -2329,6 +2330,11 @@ public class Editor extends JFrame implements RunnerListener { } else { // error message will already be visible } + } catch (SerialNotFoundException e) { + populateSerialMenu(); + if (serialMenu.getItemCount() == 0) statusError(e); + else if (serialPrompt()) run(); + else statusNotice("Upload canceled."); } catch (RunnerException e) { //statusError("Error during upload."); //e.printStackTrace();