Jelajahi Sumber

pr mentioned changes implemented

Jan-Peter Klein 1 tahun lalu
induk
melakukan
09b638eafa

+ 13 - 12
src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultExpertSettingsController.java

@@ -17,7 +17,6 @@ import javafx.beans.property.StringProperty;
 import javafx.fxml.FXML;
 import javafx.scene.Scene;
 import javafx.scene.control.CheckBox;
-import javafx.scene.control.Label;
 import javafx.stage.Stage;
 import java.nio.file.Path;
 
@@ -26,21 +25,20 @@ public class CreateNewVaultExpertSettingsController implements FxController {
 
 	public static final int DEFAULT_SHORTENING_THRESHOLD = 220;
 	public static final int MIN_SHORTENING_THRESHOLD = 36;
-	private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/security/architecture/#name-shortening";
+	private static final String DOCS_NAME_SHORTENING_URL = "https://docs.cryptomator.org/en/1.7/security/architecture/#name-shortening";
 	private final Stage window;
+	private final Lazy<Application> application;
 	private final Lazy<Scene> chooseLocationScene;
 	private final Lazy<Scene> choosePasswordScene;
-	private IntegerProperty shorteningThreshold;
-	public NumericTextField shorteningThresholdTextField;
-	private final BooleanBinding validShorteningThreshold;
-	private final Lazy<Application> application;
 	private final StringProperty vaultNameProperty;
 	private final ObjectProperty<Path> vaultPathProperty;
+	private final IntegerProperty shorteningThreshold;
 
-	public CheckBox expertSettingsCheckBox;
-	public Label vaultNameLabel;
-	public Label vaultLocationLabel;
+	private final BooleanBinding validShorteningThreshold;
 
+	//FXML
+	public CheckBox expertSettingsCheckBox;
+	public NumericTextField shorteningThresholdTextField;
 
 	@Inject
 	CreateNewVaultExpertSettingsController(@AddVaultWizardWindow Stage window, //
@@ -75,7 +73,7 @@ public class CreateNewVaultExpertSettingsController implements FxController {
 	@FXML
 	public void toggleUseExpertSettings() {
 		if (!expertSettingsCheckBox.isSelected()) {
-			shorteningThresholdTextField.setText(DEFAULT_SHORTENING_THRESHOLD+"");
+			shorteningThresholdTextField.setText(DEFAULT_SHORTENING_THRESHOLD + "");
 		}
 	}
 
@@ -85,7 +83,9 @@ public class CreateNewVaultExpertSettingsController implements FxController {
 	}
 
 	@FXML
-	public void next() { window.setScene(choosePasswordScene.get()); }
+	public void next() {
+		window.setScene(choosePasswordScene.get());
+	}
 
 	public BooleanBinding validShorteningThresholdProperty() {
 		return validShorteningThreshold;
@@ -105,12 +105,13 @@ public class CreateNewVaultExpertSettingsController implements FxController {
 	}
 
 	public void openDocs() {
-		application.get().getHostServices().showDocument(DOCS_MOUNTING_URL);
+		application.get().getHostServices().showDocument(DOCS_NAME_SHORTENING_URL);
 	}
 
 	public Path getVaultPath() {
 		return vaultPathProperty.get();
 	}
+
 	public String getVaultName() {
 		return vaultNameProperty.get();
 	}

+ 3 - 4
src/main/resources/fxml/addvault_new_location.fxml

@@ -11,7 +11,6 @@
 <?import javafx.scene.layout.HBox?>
 <?import javafx.scene.layout.Region?>
 <?import javafx.scene.layout.VBox?>
-<?import javafx.scene.control.CheckBox?>
 <VBox xmlns:fx="http://javafx.com/fxml"
 	  xmlns="http://javafx.com/javafx"
 	  fx:controller="org.cryptomator.ui.addvaultwizard.CreateNewVaultLocationController"
@@ -21,8 +20,8 @@
 	  alignment="CENTER_LEFT">
 	<fx:define>
 		<ToggleGroup fx:id="locationPresetsToggler"/>
-		<FontAwesome5IconView fx:id="badLocation" styleClass="glyph-icon-red" glyph="TIMES" />
-		<FontAwesome5IconView fx:id="goodLocation" styleClass="glyph-icon-primary" glyph="CHECK" />
+		<FontAwesome5IconView fx:id="badLocation" styleClass="glyph-icon-red" glyph="TIMES"/>
+		<FontAwesome5IconView fx:id="goodLocation" styleClass="glyph-icon-primary" glyph="CHECK"/>
 	</fx:define>
 	<padding>
 		<Insets topRightBottomLeft="24"/>
@@ -48,7 +47,7 @@
 		<VBox spacing="6">
 			<Label text="%addvaultwizard.new.locationLabel" labelFor="$locationTextField"/>
 			<TextField fx:id="locationTextField" promptText="%addvaultwizard.new.locationPrompt" text="${controller.vaultPath}" editable="false" disable="${!controller.anyRadioButtonSelected}" HBox.hgrow="ALWAYS"/>
-			<Label fx:id="locationStatusLabel" alignment="CENTER_RIGHT" wrapText="true" visible="${controller.anyRadioButtonSelected}" maxWidth="Infinity" graphicTextGap="6" />
+			<Label fx:id="locationStatusLabel" alignment="CENTER_RIGHT" wrapText="true" visible="${controller.anyRadioButtonSelected}" maxWidth="Infinity" graphicTextGap="6"/>
 		</VBox>
 
 		<Region VBox.vgrow="ALWAYS"/>