Skip to content

1.5.x enhancements: serial monitor autostart and editor window size autosave #1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 12 additions & 4 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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();
}
}
}

Expand Down
1 change: 1 addition & 0 deletions build/shared/lib/preferences.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ serial.databits=8
serial.stopbits=1
serial.parity=N
serial.debug_rate=9600
serial.autostart=false

# I18 Preferences

Expand Down
7 changes: 7 additions & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down