Jan-Peter Klein il y a 7 mois
Parent
commit
af667b10cf

+ 13 - 14
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);
 	}
 

+ 14 - 17
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

+ 11 - 13
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> vault, ObservableList<Vault> vaults, //
+	public VaultDetailUnknownErrorController(@MainWindow Stage mainWindow, //
+											 ObjectProperty<Vault> vault, //
+											 ObservableList<Vault> 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();
 	}
 }

+ 8 - 9
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

+ 15 - 16
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();
 		}
 	}
 

+ 12 - 10
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() {