Просмотр исходного кода

Made mount point settings localizable
(and some fxml cleanup)
[ci skip]

Sebastian Stenzel 5 лет назад
Родитель
Сommit
b445f614fb

+ 1 - 1
main/ui/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java

@@ -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) {

+ 26 - 26
main/ui/src/main/resources/fxml/vault_options_mount.fxml

@@ -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>

+ 7 - 1
main/ui/src/main/resources/i18n/strings.properties

@@ -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
+