Skip to content

Commit effb59d

Browse files
author
Federico Fissore
committed
Merge remote-tracking branch 'arduino/ide-1.5.x' into dev-ide-1.5.x-discovery
2 parents c206ba6 + b5ba161 commit effb59d

24 files changed

+384
-337
lines changed

app/src/processing/app/I18n.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ public class I18n {
2828
static String PROMPT_OK;
2929
static String PROMPT_BROWSE;
3030

31-
static protected void init (String language) {
31+
static protected void init (String language) throws MissingResourceException {
3232
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
3333
try {
3434
if (language != null && language.trim().length() > 0) {
35-
Locale.setDefault(new Locale(language));
35+
Locale locale = new Locale(language);
36+
i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", locale);
37+
Locale.setDefault(locale);
38+
} else {
39+
i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", Locale.getDefault());
3640
}
37-
i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", Locale.getDefault());
38-
3941
PROMPT_YES = _("Yes");
4042
PROMPT_NO = _("No");
4143
PROMPT_CANCEL = _("Cancel");

app/src/processing/app/Preferences.java

+79-98
Original file line numberDiff line numberDiff line change
@@ -73,95 +73,68 @@ public class Preferences {
7373

7474
static final String PREFS_FILE = "preferences.txt";
7575

76-
String[] languages = {
77-
_("System Default"),
78-
"العربية" + " (" + _("Arabic") + ")",
79-
"Aragonés" + " (" + _("Aragonese") + ")",
80-
"български" + " (" + _("Bulgarian") + ")",
81-
"Català" + " (" + _("Catalan") + ")",
82-
"Hrvatski" + " (" + _("Croatian") + ")",
83-
"český" + " (" + _("Czech") + ")",
84-
"简体中文" + " (" + _("Chinese Simplified") + ")",
85-
"繁體中文" + " (" + _("Chinese Traditional") + ")",
86-
"Dansk" + " (" + _("Danish") + ")",
87-
"Nederlands" + " (" + _("Dutch") + ")",
88-
"English" + " (" + _("English") + ")",
89-
"Eesti" + " (" + _("Estonian") + ")",
90-
"Pilipino" + " (" + _("Filipino") + ")",
91-
"Français" + " (" + _("French") + ")",
92-
"Canadienne-français" + " (" + _("Canadian French") + ")",
93-
"Galego" + " (" + _("Galician") + ")",
94-
"საქართველოს" + " (" + _("Georgian") + ")",
95-
"עברית" + " (" + _("Hebrew") + ")",
96-
"Deutsch" + " (" + _("German") + ")",
97-
"ελληνικά" + " (" + _("Greek") + ")",
98-
"Magyar" + " (" + _("Hindi") + ")",
99-
"Magyar" + " (" + _("Hungarian") + ")",
100-
"Bahasa Indonesia" + " (" + _("Indonesian") + ")",
101-
"Italiano" + " (" + _("Italian") + ")",
102-
"日本語" + " (" + _("Japanese") + ")",
103-
"한국어" + " (" + _("Korean") + ")",
104-
"Latviešu" + " (" + _("Latvian") + ")",
105-
"Lietuvių Kalba" + " (" + _("Lithuaninan") + ")",
106-
"मराठी" + " (" + _("Marathi") + ")",
107-
"Norsk" + " (" + _("Norwegian") + ")",
108-
"Norsk bokmål" + " (" + _("Norwegian Bokmål") + ")",
109-
"فارسی" + " (" + _("Persian") + ")",
110-
"Język Polski" + " (" + _("Polish") + ")",
111-
"Português" + " (" + _("Portuguese") + " - Brazil)",
112-
"Português" + " (" + _("Portuguese") + " - Portugal)",
113-
"Română" + " (" + _("Romanian") + ")",
114-
"Русский" + " (" + _("Russian") + ")",
115-
"Español" + " (" + _("Spanish") + ")",
116-
"தமிழ்" + " (" + _("Tamil") + ")",
117-
"Türk" + " (" + _("Turkish") + ")",
118-
"Український" + " (" + _("Ukrainian") + ")"
119-
};
120-
String[] languagesISO = {
121-
"",
122-
"ar",
123-
"an",
124-
"bg",
125-
"ca",
126-
"hr_hr",
127-
"cs_cz",
128-
"zh_cn",
129-
"zh_tw",
130-
"da",
131-
"nl",
132-
"en",
133-
"et",
134-
"tl",
135-
"fr",
136-
"fr_ca",
137-
"gl",
138-
"ka_ge",
139-
"he",
140-
"de",
141-
"el",
142-
"hi",
143-
"hu",
144-
"id",
145-
"it",
146-
"ja",
147-
"ko",
148-
"lv",
149-
"lt",
150-
"mr",
151-
"no_nb",
152-
"nb_no",
153-
"fa",
154-
"pl",
155-
"pt_br",
156-
"pt_pt",
157-
"ro",
158-
"ru",
159-
"es",
160-
"ta",
161-
"tr",
162-
"uk"
163-
};
164-
76+
class Language {
77+
Language(String _name, String _originalName, String _isoCode) {
78+
name = _name;
79+
originalName = _originalName;
80+
isoCode = _isoCode;
81+
}
82+
83+
public String toString() {
84+
if (originalName.length() == 0)
85+
return name;
86+
return originalName + " (" + name + ")";
87+
};
88+
89+
String name;
90+
String originalName;
91+
String isoCode;
92+
}
93+
94+
Language languages[] = {
95+
new Language(_("System Default"), "", ""),
96+
new Language(_("Arabic"), "العربية", "ar"),
97+
new Language(_("Aragonese"), "Aragonés", "an"),
98+
new Language(_("Bulgarian"), "български", "bg"),
99+
new Language(_("Catalan"), "Català", "ca"),
100+
new Language(_("Croatian"), "Hrvatski", "hr_hr"),
101+
new Language(_("Czech"), "český", "cs_cz"),
102+
new Language(_("Chinese Simplified"), "简体中文", "zh_cn"),
103+
new Language(_("Chinese Traditional"), "繁體中文", "zh_tw"),
104+
new Language(_("Danish"), "Dansk", "da"),
105+
new Language(_("Dutch"), "Nederlands", "nl"),
106+
new Language(_("English"), "English", "en"),
107+
new Language(_("Estonian"), "Eesti", "et"),
108+
new Language(_("Filipino"), "Pilipino", "tl"),
109+
new Language(_("French"), "Français", "fr"),
110+
new Language(_("Canadian French"), "Canadienne-français", "fr_ca"),
111+
new Language(_("Galician"), "Galego", "gl"),
112+
new Language(_("Georgian"), "საქართველოს", "ka_ge"),
113+
new Language(_("German"), "Deutsch", "de"),
114+
new Language(_("Greek"), "ελληνικά", "el"),
115+
new Language(_("Hebrew"), "עברית", "he"),
116+
new Language(_("Hindi"), "हिंदी", "hi"),
117+
new Language(_("Hungarian"), "Magyar", "hu"),
118+
new Language(_("Indonesian"), "Bahasa Indonesia", "id"),
119+
new Language(_("Italian"), "Italiano", "it"),
120+
new Language(_("Japanese"), "日本語", "ja"),
121+
new Language(_("Korean"), "한국어", "ko"),
122+
new Language(_("Latvian"), "Latviešu", "lv"),
123+
new Language(_("Lithuaninan"), "Lietuvių Kalba", "lt"),
124+
new Language(_("Marathi"), "मराठी", "mr"),
125+
new Language(_("Norwegian"), "Norsk", "no_nb"),
126+
new Language(_("Norwegian Bokmål"), "Norsk bokmål", "nb_no"),
127+
new Language(_("Persian"), "فارسی", "fa"),
128+
new Language(_("Polish"), "Język Polski", "pl"),
129+
new Language(_("Portuguese (Brazil)"), "Português (Brazil)", "pt_br"),
130+
new Language(_("Portuguese (Portugal)"), "Português (Portugal)", "pt_pt"),
131+
new Language(_("Romanian"), "Română", "ro"),
132+
new Language(_("Russian"), "Русский", "ru"),
133+
new Language(_("Spanish"), "Español", "es"),
134+
new Language(_("Tamil"), "தமிழ்", "ta"),
135+
new Language(_("Turkish"), "Türk", "tr"),
136+
new Language(_("Ukrainian"), "Український", "uk"), };
137+
165138
/**
166139
* Standardized width for buttons. Mac OS X 10.3 wants 70 as its default,
167140
* Windows XP needs 66, and my Ubuntu machine needs 80+, so 80 seems proper.
@@ -217,7 +190,7 @@ public class Preferences {
217190

218191
// data model
219192

220-
static Hashtable defaults;
193+
static Hashtable<String, String> defaults;
221194
static Hashtable<String, String> table = new Hashtable<String, String>();
222195
static File preferencesFile;
223196

@@ -253,7 +226,7 @@ static protected void init(String commandLinePrefs) {
253226
}
254227

255228
// clone the hash table
256-
defaults = (Hashtable) table.clone();
229+
defaults = new Hashtable<String, String>(table);
257230

258231
// Load a prefs file if specified on the command line
259232
if (commandLinePrefs != null) {
@@ -294,7 +267,12 @@ static protected void init(String commandLinePrefs) {
294267
}
295268

296269
// load the I18n module for internationalization
297-
I18n.init(Preferences.get("editor.languages.current"));
270+
try {
271+
I18n.init(Preferences.get("editor.languages.current"));
272+
} catch (MissingResourceException e) {
273+
I18n.init("");
274+
Preferences.set("editor.languages.current", "");
275+
}
298276

299277
// set some other runtime constants (not saved on preferences file)
300278
table.put("runtime.os", PConstants.platformNames[PApplet.platform]);
@@ -386,7 +364,11 @@ public void actionPerformed(ActionEvent e) {
386364
label = new JLabel(_("Editor language: "));
387365
box.add(label);
388366
comboLanguage = new JComboBox(languages);
389-
comboLanguage.setSelectedIndex((Arrays.asList(languagesISO)).indexOf(Preferences.get("editor.languages.current")));
367+
String currentLanguage = Preferences.get("editor.languages.current");
368+
for (Language language : languages) {
369+
if (language.isoCode.equals(currentLanguage))
370+
comboLanguage.setSelectedItem(language);
371+
}
390372
box.add(comboLanguage);
391373
label = new JLabel(_(" (requires restart of Arduino)"));
392374
box.add(label);
@@ -676,9 +658,8 @@ protected void applyFrame() {
676658
setBoolean("editor.update_extension", updateExtensionBox.isSelected());
677659

678660
// adds the selected language to the preferences file
679-
Object newItem = comboLanguage.getSelectedItem();
680-
int pos = (Arrays.asList(languages)).indexOf(newItem.toString()); // position in the languages array
681-
set("editor.languages.current",(Arrays.asList(languagesISO)).get(pos));
661+
Language newLanguage = (Language) comboLanguage.getSelectedItem();
662+
set("editor.languages.current", newLanguage.isoCode);
682663

683664
editor.applyPreferences();
684665
}
@@ -725,7 +706,7 @@ static protected void load(InputStream input) throws IOException {
725706
load(input, table);
726707
}
727708

728-
static public void load(InputStream input, Map table) throws IOException {
709+
static public void load(InputStream input, Map<String, String> table) throws IOException {
729710
String[] lines = loadStrings(input); // Reads as UTF-8
730711
for (String line : lines) {
731712
if ((line.length() == 0) ||
@@ -837,7 +818,7 @@ public static void remove(String key) {
837818
}
838819

839820
static public String getDefault(String attribute) {
840-
return (String) defaults.get(attribute);
821+
return defaults.get(attribute);
841822
}
842823

843824

build/build.xml

+20-15
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@
248248
</antcall>
249249

250250
<antcall target="unzip-arm-toolchain">
251-
<param name="dist_file" value="gcc-arm-none-eabi-4.7.4-2013q2-mac.tar.gz" />
252-
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.7.4-2013q2-mac.tar.gz" />
253-
<param name="dist_check_file" value="gcc-arm-none-eabi-4.7.4-2013q2" />
251+
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" />
252+
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" />
253+
<param name="dist_check_file" value="g++_arm_none_eabi" />
254254
</antcall>
255255

256256
<delete includeEmptyDirs="true" quiet="true">
@@ -290,15 +290,20 @@
290290
</exec>
291291

292292
<!-- Sign app -->
293-
<exec executable="codesign" dir="macosx/work" failonerror="true">
293+
<exec executable="codesign" dir="macosx/work">
294294
<arg line="--keychain &quot;${macosx-sign-keychain}&quot; --force -s &quot;${macosx-sign-id}&quot; -v Arduino.app/" />
295295
</exec>
296296

297+
<!-- Check for successful signing -->
298+
<exec executable="codesign" dir="macosx/work" failonerror="true">
299+
<arg line="-vvvv Arduino.app/" />
300+
</exec>
301+
297302
<delete file="macosx/arduino-${version}-${platform}.zip" />
298303

299304
<!-- Create signed zip file -->
300305
<exec executable="zip" dir="macosx/work">
301-
<arg line="-q -r ../arduino-${version}-${platform}.zip ." />
306+
<arg line="-q -r ../arduino-${version}-${platform}-signed.zip ." />
302307
</exec>
303308

304309
<echo>
@@ -470,9 +475,9 @@
470475
<target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version">
471476
<!-- Unzip ARM tools -->
472477
<antcall target="unzip-arm-toolchain">
473-
<param name="dist_file" value="gcc-arm-none-eabi-4.7.4-2013q2-linux32.tar.gz" />
474-
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.7.4-2013q2-linux32.tar.gz" />
475-
<param name="dist_check_file" value="gcc-arm-none-eabi-4.7.4-2013q2" />
478+
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
479+
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
480+
<param name="dist_check_file" value="g++_arm_none_eabi" />
476481
</antcall>
477482

478483
<!-- Unzip AVR tools -->
@@ -490,9 +495,9 @@
490495

491496
<!-- Unzip ARM tools -->
492497
<antcall target="unzip-arm-toolchain">
493-
<param name="dist_file" value="gcc-arm-none-eabi-4.7.4-2013q2-linux64.tar.gz" />
494-
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.7.4-2013q2-linux64.tar.gz" />
495-
<param name="dist_check_file" value="gcc-arm-none-eabi-4.7.4-2013q2" />
498+
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
499+
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
500+
<param name="dist_check_file" value="g++_arm_none_eabi" />
496501
</antcall>
497502

498503
<!-- Unzip AVR tools -->
@@ -536,7 +541,7 @@
536541
</fail>
537542

538543
<!-- Unzip toolchain to the destination folder -->
539-
<exec executable="tar" output="/dev/null" os="Linux">
544+
<exec executable="tar">
540545
<arg value="xfz"/>
541546
<arg value="${staging_folder}/dist/${dist_file}"/>
542547
<arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/>
@@ -688,9 +693,9 @@
688693

689694
<!-- Unzip ARM toolchain -->
690695
<antcall target="unzip-arm-toolchain">
691-
<param name="dist_file" value="gcc-arm-none-eabi-4.7.4-2013q2-windows.tar.gz" />
692-
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.7.4-2013q2-windows.tar.gz" />
693-
<param name="dist_check_file" value="gcc-arm-none-eabi-4.7.4-2013q2" />
696+
<param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" />
697+
<param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-win32.tar.gz" />
698+
<param name="dist_check_file" value="g++_arm_none_eabi" />
694699
</antcall>
695700

696701
<delete includeEmptyDirs="true" quiet="true">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
46a93ceec28772ac19c76ffc9b285a1eac4288a3

build/linux/dist/gcc-arm-none-eabi-4.7.4-2013q2-linux32.tar.gz.sha

-1
This file was deleted.

build/linux/dist/gcc-arm-none-eabi-4.7.4-2013q2-linux64.tar.gz.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14c554bb9aa9f0d0262a593e7452d33f4babc60d

build/macosx/dist/gcc-arm-none-eabi-4.7.4-2013q2-mac.tar.gz.sha

-1
This file was deleted.

build/shared/revisions.txt

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11

2-
ARDUINO 1.5.3 BETA
2+
ARDUINO 1.5.4 BETA
3+
4+
[libraries]
5+
* sam: fixed wrong SPI initialization (noblepepper)
6+
7+
ARDUINO 1.5.3 BETA 2013.08.30
38

49
[ide]
510
* Removed useless baud rates from serial monitor
611
* Fixed some minor IDE UI bugs (Shigeru Kanemoto)
712
* Added support for new 1.5 Library format (https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification)
813
* Pass board type from boards.txt (https://github.com/arduino/Arduino/issues/308)
914
* Display estimated RAM usage after compile (Loren M. Lang)
10-
* Updated arm gcc to 4.7.4 and simplified build.xml
11-
* ARM gcc doesn't require ia32-libs anymore on 64 bits linux systems
1215
* Import library menu is now scrollable
1316
* Scrollable menus can now be scrolled with the mouse wheel
1417

@@ -27,7 +30,8 @@ ARDUINO 1.5.3 BETA
2730
* removed unused flags from String (free 1 byte of SRAM)
2831

2932
[libraries]
30-
* sam: Added CAN library (still in early stage of development) (Palliser)
33+
* sam: Removed CAN library, you can find an updated version here:
34+
https://github.com/collin80/due_can
3135
* sam: Bugfix SPI library: begin() after end() now works (stimmer)
3236
* sam: Bugfix SPI library: incorrent pin configuration in non-extended mode.
3337
* Ported all libraries to new 1.5 format
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f288affa058bfdd44f8b93800fc4cb01b2ebf1e5

build/windows/dist/gcc-arm-none-eabi-4.7.4-2013q2-windows.tar.gz.sha

-1
This file was deleted.

hardware/arduino/avr/boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ nano.menu.cpu.atmega328.bootloader.high_fuses=0xDA
137137
nano.menu.cpu.atmega328.bootloader.extended_fuses=0x05
138138
nano.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex
139139

140-
menu.cpu.nano.atmega328.build.mcu=atmega328p
140+
nano.menu.cpu.atmega328.build.mcu=atmega328p
141141

142142
## Arduino Nano w/ ATmega168
143143
## -------------------------

0 commit comments

Comments
 (0)