diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 72eae3f182e..a390b6ec264 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -875,6 +875,10 @@ public boolean handleClose(Editor editor) { // Close the running window, avoid window boogers with multiple sketches editor.internalCloseRunner(); + int[] location = editor.getPlacement(); + Preferences.setInteger("editor.window.width.default", location[2]); + Preferences.setInteger("editor.window.height.default", location[3]); + if (editors.size() == 1) { // For 0158, when closing the last window /and/ it was already an // untitled sketch, just give up and let the user quit. diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 621d1bfc91c..13363572a81 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -2414,14 +2414,14 @@ synchronized public void handleExport(final boolean usingProgrammer) { // DAM: in Arduino, this is upload class DefaultExportHandler implements Runnable { public void run() { - + boolean success = false; try { serialMonitor.closeSerialPort(); serialMonitor.setVisible(false); uploading = true; - boolean success = sketch.exportApplet(false); + success = sketch.exportApplet(false); if (success) { statusNotice(_("Done uploading.")); } else { @@ -2444,20 +2444,24 @@ public void run() { uploading = false; //toolbar.clear(); toolbar.deactivate(EditorToolbar.EXPORT); + if (success && Preferences.getBoolean("serial.autostart")) { + statusNotice(_("Done uploading... Opening serial monitor.")); + handleSerial(); + } } } // DAM: in Arduino, this is upload (with verbose output) class DefaultExportAppHandler implements Runnable { public void run() { - + boolean success = false; try { serialMonitor.closeSerialPort(); serialMonitor.setVisible(false); uploading = true; - boolean success = sketch.exportApplet(true); + success = sketch.exportApplet(true); if (success) { statusNotice(_("Done uploading.")); } else { @@ -2480,6 +2484,10 @@ public void run() { uploading = false; //toolbar.clear(); toolbar.deactivate(EditorToolbar.EXPORT); + if (success && Preferences.getBoolean("serial.autostart")) { + statusNotice(_("Done uploading... Opening serial monitor.")); + handleSerial(); + } } } diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index 2aa9e4202a8..aa63f66ebb1 100644 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -259,6 +259,7 @@ serial.databits=8 serial.stopbits=1 serial.parity=N serial.debug_rate=9600 +serial.autostart=false # I18 Preferences diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 7c712f7dbc7..9ba1522f10f 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,10 @@ +ARDUINO 1.5.X BETA + +[ide] +* Add preference serial.autostart to start serial monitor after a + successful upload (Martin Falatic) +* Save editor.window.{width|height}.default values based on last + editor window closed (Martin Falatic) ARDUINO 1.5.3 BETA