Skip to content

Commit 7cc09a6

Browse files
committed
Arduino IDE version check revisited.
1 parent 5c180c4 commit 7cc09a6

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/ui/ArduinoPreferencePage.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ public boolean okToLeave() {
8080
return testStatus();
8181
}
8282

83+
private boolean showError(String dialogMessage) {
84+
String FullDialogMessage = dialogMessage + "\nPlease see <http://eclipse.baeyens.it/installAdvice.shtml> for more info.";
85+
MessageBox dialog = new MessageBox(getShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
86+
dialog.setText("Considerations about Arduino IDE compatibility");
87+
dialog.setMessage(FullDialogMessage);
88+
if (dialog.open() == SWT.CANCEL)
89+
return false;
90+
return true;
91+
}
92+
8393
/**
8494
* PerformOK is done when the end users presses OK on a preference page. The order of the execution of the performOK is undefined. This method
8595
* saves the path variables based on the settings and removes the last used setting.<br/>
@@ -97,17 +107,20 @@ public boolean performOk() {
97107
return false;
98108
if (!mIsDirty)
99109
return true;
100-
if (mArduinoIdeVersion.getStringValue().compareTo("1.5.2") > 0) {
101-
String message = "The Arduino core team decided for a library specification which is hard to support. You need to make changes to you arduino libraries to make this work. See eclipse.baeyens.it/librarymadness.html for more info.";
102-
// MessageDialog warningDialog = new MessageDialog(null, , null, message, MessageDialog.WARNING, "OK", 0);
103-
// warningDialog.open();
104-
105-
MessageBox dialog = new MessageBox(getShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
106-
dialog.setText("Unsupportable Arduino IDE");
107-
dialog.setMessage(message);
108-
if (dialog.open() == SWT.CANCEL)
110+
111+
if (mArduinoIdeVersion.getStringValue().compareTo("1.5.0") < 0) {
112+
showError("This plugin is for Arduino IDE 1.5.x. \nPlease use V1 of the plugin for earlier versions.");
113+
return false;
114+
}
115+
if (mArduinoIdeVersion.getStringValue().equals("1.5.3") || mArduinoIdeVersion.getStringValue().equals("1.5.4")) {
116+
if (!showError("Arduino IDE 1.5.3 and 1.5.4 are not supported out of the box."))
109117
return false;
110118
}
119+
if (mArduinoIdeVersion.getStringValue().compareTo("1.5.5") > 0) {
120+
if (!showError("You are using a version of the Arduino IDE that is newer than available at the release of this plugin."))
121+
return false;
122+
}
123+
111124
super.performOk();
112125
setWorkSpacePathVariables();
113126
// reset the previous selected values

0 commit comments

Comments
 (0)