1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

IDE: Fixed default board selection.

This commit is contained in:
Cristian Maglie 2014-11-20 13:50:11 +01:00
parent b9e186e45a
commit 85aecfe0da

View File

@ -85,15 +85,15 @@ public class TargetPlatform {
boardsPreferences.remove("menu"); boardsPreferences.remove("menu");
// Create boards // Create boards
Set<String> boardIDs = boardsPreferences.keySet(); Set<String> boardIds = boardsPreferences.keySet();
for (String id : boardIDs) { for (String boardId : boardIds) {
PreferencesMap preferences = boardsPreferences.get(id); PreferencesMap preferences = boardsPreferences.get(boardId);
TargetBoard board = new TargetBoard(id, preferences, this); TargetBoard board = new TargetBoard(boardId, preferences, this);
boards.put(id, board); boards.put(boardId, board);
}
if (!boardIDs.isEmpty()) { // Pick the first board as default
PreferencesMap preferences = boardsPreferences.get(boardIDs.iterator().next()); if (defaultBoard == null)
defaultBoard = new TargetBoard(id, preferences, this); defaultBoard = board;
} }
} catch (IOException e) { } catch (IOException e) {
throw new TargetPlatformException(format(_("Error loading {0}"), throw new TargetPlatformException(format(_("Error loading {0}"),