Merge pull request #3279 from ffissore/system-proxy-settings

Use system proxy settings
This commit is contained in:
Federico Fissore 2015-06-04 13:35:14 +02:00
commit 0ae4f0bf42
5 changed files with 40 additions and 394 deletions

View File

@ -31,23 +31,32 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="proxySettingsPanel" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="sketchbookLocationField" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="browseButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="checkboxesContainer" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="okButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="additionalBoardsManagerField" min="-2" pref="500" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="arduinoNotRunningLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="sketchbookLocationLabel" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="comboWarningsLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="comboWarnings" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="morePreferencesLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="showVerboseLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@ -70,22 +79,12 @@
</Group>
</Group>
</Group>
<Component id="arduinoNotRunningLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="morePreferencesLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="preferencesFileLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="okButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="additionalBoardsManagerField" min="-2" pref="500" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -126,8 +125,6 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="checkboxesContainer" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="proxySettingsPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="additionalBoardsManagerLabel" alignment="3" min="-2" max="-2" attributes="0"/>
@ -146,7 +143,7 @@
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -269,199 +266,6 @@
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JComboBox(warningItems)"/>
</AuxValues>
</Component>
<Container class="javax.swing.JPanel" name="proxySettingsPanel">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="&lt;User Code&gt;">
<Connection PropertyName="titleX" code="_(&quot;Proxy Settings&quot;)" type="code"/>
</TitledBorder>
</Border>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="proxyHTTPSServerLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Component id="proxyHTTPServerLabel" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="proxyUserLabel" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="proxyHTTPServer" max="32767" attributes="0"/>
<Component id="proxyHTTPSServer" max="32767" attributes="0"/>
<Component id="proxyUser" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="proxyHTTPSPortLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="proxyPasswordLabel" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="proxyHTTPPortLabel" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="proxyHTTPSPort" alignment="0" max="32767" attributes="0"/>
<Component id="proxyHTTPPort" alignment="0" max="32767" attributes="0"/>
<Component id="proxyPassword" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyHTTPServerLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyHTTPServer" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyHTTPSServerLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyHTTPSServer" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyUser" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyUserLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyHTTPPortLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyHTTPPort" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyHTTPSPort" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyHTTPSPortLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="proxyPasswordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="proxyPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="proxyHTTPServerLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Server (HTTP):&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="proxyHTTPServer">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="proxyHTTPPortLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Port (HTTP):&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="proxyHTTPPort">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="proxyHTTPSServerLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Server (HTTPS):&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="proxyHTTPSServer">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="proxyHTTPSPortLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Port (HTTPS):&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="proxyHTTPSPort">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="proxyUserLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Username:&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="proxyUser">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="proxyPasswordLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Password:&quot;)" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JPasswordField" name="proxyPassword">
<Properties>
<Property name="columns" type="int" value="10"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="additionalBoardsManagerLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">

View File

