Skip to content

Commit

Permalink
update API to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Aug 26, 2016
1 parent efc07a1 commit 29e79c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/src/cc/arduino/contributions/ui/InstallerJDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ protected void onFilter(String[] _filters) {
contribTable.getCellEditor().stopCellEditing();
}
updateIndexFilter(filters, categoryFilter);
if (contribModel.getRowCount() == 1) {
// TODO: understand why it doesn't work
//contribTable.addRowSelectionInterval(0, 0);
}
}
};

Expand Down
8 changes: 4 additions & 4 deletions arduino-core/src/processing/app/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String
// this method is less useful in Windows < WIN10 since you need drivers to be already installed
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
URLConnection con;
try {
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/boards/0x"+vid+"/0x"+pid);
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/v1/boards/0x"+vid+"/0x"+pid);
URLConnection connection = jsonUrl.openConnection();
connection.connect();
HttpURLConnection httpConnection = (HttpURLConnection) connection;
Expand All @@ -219,8 +218,9 @@ public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String
BoardCloudAPIid board = mapper.readValue(is, BoardCloudAPIid.class);
// Launch a popup with a link to boardmanager#board.getName()
// replace spaces with &
String boardNameReplaced = board.getName().replaceAll(" ", "&");
String message = I18n.format(tr("{0}Install{1} the package to use your {2}"), "<a href=\"http://boardsmanager/all#"+boardNameReplaced+"\">", "</a>", board.getName());
String realBoardName = board.getName().replaceAll("\\(.*?\\)", "").trim();
String boardNameReplaced = realBoardName.replaceAll(" ", "&");
String message = I18n.format(tr("{0}Install{1} the package to use your {2}"), "<a href=\"http://boardsmanager/all#"+boardNameReplaced+"\">", "</a>", realBoardName);
BaseNoGui.setBoardManagerLink(message);
} catch (Exception e) {
// No connection no problem, fail silently
Expand Down

0 comments on commit 29e79c8

Please sign in to comment.