Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b3682d6 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

remove MainWindowController 'flashed' property and related getters/setters as...

remove MainWindowController 'flashed' property and related getters/setters as duplicate of device.flashed
parent 7c3a6486
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import ecorp.easy.installer.controllers.stepControllers.Stoppable;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.steps.IStep;
import ecorp.easy.installer.tasks.CommandExecutionTask;
import ecorp.easy.installer.tasks.CommandRunnerService;
import ecorp.easy.installer.threads.ThreadFactory;
import ecorp.easy.installer.utils.UiUtils;

@@ -67,7 +66,6 @@ public class MainWindowController implements Initializable {
    String currentSubRootId =null;
    ThreadFactory factory = new ThreadFactory("/yaml/");
    Phone device; //Object encapsulating data about the device to flash
    private boolean isFlashed = false; // True when /e/ OS installed on device
    private String currentStepKey = "f0";
    
    private Object subController;
@@ -158,14 +156,6 @@ public class MainWindowController implements Initializable {
        this.titleLabel.setText(i18n.getString(titleKey));
    }
    
    /**
     * Tell MainController that device is flashed or not
     * @param isFlashed 
     */
    public void setIsFlashed(boolean isFlashed) {
        this.isFlashed = isFlashed;
    }
    
    /**
     * Load different group of controls depending of the current step (of whole process)
     */
@@ -205,7 +195,7 @@ public class MainWindowController implements Initializable {
                    String fxmlName = "";
                    String title ="installationTitle";
                    if(currentStepKey.equals(IStep.LAST_STEP_KEY)){
                        if(isFlashed){
                        if(device.isFlashed()){
                            fxmlName="7-flashResult.fxml";
                            title="installationTitle";
                        }else{
@@ -251,7 +241,7 @@ public class MainWindowController implements Initializable {
                case "flashResultRoot":
                    final String fxmlFileName;
                    final String nextViewTitle;
                    if( isFlashed ){
                    if( device.isFlashed() ){
                        fxmlFileName = "8-congrats.fxml";
                        nextViewTitle ="congrats_mTitle";
                    }
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS
        
        parentController.resetNextButtonEventHandler(); 
        //parentController.setNextButtonVisible(false);
        parentController.setIsFlashed(false);
        //parentController.setIsFlashed(false);
        parentController.setCurrentStepKey(IStep.LAST_STEP_KEY);
        
        if(i18n.containsKey(errorMsgKey)){
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ public class LoadStepController extends StepController<LoadStep> implements Stop
    
    protected void displayError(String errorMsgKey){
        
        parentController.setIsFlashed(false);
        //parentController.setIsFlashed(false);
        parentController.setCurrentStepKey(IStep.LAST_STEP_KEY);
        parentController.resetNextButtonEventHandler();
        parentController.setNextButtonVisible(true);
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class StepController<S extends IStep> implements Initializable{
        System.out.println("onStepEnd() load: "+step.getNextStepKey());
        parentController.setCurrentStepKey(step.getNextStepKey());
        if(step.getNextStepKey().equals(IStep.LAST_STEP_KEY)){
            parentController.setIsFlashed(true);
            parentController.getDevice().setFlashed();
        }
        parentController.loadSubScene();