mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-20 01:26:52 -04:00
code cleanup
This commit is contained in:
@@ -149,20 +149,19 @@ public class FxApplicationWindows {
|
||||
|
||||
public void showDokanySupportEndWindow() {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
customDialog.setOwner(mainWindow.get().window())
|
||||
.setTitleKey("dokanySupportEnd.title")
|
||||
.setMessageKey("dokanySupportEnd.message")
|
||||
.setDescriptionKey("dokanySupportEnd.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("generic.button.close")
|
||||
.setCancelButtonKey("dokanySupportEnd.preferencesBtn")
|
||||
.setOkAction(Stage::close) //
|
||||
.setCancelAction(v -> {
|
||||
showPreferencesWindow(SelectedPreferencesTab.VOLUME);
|
||||
v.close();
|
||||
}) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
customDialog.setOwner(mainWindow.get().window()) //
|
||||
.setTitleKey("dokanySupportEnd.title") //
|
||||
.setMessageKey("dokanySupportEnd.message") //
|
||||
.setDescriptionKey("dokanySupportEnd.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("generic.button.close") //
|
||||
.setCancelButtonKey("dokanySupportEnd.preferencesBtn") //
|
||||
.setOkAction(Stage::close) //
|
||||
.setCancelAction(v -> {
|
||||
showPreferencesWindow(SelectedPreferencesTab.VOLUME);
|
||||
v.close();
|
||||
}) //
|
||||
.build().showAndWait();
|
||||
}, Platform::runLater);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,26 +51,23 @@ public class VaultDetailMissingVaultController implements FxController {
|
||||
|
||||
@FXML
|
||||
void didClickRemoveVault() {
|
||||
customDialog
|
||||
.setOwner(window)
|
||||
.setTitleKey("removeVault.title", vault.get().getDisplayName())
|
||||
.setMessageKey("removeVault.message")
|
||||
.setDescriptionKey("removeVault.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("removeVault.confirmBtn")
|
||||
.setCancelButtonKey("generic.button.cancel")
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.get().getDisplayName());
|
||||
vaults.remove(vault.get());
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
customDialog.setOwner(window) //
|
||||
.setTitleKey("removeVault.title", vault.get().getDisplayName()) //
|
||||
.setMessageKey("removeVault.message") //
|
||||
.setDescriptionKey("removeVault.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeVault.confirmBtn") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.get().getDisplayName());
|
||||
vaults.remove(vault.get());
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build().showAndWait();
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
void changeLocation() {
|
||||
// copied from ChooseExistingVaultController class
|
||||
|
||||
@@ -29,8 +29,9 @@ public class VaultDetailUnknownErrorController implements FxController {
|
||||
private final CustomDialog.Builder customDialog;
|
||||
|
||||
@Inject
|
||||
public VaultDetailUnknownErrorController(@MainWindow Stage mainWindow,
|
||||
ObjectProperty<Vault> vault, ObservableList<Vault> vaults, //
|
||||
public VaultDetailUnknownErrorController(@MainWindow Stage mainWindow, //
|
||||
ObjectProperty<Vault> vault, //
|
||||
ObservableList<Vault> vaults, //
|
||||
FxApplicationWindows appWindows, //
|
||||
@Named("errorWindow") Stage errorWindow, //
|
||||
CustomDialog.Builder customDialog) {
|
||||
@@ -54,22 +55,19 @@ public class VaultDetailUnknownErrorController implements FxController {
|
||||
|
||||
@FXML
|
||||
void didClickRemoveVault() {
|
||||
customDialog
|
||||
.setOwner(mainWindow)
|
||||
.setTitleKey("removeVault.title", vault.get().getDisplayName())
|
||||
.setMessageKey("removeVault.message")
|
||||
.setDescriptionKey("removeVault.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("removeVault.confirmBtn")
|
||||
.setCancelButtonKey("generic.button.cancel")
|
||||
customDialog.setOwner(mainWindow) //
|
||||
.setTitleKey("removeVault.title", vault.get().getDisplayName()) //
|
||||
.setMessageKey("removeVault.message") //
|
||||
.setDescriptionKey("removeVault.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeVault.confirmBtn") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.get().getDisplayName());
|
||||
vaults.remove(vault.get());
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
|
||||
.build().showAndWait();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,20 +82,19 @@ public class VaultListContextMenuController implements FxController {
|
||||
@FXML
|
||||
public void didClickRemoveVault() {
|
||||
var vault = Objects.requireNonNull(selectedVault.get());
|
||||
customDialog.setOwner(mainWindow)
|
||||
.setTitleKey("removeVault.title", vault.getDisplayName())
|
||||
.setMessageKey("removeVault.message")
|
||||
.setDescriptionKey("removeVault.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("removeVault.confirmBtn")
|
||||
.setCancelButtonKey("generic.button.cancel")
|
||||
customDialog.setOwner(mainWindow) //
|
||||
.setTitleKey("removeVault.title", vault.getDisplayName()) //
|
||||
.setMessageKey("removeVault.message") //
|
||||
.setDescriptionKey("removeVault.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeVault.confirmBtn") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.getDisplayName());
|
||||
vaults.remove(vault);
|
||||
v.close();
|
||||
}) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
.build().showAndWait();
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
@@ -91,7 +91,7 @@ public class VaultListController implements FxController {
|
||||
VaultListManager vaultListManager, //
|
||||
ResourceBundle resourceBundle, //
|
||||
FxApplicationWindows appWindows, //
|
||||
Settings settings,
|
||||
Settings settings, //
|
||||
CustomDialog.Builder customDialog) {
|
||||
this.mainWindow = mainWindow;
|
||||
this.vaults = vaults;
|
||||
@@ -210,21 +210,20 @@ public class VaultListController implements FxController {
|
||||
private void pressedShortcutToRemoveVault() {
|
||||
final var vault = selectedVault.get();
|
||||
if (vault != null && EnumSet.of(LOCKED, MISSING, ERROR, NEEDS_MIGRATION).contains(vault.getState())) {
|
||||
customDialog.setOwner(mainWindow)
|
||||
.setTitleKey("removeVault.title", vault.getDisplayName())
|
||||
.setMessageKey("removeVault.message")
|
||||
.setDescriptionKey("removeVault.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("removeVault.confirmBtn")
|
||||
.setCancelButtonKey("generic.button.cancel")
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.getDisplayName());
|
||||
vaults.remove(vault);
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
customDialog.setOwner(mainWindow) //
|
||||
.setTitleKey("removeVault.title", vault.getDisplayName()) //
|
||||
.setMessageKey("removeVault.message") //
|
||||
.setDescriptionKey("removeVault.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeVault.confirmBtn") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(v -> {
|
||||
LOG.debug("Removing vault {}.", vault.getDisplayName());
|
||||
vaults.remove(vault);
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build().showAndWait();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,11 @@ public class SupporterCertificateController implements FxController {
|
||||
private TextArea supporterCertificateField;
|
||||
|
||||
@Inject
|
||||
SupporterCertificateController(Application application, @PreferencesWindow Stage window, LicenseHolder licenseHolder, Settings settings, CustomDialog.Builder customDialog) {
|
||||
SupporterCertificateController(Application application, //
|
||||
@PreferencesWindow Stage window, //
|
||||
LicenseHolder licenseHolder, //
|
||||
Settings settings, //
|
||||
CustomDialog.Builder customDialog) {
|
||||
this.application = application;
|
||||
this.window = window;
|
||||
this.licenseHolder = licenseHolder;
|
||||
@@ -85,21 +89,19 @@ public class SupporterCertificateController implements FxController {
|
||||
|
||||
@FXML
|
||||
void didClickRemoveCert() {
|
||||
customDialog.setOwner(window)
|
||||
.setTitleKey("removeCert.title")
|
||||
.setMessageKey("removeCert.message")
|
||||
.setDescriptionKey("removeCert.description")
|
||||
.setIcon(FontAwesome5Icon.QUESTION)
|
||||
.setOkButtonKey("removeCert.confirmBtn")
|
||||
customDialog.setOwner(window) //
|
||||
.setTitleKey("removeCert.title") //
|
||||
.setMessageKey("removeCert.message") //
|
||||
.setDescriptionKey("removeCert.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeCert.confirmBtn") //
|
||||
.setCancelButtonKey("generic.button.cancel")
|
||||
.setOkAction(v -> {
|
||||
settings.licenseKey.set(null);
|
||||
v.close();
|
||||
}) //
|
||||
.setCancelAction(Stage::close) //
|
||||
.build()
|
||||
.showAndWait();
|
||||
|
||||
.build().showAndWait();
|
||||
}
|
||||
|
||||
public LicenseHolder getLicenseHolder() {
|
||||
|
||||
Reference in New Issue
Block a user