diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java index 2e8cbb026..a9b535e21 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java @@ -149,20 +149,19 @@ public class FxApplicationWindows { public void showDokanySupportEndWindow() { CompletableFuture.runAsync(() -> { - customDialog.setOwner(mainWindow.get().window()) - .setTitleKey("dokanySupportEnd.title") - .setMessageKey("dokanySupportEnd.message") - .setDescriptionKey("dokanySupportEnd.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("generic.button.close") - .setCancelButtonKey("dokanySupportEnd.preferencesBtn") - .setOkAction(Stage::close) // - .setCancelAction(v -> { - showPreferencesWindow(SelectedPreferencesTab.VOLUME); - v.close(); - }) // - .build() - .showAndWait(); + customDialog.setOwner(mainWindow.get().window()) // + .setTitleKey("dokanySupportEnd.title") // + .setMessageKey("dokanySupportEnd.message") // + .setDescriptionKey("dokanySupportEnd.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("generic.button.close") // + .setCancelButtonKey("dokanySupportEnd.preferencesBtn") // + .setOkAction(Stage::close) // + .setCancelAction(v -> { + showPreferencesWindow(SelectedPreferencesTab.VOLUME); + v.close(); + }) // + .build().showAndWait(); }, Platform::runLater); } diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java index 35ab02706..122db7476 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java @@ -51,26 +51,23 @@ public class VaultDetailMissingVaultController implements FxController { @FXML void didClickRemoveVault() { - customDialog - .setOwner(window) - .setTitleKey("removeVault.title", vault.get().getDisplayName()) - .setMessageKey("removeVault.message") - .setDescriptionKey("removeVault.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("removeVault.confirmBtn") - .setCancelButtonKey("generic.button.cancel") - .setOkAction(v -> { - LOG.debug("Removing vault {}.", vault.get().getDisplayName()); - vaults.remove(vault.get()); - v.close(); - }) // - .setCancelAction(Stage::close) // - .build() - .showAndWait(); + customDialog.setOwner(window) // + .setTitleKey("removeVault.title", vault.get().getDisplayName()) // + .setMessageKey("removeVault.message") // + .setDescriptionKey("removeVault.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("removeVault.confirmBtn") // + .setCancelButtonKey("generic.button.cancel") // + .setOkAction(v -> { + LOG.debug("Removing vault {}.", vault.get().getDisplayName()); + vaults.remove(vault.get()); + v.close(); + }) // + .setCancelAction(Stage::close) // + .build().showAndWait(); ; } - @FXML void changeLocation() { // copied from ChooseExistingVaultController class diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnknownErrorController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnknownErrorController.java index 272016c09..e45696dfa 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnknownErrorController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnknownErrorController.java @@ -29,8 +29,9 @@ public class VaultDetailUnknownErrorController implements FxController { private final CustomDialog.Builder customDialog; @Inject - public VaultDetailUnknownErrorController(@MainWindow Stage mainWindow, - ObjectProperty vault, ObservableList vaults, // + public VaultDetailUnknownErrorController(@MainWindow Stage mainWindow, // + ObjectProperty vault, // + ObservableList vaults, // FxApplicationWindows appWindows, // @Named("errorWindow") Stage errorWindow, // CustomDialog.Builder customDialog) { @@ -54,22 +55,19 @@ public class VaultDetailUnknownErrorController implements FxController { @FXML void didClickRemoveVault() { - customDialog - .setOwner(mainWindow) - .setTitleKey("removeVault.title", vault.get().getDisplayName()) - .setMessageKey("removeVault.message") - .setDescriptionKey("removeVault.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("removeVault.confirmBtn") - .setCancelButtonKey("generic.button.cancel") + customDialog.setOwner(mainWindow) // + .setTitleKey("removeVault.title", vault.get().getDisplayName()) // + .setMessageKey("removeVault.message") // + .setDescriptionKey("removeVault.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("removeVault.confirmBtn") // + .setCancelButtonKey("generic.button.cancel") // .setOkAction(v -> { LOG.debug("Removing vault {}.", vault.get().getDisplayName()); vaults.remove(vault.get()); v.close(); }) // .setCancelAction(Stage::close) // - .build() - .showAndWait(); - + .build().showAndWait(); } } diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java index c148ed8a5..28c5eaf66 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java @@ -82,20 +82,19 @@ public class VaultListContextMenuController implements FxController { @FXML public void didClickRemoveVault() { var vault = Objects.requireNonNull(selectedVault.get()); - customDialog.setOwner(mainWindow) - .setTitleKey("removeVault.title", vault.getDisplayName()) - .setMessageKey("removeVault.message") - .setDescriptionKey("removeVault.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("removeVault.confirmBtn") - .setCancelButtonKey("generic.button.cancel") + customDialog.setOwner(mainWindow) // + .setTitleKey("removeVault.title", vault.getDisplayName()) // + .setMessageKey("removeVault.message") // + .setDescriptionKey("removeVault.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("removeVault.confirmBtn") // + .setCancelButtonKey("generic.button.cancel") // .setOkAction(v -> { LOG.debug("Removing vault {}.", vault.getDisplayName()); vaults.remove(vault); v.close(); }) // - .build() - .showAndWait(); + .build().showAndWait(); } @FXML diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index db41c829f..e17893ced 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -91,7 +91,7 @@ public class VaultListController implements FxController { VaultListManager vaultListManager, // ResourceBundle resourceBundle, // FxApplicationWindows appWindows, // - Settings settings, + Settings settings, // CustomDialog.Builder customDialog) { this.mainWindow = mainWindow; this.vaults = vaults; @@ -210,21 +210,20 @@ public class VaultListController implements FxController { private void pressedShortcutToRemoveVault() { final var vault = selectedVault.get(); if (vault != null && EnumSet.of(LOCKED, MISSING, ERROR, NEEDS_MIGRATION).contains(vault.getState())) { - customDialog.setOwner(mainWindow) - .setTitleKey("removeVault.title", vault.getDisplayName()) - .setMessageKey("removeVault.message") - .setDescriptionKey("removeVault.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("removeVault.confirmBtn") - .setCancelButtonKey("generic.button.cancel") - .setOkAction(v -> { - LOG.debug("Removing vault {}.", vault.getDisplayName()); - vaults.remove(vault); - v.close(); - }) // - .setCancelAction(Stage::close) // - .build() - .showAndWait(); + customDialog.setOwner(mainWindow) // + .setTitleKey("removeVault.title", vault.getDisplayName()) // + .setMessageKey("removeVault.message") // + .setDescriptionKey("removeVault.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("removeVault.confirmBtn") // + .setCancelButtonKey("generic.button.cancel") // + .setOkAction(v -> { + LOG.debug("Removing vault {}.", vault.getDisplayName()); + vaults.remove(vault); + v.close(); + }) // + .setCancelAction(Stage::close) // + .build().showAndWait(); } } diff --git a/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java b/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java index 95c8e6d0f..722816e27 100644 --- a/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java +++ b/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java @@ -33,7 +33,11 @@ public class SupporterCertificateController implements FxController { private TextArea supporterCertificateField; @Inject - SupporterCertificateController(Application application, @PreferencesWindow Stage window, LicenseHolder licenseHolder, Settings settings, CustomDialog.Builder customDialog) { + SupporterCertificateController(Application application, // + @PreferencesWindow Stage window, // + LicenseHolder licenseHolder, // + Settings settings, // + CustomDialog.Builder customDialog) { this.application = application; this.window = window; this.licenseHolder = licenseHolder; @@ -85,21 +89,19 @@ public class SupporterCertificateController implements FxController { @FXML void didClickRemoveCert() { - customDialog.setOwner(window) - .setTitleKey("removeCert.title") - .setMessageKey("removeCert.message") - .setDescriptionKey("removeCert.description") - .setIcon(FontAwesome5Icon.QUESTION) - .setOkButtonKey("removeCert.confirmBtn") + customDialog.setOwner(window) // + .setTitleKey("removeCert.title") // + .setMessageKey("removeCert.message") // + .setDescriptionKey("removeCert.description") // + .setIcon(FontAwesome5Icon.QUESTION) // + .setOkButtonKey("removeCert.confirmBtn") // .setCancelButtonKey("generic.button.cancel") .setOkAction(v -> { settings.licenseKey.set(null); v.close(); }) // .setCancelAction(Stage::close) // - .build() - .showAndWait(); - + .build().showAndWait(); } public LicenseHolder getLicenseHolder() {