|
@@ -13,6 +13,7 @@ import org.cryptomator.ui.preferences.SelectedPreferencesTab;
|
|
|
import org.cryptomator.ui.quit.QuitComponent;
|
|
|
import org.cryptomator.ui.unlock.UnlockComponent;
|
|
|
import org.cryptomator.ui.unlock.UnlockWorkflow;
|
|
|
+import org.cryptomator.ui.updatereminder.UpdateReminderComponent;
|
|
|
import org.cryptomator.ui.vaultoptions.SelectedVaultOptionsTab;
|
|
|
import org.cryptomator.ui.vaultoptions.VaultOptionsComponent;
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
@@ -45,6 +46,7 @@ public class FxApplicationWindows {
|
|
|
private final Lazy<PreferencesComponent> preferencesWindow;
|
|
|
private final QuitComponent.Builder quitWindowBuilder;
|
|
|
private final UnlockComponent.Factory unlockWorkflowFactory;
|
|
|
+ private final UpdateReminderComponent.Factory updateReminderWindowBuilder;
|
|
|
private final LockComponent.Factory lockWorkflowFactory;
|
|
|
private final ErrorComponent.Factory errorWindowFactory;
|
|
|
private final ExecutorService executor;
|
|
@@ -52,13 +54,24 @@ public class FxApplicationWindows {
|
|
|
private final FilteredList<Window> visibleWindows;
|
|
|
|
|
|
@Inject
|
|
|
- public FxApplicationWindows(@PrimaryStage Stage primaryStage, Optional<TrayIntegrationProvider> trayIntegration, Lazy<MainWindowComponent> mainWindow, Lazy<PreferencesComponent> preferencesWindow, QuitComponent.Builder quitWindowBuilder, UnlockComponent.Factory unlockWorkflowFactory, LockComponent.Factory lockWorkflowFactory, ErrorComponent.Factory errorWindowFactory, ExecutorService executor, VaultOptionsComponent.Factory vaultOptionsWindow) {
|
|
|
+ public FxApplicationWindows(@PrimaryStage Stage primaryStage,
|
|
|
+ Optional<TrayIntegrationProvider> trayIntegration, //
|
|
|
+ Lazy<MainWindowComponent> mainWindow, //
|
|
|
+ Lazy<PreferencesComponent> preferencesWindow, //
|
|
|
+ QuitComponent.Builder quitWindowBuilder, //
|
|
|
+ UnlockComponent.Factory unlockWorkflowFactory, //
|
|
|
+ UpdateReminderComponent.Factory updateReminderWindowBuilder, //
|
|
|
+ LockComponent.Factory lockWorkflowFactory, //
|
|
|
+ ErrorComponent.Factory errorWindowFactory, //
|
|
|
+ VaultOptionsComponent.Factory vaultOptionsWindow, //
|
|
|
+ ExecutorService executor) {
|
|
|
this.primaryStage = primaryStage;
|
|
|
this.trayIntegration = trayIntegration;
|
|
|
this.mainWindow = mainWindow;
|
|
|
this.preferencesWindow = preferencesWindow;
|
|
|
this.quitWindowBuilder = quitWindowBuilder;
|
|
|
this.unlockWorkflowFactory = unlockWorkflowFactory;
|
|
|
+ this.updateReminderWindowBuilder = updateReminderWindowBuilder;
|
|
|
this.lockWorkflowFactory = lockWorkflowFactory;
|
|
|
this.errorWindowFactory = errorWindowFactory;
|
|
|
this.executor = executor;
|
|
@@ -117,6 +130,10 @@ public class FxApplicationWindows {
|
|
|
CompletableFuture.runAsync(() -> quitWindowBuilder.build().showQuitWindow(response,forced), Platform::runLater);
|
|
|
}
|
|
|
|
|
|
+ public void checkAndShowUpdateReminderWindow() {
|
|
|
+ CompletableFuture.runAsync(() -> updateReminderWindowBuilder.create().checkAndShowUpdateReminderWindow(), Platform::runLater);
|
|
|
+ }
|
|
|
+
|
|
|
public CompletionStage<Void> startUnlockWorkflow(Vault vault, @Nullable Stage owner) {
|
|
|
return CompletableFuture.supplyAsync(() -> {
|
|
|
Preconditions.checkState(vault.stateProperty().transition(VaultState.Value.LOCKED, VaultState.Value.PROCESSING), "Vault not locked.");
|