mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
confirm and close application before launching installer
This commit is contained in:
parent
78b0c63f87
commit
6f4d37d3ff
1 changed files with 9 additions and 1 deletions
|
@ -99,8 +99,16 @@ public class DownloadVerifierDialog extends Dialog<ButtonBar.ButtonData> {
|
||||||
releaseVerifiedField.getInputs().add(releaseLink);
|
releaseVerifiedField.getInputs().add(releaseLink);
|
||||||
releaseLink.setOnAction(event -> {
|
releaseLink.setOnAction(event -> {
|
||||||
if(release.get() != null && release.get().exists()) {
|
if(release.get() != null && release.get().exists()) {
|
||||||
|
if(release.get().getName().toLowerCase(Locale.ROOT).startsWith("sparrow")) {
|
||||||
|
Optional<ButtonType> optType = AppServices.showAlertDialog("Close Sparrow?", "Close Sparrow before installing?", Alert.AlertType.CONFIRMATION, ButtonType.NO, ButtonType.YES);
|
||||||
|
if(optType.isPresent() && optType.get() == ButtonType.YES) {
|
||||||
|
javafx.application.Platform.exit();
|
||||||
AppServices.get().getApplication().getHostServices().showDocument("file://" + release.get().getAbsolutePath());
|
AppServices.get().getApplication().getHostServices().showDocument("file://" + release.get().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
AppServices.get().getApplication().getHostServices().showDocument("file://" + release.get().getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
resultsFieldset.getChildren().addAll(signedByField, hashMatchedField, releaseVerifiedField);
|
resultsFieldset.getChildren().addAll(signedByField, hashMatchedField, releaseVerifiedField);
|
||||||
|
|
Loading…
Reference in a new issue