removed checkbox in quit prompt

This commit is contained in:
Jan-Peter Klein
2022-05-31 14:09:12 +02:00
parent 8f85777887
commit 6f33cf8df7
3 changed files with 3 additions and 16 deletions

View File

@@ -12,7 +12,6 @@ import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ContentDisplay;
import javafx.stage.Stage;
import java.awt.desktop.QuitResponse;
@@ -32,10 +31,9 @@ public class QuitController implements FxController {
private final ExecutorService executorService;
private final VaultService vaultService;
private final AtomicReference<QuitResponse> quitResponse = new AtomicReference<>();
private final Settings settings;
/* FXML */
public Button lockAndQuitButton;
public CheckBox rememberAlwaysLockAndQuitCheckbox;
@Inject
QuitController(@QuitWindow Stage window, ObservableList<Vault> vaults, ExecutorService executorService, VaultService vaultService, Settings settings) {
@@ -43,15 +41,9 @@ public class QuitController implements FxController {
this.unlockedVaults = vaults.filtered(Vault::isUnlocked);
this.executorService = executorService;
this.vaultService = vaultService;
this.settings = settings;
window.setOnCloseRequest(windowEvent -> cancel());
}
@FXML
public void initialize() {
rememberAlwaysLockAndQuitCheckbox.selectedProperty().bindBidirectional(settings.autoCloseVaults());
}
public void updateQuitRequest(QuitResponse newResponse) {
var oldResponse = quitResponse.getAndSet(newResponse);
if (oldResponse != null) {