diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index cb4312965..9d656348f 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -56,10 +56,8 @@ TimerPanel::TimerPanel(QWidget * parent, ModelData & model, TimerData & timer, G ui->value->setField(timer.val, this); ui->value->setMaximumTime(firmware->getMaxTimerStart()); - // Mode ui->mode->setModel(panelFilteredModels->getItemModel(FIM_TIMERSWITCH)); - ui->mode->setCurrentIndex(ui->mode->findData(timer.mode.toValue())); - connect(ui->mode, SIGNAL(activated(int)), this, SLOT(onModeChanged(int))); + ui->mode->setField(timer.mode, this); ui->countdownBeep->setModel(panelItemModels->getItemModel(AIM_TIMER_COUNTDOWNBEEP)); ui->countdownBeep->setField(timer.countdownBeep, this); @@ -102,7 +100,7 @@ void TimerPanel::update() lock = true; ui->name->updateValue(); - ui->mode->setCurrentIndex(ui->mode->findData(timer.mode.toValue())); + ui->mode->updateValue(); ui->value->updateValue(); ui->countdownBeep->updateValue(); @@ -128,18 +126,6 @@ QWidget * TimerPanel::getLastFocus() return ui->persistent; } -void TimerPanel::onModeChanged(int index) -{ - if (!lock) { - bool ok; - const RawSwitch rs(ui->mode->itemData(index).toInt(&ok)); - if (ok && timer.mode.toValue() != rs.toValue()) { - timer.mode = rs; - emit modified(); - } - } -} - void TimerPanel::connectItemModelEvents(const FilteredItemModel * itemModel) { connect(itemModel, &FilteredItemModel::aboutToBeUpdated, this, &TimerPanel::onItemModelAboutToBeUpdated); diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h index 67c97f669..e62041dc6 100644 --- a/companion/src/modeledit/setup.h +++ b/companion/src/modeledit/setup.h @@ -46,7 +46,6 @@ class TimerPanel : public ModelPanel QWidget * getLastFocus(); private slots: - void onModeChanged(int index); void onNameChanged(); void onItemModelAboutToBeUpdated(); void onItemModelUpdateComplete(); diff --git a/companion/src/modeledit/setup_timer.ui b/companion/src/modeledit/setup_timer.ui index a772c6d30..67b929bdb 100644 --- a/companion/src/modeledit/setup_timer.ui +++ b/companion/src/modeledit/setup_timer.ui @@ -56,7 +56,7 @@ - +