fix(cpn): Only timers with active modes should be included in lists (#3956)

* disable timers with mode OFF

* fix isModeOff to reference mode not switch

* update model edit source lists when timer mode changed

* add timer mode test to reset function

* add timer mode test for Set and Reset functions

* change yaml special source TIMERx to Tmrx
This commit is contained in:
Neil Horne
2023-08-28 20:02:54 +10:00
committed by GitHub
parent 78aa381464
commit e46d00e7d0
9 changed files with 42 additions and 17 deletions
+4 -2
View File
@@ -195,6 +195,7 @@ void TimerPanel::onModeChanged(int index)
{
timer.modeChanged();
update();
emit modeChanged();
}
/******************************************************************************/
@@ -1483,7 +1484,8 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware, prevFocus, panelFilteredModels, panelItemModels);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], &TimerPanel::modified, this, &SetupPanel::modified);
connect(timers[i], &TimerPanel::nameChanged, this, &SetupPanel::onTimerNameChanged);
connect(timers[i], &TimerPanel::nameChanged, this, &SetupPanel::onTimerChanged);
connect(timers[i], &TimerPanel::modeChanged, this, &SetupPanel::onTimerChanged);
connect(this, &SetupPanel::updated, timers[i], &TimerPanel::update);
prevFocus = timers[i]->getLastFocus();
// TODO more reliable method required
@@ -2145,7 +2147,7 @@ void SetupPanel::swapTimerData(int idx1, int idx2)
}
}
void SetupPanel::onTimerNameChanged()
void SetupPanel::onTimerChanged()
{
updateItemModels();
}