svn commit: samba r20752 - in branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics: .

derrell at samba.org derrell at samba.org
Sun Jan 14 02:56:09 GMT 2007


Author: derrell
Date: 2007-01-14 02:56:09 +0000 (Sun, 14 Jan 2007)
New Revision: 20752

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20752

Log:
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.

Modified:
   branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js


Changeset:
Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js
===================================================================
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js	2007-01-14 02:54:41 UTC (rev 20751)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js	2007-01-14 02:56:09 UTC (rev 20752)
@@ -17,19 +17,35 @@
 });
 
 
-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 @@
             // 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 @@
         function(fsm, event)
         {
           _module.visible = true;
-          swat.module.statistics.Fsm._startTimer(fsm);
+
+          // Redisplay immediately
+          swat.module.statistics.Fsm._startTimer(fsm, 0);
         }
     });
   state.addTransition(trans);



More information about the samba-cvs mailing list