Timer modes support in Companion

This commit is contained in:
Bertrand Songis
2014-02-06 22:44:11 +01:00
parent 01242e2b78
commit eb80d75ee1
15 changed files with 225 additions and 292 deletions
+9 -3
View File
@@ -11,8 +11,10 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
{
ui->setupUi(this);
lock = true;
// Mode
populateTimerSwitchCB(ui->mode, timer.mode);
populateSwitchCB(ui->mode, timer.mode, POPULATE_TIMER_MODES);
if (!GetEepromInterface()->getCapability(PermTimers)) {
ui->persistent->hide();
@@ -23,6 +25,8 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
ui->countdownBeep->addItem(tr("Beeps"));
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard()))
ui->countdownBeep->addItem(tr("Countdown"));
lock = false;
}
TimerPanel::~TimerPanel()
@@ -63,8 +67,10 @@ void TimerPanel::on_value_editingFinished()
void TimerPanel::on_mode_currentIndexChanged(int index)
{
timer.mode = TimerMode(ui->mode->itemData(index).toInt());
emit modified();
if (!lock) {
timer.mode = RawSwitch(ui->mode->itemData(index).toInt());
emit modified();
}
}
void TimerPanel::on_persistent_toggled(bool checked)