mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 12:11:28 +00:00
Specified the messages of failed UnlockWorkflows
Specified the messages of failed UnlockWorkflows by adding the ability to distinguish between the different MountPointRequirements Translation for all languages but German and Englisch required
This commit is contained in:
@@ -319,6 +319,10 @@ public class Vault {
|
||||
return vaultSettings.getId();
|
||||
}
|
||||
|
||||
public MountPointRequirement getMountPointRequirement() {
|
||||
return volume.getMountPointRequirement();
|
||||
}
|
||||
|
||||
// ******************************************************************************
|
||||
// Hashcode / Equals
|
||||
// *******************************************************************************/
|
||||
|
||||
@@ -4,6 +4,7 @@ import dagger.Lazy;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import org.cryptomator.common.vaults.MountPointRequirement;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
@@ -36,4 +37,11 @@ public class UnlockInvalidMountPointController implements FxController {
|
||||
return vault.getVaultSettings().getCustomMountPath().orElse("AUTO");
|
||||
}
|
||||
|
||||
public boolean getMustExist() {
|
||||
MountPointRequirement requirement = vault.getMountPointRequirement();
|
||||
assert requirement != MountPointRequirement.NONE; //An invalid MountPoint with no required MountPoint doesn't seem sensible
|
||||
|
||||
return requirement == MountPointRequirement.EMPTY_MOUNT_POINT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import javafx.concurrent.Task;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.Window;
|
||||
import org.cryptomator.common.vaults.MountPointRequirement;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.common.vaults.VaultState;
|
||||
import org.cryptomator.common.vaults.Volume;
|
||||
@@ -156,7 +157,15 @@ public class UnlockWorkflow extends Task<Boolean> {
|
||||
}
|
||||
|
||||
private void handleInvalidMountPoint(FileSystemException e) {
|
||||
LOG.error("Unlock failed. Mount point not an empty directory: {}", e.getMessage());
|
||||
MountPointRequirement requirement = vault.getMountPointRequirement();
|
||||
assert requirement != MountPointRequirement.NONE; //An invalid MountPoint with no required MountPoint doesn't seem sensible
|
||||
|
||||
if (requirement == MountPointRequirement.EMPTY_MOUNT_POINT) {
|
||||
LOG.error("Unlock failed. Mount point not an empty directory or doesn't exist: {}", e.getMessage());
|
||||
} else {
|
||||
LOG.error("Unlock failed. Mount point/folder already exists or parent folder doesn't exist: {}", e.getMessage());
|
||||
}
|
||||
|
||||
Platform.runLater(() -> {
|
||||
window.setScene(invalidMountPointScene.get());
|
||||
});
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="EXCLAMATION" glyphSize="24"/>
|
||||
</StackPane>
|
||||
<VBox spacing="6" HBox.hgrow="ALWAYS">
|
||||
<FormattedLabel format="%unlock.error.invalidMountPoint" arg1="${controller.mountPoint}" wrapText="true"/>
|
||||
<FormattedLabel visible="${controller.mustExist}" managed="${controller.mustExist}" format="%unlock.error.invalidMountPoint.notExisting" arg1="${controller.mountPoint}" wrapText="true"/>
|
||||
<FormattedLabel visible="${!controller.mustExist}" managed="${!controller.mustExist}" format="%unlock.error.invalidMountPoint.existing" arg1="${controller.mountPoint}" wrapText="true"/>
|
||||
</VBox>
|
||||
</HBox>
|
||||
|
||||
|
||||
@@ -100,7 +100,8 @@ unlock.success.message=Unlocked "%s" successfully! Your vault is now accessible.
|
||||
unlock.success.rememberChoice=Remember choice, don't show this again
|
||||
unlock.success.revealBtn=Reveal Vault
|
||||
## Invalid Mount Point
|
||||
unlock.error.invalidMountPoint=Mount point is not an empty directory: %s
|
||||
unlock.error.invalidMountPoint.notExisting=Mount point is not an empty directory or doesn't exist: %s
|
||||
unlock.error.invalidMountPoint.existing=Mount point/folder already exists or parent folder doesn't exist: %s
|
||||
|
||||
# Migration
|
||||
migration.title=Upgrade Vault
|
||||
|
||||
@@ -99,7 +99,8 @@ unlock.success.message=„%s“ erfolgreich entsperrt! Nun kannst du auf deinen
|
||||
unlock.success.rememberChoice=Auswahl speichern und nicht mehr anzeigen
|
||||
unlock.success.revealBtn=Tresor anzeigen
|
||||
## Invalid Mount Point
|
||||
unlock.error.invalidMountPoint=Einhängepunkt ist kein leeres Verzeichnis: %s
|
||||
unlock.error.invalidMountPoint.notExisting=Einhängepunkt ist kein leeres Verzeichnis oder existiert nicht: %s
|
||||
unlock.error.invalidMountPoint.existing=Einhängepunkt/-ordner existiert bereits oder das darüber liegende Verzeichnis existiert nicht: %s
|
||||
|
||||
# Migration
|
||||
migration.title=Tresor aktualisieren
|
||||
|
||||
Reference in New Issue
Block a user