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)...

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk/specialpurpose@488821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2006-12-19 21:52:44 +00:00
parent 113ce0f75f
commit e13ddc3faa
4 changed files with 19 additions and 4 deletions
@@ -281,6 +281,7 @@ public class PaymentEvents {
}
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 @@ public class PaymentEvents {
pos.getButtons().setLock(false);
pos.showDialog("dialog/error/exception", e.getMessage());
}
pos.setNormalCursor();
}
}
@@ -32,23 +32,28 @@ public class SecurityEvents {
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 @@ public class SecurityEvents {
}
baseLogin(pos, true);
}
pos.setNormalCursor();
}
public static void lock(PosScreen pos) {
+3 -3
View File
@@ -59,7 +59,7 @@ public class PosDialog {
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 class PosDialog {
}
public void posDialogSetVisible(boolean visible){
posVisible = visible;
posDialogVisible = visible;
SwingUtilities.invokeLater(
new Runnable() {
public void run(){
dialog.setVisible(posVisible);
dialog.setVisible(posDialogVisible);
}
}
);
+8 -1
View File
@@ -207,7 +207,7 @@ public class PosScreen extends NavigationHelper implements Runnable, DialogCallb
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()));
@@ -382,4 +382,11 @@ public class PosScreen extends NavigationHelper implements Runnable, DialogCallb
}
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));
}
}