Browse Source

Let the user choose whether a recovery key should be shown during vault creation

Sebastian Stenzel 5 years ago
parent
commit
6e30df3796

File diff suppressed because it is too large
+ 47 - 11
main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultPasswordController.java


+ 13 - 3
main/ui/src/main/resources/fxml/addvault_new_password.fxml

@@ -3,7 +3,6 @@
 <?import javafx.geometry.Insets?>
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.control.ButtonBar?>
-<?import javafx.scene.control.CheckBox?>
 <?import javafx.scene.control.Label?>
 <?import javafx.scene.control.ProgressIndicator?>
 <?import javafx.scene.layout.HBox?>
@@ -12,6 +11,8 @@
 <?import org.cryptomator.ui.controls.FontAwesome5IconView?>
 <?import org.cryptomator.ui.controls.NiceSecurePasswordField?>
 <?import org.cryptomator.ui.controls.PasswordStrengthIndicator?>
+<?import javafx.scene.control.RadioButton?>
+<?import javafx.scene.control.ToggleGroup?>
 <VBox xmlns="http://javafx.com/javafx"
 	  xmlns:fx="http://javafx.com/fxml"
 	  fx:controller="org.cryptomator.ui.addvaultwizard.CreateNewVaultPasswordController"
@@ -19,12 +20,13 @@
 	  prefHeight="400"
 	  spacing="12"
 	  alignment="CENTER_LEFT">
+	<fx:define>
+		<ToggleGroup fx:id="recoveryKeyChoice"/>
+	</fx:define>
 	<padding>
 		<Insets topRightBottomLeft="24"/>
 	</padding>
 	<children>
-		<Region VBox.vgrow="ALWAYS"/>
-
 		<VBox spacing="6">
 			<Label text="%addvaultwizard.new.enterPassword" labelFor="$passwordField"/>
 			<NiceSecurePasswordField fx:id="passwordField"/>
@@ -41,6 +43,14 @@
 			</HBox>
 		</VBox>
 
+		<Region VBox.vgrow="ALWAYS"/>
+		
+		<VBox spacing="6">
+			<Label text="You can not reset your password. Make sure to remember it well! If you lose the password, the last resort will be a recovery key." wrapText="true"/>
+			<RadioButton fx:id="showRecoveryKey" toggleGroup="${recoveryKeyChoice}" text="Then better show me the recovery key" />
+			<RadioButton fx:id="skipRecoveryKey" toggleGroup="${recoveryKeyChoice}" text="No thanks, I will not lose my password" />
+		</VBox>
+
 		<Region VBox.vgrow="ALWAYS"/>
 
 		<ButtonBar buttonMinWidth="120" buttonOrder="B+X">