svn commit: r488821 - in /incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos: event/PaymentEvents.java event/SecurityEvents.java screen/PosDialog.java screen/PosScreen.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r488821 - in /incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos: event/PaymentEvents.java event/SecurityEvents.java screen/PosDialog.java screen/PosScreen.java

jleroux@apache.org
Author: jleroux
Date: Tue Dec 19 13:52:44 2006
New Revision: 488821

URL: http://svn.apache.org/viewvc?view=rev&rev=488821
Log:
First uses of new posScreen methods setWaitCursor and setNormalCursor : during login and processing sale.
We will see later if other uses are needed (btw not sure during login si really useful)...

Modified:
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java

Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java?view=diff&rev=488821&r1=488820&r2=488821
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java (original)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java Tue Dec 19 13:52:44 2006
@@ -281,6 +281,7 @@
     }
 
     public static synchronized void processSale(PosScreen pos) {
+        pos.setWaitCursor();
         PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession());
         PosScreen.currentScreen.getOutput().print(UtilProperties.getMessage("pos","Processing",Locale.getDefault()));
 
@@ -305,6 +306,7 @@
                 pos.getButtons().setLock(false);
                 pos.showDialog("dialog/error/exception", e.getMessage());
             }
+            pos.setNormalCursor();
         }
     }
 

Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java?view=diff&rev=488821&r1=488820&r2=488821
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java (original)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java Tue Dec 19 13:52:44 2006
@@ -32,23 +32,28 @@
     public static final String module = SecurityEvents.class.getName();
 
     public static void login(PosScreen pos) {
+        pos.setWaitCursor();
         String[] func = pos.getInput().getFunction("LOGIN");
         if (func == null) {
             pos.getInput().setFunction("LOGIN", "");
         }
         baseLogin(pos, false);
+        pos.setNormalCursor();
     }
 
     public static void logout(PosScreen pos) {
+        pos.setWaitCursor();
         PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession());
         XuiSession session = pos.getSession();
         trans.closeTx();
         session.logout();
         pos.showPage("pospanel");
         PosScreen.currentScreen.setLock(true);
+        pos.setNormalCursor();
     }
 
     public static void mgrLogin(PosScreen pos) {
+        pos.setWaitCursor();
         XuiSession session = pos.getSession();
         if (session.hasRole(session.getUserLogin(), "MANAGER")) {
             ManagerEvents.mgrLoggedIn = true;
@@ -61,6 +66,7 @@
             }
             baseLogin(pos, true);
         }
+        pos.setNormalCursor();
     }
 
     public static void lock(PosScreen pos) {

Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java?view=diff&rev=488821&r1=488820&r2=488821
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java (original)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java Tue Dec 19 13:52:44 2006
@@ -59,7 +59,7 @@
     protected XPage page = null;
     protected boolean modal = true;
     protected int padding = 0;
-    protected boolean posVisible = false;
+    protected boolean posDialogVisible = false;
 
     public static PosDialog getInstance(XPage page) {
         return getInstance(page, true, 0);
@@ -334,11 +334,11 @@
     }
 
       public void posDialogSetVisible(boolean visible){
-      posVisible = visible;
+      posDialogVisible = visible;
       SwingUtilities.invokeLater(
           new Runnable() {
               public void run(){
-                  dialog.setVisible(posVisible);
+                  dialog.setVisible(posDialogVisible);
               }
           }      
       );

Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java?view=diff&rev=488821&r1=488820&r2=488821
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java (original)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java Tue Dec 19 13:52:44 2006
@@ -207,7 +207,7 @@
             if (updateOutput) {
                 if (input.isFunctionSet("PAID")) {
                     output.print(UtilProperties.getMessage("pos","ULOGIN",defaultLocale)
-                     + UtilFormatOut.formatPrice(trans.getTotalDue() * -1));
+                            + UtilFormatOut.formatPrice(trans.getTotalDue() * -1));
                 } else if (input.isFunctionSet("TOTAL")) {
                     if (trans.getTotalDue() > 0) {
                         output.print(UtilProperties.getMessage("pos","TOTALD",defaultLocale) + " " + UtilFormatOut.formatPrice(trans.getTotalDue()));
@@ -381,5 +381,12 @@
             }
         }
         return this.scrLocation;
+    }
+    
+    public void setWaitCursor() {
+        setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));        
+    }
+    public void setNormalCursor() {
+        setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));        
     }
 }