remove startFail controller entirely

This commit is contained in:
Armin Schrenk
2021-09-03 12:02:45 +02:00
parent 460e6528bf
commit 09a2f76e15
4 changed files with 0 additions and 136 deletions

View File

@@ -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"), //

View File

@@ -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)

View File

@@ -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();
}
}