update discard check
This commit is contained in:
		
							parent
							
								
									0433f5adae
								
							
						
					
					
						commit
						8444de9ad2
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -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); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue