Browse Source

Merge pull request #8773 from DonLakeFlyer/JoystickCherryPicl

Cherry pick joystick fixes from stable and fixup merge
QGC4.4
Don Gagne 5 years ago committed by GitHub
parent
commit
545d995e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Joystick/Joystick.cc
  2. 10
      src/VehicleSetup/JoystickConfigButtons.qml

2
src/Joystick/Joystick.cc

@ -280,7 +280,7 @@ void Joystick::_loadSettings() @@ -280,7 +280,7 @@ void Joystick::_loadSettings()
for (int button = 0; button < _totalButtonCount; button++) {
QString a = settings.value(QString(_buttonActionNameKey).arg(button), QString()).toString();
if(!a.isEmpty() && _findAssignableButtonAction(a) >= 0 && a != _buttonActionNone) {
if(!a.isEmpty() && a != _buttonActionNone) {
if(_buttonActionArray[button]) {
_buttonActionArray[button]->deleteLater();
}

10
src/VehicleSetup/JoystickConfigButtons.qml

@ -75,16 +75,18 @@ Item { @@ -75,16 +75,18 @@ Item {
id: buttonActionCombo
width: ScreenTools.defaultFontPixelWidth * 26
model: _activeJoystick ? _activeJoystick.assignableActionTitles : []
onActivated: {
_activeJoystick.setButtonAction(modelData, textAt(index))
}
Component.onCompleted: {
function _findCurrentButtonAction() {
if(_activeJoystick) {
var i = find(_activeJoystick.buttonActions[modelData])
if(i < 0) i = 0
currentIndex = i
}
}
Component.onCompleted: _findCurrentButtonAction()
onModelChanged: _findCurrentButtonAction()
onActivated: _activeJoystick.setButtonAction(modelData, textAt(index))
}
QGCCheckBox {
id: repeatCheck

Loading…
Cancel
Save