diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 63edd95..11d085e 100755 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ 4.0.0 alebolo rabdomante - 1.2.1 + 1.2.2 https://github.com/molok/rabdomante/ diff --git a/pom.xml b/pom.xml index 449f1d5..80f9557 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ alebolo rabdomante - 1.2.2-SNAPSHOT + 1.2.2 https://github.com/molok/rabdomante/ diff --git a/src/main/java/alebolo/rabdomante/Msg.java b/src/main/java/alebolo/rabdomante/Msg.java index 9b65f6d..498b081 100755 --- a/src/main/java/alebolo/rabdomante/Msg.java +++ b/src/main/java/alebolo/rabdomante/Msg.java @@ -91,10 +91,8 @@ public static String solutionIncomplete() { public static String grams() { return m.getString("grams"); } public static String resultsheet_incomplete() { return m.getString("resultsheet_incomplete");} public static String resultsheet_searchok() { return m.getString("resultsheet_searchok");} - public static String resultsheet_updated_at() { return m.getString("resultsheet_updated_at"); - } - + public static String resultsheet_updated_at() { return m.getString("resultsheet_updated_at"); } public static String readLicense() { return m.getString("read_license"); } - public static String license() { return m.getString("license"); } + public static String fileLocked() { return m.getString("file_locked"); } } diff --git a/src/main/java/alebolo/rabdomante/gui/Gui.java b/src/main/java/alebolo/rabdomante/gui/Gui.java index 2bd398f..7137059 100755 --- a/src/main/java/alebolo/rabdomante/gui/Gui.java +++ b/src/main/java/alebolo/rabdomante/gui/Gui.java @@ -49,7 +49,7 @@ import static alebolo.rabdomante.xlsx.Utils.COLOR_USER_INPUT; public class Gui extends Application { - public static final String WEBSITE = "https://github.com/molok/rabdomante/"; + public static final String WEBSITE = "https://github.com/molok/rabdomante"; private final Logger log = LoggerFactory.getLogger(this.getClass()); private final App app = new App(); private TextField selectedFileTxt; @@ -319,7 +319,7 @@ private void calc(Button run) { run.setDisable(true); if (Utils.fileLocked(ioFile)) { - Alert alert = new Alert(Alert.AlertType.ERROR, "The file is still open, please close it"); + Alert alert = new Alert(Alert.AlertType.ERROR, Msg.fileLocked()); alert.setTitle("Problem"); alert.setHeaderText(null); alert.showAndWait(); @@ -332,7 +332,7 @@ private void calc(Button run) { long secondsTimeLimit = timeLimit.getValue() * 60; if (Utils.fileLocked(ioFile)) { - Alert alert = new Alert(Alert.AlertType.ERROR, "The file is still open, please close it"); + Alert alert = new Alert(Alert.AlertType.ERROR, Msg.fileLocked()); alert.setTitle("Problem"); alert.setHeaderText(null); alert.showAndWait(); diff --git a/src/main/java/alebolo/rabdomante/xlsx/Utils.java b/src/main/java/alebolo/rabdomante/xlsx/Utils.java index 239f233..77d6981 100755 --- a/src/main/java/alebolo/rabdomante/xlsx/Utils.java +++ b/src/main/java/alebolo/rabdomante/xlsx/Utils.java @@ -83,8 +83,7 @@ public static void close(Closeable... toClose) { public static boolean fileLocked(File file) { try { - file.renameTo(file); - return false; + return !file.renameTo(file); } catch (Exception e) { return true; } diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 24361b5..4fc5037 100755 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -74,3 +74,4 @@ resultsheet_searchok=Search completed in resultsheet_updated_at=Updated @ read_license=Read License license=License +file_locked=The file is still open, please close it diff --git a/src/main/resources/messages_it.properties b/src/main/resources/messages_it.properties index ba4f44d..f8a72b2 100755 --- a/src/main/resources/messages_it.properties +++ b/src/main/resources/messages_it.properties @@ -74,3 +74,4 @@ resultsheet_searchok=Ricerca completata con successo in resultsheet_updated_at=Aggiornato @ read_license=Leggi la Licenza license=Licenza +file_locked=Il file risulta ancora aperto, deve essere chiuso per essere elaborato