This commit is contained in:
Jan-Peter Klein
2025-08-21 12:26:16 +02:00
parent fa053ac3df
commit 16d441ec44
15 changed files with 78 additions and 93 deletions

View File

@@ -79,11 +79,6 @@ public class VaultDetailMissingVaultController implements FxController {
}
}
@FXML
void restoreMasterkey() {
recoveryKeyWindow.create(vault.get(), window, new SimpleObjectProperty<>(RecoveryActionType.RESTORE_MASTERKEY)).showRecoveryKeyRecoverWindow();
}
@FXML
public void unlock() {
vault.get().stateProperty().set(VaultState.Value.LOCKED);

View File

@@ -20,9 +20,9 @@ import javafx.stage.Stage;
import java.util.EnumSet;
import java.util.Objects;
import static org.cryptomator.common.vaults.VaultState.Value.ALL_MISSING;
import static org.cryptomator.common.vaults.VaultState.Value.ERROR;
import static org.cryptomator.common.vaults.VaultState.Value.LOCKED;
import static org.cryptomator.common.vaults.VaultState.Value.ALL_MISSING;
import static org.cryptomator.common.vaults.VaultState.Value.MISSING;
import static org.cryptomator.common.vaults.VaultState.Value.NEEDS_MIGRATION;
import static org.cryptomator.common.vaults.VaultState.Value.UNLOCKED;

View File

@@ -63,12 +63,10 @@ public class RecoveryKeyCreationController implements FxController {
public Button nextButton;
private final VaultListManager vaultListManager;
private final Dialogs dialogs;
private final Stage owner;
@Inject
public RecoveryKeyCreationController(FxApplicationWindows appWindows, //
@RecoveryKeyWindow Stage window, //
@Named("keyRecoveryOwner") Stage owner, //
@FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy<Scene> successScene, //
@FxmlScene(FxmlFile.RECOVERYKEY_EXPERT_SETTINGS) Lazy<Scene> recoverykeyExpertSettingsScene, //
@RecoveryKeyWindow Vault vault, //
@@ -94,7 +92,6 @@ public class RecoveryKeyCreationController implements FxController {
this.masterkeyFileAccess = masterkeyFileAccess;
this.shorteningThreshold = shorteningThreshold;
this.vaultListManager = vaultListManager;
this.owner = owner;
this.dialogs = dialogs;
}
@@ -175,7 +172,6 @@ public class RecoveryKeyCreationController implements FxController {
}
}
@FXML
public void close() {
window.close();

View File

@@ -152,4 +152,3 @@ public class RecoveryKeyOnboardingController implements FxController {
}
}

View File

@@ -13,7 +13,6 @@ import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import java.util.Objects;
import java.util.ResourceBundle;
@RecoveryKeyScoped
@@ -33,15 +32,15 @@ public class RecoveryKeyRecoverController implements FxController {
@Inject
public RecoveryKeyRecoverController(@RecoveryKeyWindow Stage window, //
ResourceBundle resourceBundle, //
@FxmlScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD) Lazy<Scene> resetPasswordScene, //
@FxmlScene(FxmlFile.RECOVERYKEY_EXPERT_SETTINGS) Lazy<Scene> expertSettingsScene, //
@FxmlScene(FxmlFile.RECOVERYKEY_ONBOARDING) Lazy<Scene> onBoardingScene, //
ResourceBundle resourceBundle, //
@Named("recoverType") ObjectProperty<RecoveryActionType> recoverType) {
this.window = window;
this.recoverType = recoverType;
this.onBoardingScene = onBoardingScene;
this.resourceBundle = resourceBundle;
this.onBoardingScene = onBoardingScene;
this.recoverType = recoverType;
this.nextScene = switch (recoverType.get()) {
case RESTORE_ALL, RESTORE_VAULT_CONFIG -> {
window.setTitle(resourceBundle.getString("recoveryKey.recoverVaultConfig.title"));
@@ -61,7 +60,6 @@ public class RecoveryKeyRecoverController implements FxController {
}
default -> throw new IllegalArgumentException("Unexpected recovery action type: " + recoverType.get());
};
}
@FXML

View File

@@ -153,10 +153,12 @@ public class RecoveryKeyResetPasswordController implements FxController {
public void resetPassword() {
Task<Void> task = new ResetPasswordTask();
task.setOnScheduled(_ -> LOG.debug("Using recovery key to reset password for {}.", vault.getDisplayablePath()));
task.setOnScheduled(_ -> {
LOG.debug("Using recovery key to reset password for {}.", vault.getDisplayablePath());
});
task.setOnSucceeded(_ -> {
LOG.info("Used recovery key to reset password for {}.", vault.getDisplayablePath());
LOG.debug("Used recovery key to reset password for {}.", vault.getDisplayablePath());
window.close();
switch (recoverType.get()){
case RESET_PASSWORD -> dialogs.prepareRecoverPasswordSuccess(window).build().showAndWait();
@@ -172,16 +174,6 @@ public class RecoveryKeyResetPasswordController implements FxController {
executor.submit(task);
}
/* Getter/Setter */
public ReadOnlyBooleanProperty passwordSufficientAndMatchingProperty() {
return newPasswordController.goodPasswordProperty();
}
public boolean isPasswordSufficientAndMatching() {
return newPasswordController.isGoodPassword();
}
private class ResetPasswordTask extends Task<Void> {
private static final Logger LOG = LoggerFactory.getLogger(ResetPasswordTask.class);
@@ -196,4 +188,15 @@ public class RecoveryKeyResetPasswordController implements FxController {
return null;
}
}
/* Getter/Setter */
public ReadOnlyBooleanProperty passwordSufficientAndMatchingProperty() {
return newPasswordController.goodPasswordProperty();
}
public boolean isPasswordSufficientAndMatching() {
return newPasswordController.isGoodPassword();
}
}

View File

@@ -23,6 +23,7 @@
<Label text="%addvaultwizard.existing.instruction" wrapText="true" labelFor="$finishButton"/>
<Region VBox.vgrow="ALWAYS"/>
<ButtonBar buttonMinWidth="120" buttonOrder="+X">
<buttons>
<Button fx:id="finishButton" text="%addvaultwizard.existing.chooseBtn" ButtonBar.buttonData="NEXT_FORWARD" onAction="#chooseFileAndNext" defaultButton="true"/>

View File

@@ -22,33 +22,31 @@
<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="KEY" glyphSize="24"/>
</StackPane>
</Group>
<VBox spacing="12" HBox.hgrow="ALWAYS" alignment="TOP_CENTER">
<fx:include fx:id="newPassword" source="new_password.fxml"/>
<Group>
<StackPane>
<padding>
<Insets topRightBottomLeft="6"/>
</padding>
<Circle styleClass="glyph-icon-primary" radius="24"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="KEY" glyphSize="24"/>
</StackPane>
</Group>
<VBox spacing="12" HBox.hgrow="ALWAYS" alignment="TOP_CENTER">
<fx:include source="new_password.fxml"/>
<Region VBox.vgrow="ALWAYS"/>
<Region VBox.vgrow="ALWAYS"/>
<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
<buttons>
<Button text="%generic.button.cancel" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#close"/>
<Button fx:id="convertBtn" ButtonBar.buttonData="FINISH" defaultButton="true" onAction="#convert"> <!-- for button logic, see controller -->
<graphic>
<FontAwesome5Spinner glyphSize="12"/>
</graphic>
</Button>
</buttons>
</ButtonBar>
</VBox>
<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
<buttons>
<Button text="%generic.button.cancel" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#close"/>
<Button fx:id="convertBtn" ButtonBar.buttonData="FINISH" defaultButton="true" onAction="#convert">
<graphic>
<FontAwesome5Spinner glyphSize="12"/>
</graphic>
</Button>
</buttons>
</ButtonBar>
</VBox>
</children>
</VBox>
</HBox>

View File

@@ -14,7 +14,8 @@
minWidth="400"
maxWidth="400"
minHeight="145"
spacing="12">
spacing="12"
alignment="TOP_CENTER">
<padding>
<Insets topRightBottomLeft="12"/>
</padding>

View File

@@ -25,8 +25,7 @@
prefWidth="480"
minHeight="242"
spacing="12"
VBox.vgrow="ALWAYS"
>
VBox.vgrow="ALWAYS">
<padding>
<Insets topRightBottomLeft="12"/>
</padding>

View File

@@ -33,7 +33,7 @@
</Group>
<VBox spacing="12" HBox.hgrow="ALWAYS" alignment="TOP_CENTER">
<fx:include fx:id="recoveryKeyValidate" source="recoverykey_validate.fxml"/>
<fx:include source="recoverykey_validate.fxml"/>
<Region VBox.vgrow="ALWAYS"/>

View File

@@ -32,7 +32,7 @@
</StackPane>
</Group>
<VBox spacing="12" HBox.hgrow="ALWAYS" alignment="TOP_CENTER">
<fx:include fx:id="newPassword" source="new_password.fxml"/>
<fx:include source="new_password.fxml"/>
<Region VBox.vgrow="ALWAYS"/>

View File

@@ -37,6 +37,5 @@
</graphic>
</Label>
</VBox>
</children>
</VBox>

View File

@@ -10,35 +10,33 @@
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailMissingVaultController"
alignment="TOP_CENTER"
spacing="9">
<children>
<VBox spacing="9" alignment="CENTER">
<StackPane alignment="CENTER">
<Circle styleClass="glyph-icon-primary" radius="48"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="FILE" glyphSize="48"/>
<FontAwesome5IconView styleClass="glyph-icon-primary" glyph="SEARCH" glyphSize="24">
<StackPane.margin>
<Insets top="12"/>
</StackPane.margin>
</FontAwesome5IconView>
</StackPane>
<Label text="%main.vaultDetail.missingVaultConfig.info" wrapText="true"/>
</VBox>
<VBox spacing="6" alignment="CENTER">
<Button text="%main.vaultDetail.missing.recheck" minWidth="120" onAction="#recheck">
<graphic>
<FontAwesome5IconView glyph="REDO"/>
</graphic>
</Button>
<Button text="%main.vaultDetail.missingVaultConfig.restore" minWidth="120" onAction="#restoreVaultConfig">
<graphic>
<FontAwesome5IconView glyph="MAGIC"/>
</graphic>
</Button>
<Button text="%main.vaultDetail.missing.remove" minWidth="120" onAction="#didClickRemoveVault">
<graphic>
<FontAwesome5IconView glyph="TRASH"/>
</graphic>
</Button>
</VBox>
</children>
<VBox spacing="9" alignment="CENTER">
<StackPane>
<Circle styleClass="glyph-icon-primary" radius="48"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="FILE" glyphSize="48"/>
<FontAwesome5IconView styleClass="glyph-icon-primary" glyph="SEARCH" glyphSize="24">
<StackPane.margin>
<Insets top="12"/>
</StackPane.margin>
</FontAwesome5IconView>
</StackPane>
<Label text="%main.vaultDetail.missingVaultConfig.info" wrapText="true"/>
</VBox>
<VBox spacing="6" alignment="CENTER">
<Button text="%main.vaultDetail.missing.recheck" minWidth="120" onAction="#recheck">
<graphic>
<FontAwesome5IconView glyph="REDO"/>
</graphic>
</Button>
<Button text="%main.vaultDetail.missingVaultConfig.restore" minWidth="120" onAction="#restoreVaultConfig">
<graphic>
<FontAwesome5IconView glyph="MAGIC"/>
</graphic>
</Button>
<Button text="%main.vaultDetail.missing.remove" minWidth="120" onAction="#didClickRemoveVault">
<graphic>
<FontAwesome5IconView glyph="TRASH"/>
</graphic>
</Button>
</VBox>
</VBox>

View File

@@ -13,8 +13,6 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Arc?>
<?import javafx.scene.shape.Circle?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.layout.AnchorPane?>
<StackPane xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"