Skip to content

Commit 0bc781e

Browse files
author
Federico Fissore
committed
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
2 parents 7a3fb0c + fdb98f1 commit 0bc781e

File tree

34 files changed

+430
-1116
lines changed

34 files changed

+430
-1116
lines changed

app/src/processing/app/EditorStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public void keyTyped(KeyEvent event) {
452452
add(progressBar);
453453
progressBar.setVisible(false);
454454

455-
copyErrorButton = new JButton(_("Copy error"));
455+
copyErrorButton = new JButton(_("Copy error messages"));
456456
add(copyErrorButton);
457457
copyErrorButton.setVisible(false);
458458
copyErrorButton.addActionListener(new ActionListener() {

app/src/processing/app/i18n/Resources_en.po

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ msgstr "Copy"
353353
msgid "Copy as HTML"
354354
msgstr "Copy as HTML"
355355

356-
#: ../../../processing/app/EditorStatus.java:456
357-
msgid "Copy error"
358-
msgstr "Copy error"
356+
#: ../../../processing/app/EditorStatus.java:455
357+
msgid "Copy error messages"
358+
msgstr ""
359359

360360
#: Editor.java:1165 Editor.java:2715
361361
msgid "Copy for Forum"
@@ -529,6 +529,10 @@ msgstr "Device is not responding, check the right serial port is selected or RES
529529
msgid "Discard all changes and reload sketch?"
530530
msgstr "Discard all changes and reload sketch?"
531531

532+
#: ../../../processing/app/Preferences.java:438
533+
msgid "Display line numbers"
534+
msgstr ""
535+
532536
#: Editor.java:2064
533537
msgid "Don't Save"
534538
msgstr "Don't Save"
@@ -895,10 +899,6 @@ msgstr "Marathi"
895899
msgid "Message"
896900
msgstr "Message"
897901

898-
#: Sketch.java:1712
899-
msgid "Missing the */ from the end of a /* comment */"
900-
msgstr "Missing the */ from the end of a /* comment */"
901-
902902
#: Preferences.java:449
903903
msgid "More preferences can be edited directly in the file"
904904
msgstr "More preferences can be edited directly in the file"
@@ -1349,6 +1349,10 @@ msgstr "Sketchbook folder disappeared"
13491349
msgid "Sketchbook location:"
13501350
msgstr "Sketchbook location:"
13511351

1352+
#: ../../../processing/app/Base.java:785
1353+
msgid "Sketches (*.ino, *.pde)"
1354+
msgstr ""
1355+
13521356
#: ../../../processing/app/Preferences.java:152
13531357
msgid "Slovenian"
13541358
msgstr "Slovenian"
@@ -1590,6 +1594,16 @@ msgstr "Use Selection For Find"
15901594
msgid "Use external editor"
15911595
msgstr "Use external editor"
15921596

1597+
#: ../../../processing/app/debug/Compiler.java:94
1598+
#, java-format
1599+
msgid "Using library {0} in folder: {1} {2}"
1600+
msgstr ""
1601+
1602+
#: ../../../processing/app/debug/Compiler.java:320
1603+
#, java-format
1604+
msgid "Using previously compiled file: {0}"
1605+
msgstr ""
1606+
15931607
#: EditorToolbar.java:41 EditorToolbar.java:46
15941608
msgid "Verify"
15951609
msgstr "Verify"

app/src/processing/app/i18n/Resources_en.properties

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ Copy=Copy
239239
#: Editor.java:1177 Editor.java:2723
240240
Copy\ as\ HTML=Copy as HTML
241241

242-
#: ../../../processing/app/EditorStatus.java:456
243-
Copy\ error=Copy error
242+
#: ../../../processing/app/EditorStatus.java:455
243+
!Copy\ error\ messages=
244244

245245
#: Editor.java:1165 Editor.java:2715
246246
Copy\ for\ Forum=Copy for Forum
@@ -363,6 +363,9 @@ Device\ is\ not\ responding,\ check\ the\ right\ serial\ port\ is\ selected\ or\
363363
#: tools/FixEncoding.java:57
364364
Discard\ all\ changes\ and\ reload\ sketch?=Discard all changes and reload sketch?
365365

366+
#: ../../../processing/app/Preferences.java:438
367+
!Display\ line\ numbers=
368+
366369
#: Editor.java:2064
367370
Don't\ Save=Don't Save
368371

@@ -630,9 +633,6 @@ Marathi=Marathi
630633
#: Base.java:2112
631634
Message=Message
632635

633-
#: Sketch.java:1712
634-
Missing\ the\ */\ from\ the\ end\ of\ a\ /*\ comment\ */=Missing the */ from the end of a /* comment */
635-
636636
#: Preferences.java:449
637637
More\ preferences\ can\ be\ edited\ directly\ in\ the\ file=More preferences can be edited directly in the file
638638

@@ -960,6 +960,9 @@ Sketchbook\ folder\ disappeared=Sketchbook folder disappeared
960960
#: Preferences.java:315
961961
Sketchbook\ location\:=Sketchbook location\:
962962

963+
#: ../../../processing/app/Base.java:785
964+
!Sketches\ (*.ino,\ *.pde)=
965+
963966
#: ../../../processing/app/Preferences.java:152
964967
Slovenian=Slovenian
965968

@@ -1113,6 +1116,14 @@ Use\ Selection\ For\ Find=Use Selection For Find
11131116
#: Preferences.java:409
11141117
Use\ external\ editor=Use external editor
11151118

1119+
#: ../../../processing/app/debug/Compiler.java:94
1120+
#, java-format
1121+
!Using\ library\ {0}\ in\ folder\:\ {1}\ {2}=
1122+
1123+
#: ../../../processing/app/debug/Compiler.java:320
1124+
#, java-format
1125+
!Using\ previously\ compiled\ file\:\ {0}=
1126+
11161127
#: EditorToolbar.java:41 EditorToolbar.java:46
11171128
Verify=Verify
11181129

app/src/processing/app/tools/DiscourseFormat.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
*/
5353
public class DiscourseFormat {
5454

55-
Editor editor;
55+
private Editor editor;
5656
// JTextArea of the actual Editor
57-
JEditTextArea textarea;
58-
boolean html;
57+
private JEditTextArea textarea;
58+
private boolean html;
5959

6060

6161
/**
@@ -75,7 +75,7 @@ public DiscourseFormat(Editor editor, boolean html) {
7575
*/
7676
public void show() {
7777
// [code] tag cancels other tags, using [quote]
78-
StringBuffer cf = new StringBuffer(html ? "<pre>\n" : "[quote]\n");
78+
StringBuilder cf = new StringBuilder(html ? "<pre>\n" : "[code]\n");
7979

8080
int selStart = textarea.getSelectionStart();
8181
int selStop = textarea.getSelectionStop();
@@ -99,7 +99,7 @@ public void show() {
9999
appendFormattedLine(cf, i);
100100
}
101101

102-
cf.append(html ? "\n</pre>" : "\n[/quote]");
102+
cf.append(html ? "\n</pre>" : "\n[/code]");
103103

104104
StringSelection formatted = new StringSelection(cf.toString());
105105
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
@@ -111,17 +111,15 @@ public void lostOwnership(Clipboard clipboard, Transferable contents) {
111111
Clipboard unixclipboard = Toolkit.getDefaultToolkit().getSystemSelection();
112112
if (unixclipboard != null) unixclipboard.setContents(formatted, null);
113113

114-
editor.statusNotice("Code formatted for " +
115-
(html ? "HTML" : "the Arduino forum ") +
116-
" has been copied to the clipboard.");
114+
editor.statusNotice("Code formatted for " + (html ? "HTML" : "the Arduino forum") + " has been copied to the clipboard.");
117115
}
118116

119117
/**
120-
* Append a char to a stringbuffer while escaping for proper display in HTML.
118+
* Append a char to a StringBuilder while escaping for proper display in HTML.
121119
* @param c input char to escape
122-
* @param buffer StringBuffer to append html-safe version of c to.
120+
* @param buffer StringBuilder to append html-safe version of c to.
123121
*/
124-
private void appendToHTML(char c, StringBuffer buffer) {
122+
private void appendToHTML(char c, StringBuilder buffer) {
125123
if (!html) {
126124
buffer.append(c);
127125
} else if (c == '<') {
@@ -138,7 +136,7 @@ private void appendToHTML(char c, StringBuffer buffer) {
138136
}
139137

140138
// A terrible headache...
141-
public void appendFormattedLine(StringBuffer cf, int line) {
139+
public void appendFormattedLine(StringBuilder cf, int line) {
142140
Segment segment = new Segment();
143141

144142
TextAreaPainter painter = textarea.getPainter();
@@ -203,12 +201,14 @@ public void appendFormattedLine(StringBuffer cf, int line) {
203201
// fm = painter.getFontMetrics();
204202
} else {
205203
// Place open tags []
206-
cf.append(html ? "<span style=\"color: #" : "[color=#");
207-
cf.append(PApplet.hex(styles[id].getColor().getRGB() & 0xFFFFFF, 6));
208-
cf.append(html ? ";\">" : "]");
204+
if (html) {
205+
cf.append("<span style=\"color: #");
206+
cf.append(PApplet.hex(styles[id].getColor().getRGB() & 0xFFFFFF, 6));
207+
cf.append(";\">");
208+
}
209209

210-
if (styles[id].isBold())
211-
cf.append(html ? "<b>" : "[b]");
210+
if (html && styles[id].isBold())
211+
cf.append("<b>");
212212

213213
// fm = styles[id].getFontMetrics(defaultFont);
214214
}
@@ -228,10 +228,10 @@ public void appendFormattedLine(StringBuffer cf, int line) {
228228
appendToHTML(c, cf);
229229
}
230230
// Place close tags [/]
231-
if (j == (length - 1) && id != Token.NULL && styles[id].isBold())
232-
cf.append(html ? "</b>" : "[/b]");
233-
if (j == (length - 1) && id != Token.NULL)
234-
cf.append(html ? "</span>" : "[/color]");
231+
if (html && j == (length - 1) && id != Token.NULL && styles[id].isBold())
232+
cf.append("</b>");
233+
if (html && j == (length - 1) && id != Token.NULL)
234+
cf.append("</span>");
235235
// int charWidth;
236236
// if (c == '\t') {
237237
// charWidth = (int) painter

build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,32 @@
88
* LED attached from pin 13 to ground.
99
* Note: on most Arduinos, there is already an LED on the board
1010
that's attached to pin 13, so no hardware is needed for this example.
11-
12-
11+
1312
created 2005
1413
by David A. Mellis
1514
modified 8 Feb 2010
1615
by Paul Stoffregen
17-
16+
modified 11 Nov 2013
17+
by Scott Fitzgerald
18+
19+
1820
This example code is in the public domain.
19-
20-
21+
2122
http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
2223
*/
2324

24-
// constants won't change. Used here to
25-
// set pin numbers:
25+
// constants won't change. Used here to set a pin number :
2626
const int ledPin = 13; // the number of the LED pin
2727

28-
// Variables will change:
28+
// Variables will change :
2929
int ledState = LOW; // ledState used to set the LED
30-
long previousMillis = 0; // will store last time LED was updated
3130

32-
// the follow variables is a long because the time, measured in miliseconds,
33-
// will quickly become a bigger number than can be stored in an int.
34-
long interval = 1000; // interval at which to blink (milliseconds)
31+
// Generally, you shuould use "unsigned long" for variables that hold time
32+
// The value will quickly become too large for an int to store
33+
unsigned long previousMillis = 0; // will store last time LED was updated
34+
35+
// constants won't change :
36+
const long interval = 1000; // interval at which to blink (milliseconds)
3537

3638
void setup() {
3739
// set the digital pin as output:
@@ -47,10 +49,10 @@ void loop()
4749
// the LED is bigger than the interval at which you want to
4850
// blink the LED.
4951
unsigned long currentMillis = millis();
50-
51-
if (currentMillis - previousMillis > interval) {
52-
// save the last time you blinked the LED
53-
previousMillis = currentMillis;
52+
53+
if(currentMillis - previousMillis >= interval) {
54+
// save the last time you blinked the LED
55+
previousMillis = currentMillis;
5456

5557
// if the LED is off turn it on and vice-versa:
5658
if (ledState == LOW)

build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
/*
2-
Keyboard Button test
3-
4-
For the Arduino Leonardo, Micro and Due boards.
5-
1+
/*
2+
Keyboard Message test
3+
4+
For the Arduino Leonardo and Micro.
5+
66
Sends a text string when a button is pressed.
77
88
The circuit:
9-
* pushbutton attached from pin 2 to +5V on AVR boards
10-
and to +3.3V to the Arduino Due
11-
* 10-kilohm resistor attached from pin 2 to ground
12-
9+
* pushbutton attached from pin 4 to +5V
10+
* 10-kilohm resistor attached from pin 4 to ground
11+
1312
created 24 Oct 2011
1413
modified 27 Mar 2012
1514
by Tom Igoe
16-
15+
modified 11 Nov 2013
16+
by Scott Fitzgerald
17+
1718
This example code is in the public domain.
18-
19-
http://www.arduino.cc/en/Tutorial/KeyboardButton
19+
20+
http://www.arduino.cc/en/Tutorial/KeyboardMessage
2021
*/
2122

2223
const int buttonPin = 4; // input pin for pushbutton

hardware/arduino/avr/variants/ethernet/pins_arduino.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,22 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
215215

216216
#endif
217217

218+
// These serial port names are intended to allow libraries and architecture-neutral
219+
// sketches to automatically default to the correct port name for a particular type
220+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
221+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
222+
//
223+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
224+
//
225+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
226+
//
227+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
228+
//
229+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
230+
//
231+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
232+
// pins are NOT connected to anything by default.
233+
#define SERIAL_PORT_HARDWARE Serial
234+
#define SERIAL_PORT_HARDWARE_OPEN Serial
235+
218236
#endif

hardware/arduino/avr/variants/leonardo/pins_arduino.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,25 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
337337
};
338338

339339
#endif /* ARDUINO_MAIN */
340+
341+
// These serial port names are intended to allow libraries and architecture-neutral
342+
// sketches to automatically default to the correct port name for a particular type
343+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
344+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
345+
//
346+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
347+
//
348+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
349+
//
350+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
351+
//
352+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
353+
//
354+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
355+
// pins are NOT connected to anything by default.
356+
#define SERIAL_PORT_MONITOR Serial
357+
#define SERIAL_PORT_USBVIRTUAL Serial
358+
#define SERIAL_PORT_HARDWARE Serial1
359+
#define SERIAL_PORT_HARDWARE_OPEN Serial1
360+
340361
#endif /* Pins_Arduino_h */

hardware/arduino/avr/variants/mega/pins_arduino.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,28 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
362362

363363
#endif
364364

365+
// These serial port names are intended to allow libraries and architecture-neutral
366+
// sketches to automatically default to the correct port name for a particular type
367+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
368+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
369+
//
370+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
371+
//
372+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
373+
//
374+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
375+
//
376+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
377+
//
378+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
379+
// pins are NOT connected to anything by default.
380+
#define SERIAL_PORT_MONITOR Serial
381+
#define SERIAL_PORT_HARDWARE Serial
382+
#define SERIAL_PORT_HARDWARE1 Serial1
383+
#define SERIAL_PORT_HARDWARE2 Serial2
384+
#define SERIAL_PORT_HARDWARE3 Serial3
385+
#define SERIAL_PORT_HARDWARE_OPEN Serial1
386+
#define SERIAL_PORT_HARDWARE_OPEN1 Serial2
387+
#define SERIAL_PORT_HARDWARE_OPEN2 Serial3
388+
365389
#endif

0 commit comments

Comments
 (0)