8000 Select (first) target board when port is selected and has known board by sandeepmistry · Pull Request #7120 · arduino/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Select (first) target board when port is selected and has known board #7120

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Make target board autoselection configurable via Preferences
The setting is off by default.

Per-sketch board autoselection could work better because:
* Most 3rd party boards ship with generic USB to serial converters, making autoselection useless
* The port menu is not easily reachable as it is in Create
  • Loading branch information
facchinm authored and sandeepmistry committed Jan 16, 2018
commit 9c55607fd5875b06757ab6dd29c5f1b8e412553a
9 changes: 9 additions & 0 deletions app/src/cc/arduino/view/preferences/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private v 8000 oid initComponents() {
verifyUploadBox = new javax.swing.JCheckBox();
externalEditorBox = new javax.swing.JCheckBox();
cacheCompiledCore = new javax.swing.JCheckBox();
autoselectBoard = new javax.swing.JCheckBox();
checkUpdatesBox = new javax.swing.JCheckBox();
updateExtensionBox = new javax.swing.JCheckBox();
saveVerifyUploadBox = new javax.swing.JCheckBox();
Expand Down Expand Up @@ -275,6 +276,9 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
cacheCompiledCore.setText(tr("Aggressively cache compiled core"));
checkboxesContainer.add(cacheCompiledCore);

autoselectBoard.setText(tr("Automatically use the correct target when selecting a known serial port"));
checkboxesContainer.add(autoselectBoard);

checkUpdatesBox.setText(tr("Check for updates on startup"));
checkboxesContainer.add(checkUpdatesBox);

Expand Down Expand Up @@ -710,6 +714,7 @@ private void autoScaleCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//
private javax.swing.JButton extendedAdditionalUrlFieldWindow;
private javax.swing.JCheckBox externalEditorBox;
private javax.swing.JCheckBox cacheCompiledCore;
private javax.swing.JCheckBox autoselectBoard;
private javax.swing.JTextField fontSizeField;
private javax.swing.JLabel fontSizeLabel;
private javax.swing.JLabel jLabel1;
Expand Down Expand Up @@ -806,6 +811,8 @@ private void savePreferencesData() {

PreferencesData.setBoolean("compiler.cache_core", cacheCompiledCore.isSelected());

PreferencesData.setBoolean("editor.autoselectboard", autoselectBoard.isSelected());

PreferencesData.setBoolean("update.check", checkUpdatesBox.isSelected());

PreferencesData.setBoolean("editor.update_extension", updateExtensionBox.isSelected());
Expand Down Expand Up @@ -868,6 +875,8 @@ private void showPrerefencesData() {

cacheCompiledCore.setSelected(PreferencesData.get("compiler.cache_core") == null || PreferencesData.getBoolean("compiler.cache_core"));

autoselectBoard.setSelected(PreferencesData.getBoolean("editor.autoselectboard"));

checkUpdatesBox.setSelected(PreferencesData.getBoolean("update.check"));

updateExtensionBox.setSelected(PreferencesData.get("editor.update_extension") == null || PreferencesData.getBoolean("editor.update_extension"));
Expand Down
4 changes: 2 additions & 2 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ private void selectSerialPort(String name, String boardId) {
// ignore
}
}
if (boardId != null) {

if (boardId != null && PreferencesData.getBoolean("editor.autoselectboard")) {
TargetBoard targetBoard = BaseNoGui.getPlatform().resolveBoardById(BaseNoGui.packages, boardId);
if (targetBoard != null) {
base.selectTargetBoard(targetBoard);
Expand Down
0