diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index a73b82bf4..cbfd7e9b7 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -22,10 +22,11 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge ui->persistentValue->hide(); } - ui->countdownBeep->addItem(tr("Silent")); - ui->countdownBeep->addItem(tr("Beeps")); + ui->countdownBeep->setField(&timer.countdownBeep, this); + ui->countdownBeep->addItem(tr("Silent"), 0); + ui->countdownBeep->addItem(tr("Beeps"), 1); if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard())) - ui->countdownBeep->addItem(tr("Voice")); + ui->countdownBeep->addItem(tr("Voice"), 2); lock = false; } @@ -56,7 +57,6 @@ void TimerPanel::update() ui->persistentValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(seconds, 2, 10, QLatin1Char('0'))); } - ui->countdownBeep->setCurrentIndex(timer.countdownBeep); ui->minuteBeep->setChecked(timer.minuteBeep); } @@ -80,12 +80,6 @@ void TimerPanel::on_persistent_toggled(bool checked) emit modified(); } -void TimerPanel::on_countdownBeep_currentIndexChanged(int index) -{ - timer.countdownBeep = index; - emit modified(); -} - void TimerPanel::on_minuteBeep_toggled(bool checked) { timer.minuteBeep = checked; diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h index 3063c2833..79c342221 100644 --- a/companion/src/modeledit/setup.h +++ b/companion/src/modeledit/setup.h @@ -30,7 +30,6 @@ class TimerPanel : public ModelPanel void on_value_editingFinished(); void on_persistent_toggled(bool checked); void on_minuteBeep_toggled(bool checked); - void on_countdownBeep_currentIndexChanged(int index); private: TimerData & timer; diff --git a/companion/src/modeledit/setup_timer.ui b/companion/src/modeledit/setup_timer.ui index 7ee2ae523..84d350f21 100644 --- a/companion/src/modeledit/setup_timer.ui +++ b/companion/src/modeledit/setup_timer.ui @@ -41,7 +41,7 @@ - + @@ -79,6 +79,13 @@ + + + QUnsignedAutoComboBox + QComboBox +
qautocombobox.h
+
+