Skip to content

Commit 29e79c8

Browse files
committed
update API to v1
1 parent efc07a1 commit 29e79c8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/src/cc/arduino/contributions/ui/InstallerJDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ protected void onFilter(String[] _filters) {
123123
contribTable.getCellEditor().stopCellEditing();
124124
}
125125
updateIndexFilter(filters, categoryFilter);
126+
if (contribModel.getRowCount() == 1) {
127+
// TODO: understand why it doesn't work
128+
//contribTable.addRowSelectionInterval(0, 0);
129+
}
126130
}
127131
};
128132

arduino-core/src/processing/app/Platform.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,8 @@ public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String
205205
// this method is less useful in Windows < WIN10 since you need drivers to be already installed
206206
ObjectMapper mapper = new ObjectMapper();
207207
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
208-
URLConnection con;
209208
try {
210-
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/boards/0x"+vid+"/0x"+pid);
209+
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/v1/boards/0x"+vid+"/0x"+pid);
211210
URLConnection connection = jsonUrl.openConnection();
212211
connection.connect();
213212
HttpURLConnection httpConnection = (HttpURLConnection) connection;
@@ -219,8 +218,9 @@ public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String
219218
BoardCloudAPIid board = mapper.readValue(is, BoardCloudAPIid.class);
220219
// Launch a popup with a link to boardmanager#board.getName()
221220
// replace spaces with &
222-
String boardNameReplaced = board.getName().replaceAll(" ", "&");
223-
String message = I18n.format(tr("{0}Install{1} the package to use your {2}"), "<a href=\"http://boardsmanager/all#"+boardNameReplaced+"\">", "</a>", board.getName());
221+
String realBoardName = board.getName().replaceAll("\\(.*?\\)", "").trim();
222+
String boardNameReplaced = realBoardName.replaceAll(" ", "&");
223+
String message = I18n.format(tr("{0}Install{1} the package to use your {2}"), "<a href=\"http://boardsmanager/all#"+boardNameReplaced+"\">", "</a>", realBoardName);
224224
BaseNoGui.setBoardManagerLink(message);
225225
} catch (Exception e) {
226226
// No connection no problem, fail silently

0 commit comments

Comments
 (0)