From 29e79c8157bcac69e0f51d5d373fe13ef0b271c7 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 12 Aug 2016 18:09:47 +0200 Subject: [PATCH] update API to v1 --- app/src/cc/arduino/contributions/ui/InstallerJDialog.java | 4 ++++ arduino-core/src/processing/app/Platform.java | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/cc/arduino/contributions/ui/InstallerJDialog.java b/app/src/cc/arduino/contributions/ui/InstallerJDialog.java index 453f5c133..4563b21fd 100644 --- a/app/src/cc/arduino/contributions/ui/InstallerJDialog.java +++ b/app/src/cc/arduino/contributions/ui/InstallerJDialog.java @@ -123,6 +123,10 @@ public abstract class InstallerJDialog extends JDialog { contribTable.getCellEditor().stopCellEditing(); } updateIndexFilter(filters, categoryFilter); + if (contribModel.getRowCount() == 1) { + // TODO: understand why it doesn't work + //contribTable.addRowSelectionInterval(0, 0); + } } }; diff --git a/arduino-core/src/processing/app/Platform.java b/arduino-core/src/processing/app/Platform.java index 9cf423f0e..3afe36248 100644 --- a/arduino-core/src/processing/app/Platform.java +++ b/arduino-core/src/processing/app/Platform.java @@ -205,9 +205,8 @@ public class Platform { // 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; @@ -219,8 +218,9 @@ public class Platform { 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}"), "", "", 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}"), "", "", realBoardName); BaseNoGui.setBoardManagerLink(message); } catch (Exception e) { // No connection no problem, fail silently