mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-23 13:11:28 +00:00
Added welcome screen and onboarding text
This commit is contained in:
@@ -87,6 +87,11 @@ abstract class MainWindowModule {
|
||||
@IntoMap
|
||||
@FxControllerKey(VaultDetailController.class)
|
||||
abstract FxController bindVaultDetailController(VaultDetailController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(WelcomeController.class)
|
||||
abstract FxController bindWelcomeController(WelcomeController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.cryptomator.ui.mainwindow;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@MainWindowScoped
|
||||
public class WelcomeController implements FxController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(WelcomeController.class);
|
||||
private static final String GETTING_STARTED_URI = "https://docs.cryptomator.org/en/latest/desktop/basic-concepts/";
|
||||
|
||||
private final Application application;
|
||||
private final BooleanBinding noVaultPresent;
|
||||
|
||||
@Inject
|
||||
public WelcomeController(Application application, ObservableList<Vault> vaults) {
|
||||
this.application = application;
|
||||
this.noVaultPresent = Bindings.isEmpty(vaults);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void visitGettingStartedGuide() {
|
||||
LOG.trace("Opening {}", GETTING_STARTED_URI);
|
||||
application.getHostServices().showDocument(GETTING_STARTED_URI);
|
||||
}
|
||||
|
||||
/* Getter/Setter */
|
||||
|
||||
public BooleanBinding noVaultPresentProperty() {
|
||||
return noVaultPresent;
|
||||
}
|
||||
|
||||
public boolean isNoVaultPresent() {
|
||||
return noVaultPresent.get();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.Tooltip?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Region?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
|
||||
@@ -13,14 +13,13 @@
|
||||
<VBox xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailController"
|
||||
styleClass="vault-detail"
|
||||
minWidth="300"
|
||||
spacing="36">
|
||||
<padding>
|
||||
<Insets topRightBottomLeft="24"/>
|
||||
</padding>
|
||||
<children>
|
||||
<HBox spacing="12" visible="${controller.anyVaultSelected}">
|
||||
<HBox spacing="12" visible="${controller.anyVaultSelected}" managed="${controller.anyVaultSelected}">
|
||||
<StackPane alignment="CENTER">
|
||||
<Circle styleClass="glyph-icon-primary" radius="16"/>
|
||||
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="${controller.glyph}" HBox.hgrow="NEVER" glyphSize="16"/>
|
||||
@@ -48,6 +47,7 @@
|
||||
</VBox>
|
||||
</HBox>
|
||||
|
||||
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_welcome.fxml" visible="${!controller.anyVaultSelected}" managed="${!controller.anyVaultSelected}"/>
|
||||
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_locked.fxml" visible="${controller.vault.locked}" managed="${controller.vault.locked}"/>
|
||||
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_unlocked.fxml" visible="${controller.vault.unlocked}" managed="${controller.vault.unlocked}"/>
|
||||
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_missing.fxml" visible="${controller.vault.missing}" managed="${controller.vault.missing}"/>
|
||||
|
||||
23
main/ui/src/main/resources/fxml/vault_detail_welcome.fxml
Normal file
23
main/ui/src/main/resources/fxml/vault_detail_welcome.fxml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?import javafx.scene.control.Hyperlink?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
<?import javafx.scene.text.TextFlow?>
|
||||
<VBox xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="org.cryptomator.ui.mainwindow.WelcomeController"
|
||||
alignment="CENTER"
|
||||
spacing="24">
|
||||
<children>
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="128" preserveRatio="true" smooth="true" cache="true">
|
||||
<Image url="/bot.png"/>
|
||||
</ImageView>
|
||||
|
||||
<TextFlow prefWidth="-Infinity" visible="${controller.noVaultPresent}" managed="${controller.noVaultPresent}">
|
||||
<Text text="%main.vaultDetail.welcomeOnboarding"/>
|
||||
<Text text=" "/>
|
||||
<Hyperlink text="docs.cryptomator.org" styleClass="hyperlink-underline" onAction="#visitGettingStartedGuide"/>
|
||||
</TextFlow>
|
||||
</children>
|
||||
</VBox>
|
||||
@@ -160,6 +160,8 @@ main.vaultlist.emptyList.onboardingInstruction=Click here to add a vault
|
||||
main.vaultlist.contextMenu.remove=Remove Vault
|
||||
main.vaultlist.addVaultBtn=Add Vault
|
||||
## Vault Detail
|
||||
### Welcome
|
||||
main.vaultDetail.welcomeOnboarding=Thanks for choosing Cryptomator to protect your files. If you need any assistance, check out our getting started guides:
|
||||
### Locked
|
||||
main.vaultDetail.lockedStatus=LOCKED
|
||||
main.vaultDetail.unlockBtn=Unlock
|
||||
|
||||
Reference in New Issue
Block a user