'next' EEPROM support continued: Timer countdown modes
This commit is contained in:
@@ -19,13 +19,10 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
|
||||
ui->persistentValue->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(minuteBeep)) {
|
||||
ui->minuteBeep->hide();
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(countdownBeep)) {
|
||||
ui->countdownBeep->hide();
|
||||
}
|
||||
ui->countdownBeep->addItem(tr("None"));
|
||||
ui->countdownBeep->addItem(tr("Beeps"));
|
||||
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard()))
|
||||
ui->countdownBeep->addItem(tr("Countdown"));
|
||||
}
|
||||
|
||||
TimerPanel::~TimerPanel()
|
||||
@@ -54,13 +51,8 @@ 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')));
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(minuteBeep)) {
|
||||
ui->minuteBeep->setChecked(timer.minuteBeep);
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(countdownBeep)) {
|
||||
ui->countdownBeep->setChecked(timer.countdownBeep);
|
||||
}
|
||||
ui->countdownBeep->setCurrentIndex(timer.countdownBeep);
|
||||
ui->minuteBeep->setChecked(timer.minuteBeep);
|
||||
}
|
||||
|
||||
void TimerPanel::on_value_editingFinished()
|
||||
@@ -81,15 +73,15 @@ void TimerPanel::on_persistent_toggled(bool checked)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TimerPanel::on_minuteBeep_toggled(bool checked)
|
||||
void TimerPanel::on_countdownBeep_currentIndexChanged(int index)
|
||||
{
|
||||
timer.minuteBeep = checked;
|
||||
timer.countdownBeep = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TimerPanel::on_countdownBeep_toggled(bool checked)
|
||||
void TimerPanel::on_minuteBeep_toggled(bool checked)
|
||||
{
|
||||
timer.countdownBeep = checked;
|
||||
timer.minuteBeep = checked;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class TimerPanel : public ModelPanel
|
||||
void on_value_editingFinished();
|
||||
void on_persistent_toggled(bool checked);
|
||||
void on_minuteBeep_toggled(bool checked);
|
||||
void on_countdownBeep_toggled(bool checked);
|
||||
void on_countdownBeep_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
TimerData & timer;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>726</width>
|
||||
<height>54</height>
|
||||
<width>586</width>
|
||||
<height>38</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -33,6 +33,23 @@
|
||||
<item>
|
||||
<widget class="QComboBox" name="mode"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="countdownBeepLabel">
|
||||
<property name="text">
|
||||
<string>Countdown</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="countdownBeep"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="minuteBeep">
|
||||
<property name="text">
|
||||
<string>MinuteBeep</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="persistent">
|
||||
<property name="text">
|
||||
@@ -47,20 +64,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="minuteBeep">
|
||||
<property name="text">
|
||||
<string>MinuteBeep</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="countdownBeep">
|
||||
<property name="text">
|
||||
<string>CountDownBeep</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user