diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java index 2f05f677f96a1c50ba7eccc4cb88885011c11639..a976ce347da19c454b065bb145bed54d289e085b 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java @@ -26,6 +26,7 @@ import javafx.concurrent.WorkerStateEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.Label; +import javafx.scene.image.ImageView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -37,6 +38,8 @@ public class DeviceDetectedController extends AbstractSubController{ @FXML private Button buyNewDevice; @FXML private Button startDetectionButton; @FXML private Label detectionMsg; + @FXML private Label acceptFingeprintLbl; + @FXML private ImageView acceptFingerprintImgView; private int detectionAskCounter = 0; @@ -44,10 +47,7 @@ public class DeviceDetectedController extends AbstractSubController{ public void initialize(URL location, ResourceBundle resources){ super.initialize(location, resources); - startDetectionButton.setManaged(false); - startDetectionButton.setVisible(false); - buyNewDevice.setVisible(false); - buyNewDevice.setManaged(false); + hideButtons(); detectionMsg.setText(i18n.getString("detect_lbl_detecting")); startDetection(); } @@ -57,10 +57,13 @@ public class DeviceDetectedController extends AbstractSubController{ */ public void startDetection(){ logger.info("startDetection()"); - startDetectionButton.setManaged(false); - startDetectionButton.setVisible(false); - buyNewDevice.setVisible(false); - buyNewDevice.setManaged(false); + + acceptFingeprintLbl.setManaged(true); + acceptFingeprintLbl.setVisible(true); + acceptFingerprintImgView.setManaged(true); + acceptFingerprintImgView.setVisible(true); + + hideButtons(); ++detectionAskCounter; String labelMsg = i18n.getString("detect_lbl_detecting"); @@ -81,6 +84,7 @@ public class DeviceDetectedController extends AbstractSubController{ if(resourceUrl == null){ displayIncompatibleDeviceFound(result.getModel()); }else{ + hideRSAFingerprintNodes(); //AppConstants.setDeviceModel(result.getDevice()); detectionMsg.setText(String.format(i18n.getString("detect_lbl_compatibleDeviceFound"), model)); if(parentController != null){ @@ -107,6 +111,7 @@ public class DeviceDetectedController extends AbstractSubController{ */ private void displayUnknowDeviceFound(){ detectionMsg.setText(i18n.getString("detect_lbl_unknownDeviceFound")); + showTryAgainButton(); displayBuyNewDeviceBtn(); } @@ -117,6 +122,7 @@ public class DeviceDetectedController extends AbstractSubController{ */ private void displayIncompatibleDeviceFound(String model){ detectionMsg.setText(String.format(i18n.getString("detect_lbl_incompatibleDeviceFound"), model)); + hideRSAFingerprintNodes(); showTryAgainButton(); displayBuyNewDeviceBtn(); } @@ -138,6 +144,21 @@ public class DeviceDetectedController extends AbstractSubController{ startDetectionButton.setText(i18n.getString("detect_btn_tryWithAnotherDevice")); } + private void hideRSAFingerprintNodes(){ + acceptFingeprintLbl.setManaged(false); + acceptFingeprintLbl.setVisible(false); + acceptFingerprintImgView.setManaged(false); + acceptFingerprintImgView.setVisible(false); + } + + + private void hideButtons(){ + startDetectionButton.setManaged(false); + startDetectionButton.setVisible(false); + buyNewDevice.setManaged(false); + buyNewDevice.setVisible(false); + } + /** * Load nextUI from parentController */ diff --git a/src/main/resources/fxml/4-deviceDetected.fxml b/src/main/resources/fxml/4-deviceDetected.fxml index a0944c6984a4374881858b217b414f9040b2ff1b..832ddf17b324150a06af40217bb16f7d5c8f0ae7 100644 --- a/src/main/resources/fxml/4-deviceDetected.fxml +++ b/src/main/resources/fxml/4-deviceDetected.fxml @@ -25,7 +25,7 @@ - +