Merge branch 'autosave' into HEAD

This commit is contained in:
Cristian Maglie 2014-11-13 11:51:46 +01:00
commit 285a03a655
4 changed files with 29 additions and 2 deletions

View File

@ -1887,6 +1887,11 @@ public class Editor extends JFrame implements RunnerListener {
*/
public void handleRun(final boolean verbose) {
internalCloseRunner();
if (Preferences.getBoolean("editor.save_on_verify")) {
if (sketch.isModified() && !sketch.isReadOnly()) {
handleSave(true);
}
}
running = true;
toolbar.activate(EditorToolbar.RUN);
status.progress(_("Compiling sketch..."));
@ -2369,7 +2374,11 @@ public class Editor extends JFrame implements RunnerListener {
* hitting export twice, quickly, and horking things up.
*/
synchronized public void handleExport(final boolean usingProgrammer) {
//if (!handleExportCheckModified()) return;
if (Preferences.getBoolean("editor.save_on_verify")) {
if (sketch.isModified() && !sketch.isReadOnly()) {
handleSave(true);
}
}
toolbar.activate(EditorToolbar.EXPORT);
console.clear();
status.progress(_("Uploading to I/O Board..."));

View File

@ -208,6 +208,7 @@ public class Preferences {
JCheckBox updateExtensionBox;
JCheckBox autoAssociateBox;
JComboBox comboLanguage;
JCheckBox saveVerifyUploadBox;
// the calling editor, so updates can be applied
@ -478,6 +479,15 @@ public class Preferences {
autoAssociateBox.setEnabled(false);
}
// [ ] save when verifying or uploading
saveVerifyUploadBox = new JCheckBox(_("Save when verifying or uploading"));
pain.add(saveVerifyUploadBox);
d = saveVerifyUploadBox.getPreferredSize();
saveVerifyUploadBox.setBounds(left, top, d.width + 10, d.height);
right = Math.max(right, left + d.width);
top += d.height + GUI_BETWEEN;
// More preferences are in the ...
label = new JLabel(_("More preferences can be edited directly in the file"));
@ -620,7 +630,8 @@ public class Preferences {
setBoolean("upload.verbose", verboseUploadBox.isSelected());
setBoolean("editor.linenumbers", displayLineNumbersBox.isSelected());
setBoolean("upload.verify", verifyUploadBox.isSelected());
setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
// setBoolean("sketchbook.closing_last_window_quits",
// closingLastQuitsBox.isSelected());
//setBoolean("sketchbook.prompt", sketchPromptBox.isSelected());
@ -642,6 +653,7 @@ public class Preferences {
setBoolean("editor.external", externalEditorBox.isSelected());
setBoolean("update.check", checkUpdatesBox.isSelected());
setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
/*
// was gonna use this to check memory settings,
@ -703,6 +715,8 @@ public class Preferences {
setSelected(getBoolean("editor.external"));
checkUpdatesBox.
setSelected(getBoolean("update.check"));
saveVerifyUploadBox.
setSelected(getBoolean("editor.save_on_verify"));
if (autoAssociateBox != null) {
autoAssociateBox.

View File

@ -149,6 +149,9 @@ editor.divider.size = 0
# but keeps it from being annoyingly obtrusive
editor.divider.size.windows = 2
# automatically save sketch when verifying or uploading
editor.save_on_verify = true
# any additional java options when running externally
# (for applets that are run external to the environment...
# those with a code folder, or using any libraries)

View File

@ -2,6 +2,7 @@
ARDUINO 1.5.9
[ide]
* Autosave on sketch Upload/Verify (Fulvio Ieva)
* Sketch build process: fixed full rebuild on windows even if not needed
* Sketch build process: core.a rebuild only if needed (Matthijs Kooijman)
* Updated AStyle formatter to v2.04: http://astyle.sourceforge.net/notes.html