1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Boards Manager: additional URLs may be specified from File > Preferences

This commit is contained in:
Federico Fissore
2015-05-04 13:26:18 +02:00
parent 19bb40cbb1
commit 71106edbf8

View File

@ -209,7 +209,7 @@ public class Preferences {
// and linux is all over the map // and linux is all over the map
static final int GUI_BIG = 13; static final int GUI_BIG = 13;
static final int GUI_BETWEEN = 10; static final int GUI_BETWEEN = 5;
static final int GUI_SMALL = 6; static final int GUI_SMALL = 6;
// gui elements // gui elements
@ -237,7 +237,7 @@ public class Preferences {
JTextField proxyHTTPSPort; JTextField proxyHTTPSPort;
JTextField proxyUser; JTextField proxyUser;
JPasswordField proxyPassword; JPasswordField proxyPassword;
private final JTextField additionalBoardsManagerField;
// the calling editor, so updates can be applied // the calling editor, so updates can be applied
@ -464,6 +464,8 @@ public class Preferences {
right = Math.max(right, left + d.width); right = Math.max(right, left + d.width);
top += d.height + GUI_BETWEEN; top += d.height + GUI_BETWEEN;
// proxy settings
JPanel proxySettingsContainer = new JPanel(); JPanel proxySettingsContainer = new JPanel();
pane.add(proxySettingsContainer); pane.add(proxySettingsContainer);
setupProxySettingsFieldSet(proxySettingsContainer); setupProxySettingsFieldSet(proxySettingsContainer);
@ -472,6 +474,17 @@ public class Preferences {
right = Math.max(right, left + d.width); right = Math.max(right, left + d.width);
top += d.height + GUI_BETWEEN; top += d.height + GUI_BETWEEN;
// boards manager additional urls
box = Box.createHorizontalBox();
label = new JLabel(_("Additional Boards Manager URLs: "));
box.add(label);
additionalBoardsManagerField = new JTextField(30);
box.add(additionalBoardsManagerField);
pane.add(box);
d = box.getPreferredSize();
box.setBounds(left, top, d.width, d.height);
top += d.height + GUI_BETWEEN;
// More preferences are in the ... // More preferences are in the ...
label = new JLabel(_("More preferences can be edited directly in the file")); label = new JLabel(_("More preferences can be edited directly in the file"));
@ -788,6 +801,8 @@ public class Preferences {
Preferences.set("proxy.user", proxyUser.getText()); Preferences.set("proxy.user", proxyUser.getText());
Preferences.set("proxy.password", new String(proxyPassword.getPassword())); Preferences.set("proxy.password", new String(proxyPassword.getPassword()));
Preferences.set("boardsmanager.additional.urls", additionalBoardsManagerField.getText().replace("\r\n", "\n").replace("\r", "\n").replace("\n", ","));
editor.applyPreferences(); editor.applyPreferences();
} }
@ -834,6 +849,8 @@ public class Preferences {
proxyUser.setText(Preferences.get("proxy.user")); proxyUser.setText(Preferences.get("proxy.user"));
proxyPassword.setText(Preferences.get("proxy.password")); proxyPassword.setText(Preferences.get("proxy.password"));
additionalBoardsManagerField.setText(Preferences.get("boardsmanager.additional.urls"));
dialog.setLocationRelativeTo(editor); dialog.setLocationRelativeTo(editor);
dialog.setVisible(true); dialog.setVisible(true);
} }