This commit is contained in:
Armin Schrenk
2025-03-18 11:14:38 +01:00
parent 5204a8e356
commit ba8fb273c7
2 changed files with 5 additions and 5 deletions

View File

@@ -413,6 +413,7 @@ public class Vault {
}
/**
* Gets the cleartext name from a given path to an encrypted vault file
*/
public String getCleartextName(Path ciphertextPath) throws IOException {
if (!state.getValue().equals(VaultState.Value.UNLOCKED)) {

View File

@@ -27,9 +27,7 @@ import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DataFormat;
@@ -168,7 +166,7 @@ public class VaultDetailUnlockedController implements FxController {
}
private void copyDecryptedNamesToClipboard(List<CipherToCleartext> mapping) {
if(mapping.size() == 1) {
if (mapping.size() == 1) {
Clipboard.getSystemClipboard().setContent(Map.of(DataFormat.PLAIN_TEXT, mapping.getFirst().cleartext));
} else {
var content = mapping.stream().map(CipherToCleartext::toString).collect(Collectors.joining("\n"));
@@ -262,12 +260,13 @@ public class VaultDetailUnlockedController implements FxController {
vaultStats.getUnchecked(vault.get()).showVaultStatisticsWindow();
}
record CipherToCleartext (String ciphertext, String cleartext) {
record CipherToCleartext(String ciphertext, String cleartext) {
@Override
public String toString() {
return ciphertext + " > " + cleartext;
}
};
}
/* Getter/Setter */