Unverified Commit 545d995e authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8773 from DonLakeFlyer/JoystickCherryPicl

Cherry pick joystick fixes from stable and fixup merge
parents 6f98de25 7c595499
......@@ -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();
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment