Skip to content

Commit 72cd6b0

Browse files
committed
Fix for #358
Forgot a couple of instances in the previous commit
1 parent d41a878 commit 72cd6b0

File tree

2 files changed

+22
-35
lines changed

2 files changed

+22
-35
lines changed

it.baeyens.arduino.common/src/it/baeyens/arduino/common/InstancePreferences.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public static String[] getPrivateHardwarePaths() {
333333
}
334334

335335
public static void setPrivateHardwarePaths(String[] folderName) {
336-
setGlobalValue(KEY_PRIVATE_HARDWARE_PATHS, String.join(";", folderName)); //$NON-NLS-1$
336+
setGlobalValue(KEY_PRIVATE_HARDWARE_PATHS, String.join(File.pathSeparator, folderName));
337337
}
338338

339339
/**
@@ -342,8 +342,8 @@ public static void setPrivateHardwarePaths(String[] folderName) {
342342
* @return a list of all the folder locations that can contain hardware
343343
*/
344344
public static String[] getHardwarePaths() {
345-
return (getGlobalString(KEY_PRIVATE_HARDWARE_PATHS, "") + ";" + ConfigurationPreferences.getInstallationPath()) //$NON-NLS-1$ //$NON-NLS-2$
346-
.split(";"); //$NON-NLS-1$
345+
return (getGlobalString(KEY_PRIVATE_HARDWARE_PATHS, EMPTY_STRING) + File.pathSeparator + ConfigurationPreferences.getInstallationPath())
346+
.split(File.pathSeparator);
347347
}
348348

349349
}

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

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040
import it.baeyens.arduino.tools.Helpers;
4141

4242
/**
43-
* The ArduinoSelectionPage class is used in the new wizard and the project
44-
* properties. This class controls the gui and the data underneath the gui. This
45-
* class allows to select the arduino board and the port name
43+
* The ArduinoSelectionPage class is used in the new wizard and the project properties. This class controls the gui and the data underneath the gui.
44+
* This class allows to select the arduino board and the port name
4645
*
4746
* @author Jan Baeyens
4847
* @see ArduinoProperties ArduinoSettingsPage
@@ -68,8 +67,7 @@ public class BoardSelectionPage extends AbstractCPropertyTab {
6867
// for the current arduino environment
6968

7069
/**
71-
* Get the configuration we are currently working in. The configuration is
72-
* null if we are in the create sketch wizard.
70+
* Get the configuration we are currently working in. The configuration is null if we are in the create sketch wizard.
7371
*
7472
* @return the configuration to save info into
7573
*/
@@ -81,8 +79,7 @@ public ICConfigurationDescription getConfdesc() {
8179
}
8280

8381
/**
84-
* Listener for the child or leave fields. The listener saves the
85-
* information in the configuration
82+
* Listener for the child or leave fields. The listener saves the information in the configuration
8683
*
8784
* @author jan
8885
*
@@ -128,8 +125,7 @@ public void handleEvent(Event e) {
128125
*/
129126
String CurrentBoard = BoardSelectionPage.this.mcontrolBoardName.getText();
130127
BoardSelectionPage.this.mcontrolBoardName.removeAll();
131-
BoardSelectionPage.this.mcontrolBoardName
132-
.setItems(BoardSelectionPage.this.mAllBoardsFiles[selectedBoardFile].GetArduinoBoards());
128+
BoardSelectionPage.this.mcontrolBoardName.setItems(BoardSelectionPage.this.mAllBoardsFiles[selectedBoardFile].GetArduinoBoards());
133129
BoardSelectionPage.this.mcontrolBoardName.setText(CurrentBoard);
134130

