Showing with 2,130 additions and 1,436 deletions.
  1. +6 −2 app/src/cc/arduino/UpdatableBoardsLibsFakeURLsHandler.java
  2. +31 −5 app/src/cc/arduino/contributions/ContributionsSelfCheck.java
  3. +16 −1 app/src/cc/arduino/view/NotificationPopup.java
  4. +15 −12 app/src/processing/app/Base.java
  5. +116 −16 app/src/processing/app/Editor.java
  6. +5 −0 app/src/processing/app/EditorLineStatus.java
  7. +9 −2 app/src/processing/app/EditorToolbar.java
  8. +1 −0 app/src/processing/app/NetworkMonitor.java
  9. +11 −0 app/src/processing/app/syntax/SketchTextArea.java
  10. +6 −0 app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java
  11. +1 −1 arduino-core/src/cc/arduino/Compiler.java
  12. +1 −1 arduino-core/src/cc/arduino/Constants.java
  13. +10 −3 arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java
  14. +36 −0 arduino-core/src/cc/arduino/packages/BoardPort.java
  15. +1 −0 arduino-core/src/cc/arduino/packages/Discovery.java
  16. +25 −2 arduino-core/src/cc/arduino/packages/DiscoveryManager.java
  17. +18 −2 arduino-core/src/cc/arduino/packages/Uploader.java
  18. +7 −0 arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java
  19. +28 −8 arduino-core/src/cc/arduino/packages/discoverers/SerialDiscovery.java
  20. +99 −23 arduino-core/src/cc/arduino/packages/discoverers/serial/SerialBoardsLister.java
  21. +51 −10 arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java
  22. +8 −2 arduino-core/src/processing/app/BaseNoGui.java
  23. +17 −2 arduino-core/src/processing/app/Platform.java
  24. +1 −1 arduino-core/src/processing/app/helpers/CommandlineParser.java
  25. +3 −1 arduino-core/src/processing/app/helpers/StringReplacer.java
  26. +9 −9 arduino-core/src/processing/app/i18n/Resources_ar.po
  27. +8 −8 arduino-core/src/processing/app/i18n/Resources_ar.properties
  28. +21 −20 arduino-core/src/processing/app/i18n/Resources_ca.po
  29. +20 −19 arduino-core/src/processing/app/i18n/Resources_ca.properties
  30. +64 −64 arduino-core/src/processing/app/i18n/Resources_cs_CZ.po
  31. +63 −63 arduino-core/src/processing/app/i18n/Resources_cs_CZ.properties
  32. +3 −3 arduino-core/src/processing/app/i18n/Resources_de_DE.po
  33. +2 −2 arduino-core/src/processing/app/i18n/Resources_de_DE.properties
  34. +10 −10 arduino-core/src/processing/app/i18n/Resources_en_GB.po
  35. +9 −9 arduino-core/src/processing/app/i18n/Resources_en_GB.properties
  36. +2 −2 arduino-core/src/processing/app/i18n/Resources_es.po
  37. +2 −2 arduino-core/src/processing/app/i18n/Resources_es.properties
  38. +6 −5 arduino-core/src/processing/app/i18n/Resources_fr.po
  39. +5 −4 arduino-core/src/processing/app/i18n/Resources_fr.properties
  40. +3 −3 arduino-core/src/processing/app/i18n/Resources_hu.po
  41. +2 −2 arduino-core/src/processing/app/i18n/Resources_hu.properties
  42. +9 −8 arduino-core/src/processing/app/i18n/Resources_in.po
  43. +9 −8 arduino-core/src/processing/app/i18n/Resources_it_IT.po
  44. +8 −7 arduino-core/src/processing/app/i18n/Resources_it_IT.properties
  45. +28 −27 arduino-core/src/processing/app/i18n/Resources_ja_JP.po
  46. +27 −26 arduino-core/src/processing/app/i18n/Resources_ja_JP.properties
  47. +10 −10 arduino-core/src/processing/app/i18n/Resources_ko_KR.po
  48. +9 −9 arduino-core/src/processing/app/i18n/Resources_ko_KR.properties
  49. +35 −34 arduino-core/src/processing/app/i18n/Resources_nl.po
  50. +34 −33 arduino-core/src/processing/app/i18n/Resources_nl.properties
  51. +86 −85 arduino-core/src/processing/app/i18n/Resources_pl.po
  52. +85 −84 arduino-core/src/processing/app/i18n/Resources_pl.properties
  53. +16 −15 arduino-core/src/processing/app/i18n/Resources_pt_BR.po
  54. +15 −14 arduino-core/src/processing/app/i18n/Resources_pt_BR.properties
  55. +175 −174 arduino-core/src/processing/app/i18n/Resources_pt_PT.po
  56. +174 −173 arduino-core/src/processing/app/i18n/Resources_pt_PT.properties
  57. +20 −20 arduino-core/src/processing/app/i18n/Resources_sk.po
  58. +19 −19 arduino-core/src/processing/app/i18n/Resources_sk.properties
  59. +73 −72 arduino-core/src/processing/app/i18n/Resources_sv.po
  60. +72 −71 arduino-core/src/processing/app/i18n/Resources_sv.properties
  61. +22 −22 arduino-core/src/processing/app/i18n/Resources_tr.po
  62. +21 −21 arduino-core/src/processing/app/i18n/Resources_tr.properties
  63. +27 −26 arduino-core/src/processing/app/i18n/Resources_uk.po
  64. +26 −25 arduino-core/src/processing/app/i18n/Resources_uk.properties
  65. +11 −11 arduino-core/src/processing/app/i18n/Resources_zh_CN.po
  66. +10 −10 arduino-core/src/processing/app/i18n/Resources_zh_CN.properties
  67. +6 −6 arduino-core/src/processing/app/packages/LibraryList.java
  68. +0 −1 build/Bridge-1.6.1.zip.sha
  69. +1 −0 build/Bridge-1.6.2.zip.sha
  70. +1 −0 build/arduino-builder-arm-1.3.18.tar.bz2.sha
  71. +0 −1 build/arduino-builder-linux32-1.3.14.tar.bz2.sha
  72. +1 −0 build/arduino-builder-linux32-1.3.18.tar.bz2.sha
  73. +0 −1 build/arduino-builder-linux64-1.3.14.tar.bz2.sha
  74. +1 −0 build/arduino-builder-linux64-1.3.18.tar.bz2.sha
  75. +0 −1 build/arduino-builder-macosx-1.3.14.tar.bz2.sha
  76. +1 −0 build/arduino-builder-macosx-1.3.18.tar.bz2.sha
  77. +0 −1 build/arduino-builder-windows-1.3.14.zip.sha
  78. +1 −0 build/arduino-builder-windows-1.3.18.zip.sha
  79. +105 −24 build/build.xml
  80. +3 −0 build/build_all_dist.bash
  81. +1 −1 build/build_pull_request.bash
  82. +1 −0 build/libastylej-2.05.1-3.zip.sha
  83. +0 −1 build/libastylej-2.05.1.zip.sha
  84. +0 −1 build/liblistSerials-1.0.5.zip.sha
  85. +1 −0 build/liblistSerials-1.1.0.zip.sha
  86. +1 −0 build/linux/avr-gcc-4.8.1-arduino5-armhf-pc-linux-gnu-glibc2.13.tar.bz2.sha
  87. +1 −0 build/linux/avrdude-6.0.1-arduino5-armhf-pc-linux-gnu-glibc2.13.tar.bz2.sha
  88. +8 −5 build/shared/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino
  89. +7 −0 build/shared/lib/preferences.txt
  90. +33 −1 build/shared/revisions.txt
  91. +29 −14 hardware/arduino/avr/cores/arduino/CDC.cpp
  92. +7 −0 hardware/arduino/avr/cores/arduino/USBCore.cpp
  93. +7 −5 hardware/arduino/avr/cores/arduino/WString.h
  94. +5 −5 hardware/arduino/avr/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino
  95. +2 −2 hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp
  96. +1 −1 hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
  97. +2 −2 hardware/arduino/avr/libraries/Wire/src/Wire.cpp
  98. +16 −0 hardware/arduino/avr/libraries/Wire/src/utility/twi.c
  99. +1 −0 hardware/arduino/avr/libraries/Wire/src/utility/twi.h
  100. +12 −9 hardware/arduino/avr/platform.txt
  101. +18 −0 hardware/arduino/avr/variants/leonardo/pins_arduino.h
  102. +2 −0 hardware/arduino/sam/boards.txt
  103. +8 −4 hardware/arduino/sam/cores/arduino/Arduino.h
  104. +3 −14 hardware/arduino/sam/cores/arduino/USB/USBCore.cpp
  105. +7 −5 hardware/arduino/sam/cores/arduino/WString.h
  106. +54 −3 hardware/arduino/sam/cores/arduino/avr/pgmspace.h
  107. +9 −4 hardware/arduino/sam/platform.txt
  108. +2 −1 hardware/arduino/sam/variants/arduino_due_x/variant.h