@ -220,19 +220,6 @@ public class Preferences extends javax.swing.JDialog {
verboseUploadBox = new javax.swing.JCheckBox();
javax.swing.JLabel comboWarningsLabel = new javax.swing.JLabel();
comboWarnings = new JComboBox(warningItems);
javax.swing.JPanel proxySettingsPanel = new javax.swing.JPanel();
javax.swing.JLabel proxyHTTPServerLabel = new javax.swing.JLabel();
proxyHTTPServer = new javax.swing.JTextField();
javax.swing.JLabel proxyHTTPPortLabel = new javax.swing.JLabel();
proxyHTTPPort = new javax.swing.JTextField();
javax.swing.JLabel proxyHTTPSServerLabel = new javax.swing.JLabel();
proxyHTTPSServer = new javax.swing.JTextField();
javax.swing.JLabel proxyHTTPSPortLabel = new javax.swing.JLabel();
proxyHTTPSPort = new javax.swing.JTextField();
javax.swing.JLabel proxyUserLabel = new javax.swing.JLabel();
proxyUser = new javax.swing.JTextField();
javax.swing.JLabel proxyPasswordLabel = new javax.swing.JLabel();
proxyPassword = new javax.swing.JPasswordField();
javax.swing.JLabel additionalBoardsManagerLabel = new javax.swing.JLabel();
additionalBoardsManagerField = new javax.swing.JTextField();
javax.swing.JButton extendedAdditionalUrlFieldWindow = new javax.swing.JButton();
@ -282,93 +269,6 @@ public class Preferences extends javax.swing.JDialog {
comboWarningsLabel.setText(_("Compiler warnings: "));
proxySettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(_("Proxy Settings")));
proxyHTTPServerLabel.setText(_("Server (HTTP):"));
proxyHTTPServer.setColumns(10);
proxyHTTPPortLabel.setText(_("Port (HTTP):"));
proxyHTTPPort.setColumns(10);
proxyHTTPSServerLabel.setText(_("Server (HTTPS):"));
proxyHTTPSServer.setColumns(10);
proxyHTTPSPortLabel.setText(_("Port (HTTPS):"));
proxyHTTPSPort.setColumns(10);
proxyUserLabel.setText(_("Username:"));
proxyUser.setColumns(10);
proxyPasswordLabel.setText(_("Password:"));
proxyPassword.setColumns(10);
javax.swing.GroupLayout proxySettingsPanelLayout = new javax.swing.GroupLayout(proxySettingsPanel);
proxySettingsPanel.setLayout(proxySettingsPanelLayout);
proxySettingsPanelLayout.setHorizontalGroup(
proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(proxySettingsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxyHTTPSServerLabel)
.addGroup(proxySettingsPanelLayout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(proxyHTTPServerLabel)))
.addComponent(proxyUserLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxyHTTPServer)
.addComponent(proxyHTTPSServer)
.addComponent(proxyUser, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxyHTTPSPortLabel)
.addComponent(proxyPasswordLabel, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(proxyHTTPPortLabel, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(proxyHTTPSPort, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxyHTTPPort, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxyPassword, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap())
);
proxySettingsPanelLayout.setVerticalGroup(
proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(proxySettingsPanelLayout.createSequentialGroup()
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(proxySettingsPanelLayout.createSequentialGroup()
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyHTTPServerLabel)
.addComponent(proxyHTTPServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyHTTPSServerLabel)
.addComponent(proxyHTTPSServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(proxyUserLabel)))
.addGroup(proxySettingsPanelLayout.createSequentialGroup()
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyHTTPPortLabel)
.addComponent(proxyHTTPPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyHTTPSPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(proxyHTTPSPortLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(proxySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(proxyPasswordLabel)
.addComponent(proxyPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
additionalBoardsManagerLabel.setText(_("Additional Boards Manager URLs: "));
additionalBoardsManagerLabel.setToolTipText(_("Enter a comma separated list of urls"));
@ -446,21 +346,28 @@ public class Preferences extends javax.swing.JDialog {
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxySettingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(sketchbookLocationField)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(browseButton))
.addComponent(checkboxesContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(okButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(additionalBoardsManagerLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(arduinoNotRunningLabel)
.addComponent(sketchbookLocationLabel)
.addGroup(layout.createSequentialGroup()
.addComponent(comboWarningsLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(morePreferencesLabel)
.addGroup(layout.createSequentialGroup()
.addComponent(showVerboseLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@ -478,18 +385,10 @@ public class Preferences extends javax.swing.JDialog {
.addComponent(comboLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(requiresRestartLabel))))
.addComponent(arduinoNotRunningLabel)
.addComponent(morePreferencesLabel)
.addComponent(preferencesFileLabel))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(okButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(additionalBoardsManagerLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
@ -522,8 +421,6 @@ public class Preferences extends javax.swing.JDialog {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkboxesContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(proxySettingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(additionalBoardsManagerLabel)
@ -539,7 +436,7 @@ public class Preferences extends javax.swing.JDialog {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cancelButton)
.addComponent(okButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
pack();
@ -612,12 +509,6 @@ public class Preferences extends javax.swing.JDialog {
private javax.swing.JCheckBox externalEditorBox;
private javax.swing.JTextField fontSizeField;
private javax.swing.JLabel preferencesFileLabel;
private javax.swing.JTextField proxyHTTPPort;
private javax.swing.JTextField proxyHTTPSPort;
private javax.swing.JTextField proxyHTTPSServer;
private javax.swing.JTextField proxyHTTPServer;
private javax.swing.JPasswordField proxyPassword;
private javax.swing.JTextField proxyUser;
private javax.swing.JCheckBox saveVerifyUploadBox;
private javax.swing.JTextField sketchbookLocationField;
private javax.swing.JCheckBox updateExtensionBox;
@ -686,21 +577,6 @@ public class Preferences extends javax.swing.JDialog {
PreferencesData.setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
PreferencesData.set("proxy.http.server", proxyHTTPServer.getText());
try {
PreferencesData.set("proxy.http.port", Integer.valueOf(proxyHTTPPort.getText()).toString());
} catch (NumberFormatException e) {
PreferencesData.remove("proxy.http.port");
}
PreferencesData.set("proxy.https.server", proxyHTTPSServer.getText());
try {
PreferencesData.set("proxy.https.port", Integer.valueOf(proxyHTTPSPort.getText()).toString());
} catch (NumberFormatException e) {
PreferencesData.remove("proxy.https.port");
}
PreferencesData.set("proxy.user", proxyUser.getText());
PreferencesData.set("proxy.password", new String(proxyPassword.getPassword()));
PreferencesData.set("boardsmanager.additional.urls", additionalBoardsManagerField.getText().replace("\r\n", "\n").replace("\r", "\n").replace("\n", ","));
//editor.applyPreferences();
@ -743,21 +619,6 @@ public class Preferences extends javax.swing.JDialog {
saveVerifyUploadBox.setSelected(PreferencesData.getBoolean("editor.save_on_verify"));
proxyHTTPServer.setText(PreferencesData.get("proxy.http.server"));
try {
proxyHTTPPort.setText(Integer.toString(PreferencesData.getInteger("proxy.http.port", 8080)));
} catch (NumberFormatException e) {
proxyHTTPPort.setText("");
}
proxyHTTPSServer.setText(PreferencesData.get("proxy.https.server"));
try {
proxyHTTPSPort.setText(Integer.toString(PreferencesData.getInteger("proxy.https.port", 8443)));
} catch (NumberFormatException e) {
proxyHTTPSPort.setText("");
}
proxyUser.setText(PreferencesData.get("proxy.user"));
proxyPassword.setText(PreferencesData.get("proxy.password"));
additionalBoardsManagerField.setText(PreferencesData.get("boardsmanager.additional.urls"));
}
}

View File

@ -124,6 +124,7 @@ public class Base {
static public void main(String args[]) throws Exception {
System.setProperty("awt.useSystemAAFontSettings", "on");
System.setProperty("swing.aatext", "true");
System.setProperty("java.net.useSystemProxies", "true");
splashScreenHelper.splashText(_("Loading configuration..."));
@ -1748,8 +1749,6 @@ public class Base {
if (activeEditor != null) {
dialog.setLocationRelativeTo(activeEditor);
}
dialog.pack();
dialog.setMinimumSize(dialog.getSize());
dialog.setVisible(true);
}

View File

@ -36,9 +36,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.*;
import java.util.Observable;
public class FileDownloader extends Observable {
@ -122,29 +120,9 @@ public class FileDownloader extends Observable {
setStatus(Status.CONNECTING);
System.getProperties().remove("http.proxyHost");
System.getProperties().remove("http.proxyPort");
System.getProperties().remove("https.proxyHost");
System.getProperties().remove("https.proxyPort");
System.getProperties().remove("http.proxyUser");
System.getProperties().remove("http.proxyPassword");
Proxy proxy = ProxySelector.getDefault().select(downloadUrl.toURI()).get(0);
if (PreferencesData.has("proxy.http.server") && PreferencesData.get("proxy.http.server") != null && !PreferencesData.get("proxy.http.server").equals("")) {
System.getProperties().put("http.proxyHost", PreferencesData.get("proxy.http.server"));
System.getProperties().put("http.proxyPort", PreferencesData.get("proxy.http.port"));
}
if (PreferencesData.has("proxy.https.server") && PreferencesData.get("proxy.https.server") != null && !PreferencesData.get("proxy.https.server").equals("")) {
System.getProperties().put("https.proxyHost", PreferencesData.get("proxy.https.server"));
System.getProperties().put("https.proxyPort", PreferencesData.get("proxy.https.port"));
}
if (PreferencesData.has("proxy.user") && PreferencesData.get("proxy.user") != null && !PreferencesData.get("proxy.user").equals("")) {
System.getProperties().put("http.proxyUser", PreferencesData.get("proxy.user"));
System.getProperties().put("http.proxyPassword", PreferencesData.get("proxy.password"));
System.getProperties().put("https.proxyUser", PreferencesData.get("proxy.user"));
System.getProperties().put("https.proxyPassword", PreferencesData.get("proxy.password"));
}
HttpURLConnection connection = (HttpURLConnection) downloadUrl.openConnection();
HttpURLConnection connection = (HttpURLConnection) downloadUrl.openConnection(proxy);
if (downloadUrl.getUserInfo() != null) {
String auth = "Basic " + new String(new Base64().encode(downloadUrl.getUserInfo().getBytes()));
@ -160,10 +138,12 @@ public class FileDownloader extends Observable {
int resp = connection.getResponseCode();
if (resp == HttpURLConnection.HTTP_MOVED_PERM || resp == HttpURLConnection.HTTP_MOVED_TEMP) {
String newUrl = connection.getHeaderField("Location");
URL newUrl = new URL(connection.getHeaderField("Location"));
proxy = ProxySelector.getDefault().select(newUrl.toURI()).get(0);
// open the new connnection again
connection = (HttpURLConnection) new URL(newUrl).openConnection();
connection = (HttpURLConnection) newUrl.openConnection(proxy);
if (downloadUrl.getUserInfo() != null) {
String auth = "Basic " + new String(new Base64().encode(downloadUrl.getUserInfo().getBytes()));
connection.setRequestProperty("Authorization", auth);

View File

@ -742,8 +742,10 @@ public class BaseNoGui {
}
static public void main(String args[]) throws Exception {
if (args.length == 0)
if (args.length == 0) {
showError(_("No parameters"), _("No command line parameters found"), null);
}
System.setProperty("java.net.useSystemProxies", "true");
Runtime.getRuntime().addShutdownHook(new Thread(DeleteFilesOnShutdown.INSTANCE));