|
@@ -1,6 +1,5 @@
|
|
|
package org.cryptomator.ui.fxapp;
|
|
|
|
|
|
-import com.tobiasdiez.easybind.EasyBind;
|
|
|
import dagger.Lazy;
|
|
|
import org.cryptomator.common.LicenseHolder;
|
|
|
import org.cryptomator.common.settings.Settings;
|
|
@@ -41,9 +40,9 @@ public class FxApplication extends Application {
|
|
|
private final Settings settings;
|
|
|
private final Lazy<MainWindowComponent> mainWindow;
|
|
|
private final Lazy<PreferencesComponent> preferencesWindow;
|
|
|
+ private final Lazy<QuitComponent> quitWindow;
|
|
|
private final Provider<UnlockComponent.Builder> unlockWindowBuilderProvider;
|
|
|
private final Provider<LockComponent.Builder> lockWindowBuilderProvider;
|
|
|
- private final Provider<QuitComponent.Builder> quitWindowBuilderProvider;
|
|
|
private final Optional<TrayIntegrationProvider> trayIntegration;
|
|
|
private final Optional<UiAppearanceProvider> appearanceProvider;
|
|
|
private final VaultService vaultService;
|
|
@@ -52,13 +51,13 @@ public class FxApplication extends Application {
|
|
|
private final UiAppearanceListener systemInterfaceThemeListener = this::systemInterfaceThemeChanged;
|
|
|
|
|
|
@Inject
|
|
|
- FxApplication(Settings settings, Lazy<MainWindowComponent> mainWindow, Lazy<PreferencesComponent> preferencesWindow, Provider<UnlockComponent.Builder> unlockWindowBuilderProvider, Provider<LockComponent.Builder> lockWindowBuilderProvider, Provider<QuitComponent.Builder> quitWindowBuilderProvider, Optional<TrayIntegrationProvider> trayIntegration, Optional<UiAppearanceProvider> appearanceProvider, VaultService vaultService, LicenseHolder licenseHolder, ObservableSet<Stage> visibleStages) {
|
|
|
+ FxApplication(Settings settings, Lazy<MainWindowComponent> mainWindow, Lazy<PreferencesComponent> preferencesWindow, Provider<UnlockComponent.Builder> unlockWindowBuilderProvider, Provider<LockComponent.Builder> lockWindowBuilderProvider, Lazy<QuitComponent> quitWindow, Optional<TrayIntegrationProvider> trayIntegration, Optional<UiAppearanceProvider> appearanceProvider, VaultService vaultService, LicenseHolder licenseHolder, ObservableSet<Stage> visibleStages) {
|
|
|
this.settings = settings;
|
|
|
this.mainWindow = mainWindow;
|
|
|
this.preferencesWindow = preferencesWindow;
|
|
|
this.unlockWindowBuilderProvider = unlockWindowBuilderProvider;
|
|
|
this.lockWindowBuilderProvider = lockWindowBuilderProvider;
|
|
|
- this.quitWindowBuilderProvider = quitWindowBuilderProvider;
|
|
|
+ this.quitWindow = quitWindow;
|
|
|
this.trayIntegration = trayIntegration;
|
|
|
this.appearanceProvider = appearanceProvider;
|
|
|
this.vaultService = vaultService;
|
|
@@ -70,7 +69,7 @@ public class FxApplication extends Application {
|
|
|
LOG.trace("FxApplication.start()");
|
|
|
Platform.setImplicitExit(false);
|
|
|
|
|
|
- EasyBind.subscribe(hasVisibleStages, this::hasVisibleStagesChanged);
|
|
|
+ hasVisibleStages.addListener(this::hasVisibleStagesChanged);
|
|
|
|
|
|
settings.theme().addListener(this::appThemeChanged);
|
|
|
loadSelectedStyleSheet(settings.theme().get());
|
|
@@ -81,7 +80,7 @@ public class FxApplication extends Application {
|
|
|
throw new UnsupportedOperationException("Use start() instead.");
|
|
|
}
|
|
|
|
|
|
- private void hasVisibleStagesChanged(boolean newValue) {
|
|
|
+ private void hasVisibleStagesChanged(@SuppressWarnings("unused") ObservableValue<? extends Boolean> observableValue, @SuppressWarnings("unused") boolean oldValue, boolean newValue) {
|
|
|
if (newValue) {
|
|
|
trayIntegration.ifPresent(TrayIntegrationProvider::restoredFromTray);
|
|
|
} else {
|
|
@@ -119,7 +118,7 @@ public class FxApplication extends Application {
|
|
|
|
|
|
public void showQuitWindow(QuitResponse response) {
|
|
|
Platform.runLater(() -> {
|
|
|
- quitWindowBuilderProvider.get().quitResponse(response).build().showQuitWindow();
|
|
|
+ quitWindow.get().showQuitWindow(response);
|
|
|
LOG.debug("Showing QuitWindow");
|
|
|
});
|
|
|
}
|