Refactor health check start:

* replace health tab in options by a button in gernal tab
* move info text of health tab into start controller
* replace lazy loading of config in controller by loading in dagger module
* add new scene+controller for failed config loading
* don't close options window on health check start
This commit is contained in:
Armin Schrenk
2021-07-09 13:51:54 +02:00
parent 8ecb78abec
commit cb5d628cfc
15 changed files with 161 additions and 148 deletions
+29 -18
View File
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.ColumnConstraints?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.health.StartController"
@@ -17,25 +20,33 @@
<Insets topRightBottomLeft="12"/>
</padding>
<children>
<Label text="TODO loading config..." visible="${controller.loading}" managed="${controller.loading}" wrapText="true" contentDisplay="LEFT">
<graphic>
<FontAwesome5IconView glyph="SPINNER"/>
</graphic>
</Label>
<Label text="%health.start.configInvalid" visible="${controller.failed}" managed="${controller.failed}" wrapText="true" contentDisplay="LEFT">
<graphic>
<FontAwesome5IconView glyph="TIMES" styleClass="glyph-icon-red"/>
</graphic>
</Label>
<Label text="%health.start.configValid" visible="${controller.loaded}" managed="${controller.loaded}" wrapText="true" contentDisplay="LEFT">
<graphic>
<FontAwesome5IconView glyph="CHECK" styleClass="glyph-icon-primary"/>
</graphic>
</Label>
<Label text="%vaultOptions.health.introduction" wrapText="true"/>
<Label text="%vaultOptions.health.remarks" wrapText="true"/>
<GridPane >
<padding>
<Insets left="6"/>
</padding>
<columnConstraints>
<ColumnConstraints minWidth="20" halignment="LEFT"/>
<ColumnConstraints fillWidth="true"/>
</columnConstraints>
<rowConstraints>
<RowConstraints valignment="TOP"/>
<RowConstraints valignment="TOP"/>
<RowConstraints valignment="TOP"/>
</rowConstraints>
<Label text="1." GridPane.rowIndex="0" GridPane.columnIndex="0" />
<Label text="%vaultOptions.health.remarkSync" wrapText="true" GridPane.rowIndex="0" GridPane.columnIndex="1" />
<Label text="2." GridPane.rowIndex="1" GridPane.columnIndex="0" />
<Label text="%vaultOptions.health.remarkFix" wrapText="true" GridPane.rowIndex="1" GridPane.columnIndex="1" />
<Label text="3." GridPane.rowIndex="2" GridPane.columnIndex="0" />
<Label text="%vaultOptions.health.remarkBackup" wrapText="true" GridPane.rowIndex="2" GridPane.columnIndex="1" />
</GridPane>
<CheckBox text="%vaultOptions.health.affirmation" fx:id="affirmationBox"/>
<ButtonBar buttonMinWidth="120" buttonOrder="+CX">
<buttons>
<Button text="%generic.button.cancel" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#close"/>
<Button text="%generic.button.next" ButtonBar.buttonData="NEXT_FORWARD" disable="${!controller.loaded}" defaultButton="true" onAction="#next"/>
<Button text="%generic.button.next" ButtonBar.buttonData="NEXT_FORWARD" disable="${!affirmationBox.selected}" defaultButton="true" onAction="#next"/>
</buttons>
</ButtonBar>
</children>
@@ -0,0 +1,19 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Button?>
<VBox xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.cryptomator.ui.health.StartFailController"
minWidth="400"
maxWidth="400"
minHeight="145"
spacing="12">
<Label text="TODO: Error on loading" />
<ButtonBar buttonMinWidth="120" buttonOrder="+CX">
<buttons>
<Button text="%generic.button.close" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#close"/>
</buttons>
</ButtonBar>
</VBox>
@@ -36,13 +36,5 @@
<fx:include source="/fxml/vault_options_masterkey.fxml"/>
</content>
</Tab>
<Tab fx:id="healthTab" id="HEALTH" text="%vaultOptions.health">
<graphic>
<FontAwesome5IconView glyph="STETHOSCOPE"/>
</graphic>
<content>
<fx:include source="/fxml/vault_options_health.fxml"/>
</content>
</Tab>
</tabs>
</TabPane>
@@ -12,6 +12,7 @@
<?import javafx.scene.text.Text?>
<?import org.cryptomator.ui.controls.NumericTextField?>
<?import org.cryptomator.ui.controls.FormattedLabel?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.vaultoptions.GeneralVaultOptionsController"
@@ -39,5 +40,11 @@
<Label text="%vaultOptions.general.actionAfterUnlock"/>
<ChoiceBox fx:id="actionAfterUnlockChoiceBox"/>
</HBox>
<Button fx:id="healthCheckButton" text="%vaultOptions.health.startBtn" onAction="#startHealthCheck">
<graphic>
<FontAwesome5IconView glyph="STETHOSCOPE"/>
</graphic>
</Button>
</children>
</VBox>