changed dialog prefix

This commit is contained in:
Jan-Peter Klein
2024-06-13 11:51:01 +02:00
parent 1ba401b8e6
commit 1ac017e3ab
12 changed files with 79 additions and 79 deletions

View File

@@ -12,7 +12,7 @@ public enum FxmlFile {
CONVERTVAULT_HUBTOPASSWORD_START("/fxml/convertvault_hubtopassword_start.fxml"), //
CONVERTVAULT_HUBTOPASSWORD_CONVERT("/fxml/convertvault_hubtopassword_convert.fxml"), //
CONVERTVAULT_HUBTOPASSWORD_SUCCESS("/fxml/convertvault_hubtopassword_success.fxml"), //
DOKANY_INFO_DIALOG("/fxml/dokany_info.fxml"), //
DOKANY_SUPPORT_END_DIALOG("/fxml/dokany_support_end.fxml"), //
ERROR("/fxml/error.fxml"), //
FORGET_PASSWORD("/fxml/forget_password.fxml"), //
HEALTH_START("/fxml/health_start.fxml"), //

View File

@@ -1,34 +0,0 @@
package org.cryptomator.ui.dokanyinfodialog;
import dagger.Lazy;
import dagger.Subcomponent;
import org.cryptomator.ui.common.FxmlFile;
import org.cryptomator.ui.common.FxmlScene;
import javafx.scene.Scene;
import javafx.stage.Stage;
@DokanyInfoDialogScoped
@Subcomponent(modules = {DokanyInfoDialogModule.class})
public interface DokanyInfoDialogComponent {
@DokanyInfoDialogWindow
Stage window();
@FxmlScene(FxmlFile.DOKANY_INFO_DIALOG)
Lazy<Scene> dokanyInfoScene();
default void showDokanyInfoWindow() {
Stage stage = window();
stage.setScene(dokanyInfoScene().get());
stage.sizeToScene();
stage.show();
}
@Subcomponent.Factory
interface Factory {
DokanyInfoDialogComponent create();
}
}

View File

@@ -0,0 +1,34 @@
package org.cryptomator.ui.dokanysupportenddialog;
import dagger.Lazy;
import dagger.Subcomponent;
import org.cryptomator.ui.common.FxmlFile;
import org.cryptomator.ui.common.FxmlScene;
import javafx.scene.Scene;
import javafx.stage.Stage;
@DokanySupportEndDialogScoped
@Subcomponent(modules = {DokanySupportEndDialogModule.class})
public interface DokanySupportEndDialogComponent {
@DokanySupportEndDialogWindow
Stage window();
@FxmlScene(FxmlFile.DOKANY_SUPPORT_END_DIALOG)
Lazy<Scene> dokanySupportEndScene();
default void showDokanySupportEndWindow() {
Stage stage = window();
stage.setScene(dokanySupportEndScene().get());
stage.sizeToScene();
stage.show();
}
@Subcomponent.Factory
interface Factory {
DokanySupportEndDialogComponent create();
}
}

View File

@@ -1,4 +1,4 @@
package org.cryptomator.ui.dokanyinfodialog;
package org.cryptomator.ui.dokanysupportenddialog;
import org.cryptomator.ui.common.FxController;
import org.cryptomator.ui.fxapp.FxApplicationWindows;
@@ -9,14 +9,14 @@ import javafx.fxml.FXML;
import javafx.stage.Stage;
@DokanyInfoDialogScoped
public class DokanyInfoDialogController implements FxController {
@DokanySupportEndDialogScoped
public class DokanySupportEndDialogController implements FxController {
private final Stage window;
private final FxApplicationWindows applicationWindows;
@Inject
DokanyInfoDialogController(@DokanyInfoDialogWindow Stage window, FxApplicationWindows applicationWindows) {
DokanySupportEndDialogController(@DokanySupportEndDialogWindow Stage window, FxApplicationWindows applicationWindows) {
this.window = window;
this.applicationWindows = applicationWindows;
}

View File

@@ -1,4 +1,4 @@
package org.cryptomator.ui.dokanyinfodialog;
package org.cryptomator.ui.dokanysupportenddialog;
import dagger.Binds;
import dagger.Module;
@@ -20,21 +20,21 @@ import java.util.Map;
import java.util.ResourceBundle;
@Module
abstract class DokanyInfoDialogModule {
abstract class DokanySupportEndDialogModule {
@Provides
@DokanyInfoDialogWindow
@DokanyInfoDialogScoped
@DokanySupportEndDialogWindow
@DokanySupportEndDialogScoped
static FxmlLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) {
return new FxmlLoaderFactory(factories, sceneFactory, resourceBundle);
}
@Provides
@DokanyInfoDialogWindow
@DokanyInfoDialogScoped
@DokanySupportEndDialogWindow
@DokanySupportEndDialogScoped
static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle) {
Stage stage = factory.create();
stage.setTitle(resourceBundle.getString("dokanyInfo.title"));
stage.setTitle(resourceBundle.getString("dokanySupportEnd.title"));
stage.setMinWidth(500);
stage.setMinHeight(100);
stage.initModality(Modality.APPLICATION_MODAL);
@@ -42,16 +42,16 @@ abstract class DokanyInfoDialogModule {
}
@Provides
@FxmlScene(FxmlFile.DOKANY_INFO_DIALOG)
@DokanyInfoDialogScoped
static Scene provideDokanyInfoDialogScene(@DokanyInfoDialogWindow FxmlLoaderFactory fxmlLoaders) {
return fxmlLoaders.createScene(FxmlFile.DOKANY_INFO_DIALOG);
@FxmlScene(FxmlFile.DOKANY_SUPPORT_END_DIALOG)
@DokanySupportEndDialogScoped
static Scene provideDokanySupportEndDialogScene(@DokanySupportEndDialogWindow FxmlLoaderFactory fxmlLoaders) {
return fxmlLoaders.createScene(FxmlFile.DOKANY_SUPPORT_END_DIALOG);
}
@Binds
@IntoMap
@FxControllerKey(DokanyInfoDialogController.class)
abstract FxController bindDokanyInfoDialogController(DokanyInfoDialogController controller);
@FxControllerKey(DokanySupportEndDialogController.class)
abstract FxController bindDokanySupportEndDialogController(DokanySupportEndDialogController controller);
}

View File

@@ -1,4 +1,4 @@
package org.cryptomator.ui.dokanyinfodialog;
package org.cryptomator.ui.dokanysupportenddialog;
import javax.inject.Scope;
import java.lang.annotation.Documented;
@@ -8,6 +8,6 @@ import java.lang.annotation.RetentionPolicy;
@Scope
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface DokanyInfoDialogScoped {
@interface DokanySupportEndDialogScoped {
}

View File

@@ -1,4 +1,4 @@
package org.cryptomator.ui.dokanyinfodialog;
package org.cryptomator.ui.dokanysupportenddialog;
import javax.inject.Qualifier;
import java.lang.annotation.Documented;
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Qualifier
@Documented
@Retention(RUNTIME)
@interface DokanyInfoDialogWindow {
@interface DokanySupportEndDialogWindow {
}

View File

@@ -77,17 +77,17 @@ public class FxApplication {
}
var dokany = "org.cryptomator.frontend.dokany.mount.DokanyMountProvider";
boolean dokanyInfoWindowShown = false;
boolean dokanySupportEndWindowShown = false;
if (settings.mountService.getValueSafe().equals(dokany)) {
appWindows.showDokanyInfoWindow();
dokanyInfoWindowShown = true;
appWindows.showDokanySupportEndWindow();
dokanySupportEndWindowShown = true;
settings.mountService.set(null);
}
for (VaultSettings vaultSettings : settings.directories) {
if (vaultSettings.mountService.getValueSafe().equals(dokany)) {
if (!dokanyInfoWindowShown) {
appWindows.showDokanyInfoWindow();
dokanyInfoWindowShown = true;
if (!dokanySupportEndWindowShown) {
appWindows.showDokanySupportEndWindow();
dokanySupportEndWindowShown = true;
}
vaultSettings.mountService.set(null);
}

View File

@@ -7,7 +7,7 @@ package org.cryptomator.ui.fxapp;
import dagger.Module;
import dagger.Provides;
import org.cryptomator.ui.dokanyinfodialog.DokanyInfoDialogComponent;
import org.cryptomator.ui.dokanysupportenddialog.DokanySupportEndDialogComponent;
import org.cryptomator.ui.error.ErrorComponent;
import org.cryptomator.ui.health.HealthCheckComponent;
import org.cryptomator.ui.lock.LockComponent;
@@ -34,7 +34,7 @@ import java.io.InputStream;
ErrorComponent.class, //
HealthCheckComponent.class, //
UpdateReminderComponent.class, //
DokanyInfoDialogComponent.class, //
DokanySupportEndDialogComponent.class, //
ShareVaultComponent.class})
abstract class FxApplicationModule {

View File

@@ -5,7 +5,7 @@ import dagger.Lazy;
import org.cryptomator.common.vaults.Vault;
import org.cryptomator.common.vaults.VaultState;
import org.cryptomator.integrations.tray.TrayIntegrationProvider;
import org.cryptomator.ui.dokanyinfodialog.DokanyInfoDialogComponent;
import org.cryptomator.ui.dokanysupportenddialog.DokanySupportEndDialogComponent;
import org.cryptomator.ui.error.ErrorComponent;
import org.cryptomator.ui.lock.LockComponent;
import org.cryptomator.ui.mainwindow.MainWindowComponent;
@@ -49,7 +49,7 @@ public class FxApplicationWindows {
private final QuitComponent.Builder quitWindowBuilder;
private final UnlockComponent.Factory unlockWorkflowFactory;
private final UpdateReminderComponent.Factory updateReminderWindowBuilder;
private final DokanyInfoDialogComponent.Factory dokanyInfoWindowBuilder;
private final DokanySupportEndDialogComponent.Factory dokanySupportEndWindowBuilder;
private final LockComponent.Factory lockWorkflowFactory;
private final ErrorComponent.Factory errorWindowFactory;
private final ExecutorService executor;
@@ -65,7 +65,7 @@ public class FxApplicationWindows {
QuitComponent.Builder quitWindowBuilder, //
UnlockComponent.Factory unlockWorkflowFactory, //
UpdateReminderComponent.Factory updateReminderWindowBuilder, //
DokanyInfoDialogComponent.Factory dokanyInfoWindowBuilder, //
DokanySupportEndDialogComponent.Factory dokanySupportEndWindowBuilder, //
LockComponent.Factory lockWorkflowFactory, //
ErrorComponent.Factory errorWindowFactory, //
VaultOptionsComponent.Factory vaultOptionsWindow, //
@@ -78,7 +78,7 @@ public class FxApplicationWindows {
this.quitWindowBuilder = quitWindowBuilder;
this.unlockWorkflowFactory = unlockWorkflowFactory;
this.updateReminderWindowBuilder = updateReminderWindowBuilder;
this.dokanyInfoWindowBuilder = dokanyInfoWindowBuilder;
this.dokanySupportEndWindowBuilder = dokanySupportEndWindowBuilder;
this.lockWorkflowFactory = lockWorkflowFactory;
this.errorWindowFactory = errorWindowFactory;
this.executor = executor;
@@ -146,8 +146,8 @@ public class FxApplicationWindows {
CompletableFuture.runAsync(() -> updateReminderWindowBuilder.create().checkAndShowUpdateReminderWindow(), Platform::runLater);
}
public void showDokanyInfoWindow() {
CompletableFuture.runAsync(() -> dokanyInfoWindowBuilder.create().showDokanyInfoWindow(), Platform::runLater);
public void showDokanySupportEndWindow() {
CompletableFuture.runAsync(() -> dokanySupportEndWindowBuilder.create().showDokanySupportEndWindow(), Platform::runLater);
}