From 5064af486f04e6e1c60ada5ebaa2f37db13b9b31 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 8 May 2015 10:18:43 +0200 Subject: [PATCH 1/9] Added .editorconfig files http://editorconfig.org/ --- app/.editorconfig | 16 ++++++++++++++++ arduino-core/.editorconfig | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 app/.editorconfig create mode 100644 arduino-core/.editorconfig diff --git a/app/.editorconfig b/app/.editorconfig new file mode 100644 index 00000000000..bd8c8987e6d --- /dev/null +++ b/app/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 + +[*.{md,adoc}] +indent_style = space +trim_trailing_whitespace = false diff --git a/arduino-core/.editorconfig b/arduino-core/.editorconfig new file mode 100644 index 00000000000..bd8c8987e6d --- /dev/null +++ b/arduino-core/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 + +[*.{md,adoc}] +indent_style = space +trim_trailing_whitespace = false From b32d3553c68a1c18b1f9d1ce3557180729012f96 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 8 May 2015 10:19:24 +0200 Subject: [PATCH 2/9] Windows: this launch4j conf SHOULD force using only the bundled JVM --- build/windows/launcher/config.xml | 2 -- build/windows/launcher/config_debug.xml | 2 -- 2 files changed, 4 deletions(-) diff --git a/build/windows/launcher/config.xml b/build/windows/launcher/config.xml index c3502168906..8d18335b9fc 100644 --- a/build/windows/launcher/config.xml +++ b/build/windows/launcher/config.xml @@ -42,8 +42,6 @@ java - 1.8.0 - preferJre 32 -splash:./lib/splash.png -Dsun.java2d.d3d=false diff --git a/build/windows/launcher/config_debug.xml b/build/windows/launcher/config_debug.xml index 76e716b679a..6536f063fec 100644 --- a/build/windows/launcher/config_debug.xml +++ b/build/windows/launcher/config_debug.xml @@ -42,8 +42,6 @@ java - 1.8.0 - preferJre 32 -Dsun.java2d.d3d=false From 36cfd0af2865aa053682e788160afc595d54ce99 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 8 May 2015 10:34:40 +0200 Subject: [PATCH 3/9] Windows: launch4j urls changed to generic host downloads.sourceforge.net instead of switch.dl.sourceforge.net --- build/build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.xml b/build/build.xml index be58b13ca86..940a6cf6001 100644 --- a/build/build.xml +++ b/build/build.xml @@ -756,7 +756,7 @@ - + @@ -765,7 +765,7 @@ - + From fe52e7f04fd52a478bfd326a057767adbdb9a0bd Mon Sep 17 00:00:00 2001 From: newbie15 Date: Tue, 26 Mar 2013 15:44:33 +0700 Subject: [PATCH 4/9] Added a note about non-standard row offsets in LiquidCrystal.cpp In my case I had to change it to make my 16x4 LCD work properly Fixes #1333 --- libraries/LiquidCrystal/src/LiquidCrystal.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libraries/LiquidCrystal/src/LiquidCrystal.cpp b/libraries/LiquidCrystal/src/LiquidCrystal.cpp index 249e0ec9b55..9bf508b7b6b 100644 --- a/libraries/LiquidCrystal/src/LiquidCrystal.cpp +++ b/libraries/LiquidCrystal/src/LiquidCrystal.cpp @@ -158,12 +158,18 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { } +/* + in some 16x4 LCD when line 3 and 4 are not placed correctly you may try: + setRowOffsets(0x00, 0x40, 0x14, 0x54) + or + setRowOffsets(0x00, 0x40, 0x10, 0x50) + */ void LiquidCrystal::setRowOffsets(int row0, int row1, int row2, int row3) { - _row_offsets[0] = row0; - _row_offsets[1] = row1; - _row_offsets[2] = row2; - _row_offsets[3] = row3; + _row_offsets[0] = row0; + _row_offsets[1] = row1; + _row_offsets[2] = row2; + _row_offsets[3] = row3; } /********** high level commands, for the user! */ From e8c4980c4eb78ae182c00af721a34fb26a4a7433 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 11 May 2015 10:48:52 +0200 Subject: [PATCH 5/9] Added BaseNoGui.VERSION_NAME_LONG: it includes "Hourly Build DATE" in case of a hourly build --- app/src/processing/app/Base.java | 2 +- app/src/processing/app/Editor.java | 4 +--- app/src/processing/app/EditorStatus.java | 2 +- .../src/processing/app/BaseNoGui.java | 17 ++++++++++++- build/build.xml | 24 +++++++++++++------ 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index d5c4f69ac0d..653855de2c3 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1787,7 +1787,7 @@ public void paint(Graphics g) { g.setFont(new Font("SansSerif", Font.PLAIN, 11)); g.setColor(Color.white); - g.drawString(BaseNoGui.VERSION_NAME, 33, 20); + g.drawString(BaseNoGui.VERSION_NAME_LONG, 33, 20); } }; window.addMouseListener(new MouseAdapter() { diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 91e72d938d2..0e02270fe53 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -2297,9 +2297,7 @@ protected boolean handleOpenInternal(File sketchFile) { return false; } header.rebuild(); - // Set the title of the window to "sketch_070752a - Processing 0126" - setTitle(I18n.format(_("{0} | Arduino {1}"), sketch.getName(), - BaseNoGui.VERSION_NAME)); + setTitle(I18n.format(_("{0} | Arduino {1}"), sketch.getName(), BaseNoGui.VERSION_NAME_LONG)); // Disable untitled setting from previous document, if any untitled = false; diff --git a/app/src/processing/app/EditorStatus.java b/app/src/processing/app/EditorStatus.java index 6d715fc8c2f..82abf3aa2df 100644 --- a/app/src/processing/app/EditorStatus.java +++ b/app/src/processing/app/EditorStatus.java @@ -464,7 +464,7 @@ public void keyTyped(KeyEvent event) { copyErrorButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String message = ""; - message += _("Arduino: ") + BaseNoGui.VERSION_NAME + " (" + System.getProperty("os.name") + "), "; + message += _("Arduino: ") + BaseNoGui.VERSION_NAME_LONG + " (" + System.getProperty("os.name") + "), "; message += _("Board: ") + "\"" + Base.getBoardPreferences().get("name") + "\"\n\n"; message += editor.console.consoleTextPane.getText().trim(); if ((PreferencesData.getBoolean("build.verbose")) == false) { diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index dde4ba9f42c..da2fcfdd90a 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -32,7 +32,22 @@ public class BaseNoGui { /** Version string to be used for build */ public static final int REVISION = 10605; /** Extended version string displayed on GUI */ - static String VERSION_NAME = "1.6.5"; + public static final String VERSION_NAME = "1.6.5"; + public static final String VERSION_NAME_LONG; + + static { + String versionNameLong = VERSION_NAME; + File hourlyBuildTxt = new File(getContentFile("lib"), "hourlyBuild.txt"); + if (hourlyBuildTxt.exists() && hourlyBuildTxt.canRead()) { + versionNameLong += " Hourly Build"; + try { + versionNameLong += " " + FileUtils.readFileToString(hourlyBuildTxt).trim(); + } catch (IOException e) { + //noop + } + } + VERSION_NAME_LONG = versionNameLong; + } static File buildFolder; diff --git a/build/build.xml b/build/build.xml index 940a6cf6001..49840c5019c 100644 --- a/build/build.xml +++ b/build/build.xml @@ -4,6 +4,10 @@ + + + + @@ -59,6 +63,8 @@ + + @@ -385,7 +391,7 @@ - + @@ -393,7 +399,7 @@ - + @@ -468,7 +474,7 @@ - + @@ -637,11 +643,11 @@ - + - + @@ -858,12 +864,12 @@ - - + @@ -989,4 +995,8 @@ + + ${BUILD_DATE} + + From 050a642edfc193c610df337938ed0c075e38d719 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 11 May 2015 10:58:22 +0200 Subject: [PATCH 6/9] Disabled port type fake menu entry. Fixes #3113 --- app/src/processing/app/Editor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 0e02270fe53..74805fdd24e 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1119,7 +1119,9 @@ public int compare(BoardPort o1, BoardPort o2) { } else { lastProtocolTranslated = port.getProtocol(); } - serialMenu.add(new JMenuItem(_(lastProtocolTranslated))); + JMenuItem lastProtocolMenuItem = new JMenuItem(_(lastProtocolTranslated)); + lastProtocolMenuItem.setEnabled(false); + serialMenu.add(lastProtocolMenuItem); } String address = port.getAddress(); String label = port.getLabel(); From 334e75254f7fc9a1fe051781ce9e9720e3c50c60 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 11 May 2015 17:07:09 +0200 Subject: [PATCH 7/9] Restoring left empty space on the editor --- app/src/processing/app/Editor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 74805fdd24e..d05518b3dbd 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -47,7 +47,7 @@ import java.util.zip.*; import javax.swing.*; -import javax.swing.border.EmptyBorder; +import javax.swing.border.MatteBorder; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.undo.*; @@ -256,7 +256,7 @@ public void windowDeactivated(WindowEvent e) { // RTextScrollPane scrollPane = new RTextScrollPane(textarea, true); - scrollPane.setBorder(new EmptyBorder(0, 0, 0, 0)); + scrollPane.setBorder(new MatteBorder(0, 6, 0, 0, Theme.getColor("editor.bgcolor"))); scrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); scrollPane.setLineNumbersEnabled(Preferences.getBoolean("editor.linenumbers")); scrollPane.setIconRowHeaderEnabled(false); @@ -265,7 +265,7 @@ public void windowDeactivated(WindowEvent e) { gutter.setBookmarkingEnabled(false); //gutter.setBookmarkIcon(CompletionsRenderer.getIcon(CompletionType.TEMPLATE)); gutter.setIconRowHeaderInheritsGutterBackground(true); - + upper.add(scrollPane); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upper, consolePanel); From fe94d6aa6d27eb8cf0bf2b4a9f0241d049c4449a Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 11 May 2015 17:37:05 +0200 Subject: [PATCH 8/9] Adding keywords. Closes #2213 --- build/shared/lib/keywords.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/shared/lib/keywords.txt b/build/shared/lib/keywords.txt index 9ac844ede70..fdd43ab7406 100644 --- a/build/shared/lib/keywords.txt +++ b/build/shared/lib/keywords.txt @@ -28,6 +28,16 @@ INTERNAL LITERAL2 AnalogReference RESERVED_WORD_2 INTERNAL1V1 LITERAL2 AnalogReference RESERVED_WORD_2 INTERNAL2V56 LITERAL2 AnalogReference RESERVED_WORD_2 +auto LITERAL2 +constexpr LITERAL2 RESERVED_WORD_2 +decltype LITERAL2 RESERVED_WORD_2 +nullptr LITERAL2 RESERVED_WORD_2 +char16_t LITERAL2 RESERVED_WORD_2 +char32_t LITERAL2 RESERVED_WORD_2 +static_assert LITERAL2 RESERVED_WORD_2 +operator LITERAL2 RESERVED_WORD_2 +enum LITERAL2 RESERVED_WORD_2 +delete LITERAL2 RESERVED_WORD_2 boolean LITERAL2 BooleanVariables RESERVED_WORD_2 byte LITERAL2 Byte RESERVED_WORD_2 char LITERAL2 Char RESERVED_WORD_2 From e74c2dc8fe22644a4a153985dbacd1232039a6d1 Mon Sep 17 00:00:00 2001 From: Chris--A Date: Tue, 12 May 2015 16:51:52 +1000 Subject: [PATCH 9/9] IDE: prevent multiple bad name notifications. This patch will prevent the IDE from informing the user about a bad sketch folder name multiple times. Now the user is informed once at start up only, or once when it is detected during a rescan of the folders. --- .../contributions/libraries/LibrariesIndexer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java index c285ade68a4..92d8809e1ea 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java @@ -45,6 +45,7 @@ import java.io.InputStream; import java.util.Arrays; import java.util.List; +import java.util.ArrayList; import static processing.app.I18n._; @@ -57,6 +58,8 @@ public class LibrariesIndexer { private final File indexFile; private final File stagingFolder; private File sketchbookLibrariesFolder; + + private static final List badLibNotified = new ArrayList(); public LibrariesIndexer(File preferencesFolder) { indexFile = new File(preferencesFolder, "library_index.json"); @@ -117,11 +120,18 @@ private void scanInstalledLibraries(File folder, boolean isSketchbook) { for (File subfolder : list) { if (!BaseNoGui.isSanitaryName(subfolder.getName())) { - String mess = I18n.format(_("The library \"{0}\" cannot be used.\n" + + // Detect whether the current folder name has already had a notification. + if(!badLibNotified.contains(subfolder.getName())) { + + badLibNotified.add(subfolder.getName()); + + String mess = I18n.format(_("The library \"{0}\" cannot be used.\n" + "Library names must contain only basic letters and numbers.\n" + "(ASCII only and no spaces, and it cannot start with a number)"), subfolder.getName()); - BaseNoGui.showMessage(_("Ignoring bad library name"), mess); + BaseNoGui.showMessage(_("Ignoring bad library name"), mess); + } continue; }