From 1a33911bec1e5df697f929495dcce8c32b43dc06 Mon Sep 17 00:00:00 2001 From: Reksotiv Date: Wed, 30 Dec 2020 23:17:53 +0300 Subject: [PATCH] improved compatibility with the old configurator --- src/widgets/axes.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/widgets/axes.cpp b/src/widgets/axes.cpp index 41f8661..bba7ae0 100644 --- a/src/widgets/axes.cpp +++ b/src/widgets/axes.cpp @@ -254,11 +254,16 @@ void Axes::readFromConfig() // Converter::EnumToIndex(device_enum, list) ui->checkBox_Center->setChecked(axCfg->is_centered); ui->spinBox_CalibMax->setValue(axCfg->calib_max); // axes to buttons - m_lastA2bCount = a2bCfg->buttons_cnt; - ui->spinBox_A2bCount->setValue(a2bCfg->buttons_cnt); - if (a2bCfg->buttons_cnt > 1) { - for (int i = 0; i < a2bCfg->buttons_cnt + 1; ++i) { - ui->widget_A2bSlider->setPointValue(a2bCfg->points[i], i); + if (a2bCfg->is_enabled == 0) { + m_lastA2bCount = 0; + ui->spinBox_A2bCount->setValue(0); + } else { + m_lastA2bCount = a2bCfg->buttons_cnt; + ui->spinBox_A2bCount->setValue(a2bCfg->buttons_cnt); + if (a2bCfg->buttons_cnt > 1) { + for (int i = 0; i < a2bCfg->buttons_cnt + 1; ++i) { + ui->widget_A2bSlider->setPointValue(a2bCfg->points[i], i); + } } } // axes extended settings