135131
BoardSelectionPage.this.BoardModifyListener.handleEvent(null);
@@ -144,8 +140,8 @@ public void handleEvent(Event e) {
144140
String boardName = BoardSelectionPage.this.mcontrolBoardName.getText();
145141

146142
for (LabelCombo curLabelCombo : BoardSelectionPage.this.mBoardOptionCombos) {
147-
curLabelCombo.setItems(BoardSelectionPage.this.mAllBoardsFiles[selectedBoardFile]
148-
.getMenuItemNames(curLabelCombo.getMenuName(), boardName));
143+
curLabelCombo.setItems(
144+
BoardSelectionPage.this.mAllBoardsFiles[selectedBoardFile].getMenuItemNames(curLabelCombo.getMenuName(), boardName));
149145
}
150146

151147
IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
@@ -242,8 +238,7 @@ public void draw(Composite composite) {
242238
this.mcontrolBoardName.setEnabled(false);
243239

244240
// ----
245-
this.mControlUploadPort = new LabelCombo(composite, Messages.ui_port, this.ncol - 1,
246-
Const.ENV_KEY_JANTJE_COM_PORT, false);
241+
this.mControlUploadPort = new LabelCombo(composite, Messages.ui_port, this.ncol - 1, Const.ENV_KEY_JANTJE_COM_PORT, false);
247242

248243
this.mControlUploadPort.setItems(ArrayUtil.addAll(Activator.bonjourDiscovery.getList(), Common.listComPorts()));
249244

@@ -257,8 +252,7 @@ public void draw(Composite composite) {
257252
this.mBoardOptionCombos = new LabelCombo[menuNames.length];
258253
for (int currentOption = 0; currentOption < menuNames.length; currentOption++) {
259254
String menuName = menuNames[currentOption];
260-
this.mBoardOptionCombos[currentOption] = new LabelCombo(composite, menuName, this.ncol - 1,
261-
Const.ENV_KEY_JANTJE_START + menuName, true);
255+
this.mBoardOptionCombos[currentOption] = new LabelCombo(composite, menuName, this.ncol - 1, Const.ENV_KEY_JANTJE_START + menuName, true);
262256
}
263257

264258
// Create the control to alert parents of changes
@@ -348,8 +342,7 @@ protected void updateButtons() {
348342
}
349343

350344
/**
351-
* Based on the current selection save the last used values$this to make
352-
* sure you can create the same sketch quickly again
345+
* Based on the current selection save the last used values$this to make sure you can create the same sketch quickly again
353346
*/
354347
private void saveAllLastUseds() {
355348
//
@@ -369,8 +362,7 @@ private void saveAllLastUseds() {
369362
}
370363

371364
/**
372-
* Based on the selected board and parameters save all info needed to the
373-
* build environments
365+
* Based on the selected board and parameters save all info needed to the build environments
374366
*
375367
* @param confdesc
376368
*/
@@ -382,17 +374,14 @@ public void saveAllSelections(ICConfigurationDescription confdesc) {
382374
IContributedEnvironment contribEnv = envManager.getContributedEnvironment();
383375

384376
// Set the path variables
385-
IPath platformPath = new Path(new File(this.mControlBoardsTxtFile.getText().trim()).getParent())
386-
.append(Const.PLATFORM_FILE_NAME);
377+
IPath platformPath = new Path(new File(this.mControlBoardsTxtFile.getText().trim()).getParent()).append(Const.PLATFORM_FILE_NAME);
387378
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_BOARDS_FILE, boardFile);
388-
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_PLATFORM_FILE,
389-
platformPath.toString());
379+
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_PLATFORM_FILE, platformPath.toString());
390380
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_BOARD_NAME, boardName);
391381
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_COM_PORT, uploadPort);
392382

393383
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_PACKAGE_ID, getPackage());
394-
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_ARCITECTURE_ID,
395-
getArchitecture());
384+
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_ARCITECTURE_ID, getArchitecture());
396385
Common.setBuildEnvironmentVariable(contribEnv, confdesc, Const.ENV_KEY_JANTJE_BOARD_ID, getBoardID());
397386

398387
for (LabelCombo curLabelCombo : this.mBoardOptionCombos) {
@@ -411,7 +400,7 @@ private void setValues(ICConfigurationDescription confdesc) {
411400
boardName = Common.getBuildEnvironmentVariable(confdesc, Const.ENV_KEY_JANTJE_BOARD_NAME, boardName);
412401
uploadPort = Common.getBuildEnvironmentVariable(confdesc, Const.ENV_KEY_JANTJE_COM_PORT, uploadPort);
413402
}
414-
Map<String, String> options = InstancePreferences.getLastUsedMenuOption();
403+
415404
this.mControlBoardsTxtFile.setText(boardFile);
416405
// if no boards file is selected select the first
417406
if (this.mControlBoardsTxtFile.getText().isEmpty()) {
@@ -424,9 +413,9 @@ private void setValues(ICConfigurationDescription confdesc) {
424413
this.mControlUploadPort.setValue(uploadPort);
425414

426415
// set the options in the combo boxes before setting the value
416+
Map<String, String> options = InstancePreferences.getLastUsedMenuOption();
427417
for (LabelCombo curLabelCombo : this.mBoardOptionCombos) {
428-
curLabelCombo.setItems(
429-
this.mAllBoardsFiles[selectedBoardFile].getMenuItemNames(curLabelCombo.getMenuName(), boardName));
418+
curLabelCombo.setItems(this.mAllBoardsFiles[selectedBoardFile].getMenuItemNames(curLabelCombo.getMenuName(), boardName));
430419
if (confdesc != null) {
431420
curLabelCombo.getStoredValue(confdesc);
432421
} else {
@@ -496,8 +485,7 @@ public void handleTabEvent(int kind, Object data) {
496485
}
497486

498487
/*
499-
* Returns the package name based on the platformfile name Caters for the
500-
* packages (with version number and for the old way
488+
* Returns the package name based on the platformfile name Caters for the packages (with version number and for the old way
501489
*/
502490
public String getPackage() {
503491
IPath platformFile = new Path(this.mControlBoardsTxtFile.getText().trim());
@@ -510,8 +498,7 @@ public String getPackage() {
510498
}
511499

512500
/*
513-
* Returns the architecture based on the platfor file name Caters for the
514-
* packages (with version number and for the old way
501+
* Returns the architecture based on the platfor file name Caters for the packages (with version number and for the old way
515502
*/
516503
public String getArchitecture() {
517504
IPath platformFile = new Path(this.mControlBoardsTxtFile.getText().trim());

0 commit comments

Comments
 (0)