mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-27 21:54:30 +01:00
Boards Manager: additional URLs may be specified from File > Preferences
This commit is contained in:
parent
19bb40cbb1
commit
71106edbf8
@ -209,7 +209,7 @@ public class Preferences {
|
||||
// and linux is all over the map
|
||||
|
||||
static final int GUI_BIG = 13;
|
||||
static final int GUI_BETWEEN = 10;
|
||||
static final int GUI_BETWEEN = 5;
|
||||
static final int GUI_SMALL = 6;
|
||||
|
||||
// gui elements
|
||||
@ -237,7 +237,7 @@ public class Preferences {
|
||||
JTextField proxyHTTPSPort;
|
||||
JTextField proxyUser;
|
||||
JPasswordField proxyPassword;
|
||||
|
||||
private final JTextField additionalBoardsManagerField;
|
||||
|
||||
// the calling editor, so updates can be applied
|
||||
|
||||
@ -464,6 +464,8 @@ public class Preferences {
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
// proxy settings
|
||||
|
||||
JPanel proxySettingsContainer = new JPanel();
|
||||
pane.add(proxySettingsContainer);
|
||||
setupProxySettingsFieldSet(proxySettingsContainer);
|
||||
@ -472,6 +474,17 @@ public class Preferences {
|
||||
right = Math.max(right, left + d.width);
|
||||
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 ...
|
||||
|
||||
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.password", new String(proxyPassword.getPassword()));
|
||||
|
||||
Preferences.set("boardsmanager.additional.urls", additionalBoardsManagerField.getText().replace("\r\n", "\n").replace("\r", "\n").replace("\n", ","));
|
||||
|
||||
editor.applyPreferences();
|
||||
}
|
||||
|
||||
@ -834,6 +849,8 @@ public class Preferences {
|
||||
proxyUser.setText(Preferences.get("proxy.user"));
|
||||
proxyPassword.setText(Preferences.get("proxy.password"));
|
||||
|
||||
additionalBoardsManagerField.setText(Preferences.get("boardsmanager.additional.urls"));
|
||||
|
||||
dialog.setLocationRelativeTo(editor);
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user