Skip to content

Commit 72c4cf8

Browse files
author
jantje
committed
#1347 Changing boards does not change the board specification fields
immediately
1 parent d096392 commit 72c4cf8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

io.sloeber.ui/src/io/sloeber/ui/project/properties/BoardSelectionPage.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -325,39 +325,39 @@ protected Object getnewDefaultObject() {
325325
private void setTheLabelCombos() {
326326

327327
saveUsedOptionValues();
328-
BoardDescription boardDesc = (BoardDescription) getDescription(getConfdesc());
328+
BoardDescription boardOnScreen = getBoardFromScreen();
329329

330-
File newLabelComboBoardFile = boardDesc.getReferencingBoardsFile();
331-
String newOptionBoardID = boardDesc.getBoardID();
332-
boolean boardsFileChanged = !newLabelComboBoardFile.equals(myCurrentLabelComboBoardFile);
333-
boolean boardIDChanged = !newOptionBoardID.equals(myCurrentOptionBoardID);
330+
File onScreenComboBoardFile = boardOnScreen.getReferencingBoardsFile();
331+
String onScreenBoardID = boardOnScreen.getBoardID();
332+
boolean boardsFileChanged = !onScreenComboBoardFile.equals(myCurrentLabelComboBoardFile);
333+
boolean boardIDChanged = !onScreenBoardID.equals(myCurrentOptionBoardID);
334334
if (boardsFileChanged || boardIDChanged) {
335-
myCurrentLabelComboBoardFile = newLabelComboBoardFile;
336-
myCurrentOptionBoardID = newOptionBoardID;
335+
myCurrentLabelComboBoardFile = onScreenComboBoardFile;
336+
myCurrentOptionBoardID = onScreenBoardID;
337337

338338
saveUsedOptionValues();
339339
for (LabelCombo labelCombo : myBoardOptionCombos.values()) {
340340
labelCombo.dispose();
341341
}
342342
myBoardOptionCombos.clear();
343343

344-
Map<String, String> menus = boardDesc.getAllMenus();
345-
Map<String, String> boardOptions = boardDesc.getOptions();
344+
Map<String, String> menus = boardOnScreen.getAllMenus();
345+
Map<String, String> boardOptions = boardOnScreen.getOptions();
346346

347347
for (Map.Entry<String, String> curMenu : menus.entrySet()) {
348348
String menuName = curMenu.getValue();
349349
String menuID = curMenu.getKey();
350-
String[] menuItemNames = boardDesc.getMenuItemNamesFromMenuID(menuID);
350+
String[] menuItemNames = boardOnScreen.getMenuItemNamesFromMenuID(menuID);
351351
if (menuItemNames.length > 0) {
352352
LabelCombo newLabelCombo = new LabelCombo(myComposite, menuName, 2, true);
353353
myBoardOptionCombos.put(menuID, newLabelCombo);
354354

355-
newLabelCombo.setItems(boardDesc.getMenuItemNamesFromMenuID(menuID));
355+
newLabelCombo.setItems(boardOnScreen.getMenuItemNamesFromMenuID(menuID));
356356
newLabelCombo.setLabel(menuName);
357357
String optionValue = boardOptions.get(menuID);
358358
if (optionValue != null) {
359359
// convert the ID to a name
360-
optionValue = boardDesc.getMenuItemNamedFromMenuItemID(optionValue, menuID);
360+
optionValue = boardOnScreen.getMenuItemNamedFromMenuItemID(optionValue, menuID);
361361
} else {
362362
// use last used name for this menu ID
363363
optionValue = myUsedOptionValues.get(menuID);
@@ -376,14 +376,14 @@ private void setTheLabelCombos() {
376376
myScrollComposite.setMinSize(point);
377377
}
378378
else {
379-
Map<String, String> boardOptions = boardDesc.getOptions();
379+
Map<String, String> boardOptions = boardOnScreen.getOptions();
380380
for (Entry<String, LabelCombo> curOptionCombo : myBoardOptionCombos.entrySet()) {
381381
String curMenuID = curOptionCombo.getKey();
382382
LabelCombo curLabelCombo = curOptionCombo.getValue();
383383
String optionValue = boardOptions.get(curMenuID);
384384
if (optionValue != null) {
385385
// convert the ID to a name
386-
optionValue = boardDesc.getMenuItemNamedFromMenuItemID(optionValue, curMenuID);
386+
optionValue = boardOnScreen.getMenuItemNamedFromMenuItemID(optionValue, curMenuID);
387387
} else {
388388
// use last used name for this menu ID
389389
optionValue = myUsedOptionValues.get(curMenuID);

0 commit comments

Comments
 (0)