From a4ef082bc4386ac0c01b99060a017d44692c8e21 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 14 Mar 2019 11:12:25 +0100 Subject: [PATCH] fixes #854 --- .../org/cryptomator/ui/controllers/MainController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java index f4f498938..9e4512ab3 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java @@ -220,12 +220,12 @@ public class MainController implements ViewController { private void gracefulShutdown() { vaults.filtered(Vault.NOT_LOCKED).forEach(Vault::prepareForShutdown); if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { + mainWindow.show(); // to keep the application open ButtonType tryAgainButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.tryAgain")); ButtonType forceShutdownButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.forceShutdown")); Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog( localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"), forceShutdownButtonType, ButtonType.CANCEL, forceShutdownButtonType, tryAgainButtonType); - Optional choice = gracefulShutdownDialog.showAndWait(); choice.ifPresent(btnType -> { if (tryAgainButtonType.equals(btnType)) { @@ -233,7 +233,11 @@ public class MainController implements ViewController { } else if (forceShutdownButtonType.equals(btnType)) { Platform.runLater(Platform::exit); } else { - return; + if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { + showUnlockedView(vaults.get(0), false); //if there are still unlocked vaults, show one of them + } else { + showUnlockView(UnlockController.State.UNLOCKING); //otherwise show any vault + } } }); } else {