summaryrefslogtreecommitdiff
path: root/webapps/swat/source
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2007-01-14 02:56:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:43 -0500
commitee0ad11f7609facfe2ee15cda413de99ae02d64b (patch)
treec3e60e66bdd7ae02e42da8916dd6682b447530ea /webapps/swat/source
parent332cc82dd2719f5a542d19066b8277bd6da57fbb (diff)
downloadsamba-ee0ad11f7609facfe2ee15cda413de99ae02d64b.tar.gz
samba-ee0ad11f7609facfe2ee15cda413de99ae02d64b.tar.bz2
samba-ee0ad11f7609facfe2ee15cda413de99ae02d64b.zip
r20752: There's no reason to wait 5 seconds before the first Status and Statistics
report is generated. Upon "appear" events, set timer expiry to 0 seconds for the first timeout. (This used to be commit 7b98d6a77f02c2dc145630b0cf9e8bb6a1b25c92)
Diffstat (limited to 'webapps/swat/source')
-rw-r--r--webapps/swat/source/class/swat/module/statistics/Fsm.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/webapps/swat/source/class/swat/module/statistics/Fsm.js b/webapps/swat/source/class/swat/module/statistics/Fsm.js
index 3ecb42a49d..280d554999 100644
--- a/webapps/swat/source/class/swat/module/statistics/Fsm.js
+++ b/webapps/swat/source/class/swat/module/statistics/Fsm.js
@@ -17,19 +17,35 @@ function()
});
-qx.Class._startTimer = function(fsm)
+/**
+ * Start the redisplay timer.
+ *
+ * @param fsm {qx.util.fsm.FiniteStateMachine}
+ * The finite state machine in use by this module
+ *
+ * @param msInterval {Integer}
+ * The number of milliseconds before the timer should expire
+ */
+qx.Class._startTimer = function(fsm, msInterval)
{
+
// First, for good house keeping, ensure no timer exists
swat.module.statistics.Fsm._stopTimer(fsm);
// Create a timer instance to expire in a few seconds
- var timer = new qx.client.Timer(5000);
+ var timer = new qx.client.Timer(msInterval);
timer.addEventListener("interval", fsm.eventListener, fsm);
fsm.addObject("timer", timer);
timer.start();
};
+/**
+ * Stop the redisplay timer.
+ *
+ * @param fsm {qx.util.fsm.FiniteStateMachine}
+ * The finite state machine in use by this module
+ */
qx.Class._stopTimer = function(fsm)
{
// ... then stop the timer. Get the timer object.
@@ -84,7 +100,8 @@ qx.Proto.buildFsm = function(module)
// Restart the timer.
if (_module.visible)
{
- swat.module.statistics.Fsm._startTimer(fsm);
+ // Give it a reasonable interval before we redisplay
+ swat.module.statistics.Fsm._startTimer(fsm, 5000);
}
}
},
@@ -172,7 +189,9 @@ qx.Proto.buildFsm = function(module)
function(fsm, event)
{
_module.visible = true;
- swat.module.statistics.Fsm._startTimer(fsm);
+
+ // Redisplay immediately
+ swat.module.statistics.Fsm._startTimer(fsm, 0);
}
});
state.addTransition(trans);