Added a silent mode where getdown will only log its actions instead of popping up a gui. It's enabled with -Dsilent=true.

This commit is contained in:
Charlie Groves
2007-10-02 18:19:45 +00:00
parent fa67a45d85
commit c31e05eb3a
@@ -87,6 +87,7 @@ public abstract class Getdown extends Thread
public Getdown (File appDir, String appId, Object[] signers) public Getdown (File appDir, String appId, Object[] signers)
{ {
super("Getdown"); super("Getdown");
_silent = Boolean.getBoolean("silent");
try { try {
_msgs = ResourceBundle.getBundle("com.threerings.getdown.messages"); _msgs = ResourceBundle.getBundle("com.threerings.getdown.messages");
} catch (Exception e) { } catch (Exception e) {
@@ -144,6 +145,8 @@ public abstract class Getdown extends Thread
_dead = false; _dead = false;
if (detectProxy()) { if (detectProxy()) {
getdown(); getdown();
} else if (_silent) {
Log.warning("Need a proxy, but we don't want to bother anyone. Exiting");
} else { } else {
// create a panel they can use to configure the proxy settings // create a panel they can use to configure the proxy settings
_container = createContainer(); _container = createContainer();
@@ -301,7 +304,7 @@ public abstract class Getdown extends Thread
} catch (IOException ioe) { } catch (IOException ioe) {
Log.info("Failed to HEAD " + rurl + ": " + ioe); Log.info("Failed to HEAD " + rurl + ": " + ioe);
Log.info("We probably need a proxy. Attempting to auto-detect..."); Log.info("We probably need a proxy, but auto-detection failed.");
} }
// let the caller know that we need a proxy but can't detect it // let the caller know that we need a proxy but can't detect it
@@ -694,7 +697,7 @@ public abstract class Getdown extends Thread
*/ */
protected void createInterface (boolean force) protected void createInterface (boolean force)
{ {
if (_container != null && !force) { if (_silent || (_container != null && !force)) {
return; return;
} }
@@ -910,6 +913,7 @@ public abstract class Getdown extends Thread
protected AbortPanel _abort; protected AbortPanel _abort;
protected boolean _dead; protected boolean _dead;
protected boolean _silent;
protected long _startup; protected long _startup;
protected boolean _enableTracking = true; protected boolean _enableTracking = true;