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

Commit 5dcc21c5 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

fix conflict in merge

parents c46fcc3d d6bfc967
Loading
Loading
Loading
Loading
+13 −33
Original line number Diff line number Diff line
@@ -27,14 +27,11 @@ 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;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.animation.FadeTransition;

import javafx.fxml.Initializable;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
@@ -63,11 +60,9 @@ public class MainWindowController implements Initializable {
    @FXML Button nextButton;
    @FXML Label titleLabel;
    
    ResourceBundle i18n ;//internationalization
    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 ResourceBundle i18n ;//internationalization
    private String currentSubRootId =null;
    Phone phone; //Object encapsulating data about the device to flash
    private String currentStepKey = "f0";
    
    private Object subController;
@@ -158,14 +153,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 +192,7 @@ public class MainWindowController implements Initializable {
                    String fxmlName = "";
                    String title ="installationTitle";
                    if(currentStepKey.equals(IStep.LAST_STEP_KEY)){
                        if(isFlashed){
                        if(phone.isFlashed()){
                            fxmlName="7-flashResult.fxml";
                            title="installationTitle";
                        }else{
@@ -213,7 +200,7 @@ public class MainWindowController implements Initializable {
                            title="feedback_mTitle";
                        }
                    }else{
                        final IStep step = factory.getFlashMould().getSteps().get(currentStepKey);
                        final IStep step = phone.getFlashingProcess().getSteps().get(currentStepKey);

                        switch(step.getType()){
                            case "askAccount":
@@ -251,7 +238,7 @@ public class MainWindowController implements Initializable {
                case "flashResultRoot":
                    final String fxmlFileName;
                    final String nextViewTitle;
                    if( isFlashed ){
                    if( phone.isFlashed() ){
                        fxmlFileName = "8-congrats.fxml";
                        nextViewTitle ="congrats_mTitle";
                    }
@@ -284,13 +271,12 @@ public class MainWindowController implements Initializable {
    
    /**
     * Put device object inside the factory
     * @param device the device object
     * @param phone the device object
     */
    public void setDevice(Phone device){
        this.factory.changeMould(device);
        this.device = device;
        CommandExecutionTask.updateCommonParam("DEVICE_ID", device.getSerialNo());
        CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", device.getAdbDevice());
    public void setPhone(Phone phone){
        this.phone = phone;
        CommandExecutionTask.updateCommonParam("DEVICE_ID", phone.getSerialNo());
        CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", phone.getAdbDevice());
    }
    
    /**
@@ -304,7 +290,6 @@ public class MainWindowController implements Initializable {
    
    /**
     * Close previous view after a fadeOut, and open new view
     * @param previousNodeId
     * @param fxmlName
     * @param viewTitle 
     * @param controller optionnal controller for the new UI. Should be null if already defined in FXML
@@ -413,11 +398,6 @@ public class MainWindowController implements Initializable {
            });
    }
    
    
// Private method relative to Flash & preparation Thread
    public ThreadFactory getThreadFactory(){
        return factory;
    }
// Other methods
    /**
     * Method call when app is closing
@@ -461,8 +441,8 @@ public class MainWindowController implements Initializable {
     * Allow subController to access to the device's information
     * @return 
     */
    public Phone getDevice() {
        return device;
    public Phone getPhone() {
        return phone;
    }
    
    
+3 −3
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS
        new Locale.Builder()
       .setRegion("en")
       .setLanguage("EN")
       .setVariant(parentController.getDevice().getInternalCode())
       .setVariant(parentController.getPhone().getInternalCode())
       .build());
    
    private int currentEmphasizedInstruction = 0;
@@ -89,7 +89,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS
        displayInstructionImage(instructions.get(currentEmphasizedInstruction));
        instructionsCount = instructions.size();
        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
@@ -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)){
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public class CustomStepController extends StepController<ICustomStep>{
        new Locale.Builder()
       .setRegion("en")
       .setLanguage("EN")
       .setVariant(parentController.getDevice().getInternalCode())
       .setVariant(parentController.getPhone().getInternalCode())
       .build());
    
    private int currentEmphasizedInstruction = 0; 
@@ -77,7 +77,7 @@ public class CustomStepController extends StepController<ICustomStep>{
        instructionsCount = instructions.size();

        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
+2 −2
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ public class LoadStepController extends StepController<LoadStep> implements Stop
        }
        
        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class StepController<S extends IStep> implements Initializable{
        final String stepKey = parentController.getCurrentStepKey();
        System.out.println("stepKey = "+stepKey);
        
        step = (S) parentController.getThreadFactory().getFlashMould().getSteps().get(stepKey);
        step = (S) parentController.getPhone().getFlashingProcess().getSteps().get(stepKey);
        
        parentController.setNextButtonOnClickListener( ( MouseEvent event) -> {
            if(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){
@@ -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.getPhone().setFlashed();
        }
        parentController.loadSubScene();
        
Loading