From faaa44d9b94592763e350b1a402c13ad21165ef9 Mon Sep 17 00:00:00 2001 From: nanthony21 Date: Fri, 30 Mar 2018 21:06:45 -0500 Subject: [PATCH] Fixed an apparent bug that prevented the checkbox from accurately representing the active state of the joystick after calibration --- src/VehicleSetup/JoystickConfig.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index 5895ab3..ced3e8a 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -366,8 +366,16 @@ SetupPage { id: enabledCheckBox enabled: _activeJoystick ? _activeJoystick.calibrated : false text: _activeJoystick ? _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") : "" - checked: _activeVehicle.joystickEnabled onClicked: _activeVehicle.joystickEnabled = checked + Component.onCompleted: checked = _activeVehicle.joystickEnabled + + Connections { + target: _activeVehicle + + onJoystickEnabledChanged: { + enabledCheckBox.checked = _activeVehicle.joystickEnabled + } + } Connections { target: joystickManager