update discard check

This commit is contained in:
buzzcode2007 2024-02-28 10:43:48 +08:00
parent 0433f5adae
commit 8444de9ad2

View file

@ -319,7 +319,7 @@ public class OnTransact extends javax.swing.JFrame {
// Window events
private void close_precheck(java.awt.event.WindowEvent evt) {
boolean CLOSING_STATE = receipt.clear;
if (!receipt.clear) {CLOSING_STATE = confirm_discard();};
if (!receipt.clear) {CLOSING_STATE = reset();};
if (CLOSING_STATE) {evt.getWindow().dispose();};
}
@ -330,8 +330,7 @@ public class OnTransact extends javax.swing.JFrame {
private boolean jToggleButton_DiscardActionPerformed(java.awt.event.ActionEvent evt) {
// When the discard button is clicked
boolean user_choice = confirm_discard();
if (user_choice) {init();};
boolean user_choice = reset();
jToggleButton_Discard.setSelected(false);
return (user_choice);
};
@ -384,13 +383,14 @@ public class OnTransact extends javax.swing.JFrame {
refresh_interface();
};
public static void reset() {
public static Boolean reset() {
/* Reset the transaction. */
Boolean DISCARD_STATE = (!transact.progress || confirm_discard());
if (DISCARD_STATE) {
init();
};
return (DISCARD_STATE);
};
private SpinnerNumberModel model_price = new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, .01);