From: Anneli <an...@us...> - 2005-03-07 11:14:13
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29708/src/org/redpos/client/ui/plugin/function Modified Files: Pay.java Log Message: Added functionality for short commands when selecting payment Index: Pay.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/Pay.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Pay.java 19 Feb 2005 08:37:14 -0000 1.6 --- Pay.java 7 Mar 2005 11:14:00 -0000 1.7 *************** *** 46,50 **** import org.redpos.client.ui.plugin.*; import org.redpos.client.ui.plugin.contract.PluginFunctionConstants; - /** * UI plugin function service. Initiates payment of ongoing receipt. --- 46,49 ---- *************** *** 59,63 **** public class Pay extends PluginFunctionMBeanSupport implements ! PayMBean, NotificationListener, PaymentSelection.PaymentSelectionListener, --- 58,62 ---- public class Pay extends PluginFunctionMBeanSupport implements ! PayMBean, NotificationListener, PaymentSelection.PaymentSelectionListener, *************** *** 88,91 **** --- 87,91 ---- private Amount payChange; private static ConfirmActionUI confirm; + private boolean showPaySelectionUI = false; /** *************** *** 107,127 **** return false; } ! ! // get amount to pay ! // ! toPay = getAmountToPay(); ! if(toPay == null) ! return false; ! this.parent = parent; ! // create payment selector ! // ! paymentSelection = new PaymentSelection(parent, getLanguage(), this, ! getAvailablePayments()); ! paymentSelection.setFocus(); ! paymentSelection.setPayTotal(toPay); ! ! parent.layout(); return true; --- 107,133 ---- return false; } ! this.parent = parent; + + if (toPay == null || showPaySelectionUI) + { + // get amount to pay + // + toPay = getAmountToPay(); + if(toPay == null) + return false; + // create payment selector + // + paymentSelection = new PaymentSelection(parent, getLanguage(), this, + getAvailablePayments()); + paymentSelection.setFocus(); + paymentSelection.setPayTotal(toPay); ! parent.layout(); ! } ! else ! { ! handlePaymentSelected(); ! } return true; *************** *** 138,142 **** handlePaymentSelected(); } ! /** * Invoked by the payment selection dialog --- 144,148 ---- handlePaymentSelected(); } ! /** * Invoked by the payment selection dialog *************** *** 297,304 **** { // remove payment selector from ui ! paymentSelection.dispose(); ! paymentSelection = null; ! parent.layout(); ! // the amount to pay will be shown in a different currency if (payment.code.equals("SICUEX")) --- 303,313 ---- { // remove payment selector from ui ! if (paymentSelection != null) ! { ! paymentSelection.dispose(); ! paymentSelection = null; ! parent.layout(); ! } ! // the amount to pay will be shown in a different currency if (payment.code.equals("SICUEX")) *************** *** 360,365 **** parent.layout(); } ! } ! parent.layout(); } --- 369,374 ---- parent.layout(); } ! } ! parent.layout(); } *************** *** 415,418 **** --- 424,429 ---- userInput = null; parent.layout(); + + showPaySelectionUI = true; // re-invoke payment selection *************** *** 426,429 **** --- 437,442 ---- catch(NullPointerException e) {} + if (!showPaySelectionUI) + toPay = null; } *************** *** 439,442 **** --- 452,457 ---- userInput = null; parent.layout(); + + showPaySelectionUI = true; // re-invoke payment selection *************** *** 530,534 **** sendUIMessage(message); } - return false; } --- 545,548 ---- *************** *** 571,574 **** --- 585,596 ---- paymentAdded = false; } + else if(n.getType().equals(POSEngineConstants.NOTIFICATION_POS_PAYMENT_SELECTED)) + { + PaymentInfo paymentInfo = (PaymentInfo)n.getUserData(); + this.payment = paymentInfo; + toPay = getAmountToPay(); + showPaySelectionUI = false; + handlePaymentSelected(); + } else if(n.getType().equals( POSEngineConstants.NOTIFICATION_POS_PAYMENT_COMPLETE)) *************** *** 732,735 **** --- 754,760 ---- return true; else if(n.getType().equals( + POSEngineConstants.NOTIFICATION_POS_PAYMENT_SELECTED)) + return true; + else if(n.getType().equals( ReceiptConstants.NOTIFICATION_RECEIPT_STARTED)) return true; |