Skip to content

add save when verifyng and uploading #1934 #2214

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
wants to merge 1 commit into from
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
13 changes: 12 additions & 1 deletion app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
package processing.app;

import cc.arduino.packages.UploaderAndMonitorFactory;

import com.jcraft.jsch.JSchException;

import processing.app.debug.*;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.PreferencesMapException;
Expand Down Expand Up @@ -1891,6 +1893,11 @@ protected void handleFindReference() {
*/
public void handleRun(final boolean verbose) {
internalCloseRunner();
if (Preferences.getBoolean("save.verifyUpload")){
if (sketch.isModified()){
handleSave(true);
}
}
running = true;
toolbar.activate(EditorToolbar.RUN);
status.progress(_("Compiling sketch..."));
Expand Down Expand Up @@ -2375,7 +2382,11 @@ public boolean serialPrompt() {
* hitting export twice, quickly, and horking things up.
*/
synchronized public void handleExport(final boolean usingProgrammer) {
//if (!handleExportCheckModified()) return;
if (Preferences.getBoolean("save.verifyUpload")){
if (sketch.isModified()){
handleSave(true);
}
}
toolbar.activate(EditorToolbar.EXPORT);
console.clear();
status.progress(_("Uploading to I/O Board..."));
Expand Down
19 changes: 17 additions & 2 deletions app/src/processing/app/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public String toString() {
JCheckBox updateExtensionBox;
JCheckBox autoAssociateBox;
JComboBox comboLanguage;
JCheckBox saveVerifyUploadBox;


// the calling editor, so updates can be applied
Expand Down Expand Up @@ -488,6 +489,16 @@ public void actionPerformed(ActionEvent e) {
autoAssociateBox.setEnabled(false);
}

// [ ] save when verifyng and uploading

saveVerifyUploadBox = new JCheckBox(_("Save when verifyng and 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"));
Expand Down Expand Up @@ -630,6 +641,7 @@ protected void applyFrame() {
setBoolean("upload.verbose", verboseUploadBox.isSelected());
setBoolean("editor.linenumbers", displayLineNumbersBox.isSelected());
setBoolean("upload.verify", verifyUploadBox.isSelected());
setBoolean("save.verifyUpload", saveVerifyUploadBox.isSelected());

// setBoolean("sketchbook.closing_last_window_quits",
// closingLastQuitsBox.isSelected());
Expand All @@ -652,7 +664,8 @@ protected void applyFrame() {

setBoolean("editor.external", externalEditorBox.isSelected());
setBoolean("update.check", checkUpdatesBox.isSelected());

setBoolean("save.verifyUpload", saveVerifyUploadBox.isSelected());

/*
// was gonna use this to check memory settings,
// but it quickly gets much too messy
Expand Down Expand Up @@ -713,7 +726,9 @@ protected void showFrame(Editor editor) {
setSelected(getBoolean("editor.external"));
checkUpdatesBox.
setSelected(getBoolean("update.check"));

saveVerifyUploadBox.
setSelected(getBoolean("save.verifyUpload"));

if (autoAssociateBox != null) {
autoAssociateBox.
setSelected(getBoolean("platform.auto_file_type_associations"));
Expand Down