Skip to content

Commit a4ce071

Browse files
committed
Improve file picker guidance for iCloud Drive and Other File Provider
1 parent caffb40 commit a4ce071

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

Cryptomator/AddVault/CreateNewVault/LocalVault/CreateNewLocalVaultViewModel.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ class CreateNewLocalVaultViewModel: LocalFileSystemAuthenticationViewModel, Loca
1616

1717
init(vaultName: String, selectedLocalFileSystemType: LocalFileSystemType, accountManager: CloudProviderAccountManager = CloudProviderAccountDBManager.shared) {
1818
let documentPickerButtonText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.button")
19-
let headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.header")
19+
let headerText: String
20+
switch selectedLocalFileSystemType {
21+
case .iCloudDrive:
22+
headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.iCloudDrive.header")
23+
case .custom:
24+
headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.otherFileProvider.header")
25+
}
2026
self.vaultName = vaultName
2127
super.init(documentPickerButtonText: documentPickerButtonText, headerText: headerText, selectedLocalFileSystemType: selectedLocalFileSystemType, validationLogic: CreateNewLocalVaultValidationLogic(vaultName: vaultName), accountManager: accountManager)
2228
}

Cryptomator/AddVault/OpenExistingVault/LocalVault/OpenExistingLocalVaultViewModel.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ class OpenExistingLocalVaultViewModel: LocalFileSystemAuthenticationViewModel, L
1515
private let validator: OpenExistingLocalVaultValidationLogic
1616
init(selectedLocalFileSystemType: LocalFileSystemType, accountManager: CloudProviderAccountManager = CloudProviderAccountDBManager.shared) {
1717
let documentPickerButtonText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.button")
18-
let headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.header")
18+
let headerText: String
19+
switch selectedLocalFileSystemType {
20+
case .iCloudDrive:
21+
headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.iCloudDrive.header")
22+
case .custom:
23+
headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.otherFileProvider.header")
24+
}
1925
self.validator = OpenExistingLocalVaultValidationLogic()
2026
super.init(documentPickerButtonText: documentPickerButtonText, headerText: headerText, selectedLocalFileSystemType: selectedLocalFileSystemType, validationLogic: validator, accountManager: accountManager)
2127
}

SharedResources/en.lproj/Localizable.strings

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@
145145
"keepUnlockedDuration.auto.shortDisplayName" = "Auto";
146146
"keepUnlockedDuration.indefinite" = "Indefinite";
147147

148-
"localFileSystemAuthentication.createNewVault.header" = "In the next screen, choose the storage location for your new vault.";
148+
"localFileSystemAuthentication.createNewVault.iCloudDrive.header" = "In the next screen, navigate to iCloud Drive, select a storage location, then tap Open.";
149+
"localFileSystemAuthentication.createNewVault.otherFileProvider.header" = "In the next screen, navigate to your storage location, select it, then tap Open.";
149150
"localFileSystemAuthentication.createNewVault.button" = "Select Storage Location";
150151
"localFileSystemAuthentication.createNewVault.error.detectedExistingVault" = "A vault already exists at this location. Please try again with a different storage location.";
151-
"localFileSystemAuthentication.openExistingVault.header" = "In the next screen, choose the folder of your existing vault.";
152+
"localFileSystemAuthentication.openExistingVault.iCloudDrive.header" = "In the next screen, navigate to iCloud Drive, select your vault folder, then tap Open.";
153+
"localFileSystemAuthentication.openExistingVault.otherFileProvider.header" = "In the next screen, navigate to your vault folder, select it, then tap Open.";
152154
"localFileSystemAuthentication.openExistingVault.button" = "Select Vault Folder";
153155
"localFileSystemAuthentication.openExistingVault.error.noVaultFound" = "The selected folder is not a vault. Please try again with a different folder.";
154156
"localFileSystemAuthentication.info.footer" = "File providers that are grayed out don't support \"picking folders\". This is not a limitation of Cryptomator.";

0 commit comments

Comments
 (0)