mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
address infeos review: drop paths injection, close on locked vault, clear mapping on close
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user