Sfoglia il codice sorgente

added vault config success scene

Jan-Peter Klein 7 mesi fa
parent
commit
aa95ad40c0

+ 1 - 0
src/main/java/org/cryptomator/ui/common/FxmlFile.java

@@ -44,6 +44,7 @@ public enum FxmlFile {
 	RECOVERYKEY_RECOVER("/fxml/recoverykey_recover.fxml"), //
 	RECOVERYKEY_RESET_PASSWORD("/fxml/recoverykey_reset_password.fxml"), //
 	RECOVERYKEY_RESET_PASSWORD_SUCCESS("/fxml/recoverykey_reset_password_success.fxml"), //
+	RECOVERYKEY_RESET_VAULT_CONFIG_SUCCESS("/fxml/recoverykey_reset_vault_config_success.fxml"), //
 	RECOVERYKEY_SUCCESS("/fxml/recoverykey_success.fxml"), //
 	REMOVE_CERT("/fxml/remove_cert.fxml"), //
 	REMOVE_VAULT("/fxml/remove_vault.fxml"), //

+ 7 - 0
src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java

@@ -105,6 +105,13 @@ abstract class RecoveryKeyModule {
 		return fxmlLoaders.createScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD_SUCCESS);
 	}
 
+	@Provides
+	@FxmlScene(FxmlFile.RECOVERYKEY_RESET_VAULT_CONFIG_SUCCESS)
+	@RecoveryKeyScoped
+	static Scene provideRecoveryKeyResetVaultConfigSuccessScene(@RecoveryKeyWindow FxmlLoaderFactory fxmlLoaders) {
+		return fxmlLoaders.createScene(FxmlFile.RECOVERYKEY_RESET_VAULT_CONFIG_SUCCESS);
+	}
+
 
 	// ------------------
 

+ 12 - 2
src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyResetPasswordController.java

@@ -47,19 +47,29 @@ public class RecoveryKeyResetPasswordController implements FxController {
 	private final ExecutorService executor;
 	private final StringProperty recoveryKey;
 	private final Lazy<Scene> recoverResetPasswordSuccessScene;
+	private final Lazy<Scene> recoverResetVaultConfigSuccessScene;
 	private final FxApplicationWindows appWindows;
 	private final MasterkeyFileAccess masterkeyFileAccess;
 
 	public NewPasswordController newPasswordController;
 
 	@Inject
-	public RecoveryKeyResetPasswordController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, @FxmlScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD_SUCCESS) Lazy<Scene> recoverResetPasswordSuccessScene, FxApplicationWindows appWindows, MasterkeyFileAccess masterkeyFileAccess) {
+	public RecoveryKeyResetPasswordController(@RecoveryKeyWindow Stage window, //
+											  @RecoveryKeyWindow Vault vault, //
+											  RecoveryKeyFactory recoveryKeyFactory, //
+											  ExecutorService executor, //
+											  @RecoveryKeyWindow StringProperty recoveryKey, //
+											  @FxmlScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD_SUCCESS) Lazy<Scene> recoverResetPasswordSuccessScene, //
+											  @FxmlScene(FxmlFile.RECOVERYKEY_RESET_VAULT_CONFIG_SUCCESS) Lazy<Scene> recoverResetVaultConfigSuccessScene, //
+											  FxApplicationWindows appWindows, //
+											  MasterkeyFileAccess masterkeyFileAccess) {
 		this.window = window;
 		this.vault = vault;
 		this.recoveryKeyFactory = recoveryKeyFactory;
 		this.executor = executor;
 		this.recoveryKey = recoveryKey;
 		this.recoverResetPasswordSuccessScene = recoverResetPasswordSuccessScene;
+		this.recoverResetVaultConfigSuccessScene = recoverResetVaultConfigSuccessScene;
 		this.appWindows = appWindows;
 		this.masterkeyFileAccess = masterkeyFileAccess;
 	}
@@ -105,7 +115,7 @@ public class RecoveryKeyResetPasswordController implements FxController {
 						}
 					});
 				}
-				window.setScene(recoverResetPasswordSuccessScene.get());
+				window.setScene(recoverResetVaultConfigSuccessScene.get());
 			} catch (IOException e) {
 				LOG.error("Moving recovered files failed", e);
 			}

+ 53 - 0
src/main/resources/fxml/recoverykey_reset_vault_config_success.fxml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.ButtonBar?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.layout.HBox?>
+<?import javafx.scene.layout.StackPane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.shape.Circle?>
+<?import javafx.scene.Group?>
+<?import javafx.scene.layout.Region?>
+<HBox xmlns:fx="http://javafx.com/fxml"
+	  xmlns="http://javafx.com/javafx"
+	  fx:controller="org.cryptomator.ui.recoverykey.RecoveryKeyResetPasswordSuccessController"
+	  minWidth="400"
+	  maxWidth="400"
+	  minHeight="145"
+	  spacing="12"
+	  alignment="TOP_LEFT">
+<padding>
+	<Insets topRightBottomLeft="12"/>
+</padding>
+<children>
+	<Group>
+		<StackPane>
+			<padding>
+				<Insets topRightBottomLeft="6"/>
+			</padding>
+			<Circle styleClass="glyph-icon-primary" radius="24"/>
+			<FontAwesome5IconView styleClass="glyph-icon-white" glyph="CHECK" glyphSize="24"/>
+		</StackPane>
+	</Group>
+
+	<VBox HBox.hgrow="ALWAYS">
+		<Label styleClass="label-large" text="%recoveryKey.recover.resetVaultConfigSuccess.message" wrapText="true" textAlignment="LEFT">
+			<padding>
+				<Insets bottom="6" top="6"/>
+			</padding>
+		</Label>
+
+		<Label text="%recoveryKey.recover.resetSuccess.description" wrapText="true" textAlignment="LEFT"/>
+
+		<Region VBox.vgrow="ALWAYS" minHeight="18"/>
+		<ButtonBar buttonMinWidth="120" buttonOrder="+C">
+			<buttons>
+				<Button text="%generic.button.close" ButtonBar.buttonData="CANCEL_CLOSE" defaultButton="true" cancelButton="true" onAction="#close"/>
+			</buttons>
+		</ButtonBar>
+	</VBox>
+</children>
+</HBox>

+ 2 - 0
src/main/resources/i18n/strings.properties

@@ -515,6 +515,8 @@ recoveryKey.recover.resetBtn=Reset
 ### Recovery Key Password Reset Success
 recoveryKey.recover.resetSuccess.message=Password reset successful
 recoveryKey.recover.resetSuccess.description=You can unlock your vault with the new password.
+### Recovery Key Vault Config Reset Success
+recoveryKey.recover.resetVaultConfigSuccess.message=Vault config reset successful
 
 # Convert Vault
 convertVault.title=Convert Vault