oOo's timestamper fixes (wtf was i thinking with those web params? !thwap)

This commit is contained in:
jrandom
2004-08-24 19:59:54 +00:00
committed by zzz
parent db135e502c
commit 84f8931ddd
3 changed files with 5 additions and 4 deletions

View File

@ -222,9 +222,10 @@ public class ConfigNetHandler extends FormHandler {
updateRates(); updateRates();
if (_timeSyncEnabled) { if (_timeSyncEnabled) {
// Time sync enable, means NOT disabled
_context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false"); _context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false");
} else { } else {
_context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false"); _context.router().setConfigSetting(Timestamper.PROP_DISABLED, "true");
} }
boolean saved = _context.router().saveConfig(); boolean saved = _context.router().saveConfig();

View File

@ -51,8 +51,8 @@ public class ConfigNetHelper {
} }
public String getEnableTimeSyncChecked() { public String getEnableTimeSyncChecked() {
String enabled = _context.getProperty(Timestamper.PROP_DISABLED, "true"); String disabled = _context.getProperty(Timestamper.PROP_DISABLED, "false");
if ( (enabled == null) || (!"true".equalsIgnoreCase(enabled)) ) if ( (disabled != null) && ("true".equalsIgnoreCase(disabled)) )
return ""; return "";
else else
return " checked "; return " checked ";

View File

@ -180,7 +180,7 @@ public class Timestamper implements Runnable {
String disabled = _context.getProperty(PROP_DISABLED); String disabled = _context.getProperty(PROP_DISABLED);
if (disabled == null) if (disabled == null)
disabled = DEFAULT_DISABLED + ""; disabled = DEFAULT_DISABLED + "";
_disabled = Boolean.getBoolean(disabled); _disabled = Boolean.valueOf(disabled).booleanValue();
} }
/** /**