8 changes: 6 additions & 2 deletions app/src/cc/arduino/UpdatableBoardsLibsFakeURLsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,26 @@ public void hyperlinkUpdate(HyperlinkEvent event) {
}

URL url = event.getURL();
openBoardLibManager(url);
}

public void openBoardLibManager(URL url) {
if (BOARDSMANAGER.equals(url.getHost())) {
try {
base.openBoardsManager("", "DropdownUpdatableCoresItem");
base.openBoardsManager(url.getRef() == null ? "": url.getRef() , url.getPath() == null ? "" : url.getPath().replace("/", ""));
} catch (Exception e) {
e.printStackTrace();
}
return;
}

if (LIBRARYMANAGER.equals(url.getHost())) {
base.openLibraryManager("DropdownUpdatableLibrariesItem");
base.openLibraryManager(url.getRef() == null ? "": url.getRef() , url.getPath() == null ? "" : url.getPath().replace("/", ""));
return;
}

throw new IllegalArgumentException(url.getHost() + " is invalid");

}

}
36 changes: 31 additions & 5 deletions app/src/cc/arduino/contributions/ContributionsSelfCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
import cc.arduino.view.NotificationPopup;
import processing.app.Base;
import processing.app.BaseNoGui;
import processing.app.Editor;
import processing.app.I18n;

