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) {

View File

@@ -10,7 +10,6 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.control.CheckBox?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.quit.QuitController"
@@ -27,10 +26,7 @@
<Circle styleClass="glyph-icon-primary" radius="24"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="QUESTION" glyphSize="24"/>
</StackPane>
<VBox alignment="CENTER_LEFT" VBox.vgrow="ALWAYS">
<Label text="%quit.prompt" wrapText="true" textAlignment="LEFT" HBox.hgrow="ALWAYS"/>
<CheckBox text="%quit.prompt.rememberAlwaysLockAndQuitCheckbox" fx:id="rememberAlwaysLockAndQuitCheckbox"/>
</VBox>
<Label text="%quit.prompt" wrapText="true" textAlignment="LEFT" HBox.hgrow="ALWAYS"/>
</HBox>
<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">

View File

@@ -382,5 +382,4 @@ passwordStrength.messageLabel.4=Very strong
# Quit
quit.prompt=Quit application? There are unlocked vaults.
quit.lockAndQuit=Lock and Quit
quit.prompt.rememberAlwaysLockAndQuitCheckbox=Always lock all vaults and quit application
quit.lockAndQuit=Lock and Quit