From b915cf7ad917cbc696e291a3416292c7f388ab72 Mon Sep 17 00:00:00 2001 From: Jannik Date: Tue, 20 Feb 2018 21:22:10 +0100 Subject: [PATCH] removed last unnecessary reboot * needs more testing, especialy under Windows * test on a completly fresh setup --- src/main/java/com/cemu_UI/application/Main.java | 2 -- .../java/com/cemu_UI/application/MainWindowController.java | 7 ++++--- src/main/java/com/cemu_UI/controller/UpdateController.java | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/cemu_UI/application/Main.java b/src/main/java/com/cemu_UI/application/Main.java index 14eb6da..618ef02 100644 --- a/src/main/java/com/cemu_UI/application/Main.java +++ b/src/main/java/com/cemu_UI/application/Main.java @@ -142,8 +142,6 @@ public class Main extends Application { mainWindowController.setLastLocalSync(0); mainWindowController.setxPosHelper(0); mainWindowController.saveSettings(); - Runtime.getRuntime().exec("java -jar cemu_UI.jar"); //TODO check if this really is needed start again (preventing Bugs) - System.exit(0); //finishes itself } if (!pictureCache.exists()) { diff --git a/src/main/java/com/cemu_UI/application/MainWindowController.java b/src/main/java/com/cemu_UI/application/MainWindowController.java index e50cf16..b18723c 100644 --- a/src/main/java/com/cemu_UI/application/MainWindowController.java +++ b/src/main/java/com/cemu_UI/application/MainWindowController.java @@ -290,7 +290,7 @@ public class MainWindowController { private String selectedGameTitle; private String id; private String version = "0.3.0"; - private String buildNumber = "075"; + private String buildNumber = "077"; private String versionName = "Puzzle Plank Galaxy"; private int xPos = -200; private int yPos = 17; @@ -719,7 +719,7 @@ public class MainWindowController { try { Desktop.getDesktop().browse(new URI("https://github.com/Seil0/cemu_UI/issues/3")); } catch (IOException | URISyntaxException e) { - e.printStackTrace(); + LOGGER.error("An error ocoured while trying to open a Website.", e); } } }); @@ -1297,7 +1297,6 @@ public class MainWindowController { //remove all games from gamesAnchorPane and add them afterwards public void refreshUIData() { - System.out.println("refresh"); //remove all games form gamesAnchorPane gamesAnchorPane.getChildren().removeAll(gamesAnchorPane.getChildren()); @@ -1544,6 +1543,8 @@ public class MainWindowController { /**FIXME somehow the window width is set to 8, if we can find a way to get always the real window with *(at the beginning we have to use prefWidth after resizing Width) we can remove this + *This is caused by the time the game objects are generates, + *it's before the window is opened so it's size is > 10 */ if (mainAnchorPane.getWidth() < 10) { xPosHelperMax = (int) Math.floor((mainAnchorPane.getPrefWidth() - 36) / 217); diff --git a/src/main/java/com/cemu_UI/controller/UpdateController.java b/src/main/java/com/cemu_UI/controller/UpdateController.java index a7d69be..a68dd72 100644 --- a/src/main/java/com/cemu_UI/controller/UpdateController.java +++ b/src/main/java/com/cemu_UI/controller/UpdateController.java @@ -149,7 +149,7 @@ public class UpdateController implements Runnable { FileUtils.copyInputStreamToFile(pmis, new File("cemu_UI_update.jar")); // download update org.apache.commons.io.FileUtils.copyFile(new File("cemu_UI_update.jar"), new File("cemu_UI.jar")); org.apache.commons.io.FileUtils.deleteQuietly(new File("cemu_UI_update.jar")); // delete update - Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again + Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again TODO consider ProcessBuilder to execute System.exit(0); // finishes itself } catch (IOException e) { Platform.runLater(() -> {