mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 19:05:34 +01:00
minor tweaks, extend timeout for contrib download
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class ContributionManager {
|
||||
try {
|
||||
// System.out.println("downloading file " + source);
|
||||
URLConnection conn = source.openConnection();
|
||||
conn.setConnectTimeout(1000);
|
||||
conn.setConnectTimeout(2000);
|
||||
conn.setReadTimeout(5000);
|
||||
|
||||
// TODO this is often -1, may need to set progress to indeterminate
|
||||
@@ -78,6 +79,9 @@ public class ContributionManager {
|
||||
out.close();
|
||||
success = true;
|
||||
|
||||
} catch (SocketTimeoutException ste) {
|
||||
progress.error(ste);
|
||||
|
||||
} catch (IOException ioe) {
|
||||
progress.error(ioe);
|
||||
ioe.printStackTrace();
|
||||
|
||||
@@ -110,8 +110,8 @@ public class ContributionManagerDialog {
|
||||
if (isError()) {
|
||||
status.setErrorMessage("An error occured when downloading " +
|
||||
"the list of available contributions.");
|
||||
} else {
|
||||
status.updateUI();
|
||||
// } else {
|
||||
// status.updateUI();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -289,14 +289,12 @@ public class ContributionManagerDialog {
|
||||
disposeFrame();
|
||||
}
|
||||
});
|
||||
ActionListener disposer = new ActionListener() {
|
||||
// handle window closing commands for ctrl/cmd-W or hitting ESC.
|
||||
Toolkit.registerWindowCloseKeys(dialog.getRootPane(), new ActionListener() {
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
disposeFrame();
|
||||
}
|
||||
};
|
||||
Toolkit.registerWindowCloseKeys(dialog.getRootPane(), disposer);
|
||||
|
||||
// handle window closing commands for ctrl/cmd-W or hitting ESC.
|
||||
});
|
||||
|
||||
dialog.getContentPane().addKeyListener(new KeyAdapter() {
|
||||
public void keyPressed(KeyEvent e) {
|
||||
@@ -422,7 +420,6 @@ public class ContributionManagerDialog {
|
||||
public void updateStyle() {
|
||||
if (showingHint) {
|
||||
setText(filterHint);
|
||||
|
||||
// setForeground(UIManager.getColor("TextField.light")); // too light
|
||||
setForeground(Color.gray);
|
||||
setFont(getFont().deriveFont(Font.ITALIC));
|
||||
|
||||
Reference in New Issue
Block a user