import javax.swing.*;
import javax.swing.event.HyperlinkListener;

import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.util.TimerTask;

import static processing.app.I18n.tr;
Expand Down Expand Up @@ -83,20 +87,42 @@ public void run() {

String text;
if (updatableLibraries > 0 && updatablePlatforms <= 0) {
text = I18n.format(tr("Updates available for some of your {0}libraries{1}"), "<a href=\"http://librarymanager\">", "</a>");
text = I18n.format(tr("Updates available for some of your {0}libraries{1}"), "<a href=\"http://librarymanager/DropdownUpdatableLibrariesItem\">", "</a>");
} else if (updatableLibraries <= 0 && updatablePlatforms > 0) {
text = I18n.format(tr("Updates available for some of your {0}boards{1}"), "<a href=\"http://boardsmanager\">", "</a>");
text = I18n.format(tr("Updates available for some of your {0}boards{1}"), "<a href=\"http://boardsmanager/DropdownUpdatableCoresItem\">", "</a>");
} else {
text = I18n.format(tr("Updates available for some of your {0}boards{1} and {2}libraries{3}"), "<a href=\"http://boardsmanager\">", "</a>", "<a href=\"http://librarymanager\">", "</a>");
text = I18n.format(tr("Updates available for some of your {0}boards{1} and {2}libraries{3}"), "<a href=\"http://boardsmanager/DropdownUpdatableCoresItem\">", "</a>", "<a href=\"http://librarymanager/DropdownUpdatableLibrariesItem\">", "</a>");
}

if (cancelled) {
return;
}

SwingUtilities.invokeLater(() -> {
notificationPopup = new NotificationPopup(base.getActiveEditor(), hyperlinkListener, text);
notificationPopup.setVisible(true);
Editor ed = base.getActiveEditor();
notificationPopup = new NotificationPopup(ed, hyperlinkListener, text);
if (ed.isFocused()) {
notificationPopup.begin();
return;
}

// If the IDE is not focused wait until it is focused again to
// display the notification, this avoids the annoying side effect
// to "steal" the focus from another application.
WindowFocusListener wfl = new WindowFocusListener() {
@Override
public void windowLostFocus(WindowEvent evt) {
}

@Override
public void windowGainedFocus(WindowEvent evt) {
notificationPopup.begin();
for (Editor e : base.getEditors())
e.removeWindowFocusListener(this);
}
};
for (Editor e : base.getEditors())
e.addWindowFocusListener(wfl);
});
}

Expand Down
17 changes: 16 additions & 1 deletion app/src/cc/arduino/view/NotificationPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.ImageIcon;
import javax.swing.JButton;
Expand All @@ -52,16 +54,18 @@
import javax.swing.border.LineBorder;
import javax.swing.event.HyperlinkListener;

import cc.arduino.Constants;
import processing.app.Theme;

