Skip to content

Commit 7e7a9d0

Browse files
author
Federico Fissore
committed
Disabling uncertified boards warning even in java code, for good measure
1 parent 060ec30 commit 7e7a9d0

File tree

7 files changed

+3
-351
lines changed

7 files changed

+3
-351
lines changed

app/src/cc/arduino/view/ShowUncertifiedBoardWarning.java

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/src/cc/arduino/view/UncertifiedBoardWarning.form

Lines changed: 0 additions & 81 deletions
This file was deleted.

app/src/cc/arduino/view/UncertifiedBoardWarning.java

Lines changed: 0 additions & 146 deletions
This file was deleted.

app/src/processing/app/Editor.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -966,22 +966,15 @@ protected JMenu addInternalTools(JMenu menu) {
966966

967967
class SerialMenuListener implements ActionListener {
968968

969-
private final Frame parent;
970969
private final String serialPort;
971-
private final String warning;
972970

973-
public SerialMenuListener(Frame parent, String serialPort, String warning) {
974-
this.parent = parent;
971+
public SerialMenuListener(String serialPort) {
975972
this.serialPort = serialPort;
976-
this.warning = warning;
977973
}
978974

979975
public void actionPerformed(ActionEvent e) {
980976
selectSerialPort(serialPort);
981977
base.onBoardOrPortChange();
982-
if (warning != null && !Preferences.getBoolean("uncertifiedBoardWarning_dontShowMeAgain")) {
983-
SwingUtilities.invokeLater(new ShowUncertifiedBoardWarning(parent));
984-
}
985978
}
986979

987980
}
@@ -1063,7 +1056,7 @@ public int compare(BoardPort o1, BoardPort o2) {
10631056
String label = port.getLabel();
10641057

10651058
JCheckBoxMenuItem item = new JCheckBoxMenuItem(label, address.equals(selectedPort));
1066-
item.addActionListener(new SerialMenuListener(this, address, port.getPrefs().get("warning")));
1059+
item.addActionListener(new SerialMenuListener(address));
10671060
serialMenu.add(item);
10681061
}
10691062

app/src/processing/app/Sketch.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@
2323

2424
package processing.app;
2525

26-
import cc.arduino.packages.BoardPort;
2726
import cc.arduino.packages.Uploader;
28-
import cc.arduino.view.*;
2927
import processing.app.debug.Compiler;
3028
import processing.app.debug.Compiler.ProgressListener;
3129
import processing.app.debug.RunnerException;
32-
import processing.app.debug.TargetBoard;
3330
import processing.app.forms.PasswordAuthorizationDialog;
3431
import processing.app.helpers.OSUtils;
35-
import processing.app.helpers.PreferencesMap;
3632
import processing.app.helpers.PreferencesMapException;
3733
import processing.app.packages.UserLibrary;
3834
import static processing.app.I18n._;
@@ -46,8 +42,6 @@
4642
import java.util.LinkedList;
4743
import java.util.List;
4844

49-
import static processing.app.I18n._;
50-
5145

5246
/**
5347
* Stores information about files in the current sketch
@@ -1153,8 +1147,6 @@ public String build(boolean verbose) throws RunnerException, PreferencesMapExcep
11531147
* @return null if compilation failed, main class name if not
11541148
*/
11551149
public String build(String buildPath, boolean verbose) throws RunnerException, PreferencesMapException {
1156-
useOriginalVidPidIfUncertified();
1157-
11581150
// run the preprocessor
11591151
editor.status.progressUpdate(20);
11601152

@@ -1204,38 +1196,6 @@ public boolean exportApplet(String appletPath, boolean usingProgrammer)
12041196
return success;
12051197
}
12061198

1207-
private void useOriginalVidPidIfUncertified() {
1208-
BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
1209-
if (boardPort == null) {
1210-
return;
1211-
}
1212-
TargetBoard targetBoard = BaseNoGui.getTargetBoard();
1213-
if (targetBoard == null) {
1214-
return;
1215-
}
1216-
PreferencesMap boardPreferences = targetBoard.getPreferences();
1217-
if (boardPreferences.containsKey("build.vid") && boardPreferences.containsKey("build.pid")) {
1218-
if (!boardPreferences.containsKey("backup.build.vid")) {
1219-
boardPreferences.put("backup.build.vid", boardPreferences.get("build.vid"));
1220-
boardPreferences.put("backup.build.pid", boardPreferences.get("build.pid"));
1221-
}
1222-
1223-
if (boardPort.getPrefs().get("warning") != null) {
1224-
boardPreferences.put("build.vid", boardPort.getPrefs().get("vid"));
1225-
boardPreferences.put("build.pid", boardPort.getPrefs().get("pid"));
1226-
} else {
1227-
boardPreferences.put("build.vid", boardPreferences.get("backup.build.vid"));
1228-
boardPreferences.put("build.pid", boardPreferences.get("backup.build.pid"));
1229-
}
1230-
}
1231-
1232-
if (boardPort.getPrefs().get("warning") != null && !Preferences.getBoolean("uncertifiedBoardWarning_dontShowMeAgain")) {
1233-
SwingUtilities.invokeLater(new ShowUncertifiedBoardWarning(editor));
1234-
}
1235-
1236-
1237-
}
1238-
12391199
protected boolean upload(String buildPath, String suggestedClassName, boolean usingProgrammer) throws Exception {
12401200

12411201
Uploader uploader = Compiler.getUploaderByPreferences(false);

0 commit comments

Comments
 (0)