From 6efac729ae767f16a550dd5ad9959ea580400c2f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 22 Nov 2015 10:31:43 +0100 Subject: [PATCH] Vehicle: Fix joystick enabled state checkbox --- src/Vehicle/Vehicle.cc | 1 + src/VehicleSetup/JoystickConfig.qml | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index bcd6653d4..7ebdcace1 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -838,6 +838,7 @@ void Vehicle::setJoystickEnabled(bool enabled) _joystickEnabled = enabled; _startJoystick(_joystickEnabled); _saveSettings(); + emit joystickEnabledChanged(_joystickEnabled); } void Vehicle::_startJoystick(bool start) diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index 2613ad30d..c5926410f 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -355,12 +355,10 @@ QGCView { QGCCheckBox { - enabled: allowEnableDisable + enabled: _activeJoystick.calibrated text: _activeJoystick.calibrated ? "Enable joystick input" : "Enable/Disable not allowed (Calibrate First)" checked: _activeVehicle.joystickEnabled - property bool allowEnableDisable: _activeJoystick.calibrated - onClicked: _activeVehicle.joystickEnabled = checked } -- 2.22.0