mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 10:41:26 +00:00
use defaults.vault.vaultName as fallback displayName
This commit is contained in:
@@ -10,10 +10,10 @@ import org.cryptomator.integrations.mount.MountService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import static org.cryptomator.common.vaults.VaultState.Value.LOCKED;
|
||||
|
||||
@@ -23,13 +23,16 @@ public final class VaultPreparator {
|
||||
|
||||
private VaultPreparator() {}
|
||||
|
||||
public static Vault prepareVault(Path selectedDirectory, VaultComponent.Factory vaultComponentFactory, List<MountService> mountServices) {
|
||||
public static Vault prepareVault(Path selectedDirectory, //
|
||||
VaultComponent.Factory vaultComponentFactory, //
|
||||
List<MountService> mountServices, //
|
||||
ResourceBundle resourceBundle) {
|
||||
VaultSettings vaultSettings = VaultSettings.withRandomId();
|
||||
vaultSettings.path.set(selectedDirectory);
|
||||
if (selectedDirectory.getFileName() != null) {
|
||||
vaultSettings.displayName.set(selectedDirectory.getFileName().toString());
|
||||
} else {
|
||||
vaultSettings.displayName.set("defaultVaultName");
|
||||
vaultSettings.displayName.set(resourceBundle.getString("defaults.vault.vaultName"));
|
||||
}
|
||||
|
||||
var wrapper = new VaultConfigCache(vaultSettings);
|
||||
|
||||
@@ -272,7 +272,7 @@ public class VaultListController implements FxController {
|
||||
return;
|
||||
}
|
||||
|
||||
Vault preparedVault = VaultPreparator.prepareVault(path, vaultComponentFactory, mountServices);
|
||||
Vault preparedVault = VaultPreparator.prepareVault(path, vaultComponentFactory, mountServices, resourceBundle);
|
||||
VaultListManager.redetermineVaultState(preparedVault);
|
||||
|
||||
switch (preparedVault.getState()) {
|
||||
|
||||
Reference in New Issue
Block a user