~exprez135/cryptomator-libre

8198f66c1fb6e898d14cac7972304ab04d0d2fcf — Armin Schrenk 1 year, 6 months ago eb5aa4e
fixes #1208
M main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java => main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java +9 -1
@@ 29,6 29,7 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ResourceBundle;


@@ 123,6 124,9 @@ public class CreateNewVaultLocationController implements FxController {
		} catch (FileAlreadyExistsException e) {
			LOG.warn("Can not use already existing vault path {}", vaultPath.get());
			warningText.set(resourceBundle.getString("addvaultwizard.new.fileAlreadyExists"));
		} catch (NoSuchFileException e) {
			LOG.warn("At least one path component does not exist of path {}", vaultPath.get());
			warningText.set(resourceBundle.getString("addvaultwizard.new.locationDoesNotExist"));
		} catch (IOException e) {
			LOG.error("Failed to create and delete directory at chosen vault path.", e);
			errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene();


@@ 133,7 137,11 @@ public class CreateNewVaultLocationController implements FxController {
	public void chooseCustomVaultPath() {
		DirectoryChooser directoryChooser = new DirectoryChooser();
		directoryChooser.setTitle(resourceBundle.getString("addvaultwizard.new.directoryPickerTitle"));
		directoryChooser.setInitialDirectory(customVaultPath.toFile());
		if (Files.exists(customVaultPath)) {
			directoryChooser.setInitialDirectory(customVaultPath.toFile());
		} else {
			directoryChooser.setInitialDirectory(DEFAULT_CUSTOM_VAULT_PATH.toFile());
		}
		final File file = directoryChooser.showDialog(window);
		if (file != null) {
			customVaultPath = file.toPath().toAbsolutePath();

M main/ui/src/main/resources/i18n/strings.properties => main/ui/src/main/resources/i18n/strings.properties +1 -0
@@ 43,6 43,7 @@ addvaultwizard.new.directoryPickerLabel=Custom Location
addvaultwizard.new.directoryPickerButton=Choose…
addvaultwizard.new.directoryPickerTitle=Select Directory
addvaultwizard.new.fileAlreadyExists=Vault can not be created at this path because some object already exists.
addvaultwizard.new.locationDoesNotExist=Vault can not be created at this path because at least one path component does not exist.
addvaultwizard.new.invalidName=Invalid vault name. Please consider a regular directory name.
### Password
addvaultwizard.new.createVaultBtn=Create Vault