diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 8f61c53d84bafcf55842e19db9e577c2a4539af8..5831f9a0f2571a35e9445b46bd02c32611ef5715 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.MalformedURLException; -import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -339,25 +338,23 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pl if (newProfile.getProfileSettings().isAutoUpdate()) { Worker.runLater(() -> { - try { - UpdateRegistery.lookupUpdates(newProfile.getProfileSettings().getUpdateChannel()); - if (!UpdateRegistery.getAvailableUpdates().isEmpty()) { - Platform.runLater(() -> + UpdateRegistery.lookupUpdates(newProfile.getProfileSettings().getUpdateChannel()); + if (!UpdateRegistery.getAvailableUpdates().isEmpty()) { + Platform.runLater(() -> + { + Alert alert = new Alert(AlertType.CONFIRMATION); + alert.setHeaderText(Localization.getString(Strings.UI_Dialog_AutoUpdate_Header)); + alert.setContentText(Localization.getString(Strings.UI_Dialog_AutoUpdate_Content)); + alert.showAndWait().filter(item -> item == ButtonType.OK).ifPresent(result -> { - Alert alert = new Alert(AlertType.CONFIRMATION); - alert.setHeaderText(Localization.getString(Strings.UI_Dialog_AutoUpdate_Header)); - alert.setContentText(Localization.getString(Strings.UI_Dialog_AutoUpdate_Content)); - alert.showAndWait().filter(item -> item == ButtonType.OK).ifPresent(result -> - { - try { - Updates.startUpdate(); - } catch (IOException e) { - e.printStackTrace(); - } - }); + try { + Updates.startUpdate(); + } catch (IOException e) { + e.printStackTrace(); + } }); - } - } catch (IOException | URISyntaxException e) {} + }); + } }); } } diff --git a/PlayWall/src/de/tobias/playpad/Strings.java b/PlayWall/src/de/tobias/playpad/Strings.java index 6a84f43dfdc50836ddcb863666ad3f87f4b4dff7..57939d09a2c2bce4bdf1d6224442c71a52bc7070 100644 --- a/PlayWall/src/de/tobias/playpad/Strings.java +++ b/PlayWall/src/de/tobias/playpad/Strings.java @@ -197,7 +197,7 @@ public class Strings { // Update Channel - Basename public static final String Update_Channel_BaseName = "UpdateChannel."; - + // Error - Layout public static final String Error_Layout_Load = "Error.Layout.Load"; @@ -206,7 +206,7 @@ public class Strings { public static final String UI_Window_Settings_Updates_CurrentVersion = "UI.Window.Settings.Updates.CurrentVersion"; // Error - Update - Downlaod - public static final String Error_Update_Download = "Error.Update.Download"; + @Deprecated public static final String Error_Update_Download = "Error.Update.Download"; // Layout public static final String Layout_Modern_Name = "Layout.Modern.Name"; @@ -219,7 +219,7 @@ public class Strings { // TriggerPoint - Enum public static final String TriggerPoint_BaseName = "TriggerPoint."; - + // Drag and Drop Mode public static final String DnDMode_Move = "DnDMode.Move"; public static final String DnDMode_Replace = "DnDMode.Replace"; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/UpdateTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/UpdateTabViewController.java index 0363dcfcea5d37f56a1ed49a9e762c8ad82a34ee..0bf463e78c590218e2303fee471d4475a84323ca 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/UpdateTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/UpdateTabViewController.java @@ -1,7 +1,6 @@ package de.tobias.playpad.viewcontroller.option; import java.io.IOException; -import java.net.URISyntaxException; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.Strings; @@ -99,12 +98,7 @@ public class UpdateTabViewController extends SettingsTabViewController { Worker.runLater(() -> { // Search for updates - try { - UpdateRegistery.lookupUpdates(profile.getProfileSettings().getUpdateChannel()); - } catch (IOException | URISyntaxException e) { - e.printStackTrace(); - showErrorMessage(Localization.getString(Strings.Error_Update_Download, e.getLocalizedMessage())); - } + UpdateRegistery.lookupUpdates(profile.getProfileSettings().getUpdateChannel()); Platform.runLater(() -> { diff --git a/PlayWallCore/src/de/tobias/playpad/update/UpdateRegistery.java b/PlayWallCore/src/de/tobias/playpad/update/UpdateRegistery.java index 59a5681949c7f7fa507ed12726915c63ed406d3c..9b2274c4c31ced8afdd4342024a88c6ea83d5083 100644 --- a/PlayWallCore/src/de/tobias/playpad/update/UpdateRegistery.java +++ b/PlayWallCore/src/de/tobias/playpad/update/UpdateRegistery.java @@ -25,12 +25,16 @@ public class UpdateRegistery { return availableUpdates; } - public static List<Updatable> lookupUpdates(UpdateChannel channel) throws IOException, URISyntaxException { + public static List<Updatable> lookupUpdates(UpdateChannel channel) { availableUpdates.clear(); for (Updatable updatable : UpdateRegistery.updatables) { - updatable.loadInformation(channel); - if (updatable.isUpdateAvailable()) { - availableUpdates.add(updatable); + try { + updatable.loadInformation(channel); + if (updatable.isUpdateAvailable()) { + availableUpdates.add(updatable); + } + } catch (IOException | URISyntaxException e) { + } } return availableUpdates;