diff options
Diffstat (limited to 'SimpleEula.java')
| -rw-r--r-- | SimpleEula.java | 36 | 
1 files changed, 18 insertions, 18 deletions
| diff --git a/SimpleEula.java b/SimpleEula.java index 65e4266..5f2d7e5 100644 --- a/SimpleEula.java +++ b/SimpleEula.java @@ -1,23 +1,23 @@ -/*   +/*   * SimpleEula.java - displays eula agreement on program start - *  + *   * Copyright (c) 2025 Stefano Marchetti - *  + *   * This file is part of Jedecma - breast ultrasound examinations archiving software - *  + *   * Jedecma is free software: you can redistribute it and/or modify   * it under the terms of the GNU General Public License as published by   * the Free Software Foundation, either version 3 of the License, or   * (at your option) any later version. - *  + *   * Jedecma is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * GNU General Public License for more details. - *  + *   * You should have received a copy of the GNU General Public License   * along with Jedecma.  If not, see <http://www.gnu.org/licenses/>. - *   + *  */  package jedecma; @@ -33,7 +33,7 @@ import javax.swing.JOptionPane;  public class SimpleEula {  	private String EULA_PREF = "eula_";  	private String key; -	 +  	SimpleEula() {  		super();  		String language = Jedecma.param.getProperty("language"); @@ -44,12 +44,12 @@ public class SimpleEula {  		int i = s.lastIndexOf('.');  		key = EULA_PREF + s.substring(0, i) + "_" + language;  	} -	 +  	public void show() { -	    if (hasBeenShown() == false) { +	    if (!hasBeenShown()) {  	    	String title = "Jedecma " + Jedecma.progVers + " License Agreement"; -	    	String msg = loadEula(key);	    	 -	    	 +	    	String msg = loadEula(key); +  	    	if (Uti1.txtYN(msg, title, JOptionPane.INFORMATION_MESSAGE, null) == 1) {  	    		// eula accettata  	    		System.out.println("eula accepted"); @@ -64,7 +64,7 @@ public class SimpleEula {  					System.out.println("unable to write parameter file "  							+ parmfile);  				} -	    		 +  	    	} else {  	    		// eula rifiutata  	    		System.out.println("eula refused"); @@ -72,16 +72,16 @@ public class SimpleEula {  					      + Jedecma.progVers + " " + Jedecma.progBuild + "<br>"  					      + Jedecma.localMessagesBundle.getString("EULA_REFUSED")  					      + "<br>" -					      +"</center></body></html>",  +					      +"</center></body></html>",  						false);/**  	    		 * @author sfm  	    		 *  	    		 */  				Jedecma.endProc(); -	    	}  +	    	}  	    }  	} -	 +  	private String loadEula(String key) {  		String text = "";  		final String inputFile = key + ".txt"; @@ -101,12 +101,12 @@ public class SimpleEula {  				      + Jedecma.localMessagesBundle.getString("EULA_NOTFOUND")  				      + "<br>"  				      + inputFile -				      +"</center></body></html>",  +				      +"</center></body></html>",  					true);  		}  		return text;  	} -	 +  	  public boolean hasBeenShown() {  		  String eulaShown = Jedecma.param.getProperty("eulashown");  		  if ( eulaShown.toUpperCase().equals(key.toUpperCase())) { | 
