diff --git a/src/main/java/org/cryptomator/ui/common/FxmlFile.java b/src/main/java/org/cryptomator/ui/common/FxmlFile.java index 6fc36d48c..c9f687ea4 100644 --- a/src/main/java/org/cryptomator/ui/common/FxmlFile.java +++ b/src/main/java/org/cryptomator/ui/common/FxmlFile.java @@ -15,7 +15,7 @@ public enum FxmlFile { HEALTH_START_FAIL("/fxml/health_start_fail.fxml"), // HEALTH_CHECK_LIST("/fxml/health_check_list.fxml"), // HUB_P12("/fxml/hub_p12.fxml"), // - HUB_AUTH("/fxml/hub_auth.fxml"), // + HUB_RECEIVE_KEY("/fxml/hub_receive_key.fxml"), // LOCK_FORCED("/fxml/lock_forced.fxml"), // LOCK_FAILED("/fxml/lock_failed.fxml"), // MAIN_WINDOW("/fxml/main_window.fxml"), // diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java index e774c486a..9c5d7dd94 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java @@ -76,10 +76,10 @@ public abstract class HubKeyLoadingModule { } @Provides - @FxmlScene(FxmlFile.HUB_AUTH) + @FxmlScene(FxmlFile.HUB_RECEIVE_KEY) @KeyLoadingScoped static Scene provideHubAuthScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) { - return fxmlLoaders.createScene(FxmlFile.HUB_AUTH); + return fxmlLoaders.createScene(FxmlFile.HUB_RECEIVE_KEY); } @Binds @@ -106,7 +106,7 @@ public abstract class HubKeyLoadingModule { @Binds @IntoMap - @FxControllerKey(AuthController.class) - abstract FxController bindAuthController(AuthController controller); + @FxControllerKey(ReceiveKeyController.class) + abstract FxController bindReceiveKeyController(ReceiveKeyController controller); } diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/P12CreateController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/P12CreateController.java index 735950d9e..0700d496b 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/P12CreateController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/P12CreateController.java @@ -8,7 +8,6 @@ import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; import org.cryptomator.ui.common.NewPasswordController; -import org.cryptomator.ui.common.UserInteractionLock; import org.cryptomator.ui.keyloading.KeyLoading; import org.cryptomator.ui.keyloading.KeyLoadingScoped; import org.slf4j.Logger; @@ -40,7 +39,7 @@ public class P12CreateController implements FxController { private final Stage window; private final Environment env; private final AtomicReference keyPairRef; - private final Lazy authScene; + private final Lazy receiveKeyScene; private final BooleanProperty userInteractionDisabled = new SimpleBooleanProperty(); private final ObjectBinding unlockButtonContentDisplay = Bindings.createObjectBinding(this::getUnlockButtonContentDisplay, userInteractionDisabled); @@ -49,11 +48,11 @@ public class P12CreateController implements FxController { public NewPasswordController newPasswordController; @Inject - public P12CreateController(@KeyLoading Stage window, Environment env, AtomicReference keyPairRef, @FxmlScene(FxmlFile.HUB_AUTH) Lazy authScene) { + public P12CreateController(@KeyLoading Stage window, Environment env, AtomicReference keyPairRef, @FxmlScene(FxmlFile.HUB_RECEIVE_KEY) Lazy receiveKeyScene) { this.window = window; this.env = env; this.keyPairRef = keyPairRef; - this.authScene = authScene; + this.receiveKeyScene = receiveKeyScene; this.window.addEventHandler(WindowEvent.WINDOW_HIDING, this::windowClosed); } @@ -82,7 +81,7 @@ public class P12CreateController implements FxController { var keyPair = P12AccessHelper.createNew(p12File, pw); setKeyPair(keyPair); LOG.debug("Created .p12 file {}", p12File); - window.setScene(authScene.get()); + window.setScene(receiveKeyScene.get()); } catch (IOException e) { LOG.error("Failed to load .p12 file.", e); // TODO diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/P12LoadController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/P12LoadController.java index d774aa4c7..9759e92e9 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/P12LoadController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/P12LoadController.java @@ -8,7 +8,6 @@ import org.cryptomator.ui.common.Animations; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; -import org.cryptomator.ui.common.UserInteractionLock; import org.cryptomator.ui.controls.NiceSecurePasswordField; import org.cryptomator.ui.keyloading.KeyLoading; import org.cryptomator.ui.keyloading.KeyLoadingScoped; @@ -42,18 +41,18 @@ public class P12LoadController implements FxController { private final Stage window; private final Environment env; private final AtomicReference keyPairRef; - private final Lazy authScene; + private final Lazy receiveKeyScene; private final BooleanProperty userInteractionDisabled = new SimpleBooleanProperty(); private final ObjectBinding unlockButtonContentDisplay = Bindings.createObjectBinding(this::getUnlockButtonContentDisplay, userInteractionDisabled); public NiceSecurePasswordField passwordField; @Inject - public P12LoadController(@KeyLoading Stage window, Environment env, AtomicReference keyPairRef, @FxmlScene(FxmlFile.HUB_AUTH) Lazy authScene) { + public P12LoadController(@KeyLoading Stage window, Environment env, AtomicReference keyPairRef, @FxmlScene(FxmlFile.HUB_RECEIVE_KEY) Lazy receiveKeyScene) { this.window = window; this.env = env; this.keyPairRef = keyPairRef; - this.authScene = authScene; + this.receiveKeyScene = receiveKeyScene; this.window.addEventHandler(WindowEvent.WINDOW_HIDING, this::windowClosed); } @@ -79,7 +78,7 @@ public class P12LoadController implements FxController { var keyPair = P12AccessHelper.loadExisting(p12File, pw); setKeyPair(keyPair); LOG.debug("Loaded .p12 file {}", p12File); - window.setScene(authScene.get()); + window.setScene(receiveKeyScene.get()); } catch (InvalidPassphraseException e) { LOG.warn("Invalid passphrase entered for .p12 file"); Animations.createShakeWindowAnimation(window).playFromStart(); diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/AuthController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java similarity index 89% rename from src/main/java/org/cryptomator/ui/keyloading/hub/AuthController.java rename to src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java index fdc574225..77f33ee5e 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/AuthController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java @@ -28,9 +28,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.atomic.AtomicReference; @KeyLoadingScoped -public class AuthController implements FxController { +public class ReceiveKeyController implements FxController { - private static final Logger LOG = LoggerFactory.getLogger(AuthController.class); + private static final Logger LOG = LoggerFactory.getLogger(ReceiveKeyController.class); private final Application application; private final ExecutorService executor; @@ -45,7 +45,7 @@ public class AuthController implements FxController { private final AuthReceiveTask receiveTask; @Inject - public AuthController(Application application, ExecutorService executor, @KeyLoading Stage window, AtomicReference keyPairRef, AtomicReference authParamsRef, UserInteractionLock authFlowLock, AtomicReference hubUriRef, ErrorComponent.Builder errorComponent) { + public ReceiveKeyController(Application application, ExecutorService executor, @KeyLoading Stage window, AtomicReference keyPairRef, AtomicReference authParamsRef, UserInteractionLock authFlowLock, AtomicReference hubUriRef, ErrorComponent.Builder errorComponent) { this.application = application; this.executor = executor; this.window = window; diff --git a/src/main/resources/fxml/hub_auth.fxml b/src/main/resources/fxml/hub_receive_key.fxml similarity index 95% rename from src/main/resources/fxml/hub_auth.fxml rename to src/main/resources/fxml/hub_receive_key.fxml index f854e9014..e36731dc5 100644 --- a/src/main/resources/fxml/hub_auth.fxml +++ b/src/main/resources/fxml/hub_receive_key.fxml @@ -13,7 +13,7 @@