svn commit: samba r21287 - in branches/SAMBA_4_0/webapps: qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm swat/source/class/swat/main

derrell at samba.org derrell at samba.org
Sun Feb 11 22:59:03 GMT 2007


Author: derrell
Date: 2007-02-11 22:59:02 +0000 (Sun, 11 Feb 2007)
New Revision: 21287

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

Log:
Improve user feedback.  Cursor now changes to stopwatch during RPC and module loading.
Modified:
   branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModuleFsm.js


Changeset:
Modified: branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js
===================================================================
--- branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js	2007-02-11 21:54:14 UTC (rev 21286)
+++ branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js	2007-02-11 22:59:02 UTC (rev 21287)
@@ -178,7 +178,7 @@
   // Ensure that the state name doesn't already exist
   if (stateName in this._states)
   {
-    throw new Error("State " + state + " already exists");
+    throw new Error("State " + stateName + " already exists");
   }
 
   // Add the new state object to the finite state machine

Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
===================================================================
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js	2007-02-11 21:54:14 UTC (rev 21286)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js	2007-02-11 22:59:02 UTC (rev 21287)
@@ -75,6 +75,7 @@
    *  Load module's finite state machine and graphical user interface
    */
   var thisModule = this;
+  var newModule = module;
   var trans = new qx.util.fsm.Transition(
     "Transition_Idle_to_Idle_Load_Gui",
     {
@@ -87,7 +88,26 @@
           // Call the module's initialAppear function to build FSM and GUI.
           // That function should *replace* this state, State_Idle, to which
           // we'll transition.
-          thisModule.initialAppear(module);
+          var canvas = fsm.getObject("swat.main.canvas");
+          canvas.getTopLevelWidget().setGlobalCursor("progress");
+          if (! newModule.bLoaded)
+          {
+            window.setTimeout(
+              function()
+              {
+                // Call the module's initial appear handler
+                thisModule.initialAppear(newModule);
+
+                // Regenerate the appear event, since the original one got
+                // lost by doing this code inside of the timeout.
+                canvas.createDispatchEvent("appear");
+
+                // Reset the cursor to the default
+                canvas.getTopLevelWidget().setGlobalCursor(null);
+
+              }, 0);
+            newModule.bLoaded = true;
+          }
         }
     });
   state.addTransition(trans);

Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModuleFsm.js
===================================================================
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModuleFsm.js	2007-02-11 21:54:14 UTC (rev 21286)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModuleFsm.js	2007-02-11 22:59:02 UTC (rev 21287)
@@ -113,6 +113,10 @@
       {
         var bAuthCompleted = false;
 
+        // Change the cursor to indicate RPC in progress
+        var canvas = fsm.getObject("swat.main.canvas");
+        canvas.getTopLevelWidget().setGlobalCursor("progress");
+        
         // See if we just completed an authentication
         if (fsm.getPreviousState() == "State_Authenticate" &&
             event.getType() == "complete")
@@ -130,6 +134,21 @@
         }
       },
 
+    "onexit" :
+      function(fsm, event)
+      {
+        // If we're returning to the calling state (not going to the
+        // Authenticate state)...
+        var nextState = fsm.getNextState();
+        if (nextState != "State_Authenticate" &&
+            nextState != "State_AwaitRpcResult")
+        {
+          // ... then set the cursor back to normal
+          var canvas = fsm.getObject("swat.main.canvas");
+          canvas.getTopLevelWidget().setGlobalCursor(null);
+        }
+      },
+
     "events" :
     {
       "execute"  :



More information about the samba-cvs mailing list