From 6743243325fef126a4b72f6e075ac0e388580041 Mon Sep 17 00:00:00 2001 From: Martin Falatic Date: Fri, 8 Feb 2013 01:19:45 -0800 Subject: [PATCH 1/2] Adding two small enhancements 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) --- app/src/processing/app/Base.java | 4 ++++ app/src/processing/app/Editor.java | 16 ++++++++++++---- build/shared/lib/preferences.txt | 1 + build/shared/revisions.txt | 7 +++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 0af27034e46..d8f374e0c0a 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -864,6 +864,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 3cf54e0105b..4817a6bf934 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -2398,14 +2398,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 { @@ -2428,20 +2428,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 { @@ -2464,6 +2468,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 16290aa0de9..faa4ef32f41 100644 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -257,6 +257,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 34412f94a61..fa4870ae505 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,10 @@ +ARDUINO 1.5.3 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.2 BETA - 2013.02.06 From 4e0241e27217fbaded4c55b82b1fd6f776544407 Mon Sep 17 00:00:00 2001 From: Martin Falatic Date: Fri, 8 Feb 2013 01:19:45 -0800 Subject: [PATCH 2/2] Adding two small enhancements 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) --- app/src/processing/app/Base.java | 4 ++++ app/src/processing/app/Editor.java | 16 ++++++++++++---- build/shared/lib/preferences.txt | 1 + build/shared/revisions.txt | 7 +++++++ 4 files changed, 24 insertions(+), 4 deletions(-) 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..d1565e3daaa 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,10 @@ +ARDUINO 1.5.3 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