Made mount point settings localizable

(and some fxml cleanup)
[ci skip]
This commit is contained in:
Sebastian Stenzel
2019-11-19 21:39:00 +01:00
parent c6fc1d93a0
commit b445f614fb
3 changed files with 34 additions and 28 deletions

View File

@@ -116,7 +116,7 @@ public class MountOptionsController implements FxController {
@FXML
private void chooseCustomMountPoint() {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle(resourceBundle.getString("vaultOptions.mount.winDirChooser"));
directoryChooser.setTitle(resourceBundle.getString("vaultOptions.mount.mountPoint.directoryPickerTitle"));
try {
directoryChooser.setInitialDirectory(Path.of(System.getProperty("user.home")).toFile());
} catch (Exception e) {

View File

@@ -10,7 +10,6 @@
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<?import org.cryptomator.ui.controls.AlphanumericTextField?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<VBox xmlns="http://javafx.com/javafx"
@@ -32,35 +31,36 @@
<CheckBox fx:id="readOnlyCheckbox" text="%vaultOptions.mount.readonly"/>
<CheckBox fx:id="customMountFlagsCheckbox" text="%vaultOptions.mount.customMountFlags" onAction="#toggleUseCustomMountFlags"/>
<HBox>
<padding>
<Insets left="25"/>
</padding>
<children>
<TextField fx:id="mountFlags" HBox.hgrow="ALWAYS" maxWidth="Infinity"/>
</children>
</HBox>
<Text text="TODO Mount Point"/>
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointAuto" text="TODO Automatically pick a suitable location"/>
<TextField fx:id="mountFlags" HBox.hgrow="ALWAYS" maxWidth="Infinity">
<VBox.margin>
<Insets left="24"/>
</VBox.margin>
</TextField>
<Label text="%vaultOptions.mount.mountPoint">
<VBox.margin>
<Insets top="9"/>
</VBox.margin>
</Label>
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointAuto" text="%vaultOptions.mount.mountPoint.auto"/>
<HBox spacing="6" visible="${controller.osIsWindows}" managed="${controller.osIsWindows}">
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointWinDriveLetter" text="TODO Choose specific drive letter"/>
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointWinDriveLetter" text="%vaultOptions.mount.mountPoint.driveLetter"/>
<ChoiceBox fx:id="driveLetterSelection" disable="${!mountPointWinDriveLetter.selected}"/>
</HBox>
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointCustomDir" text="TODO Choose empty directory"/>
<HBox visible="${mountPointCustomDir.selected}">
<padding>
<Insets left="24"/>
</padding>
<children>
<TextField text="${controller.customMountPath}" HBox.hgrow="ALWAYS" maxWidth="Infinity" disable="true"/>
<Button text="TODO change" onAction="#chooseCustomMountPoint" contentDisplay="LEFT">
<graphic>
<FontAwesome5IconView glyph="FOLDER_OPEN" glyphSize="15"/>
</graphic>
</Button>
</children>
<HBox spacing="6" alignment="CENTER_LEFT">
<RadioButton toggleGroup="${mountPoint}" fx:id="mountPointCustomDir" text="%vaultOptions.mount.mountPoint.custom"/>
<Button text="%vaultOptions.mount.mountPoint.directoryPickerButton" onAction="#chooseCustomMountPoint" contentDisplay="LEFT" disable="${!mountPointCustomDir.selected}">
<graphic>
<FontAwesome5IconView glyph="FOLDER_OPEN" glyphSize="15"/>
</graphic>
</Button>
</HBox>
<TextField text="${controller.customMountPath}" visible="${mountPointCustomDir.selected}" maxWidth="Infinity" disable="true">
<VBox.margin>
<Insets left="24"/>
</VBox.margin>
</TextField>
</children>
</VBox>

View File

@@ -171,7 +171,12 @@ vaultOptions.mount.readonly=Read-Only
vaultOptions.mount.driveName=Drive Name
vaultOptions.mount.customMountFlags=Custom Mount Flags
vaultOptions.mount.winDriveLetterOccupied=occupied
vaultOptions.mount.winDirChooser=Pick an empty directory
vaultOptions.mount.mountPoint=Mount Point
vaultOptions.mount.mountPoint.auto=Automatically pick a suitable location
vaultOptions.mount.mountPoint.driveLetter=Use assigned drive letter
vaultOptions.mount.mountPoint.custom=Custom path
vaultOptions.mount.mountPoint.directoryPickerButton=Choose…
vaultOptions.mount.mountPoint.directoryPickerTitle=Pick an empty directory
# Recovery Key
recoveryKey.title=Recovery Key
@@ -188,3 +193,4 @@ passwordStrength.messageLabel.4=Very strong
# Quit
quit.prompt=Quit application? There are unlocked vaults.
quit.lockAndQuit=Lock and Quit