public class NotificationPopup extends JDialog {

private Timer autoCloseTimer = new Timer(false);

public NotificationPopup(Frame parent, HyperlinkListener hyperlinkListener,
String message) {
super(parent, false);
setLayout(new FlowLayout());
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setAlwaysOnTop(true);
setUndecorated(true);
setResizable(false);

Expand Down Expand Up @@ -131,6 +135,17 @@ private void updateLocation(Frame parent) {
}

public void close() {
autoCloseTimer.cancel();
dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
}

public void begin() {
autoCloseTimer.schedule(new TimerTask() {
@Override
public void run() {
close();
}
}, Constants.NOTIFICATION_POPUP_AUTOCLOSE_DELAY);
setVisible(true);
}
}
27 changes: 15 additions & 12 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ static public void main(String args[]) throws Exception {
System.setProperty("swing.aatext", "true");
System.setProperty("java.net.useSystemProxies", "true");

splashScreenHelper.splashText(tr("Loading configuration..."));

if (OSUtils.isMacOS()) {
ThinkDifferent.init();
}
Expand Down Expand Up @@ -158,6 +156,8 @@ static public void guardedMain(String args[]) throws Exception {

BaseNoGui.initParameters(args);

splashScreenHelper.splashText(tr("Loading configuration..."));

BaseNoGui.initVersion();

// if (System.getProperty("mrj.version") != null) {
Expand Down Expand Up @@ -222,15 +222,15 @@ static public void guardedMain(String args[]) throws Exception {
INSTANCE = new Base(args);
}


static public void initLogger() {
Handler consoleHandler = new ConsoleLogger();
consoleHandler.setLevel(Level.ALL);
consoleHandler.setFormatter(new LogFormatter("%1$tl:%1$tM:%1$tS [%4$7s] %2$s: %5$s%n"));

Logger globalLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
globalLogger.setLevel(consoleHandler.getLevel());

// Remove default
Handler[] handlers = globalLogger.getHandlers();
for(Handler handler : handlers) {
Expand All @@ -241,13 +241,13 @@ static public void initLogger() {
for(Handler handler : handlers) {
root.removeHandler(handler);
}

globalLogger.addHandler(consoleHandler);

Logger.getLogger("cc.arduino.packages.autocomplete").setParent(globalLogger);
Logger.getLogger("br.com.criativasoft.cpluslibparser").setParent(globalLogger);
Logger.getLogger(Base.class.getPackage().getName()).setParent(globalLogger);

}


Expand Down Expand Up @@ -1135,7 +1135,7 @@ public void rebuildImportMenu(JMenu importMenu) {
importMenu.removeAll();

JMenuItem menu = new JMenuItem(tr("Manage Libraries..."));
menu.addActionListener(e -> openLibraryManager(""));
menu.addActionListener(e -> openLibraryManager("", ""));
importMenu.add(menu);
importMenu.addSeparator();

Expand Down Expand Up @@ -1264,7 +1264,7 @@ public void onBoardOrPortChange() {
}
}

public void openLibraryManager(String dropdownItem) {
public void openLibraryManager(final String filterText, String dropdownItem) {
if (contributionsSelfCheck != null) {
contributionsSelfCheck.cancel();
}
Expand All @@ -1280,6 +1280,9 @@ protected void onIndexesUpdated() throws Exception {
if (StringUtils.isNotEmpty(dropdownItem)) {
selectDropdownItemByClassName(dropdownItem);
}
if (StringUtils.isNotEmpty(filterText)) {
setFilterText(filterText);
}
}
};
managerUI.setLocationRelativeTo(activeEditor);
Expand Down Expand Up @@ -1751,7 +1754,7 @@ public void paint(Graphics graphics) {

Font f = new Font("SansSerif", Font.PLAIN, Theme.scale(11));
g.setFont(f);
g.setColor(Color.white);
g.setColor(new Color(0,151,156));
g.drawString(BaseNoGui.VERSION_NAME_LONG, Theme.scale(33), Theme.scale(20));
}
};
Expand Down Expand Up @@ -1949,7 +1952,7 @@ static public void showReference(String prefix, String filename) {
File referenceFile = new File(referenceFolder, filename);
if (!referenceFile.exists())
referenceFile = new File(referenceFolder, filename + ".html");

if(referenceFile.exists()){
openURL(referenceFile.getAbsolutePath());
}else{
Expand Down
Loading