diff --git a/app/gui/oven_control/primewindow.cpp b/app/gui/oven_control/primewindow.cpp index e1fee28..6412b06 100644 --- a/app/gui/oven_control/primewindow.cpp +++ b/app/gui/oven_control/primewindow.cpp @@ -140,29 +140,47 @@ void PrimeWindow::keyReleaseEvent(QKeyEvent *event) void PrimeWindow::on_mostCookedButton_toggled(bool checked) { - if (!checked) - return; - -// listButtons(CookHistory::listMostCooked()); - listMostCooked(); + if (checked) + listMostCooked(); + else + { + if (!ui->recentsButton->isChecked() && !ui->favoritesButton->isChecked()) + { + ui->mostCookedButton->blockSignals(true); + ui->mostCookedButton->setChecked(true); + ui->mostCookedButton->blockSignals(false); + } + } } void PrimeWindow::on_recentsButton_toggled(bool checked) { - if (!checked) - return; - -// listButtons(CookHistory::listRecents()); - listRecents(); + if (checked) + listRecents(); + else + { + if (!ui->mostCookedButton->isChecked() && !ui->favoritesButton->isChecked()) + { + ui->recentsButton->blockSignals(true); + ui->recentsButton->setChecked(true); + ui->recentsButton->blockSignals(false); + } + } } void PrimeWindow::on_favoritesButton_toggled(bool checked) { - if (!checked) - return; - -// listButtons(CookHistory::listFavorites()); - listFavorites(); + if (checked) + listFavorites(); + else + { + if (!ui->mostCookedButton->isChecked() && !ui->recentsButton->isChecked()) + { + ui->favoritesButton->blockSignals(true); + ui->favoritesButton->setChecked(true); + ui->favoritesButton->blockSignals(false); + } + } } void PrimeWindow::listButtons(QList records)