address infeos review: drop paths injection, close on locked vault, clear mapping on close

This commit is contained in:
Jan-Peter Klein
2026-03-30 12:15:09 +02:00
parent 92d11d8bd5
commit 9eca05aeb7
3 changed files with 6 additions and 8 deletions

View File

@@ -68,12 +68,12 @@ public class DecryptFileNamesViewController implements FxController {
public TableView<CipherAndCleartext> cipherToCleartextTable;
@Inject
public DecryptFileNamesViewController(@DecryptNameWindow Stage window, @DecryptNameWindow Vault vault, @DecryptNameWindow List<Path> pathsToDecrypt, ResourceBundle resourceBundle) {
public DecryptFileNamesViewController(@DecryptNameWindow Stage window, @DecryptNameWindow Vault vault, ResourceBundle resourceBundle) {
this.window = window;
this.vault = vault;
this.resourceBundle = resourceBundle;
this.mapping = new SimpleListProperty<>(FXCollections.observableArrayList());
this.initialList = pathsToDecrypt;
this.initialList = List.of();
}
@FXML
@@ -124,6 +124,7 @@ public class DecryptFileNamesViewController implements FxController {
}
});
decrypt(initialList);
window.setOnHidden(_ -> mapping.clear());
}
private void copySingleCelltoClipboard() {

View File

@@ -33,10 +33,6 @@ public interface DecryptNameComponent {
@DecryptNameWindow
Vault vault();
default void showDecryptFileNameWindow() {
showDecryptFileNameWindow(List.of());
}
default void showDecryptFileNameWindow(List<Path> pathsToDecrypt) {
Stage s = window();
s.setScene(decryptNamesView().get());
@@ -47,12 +43,13 @@ public interface DecryptNameComponent {
s.requestFocus();
} else {
LOG.error("Aborted showing DecryptFileName window: vault state is not {}, but {}.", VaultState.Value.UNLOCKED, vault().getState());
s.close();
}
}
@Subcomponent.Factory
interface Factory {
DecryptNameComponent create(@BindsInstance @DecryptNameWindow Vault vault, @BindsInstance @Named("windowOwner") Stage owner, @BindsInstance @DecryptNameWindow List<Path> pathsToDecrypt);
DecryptNameComponent create(@BindsInstance @DecryptNameWindow Vault vault, @BindsInstance @Named("windowOwner") Stage owner);
}
}

View File

@@ -223,7 +223,7 @@ public class VaultDetailUnlockedController implements FxController {
}
private DecryptNameComponent buildDecryptNameWindow(Vault vault) {
return decryptNameWindowFactory.create(vault, mainWindow, List.of());
return decryptNameWindowFactory.create(vault, mainWindow);
}
@FXML