Merge branch 'develop' into feature/aur-build

This commit is contained in:
Armin Schrenk
2026-02-16 16:17:09 +01:00
5 changed files with 42 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ class EventualLogger extends AbstractLogger {
var builder = gutter.atLevel(event.getLevel()) //
.setCause(event.getThrowable()) //
.setMessage(event.getMessage());
event.getArguments().forEach(builder::addArgument);
Objects.requireNonNullElse(event.getArguments(), List.of()).forEach(builder::addArgument);
Objects.requireNonNullElse(event.getMarkers(), List.<Marker>of()).forEach(builder::addMarker);
builder.log();
}

View File

@@ -101,15 +101,10 @@ public class NotificationController implements FxController {
var device = userAndDevice.length == 1 ? userAndDevice[0] : userAndDevice[1];
var cleartextFileName = fiiue.cleartextPath().substring(fiiue.cleartextPath().lastIndexOf('/') + 1);
eventTimestamp.set(localizedTimeFormatter.format(fiiue.lastUpdated()));
message.set("File is locked by another device");
fileName.set(cleartextFileName);
description.set("The file is opened by %s on device %s. Ask the user to close the file and sync again. Otherwise, you can ignore the lock and open it anyway.".formatted(user, device));
actionText.set("Ignore Lock");
/* TODO: Once feature is out of beta, activate translations
message.set(resourceBundle.getString("notification.inUse.message"));
description.set(resourceBundle.getString("notification.inUse.description").formatted(fiiue.cleartextPath(), user, device));
fileName.set(cleartextFileName);
description.set(resourceBundle.getString("notification.inUse.description").formatted(user, device));
actionText.set(resourceBundle.getString("notification.inUse.action"));
*/
}
default -> {
message.set("NO CONTENT");

View File

@@ -9,11 +9,15 @@ import org.cryptomator.ui.forgetpassword.ForgetPasswordComponent;
import org.cryptomator.ui.recoverykey.RecoveryKeyComponent;
import javax.inject.Inject;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.stage.Stage;
import java.nio.file.Files;
import static org.cryptomator.common.Constants.MASTERKEY_FILENAME;
@VaultOptionsScoped
public class MasterkeyOptionsController implements FxController {
@@ -25,6 +29,7 @@ public class MasterkeyOptionsController implements FxController {
private final ForgetPasswordComponent.Builder forgetPasswordWindow;
private final KeychainManager keychain;
private final ObservableValue<Boolean> passwordSaved;
private final BooleanProperty masterkeyFileAvailable;
@Inject
@@ -40,6 +45,7 @@ public class MasterkeyOptionsController implements FxController {
} else {
this.passwordSaved = new SimpleBooleanProperty(false);
}
this.masterkeyFileAvailable = new SimpleBooleanProperty(Files.exists(vault.getPath().resolve(MASTERKEY_FILENAME)));
}
@FXML
@@ -70,4 +76,12 @@ public class MasterkeyOptionsController implements FxController {
public boolean isPasswordSaved() {
return passwordSaved.getValue();
}
public BooleanProperty masterkeyFileAvailableProperty() {
return masterkeyFileAvailable;
}
public boolean isMasterkeyFileAvailable() {
return masterkeyFileAvailable.get();
}
}

View File

@@ -4,8 +4,12 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.Group?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.vaultoptions.MasterkeyOptionsController"
@@ -15,7 +19,21 @@
<Insets topRightBottomLeft="12"/>
</padding>
<children>
<VBox spacing="6" alignment="CENTER">
<HBox spacing="12" visible="${!controller.masterkeyFileAvailable}" managed="${!controller.masterkeyFileAvailable}">
<padding>
<Insets bottom="12"/>
</padding>
<Group>
<StackPane>
<Circle styleClass="glyph-icon-primary" radius="18"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="INFO" glyphSize="18"/>
</StackPane>
</Group>
<HBox spacing="6" HBox.hgrow="ALWAYS">
<Label text="%vaultOptions.masterkey.missingMasterkeyFile" wrapText="true" HBox.hgrow="ALWAYS"/>
</HBox>
</HBox>
<VBox spacing="6" alignment="CENTER" disable="${!controller.masterkeyFileAvailable}">
<Button text="%vaultOptions.masterkey.changePasswordBtn" onAction="#changePassword" contentDisplay="LEFT" maxWidth="Infinity">
<graphic>
<FontAwesome5IconView glyph="KEY"/>
@@ -29,8 +47,8 @@
</Button>
</VBox>
<Region VBox.vgrow="ALWAYS"/>
<Label maxWidth="-Infinity" text="%vaultOptions.masterkey.recoveryKeyExplanation" wrapText="true"/>
<VBox spacing="6" alignment="CENTER">
<Label maxWidth="-Infinity" text="%vaultOptions.masterkey.recoveryKeyExplanation" wrapText="true" disable="${!controller.masterkeyFileAvailable}"/>
<VBox spacing="6" alignment="CENTER" disable="${!controller.masterkeyFileAvailable}">
<Button text="%vaultOptions.masterkey.showRecoveryKeyBtn" onAction="#showRecoveryKey" contentDisplay="LEFT" maxWidth="Infinity">
<graphic>
<FontAwesome5IconView glyph="EYE"/>

View File

@@ -522,6 +522,7 @@ vaultOptions.masterkey.forgetSavedPasswordBtn=Forget Saved Password
vaultOptions.masterkey.recoveryKeyExplanation=A recovery key is your only means to restore access to a vault if you lose your password.
vaultOptions.masterkey.showRecoveryKeyBtn=Display Recovery Key
vaultOptions.masterkey.recoverPasswordBtn=Reset Password
vaultOptions.masterkey.missingMasterkeyFile=These options are only available if the masterkey file is present in the vault directory.
## Hub
vaultOptions.hub=Recovery
vaultOptions.hub.convertInfo=You can use the recovery key to convert this Hub vault to a password-based vault in an emergency.
@@ -722,6 +723,6 @@ eventView.entry.inUse.ignoreLock=Ignore Lock
# Notifications
## FileIsInUse Notification
#notification.inUse.message=File is locked
#notification.inUse.description=File %s is opened by user %s (%s). Ask the user to close the file. Otherwise, you can ignore the lock and open it anyway, but be aware of the data loss risk.
#notification.inUse.action=Ignore Lock
notification.inUse.message=File is locked by another device
notification.inUse.description=The file is opened by %s on device %s. Ask the user to close the file and sync again. Otherwise, you can ignore the lock and open it anyway.
notification.inUse.action=Ignore Lock