|
@@ -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.jetbrains.annotations.Nullable;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -43,19 +44,30 @@ public class FxApplicationWindows {
|
|
|
private final Lazy<PreferencesComponent> preferencesWindow;
|
|
|
private final QuitComponent.Builder quitWindowBuilder;
|
|
|
private final UnlockComponent.Factory unlockWorkflowFactory;
|
|
|
+ private final UpdateReminderComponent.Builder updateReminderWindowBuilder;
|
|
|
private final LockComponent.Factory lockWorkflowFactory;
|
|
|
private final ErrorComponent.Factory errorWindowFactory;
|
|
|
private final ExecutorService executor;
|
|
|
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) {
|
|
|
+ public FxApplicationWindows(@PrimaryStage Stage primaryStage,
|
|
|
+ Optional<TrayIntegrationProvider> trayIntegration, //
|
|
|
+ Lazy<MainWindowComponent> mainWindow, //
|
|
|
+ Lazy<PreferencesComponent> preferencesWindow, //
|
|
|
+ QuitComponent.Builder quitWindowBuilder, //
|
|
|
+ UnlockComponent.Factory unlockWorkflowFactory, //
|
|
|
+ UpdateReminderComponent.Builder updateReminderWindowBuilder, //
|
|
|
+ LockComponent.Factory lockWorkflowFactory, //
|
|
|
+ ErrorComponent.Factory errorWindowFactory, //
|
|
|
+ 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;
|
|
@@ -109,6 +121,10 @@ public class FxApplicationWindows {
|
|
|
CompletableFuture.runAsync(() -> quitWindowBuilder.build().showQuitWindow(response,forced), Platform::runLater);
|
|
|
}
|
|
|
|
|
|
+ public void showUpdateReminderWindow() {
|
|
|
+ CompletableFuture.runAsync(() -> updateReminderWindowBuilder.build().showUpdateReminderWindow(), 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.");
|