diff --git a/app/gui/oven_control/cooldownpopup.cpp b/app/gui/oven_control/cooldownpopup.cpp index 170028b..c2fa048 100644 --- a/app/gui/oven_control/cooldownpopup.cpp +++ b/app/gui/oven_control/cooldownpopup.cpp @@ -10,7 +10,8 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : QWidget(parent), ui(new Ui::CooldownPopup), oven(oven), - showingCurrentTemp(false) + showingCurrentTemp(false), + needCookStarting(false) { ui->setupUi(this); @@ -37,6 +38,9 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : expectingFanLevel = oven->maxFan(); started = false; opened = false; + needCookStarting = oven->cooking(); + if (needCookStarting) + oven->stopCooking(); connect(oven, SIGNAL(changed(Oven*)), SLOT(updateView())); @@ -71,6 +75,9 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : CooldownPopup::~CooldownPopup() { + if (needCookStarting) + oven->startCooking(); + delete ui; } @@ -114,6 +121,9 @@ void CooldownPopup::start() started = true; opened = false; + oven->setFan(expectingFanLevel); + oven->startCooldown(); + checkOvenTimer.start(); updateView(); @@ -205,8 +215,6 @@ void CooldownPopup::checkOven() if (oven->door()) { opened = true; - oven->setFan(expectingFanLevel); - oven->startCooldown(); } } else diff --git a/app/gui/oven_control/cooldownpopup.h b/app/gui/oven_control/cooldownpopup.h index 01ce4e9..53dc073 100644 --- a/app/gui/oven_control/cooldownpopup.h +++ b/app/gui/oven_control/cooldownpopup.h @@ -61,6 +61,7 @@ private: int expectingFanLevel; bool started; bool opened; + bool needCookStarting; int lastDisplayedFanLevel; bool lastDisplayedHumidification;