mirror of
https://github.com/SKCraft/Launcher.git
synced 2025-02-16 01:41:22 +01:00
Fix update manager not displaying self-update errors
This commit is contained in:
parent
8dfb0490e3
commit
60030695b3
@ -105,7 +105,7 @@ public final class Launcher {
|
||||
}
|
||||
});
|
||||
|
||||
updateManager.checkForUpdate();
|
||||
updateManager.checkForUpdate(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -401,8 +401,11 @@ public final class Launcher {
|
||||
/**
|
||||
* Show the launcher.
|
||||
*/
|
||||
public void showLauncherWindow() {
|
||||
mainWindowSupplier.get().setVisible(true);
|
||||
public Window showLauncherWindow() {
|
||||
Window window = mainWindowSupplier.get();
|
||||
window.setVisible(true);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +132,7 @@ public class LauncherFrame extends JFrame {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
loadInstances();
|
||||
launcher.getUpdateManager().checkForUpdate();
|
||||
launcher.getUpdateManager().checkForUpdate(LauncherFrame.this);
|
||||
webView.browse(launcher.getNewsURL(), false);
|
||||
}
|
||||
});
|
||||
@ -394,8 +394,8 @@ public class LauncherFrame extends JFrame {
|
||||
|
||||
@Override
|
||||
public void gameClosed() {
|
||||
launcher.showLauncherWindow();
|
||||
launcher.getUpdateManager().checkForUpdate();
|
||||
Window newLauncherWindow = launcher.showLauncherWindow();
|
||||
launcher.getUpdateManager().checkForUpdate(newLauncherWindow);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class UpdateManager {
|
||||
return pendingUpdate != null;
|
||||
}
|
||||
|
||||
public void checkForUpdate() {
|
||||
public void checkForUpdate(final Window window) {
|
||||
ListenableFuture<LatestVersionInfo> future = launcher.getExecutor().submit(new UpdateChecker(launcher));
|
||||
|
||||
Futures.addCallback(future, new FutureCallback<LatestVersionInfo>() {
|
||||
@ -63,9 +63,11 @@ public class UpdateManager {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
|
||||
// Error handler attached below.
|
||||
}
|
||||
}, SwingExecutor.INSTANCE);
|
||||
|
||||
SwingHelper.addErrorDialogCallback(window, future);
|
||||
}
|
||||
|
||||
public void performUpdate(final Window window) {
|
||||
|
Loading…
Reference in New Issue
Block a user