Skip to content

Commit

Permalink
improved compatibility with the old configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
Reksotiv committed Dec 30, 2020
1 parent 2d54285 commit 1a33911
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/widgets/axes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1a33911

Please sign in to comment.