mirror of
https://github.com/cryptomator/cryptomator.git
synced 2024-11-23 12:09:45 +00:00
remove startFail controller entirely
This commit is contained in:
parent
460e6528bf
commit
09a2f76e15
@ -12,7 +12,6 @@ public enum FxmlFile {
|
||||
ERROR("/fxml/error.fxml"), //
|
||||
FORGET_PASSWORD("/fxml/forget_password.fxml"), //
|
||||
HEALTH_START("/fxml/health_start.fxml"), //
|
||||
HEALTH_START_FAIL("/fxml/health_start_fail.fxml"), //
|
||||
HEALTH_CHECK_LIST("/fxml/health_check_list.fxml"), //
|
||||
LOCK_FORCED("/fxml/lock_forced.fxml"), //
|
||||
LOCK_FAILED("/fxml/lock_failed.fxml"), //
|
||||
|
@ -116,13 +116,6 @@ abstract class HealthCheckModule {
|
||||
return fxmlLoaders.createScene(FxmlFile.HEALTH_START);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.HEALTH_START_FAIL)
|
||||
@HealthCheckScoped
|
||||
static Scene provideHealthStartFailScene(@HealthCheckWindow FxmlLoaderFactory fxmlLoaders) {
|
||||
return fxmlLoaders.createScene(FxmlFile.HEALTH_START_FAIL);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.HEALTH_CHECK_LIST)
|
||||
@HealthCheckScoped
|
||||
@ -135,11 +128,6 @@ abstract class HealthCheckModule {
|
||||
@FxControllerKey(StartController.class)
|
||||
abstract FxController bindStartController(StartController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(StartFailController.class)
|
||||
abstract FxController bindStartFailController(StartFailController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(CheckListController.class)
|
||||
|
@ -1,79 +0,0 @@
|
||||
package org.cryptomator.ui.health;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.cryptomator.cryptofs.VaultConfigLoadException;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.controls.FontAwesome5Icon;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TitledPane;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
// TODO reevaluate config loading, as soon as we have the new generic error screen
|
||||
@HealthCheckScoped
|
||||
@Deprecated
|
||||
public class StartFailController implements FxController {
|
||||
|
||||
private final Stage window;
|
||||
private final ObjectProperty<Throwable> loadError;
|
||||
private final ObjectProperty<FontAwesome5Icon> moreInfoIcon;
|
||||
|
||||
/* FXML */
|
||||
public TitledPane moreInfoPane;
|
||||
|
||||
@Inject
|
||||
public StartFailController(@HealthCheckWindow Stage window) {
|
||||
this.window = window;
|
||||
this.loadError = new SimpleObjectProperty<>(new IllegalStateException("This class is not reachable anymore"));
|
||||
this.moreInfoIcon = new SimpleObjectProperty<>(FontAwesome5Icon.CARET_RIGHT);
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
moreInfoPane.expandedProperty().addListener(this::setMoreInfoIcon);
|
||||
}
|
||||
|
||||
private void setMoreInfoIcon(ObservableValue<? extends Boolean> observable, boolean wasExpanded, boolean willExpand) {
|
||||
moreInfoIcon.set(willExpand ? FontAwesome5Icon.CARET_DOWN : FontAwesome5Icon.CARET_RIGHT);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void close() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* Getter & Setter */
|
||||
|
||||
public ObjectProperty<FontAwesome5Icon> moreInfoIconProperty() {
|
||||
return moreInfoIcon;
|
||||
}
|
||||
|
||||
public FontAwesome5Icon getMoreInfoIcon() {
|
||||
return moreInfoIcon.getValue();
|
||||
}
|
||||
|
||||
public String getStackTrace() {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
loadError.get().printStackTrace(new PrintStream(baos));
|
||||
return baos.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public String getLocalizedErrorMessage() {
|
||||
return loadError.get().getLocalizedMessage();
|
||||
}
|
||||
|
||||
public boolean isParseException() {
|
||||
return loadError.get() instanceof VaultConfigLoadException;
|
||||
}
|
||||
|
||||
public boolean isIoException() {
|
||||
return !isParseException();
|
||||
}
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ButtonBar?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.TextArea?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.TitledPane?>
|
||||
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
|
||||
<?import javafx.scene.layout.Region?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.text.TextFlow?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
<VBox xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="org.cryptomator.ui.health.StartFailController"
|
||||
prefWidth="600"
|
||||
prefHeight="400"
|
||||
spacing="12">
|
||||
<padding>
|
||||
<Insets topRightBottomLeft="12"/>
|
||||
</padding>
|
||||
<Label text="%health.fail.header" styleClass="label-large" />
|
||||
<TextFlow fx:id="ioErrorLabel" visible="${controller.ioException}" managed="${controller.ioException}">
|
||||
<Text text="%health.fail.ioError" />
|
||||
<Text text="${controller.localizedErrorMessage}"/>
|
||||
</TextFlow>
|
||||
<Label fx:id="parseErrorLabel" text="%health.fail.parseError" visible="${controller.parseException}" managed="${controller.parseException}"/>
|
||||
<TitledPane fx:id="moreInfoPane" text="%health.fail.moreInfo" expanded="false">
|
||||
<graphic>
|
||||
<HBox alignment="CENTER" minWidth="8">
|
||||
<FontAwesome5IconView glyph="${controller.moreInfoIcon}"/>
|
||||
</HBox>
|
||||
</graphic>
|
||||
<content>
|
||||
<TextArea VBox.vgrow="ALWAYS" text="${controller.stackTrace}" prefRowCount="20" editable="false" />
|
||||
</content>
|
||||
</TitledPane>
|
||||
<Region VBox.vgrow="ALWAYS"/>
|
||||
<ButtonBar buttonMinWidth="120" buttonOrder="+CX">
|
||||
<buttons>
|
||||
<Button text="%generic.button.close" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#close"/>
|
||||
</buttons>
|
||||
</ButtonBar>
|
||||
</VBox>
|
Loading…
Reference in New Issue
Block a user