diff --git a/app/gui/oven_control/autocookcheckconfigwindow.cpp b/app/gui/oven_control/autocookcheckconfigwindow.cpp new file mode 100644 index 0000000..c6c3757 --- /dev/null +++ b/app/gui/oven_control/autocookcheckconfigwindow.cpp @@ -0,0 +1,238 @@ +#include "autocookcheckconfigwindow.h" +#include "ui_autocookcheckconfigwindow.h" + +#include <QKeyEvent> + +#include "soundplayer.h" +#include "stringer.h" + +AutoCookCheckConfigWindow::AutoCookCheckConfigWindow(QWidget *parent, Cook cook) : + QMainWindow(parent), + ui(new Ui::AutoCookCheckConfigWindow), + cook(cook) +{ + ui->setupUi(this); + + if (!this->cook.isLoaded()) + this->cook.load(); + + configWidgets.append( + ConfigWidget { + ui->configButton_1, + ui->configMinLabel_1, + ui->configMaxLabel_1, + ui->configCurrentLabel_1, + ui->configSlider_1 + }); + configWidgets.append( + ConfigWidget { + ui->configButton_2, + ui->configMinLabel_2, + ui->configMaxLabel_2, + ui->configCurrentLabel_2, + ui->configSlider_2 + }); + configWidgets.append( + ConfigWidget { + ui->configButton_3, + ui->configMinLabel_3, + ui->configMaxLabel_3, + ui->configCurrentLabel_3, + ui->configSlider_3 + }); + configWidgets.append( + ConfigWidget { + ui->configButton_4, + ui->configMinLabel_4, + ui->configMaxLabel_4, + ui->configCurrentLabel_4, + ui->configSlider_4 + }); + configWidgets.append( + ConfigWidget { + ui->configButton_5, + ui->configMinLabel_5, + ui->configMaxLabel_5, + ui->configCurrentLabel_5, + ui->configSlider_5 + }); + + setupUi(); + + afterThreeSecsTimer.setSingleShot(true); + afterThreeSecsTimer.setInterval(3000); + afterThreeSecsTimer.start(); + connect(&afterThreeSecsTimer, SIGNAL(timeout()), SLOT(afterThreeSecs())); + + foreach (QPushButton *button, findChildren<QPushButton *>()) + connect(button, &QPushButton::pressed, SoundPlayer::playClick); + + foreach (QWidget *w, findChildren<QWidget *>()) + w->installEventFilter(this); + + setFocus(); +} + +AutoCookCheckConfigWindow::~AutoCookCheckConfigWindow() +{ + delete ui; +} + +bool AutoCookCheckConfigWindow::eventFilter(QObject */*watched*/, QEvent *event) +{ + switch (event->type()) + { + case QEvent::KeyPress: + case QEvent::KeyRelease: + case QEvent::MouseButtonPress: + case QEvent::MouseButtonRelease: + case QEvent::MouseMove: + afterThreeSecsTimer.start(); + break; + default: + break; + } + + return false; +} + +void AutoCookCheckConfigWindow::keyPressEvent(QKeyEvent *event) +{ + switch (event->key()) + { + case 0x01000030: // Turn left + onEncoderLeft(); + break; + case 0x01000031: // Push + pushed = focusWidget(); + break; + case 0x01000032: // Turn right + onEncoderRight(); + break; + } +} + +void AutoCookCheckConfigWindow::keyReleaseEvent(QKeyEvent *event) +{ + switch (event->key()) + { + case 0x01000030: // Turn left + onEncoderLeft(); + break; + case 0x01000031: // Push + if (focusWidget() == pushed) + onEncoderClicked(pushed); + + pushed = NULL; + break; + case 0x01000032: // Turn right + onEncoderRight(); + break; + } +} + +void AutoCookCheckConfigWindow::setupUi() +{ + ui->cookTypeIcon->setPixmap(Define::icon(cook.type)); + ui->selectCookButton->setText(cook.name); + + for (int idx = 0; idx < 5; idx++) + { + ConfigWidget cw = configWidgets.at(idx); + + CookConfig config = cook.configs[idx]; + if (config.type == Define::ConfigNotUsed) + { + cw.button->hide(); + cw.minimum->hide(); + cw.maximum->hide(); + cw.current->hide(); + cw.slider->hide(); + } + else + { + ConfigWidget cw = configWidgets.at(idx); + cw.button->show(); + cw.minimum->show(); + cw.maximum->show(); + cw.current->show(); + cw.slider->show(); + + cw.button->setStyleSheet( + "QPushButton { image: url(" + + Define::icon(config.type) + + ") } QPushButton:pressed, QPushButton:focus { image: url(" + + Define::iconOverlay(config.type) + + ") }"); + + cw.minimum->setText(Define::minimum(config.type)); + cw.maximum->setText(Define::maximum(config.type)); + + switch (config.type) + { + case Define::Time: + cw.slider->setSubPixmap(":/images/slider/sub_white.png"); + break; + case Define::BurnDegree: + cw.slider->setSubPixmap(":/images/slider/sub_yellow.png"); + break; + case Define::Brightness: + cw.slider->setSubPixmap(":/images/slider/sub_red.png"); + break; + default: + cw.slider->setSubPixmap(":/images/slider/sub_blue.png"); + break; + } + + cw.slider->blockSignals(true); + cw.slider->setMinimum(1); + cw.slider->setMaximum(config.maximum); + cw.slider->setValue(config.current); + cw.slider->blockSignals(false); + cw.slider->bigTickInterval = 1; + + switch (config.type) + { + case Define::Time: + cw.current->setText(Stringer::remainingTime(cook.time() * 1000, Stringer::fontSize14)); + break; + case Define::BurnDegree: + cw.current->setText(Stringer::temperature(cook.coreTemp(), Stringer::fontSize14)); + break; + default: + cw.current->setText(QString().sprintf( + "%d" + "<span style=\"font-size:11pt;\">/%d</span>", + config.current, config.maximum)); + break; + } + } + } +} + +void AutoCookCheckConfigWindow::onEncoderLeft() +{ + focusPreviousChild(); +} + +void AutoCookCheckConfigWindow::onEncoderRight() +{ + focusNextChild(); +} + +void AutoCookCheckConfigWindow::onEncoderClicked(QWidget *clicked) +{ + QPushButton *pb = qobject_cast<QPushButton *>(clicked); + if (pb) + pb->click(); +} + +void AutoCookCheckConfigWindow::afterThreeSecs() +{ + close(); +} + +void AutoCookCheckConfigWindow::on_backButton_clicked() +{ + close(); +} diff --git a/app/gui/oven_control/autocookcheckconfigwindow.h b/app/gui/oven_control/autocookcheckconfigwindow.h new file mode 100644 index 0000000..1558765 --- /dev/null +++ b/app/gui/oven_control/autocookcheckconfigwindow.h @@ -0,0 +1,58 @@ +#ifndef AUTOCOOKCHECKCONFIGWINDOW_H +#define AUTOCOOKCHECKCONFIGWINDOW_H + +#include <QMainWindow> +#include <QPushButton> +#include <QLabel> +#include <QSlider> + +#include "cook.h" +#include "slider.h" + +namespace Ui { +class AutoCookCheckConfigWindow; +} + +class AutoCookCheckConfigWindow : public QMainWindow +{ + Q_OBJECT + + struct ConfigWidget { + QPushButton *button; + QLabel *minimum; + QLabel *maximum; + QLabel *current; + Slider *slider; + }; + +public: + explicit AutoCookCheckConfigWindow(QWidget *parent, Cook cook); + ~AutoCookCheckConfigWindow(); + + bool eventFilter(QObject *watched, QEvent *event); + +protected: + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *event); + +private: + Ui::AutoCookCheckConfigWindow *ui; + QList<ConfigWidget> configWidgets; + Cook cook; + + void setupUi(); + + QTimer afterThreeSecsTimer; + + QWidget *pushed = NULL; + + void onEncoderLeft(); + void onEncoderRight(); + void onEncoderClicked(QWidget *clicked); + +private slots: + void afterThreeSecs(); + void on_backButton_clicked(); +}; + +#endif // AUTOCOOKCHECKCONFIGWINDOW_H diff --git a/app/gui/oven_control/autocookcheckconfigwindow.ui b/app/gui/oven_control/autocookcheckconfigwindow.ui new file mode 100644 index 0000000..9a603e1 --- /dev/null +++ b/app/gui/oven_control/autocookcheckconfigwindow.ui @@ -0,0 +1,1336 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AutoCookCheckConfigWindow</class> + <widget class="QMainWindow" name="AutoCookCheckConfigWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>1600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <property name="styleSheet"> + <string notr="true">#centralwidget { background-image: url(:/images/background/auto.png); } +#bottomBar { background-image: url(:/images/bottom_bar/background.png); } + +QSlider::groove { +background-image: url(:/images/slider/groove.png); +background-repeat: no-repeat; +background-position: center; +} + +QSlider::sub-page { +background-repeat: no-repeat; +background-position: left center; +margin: 0px 5px; +} + +QSlider[sliderColor="red"]::sub-page { +background-image: url(:/images/slider/sub_red.png); +} + +QSlider[sliderColor="yellow"]::sub-page { +background-image: url(:/images/slider/sub_yellow.png); +} + +QSlider[sliderColor="white"]::sub-page { +background-image: url(:/images/slider/sub_white.png); +} + +QSlider[sliderColor="blue"]::sub-page { +background-image: url(:/images/slider/sub_blue.png); +} + +QSlider[sliderColor="green"]::sub-page { +background-image: url(:/images/slider/sub_green.png); +} + +QSlider::handle { +background-image: url(:/images/slider/handle_big.png); +background-repeat: no-repeat; +background-position: center; +width: 23px; +height: 33px; +} + +QPushButton[style="icon"] { +background-image: url(:/images/slider_icon/background.png); +background-repeat: no-repeat; +background-position: center; +border: none; +}</string> + </property> + <widget class="QWidget" name="centralwidget"> + <widget class="QPushButton" name="configButton_4"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>27</x> + <y>1115</y> + <width>140</width> + <height>140</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="style" stdset="0"> + <string notr="true">icon</string> + </property> + </widget> + <widget class="Slider" name="configSlider_1" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>645</y> + <width>666</width> + <height>60</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + </widget> + <widget class="QLabel" name="configMinLabel_2"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>780</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>감소</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="cookTypeIcon"> + <property name="geometry"> + <rect> + <x>0</x> + <y>430</y> + <width>250</width> + <height>150</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>:/images/images/auto/005_auto_icon_01_ov.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMinLabel_4"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>1130</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>감소</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMaxLabel_3"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>700</x> + <y>950</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>증가</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QStackedWidget" name="upperStack"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>426</height> + </rect> + </property> + <widget class="QWidget" name="clockContainer"> + <property name="styleSheet"> + <string notr="true">#clockContainer { background-image: url(:/images/clock/background.png); }</string> + </property> + <widget class="Clock" name="clock" native="true"> + <property name="geometry"> + <rect> + <x>272</x> + <y>36</y> + <width>356</width> + <height>355</height> + </rect> + </property> + </widget> + <widget class="WashWarnIcon" name="label"> + <property name="geometry"> + <rect> + <x>800</x> + <y>320</y> + <width>80</width> + <height>84</height> + </rect> + </property> + </widget> + </widget> + <widget class="QWidget" name="page_2"/> + </widget> + <widget class="QLabel" name="configCurrentLabel_4"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>199</x> + <y>1200</y> + <width>641</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>스팀</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMaxLabel_4"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>700</x> + <y>1130</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>증가</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QPushButton" name="configButton_5"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>27</x> + <y>1285</y> + <width>140</width> + <height>140</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="style" stdset="0"> + <string notr="true">icon</string> + </property> + </widget> + <widget class="QPushButton" name="configButton_3"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>27</x> + <y>935</y> + <width>140</width> + <height>140</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="style" stdset="0"> + <string notr="true">icon</string> + </property> + </widget> + <widget class="QWidget" name="bottomBar" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>1450</y> + <width>900</width> + <height>150</height> + </rect> + </property> + <widget class="QPushButton" name="backButton"> + <property name="geometry"> + <rect> + <x>401</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </widget> + <widget class="QLabel" name="configCurrentLabel_5"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>189</x> + <y>1370</y> + <width>651</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>스팀</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="Slider" name="configSlider_3" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>975</y> + <width>666</width> + <height>60</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + </widget> + <widget class="QPushButton" name="configButton_1"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>27</x> + <y>605</y> + <width>140</width> + <height>140</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="style" stdset="0"> + <string notr="true">icon</string> + </property> + </widget> + <widget class="Slider" name="configSlider_2" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>805</y> + <width>666</width> + <height>60</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + </widget> + <widget class="QLabel" name="configMinLabel_5"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>1300</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>감소</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configCurrentLabel_1"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>199</x> + <y>690</y> + <width>641</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>스팀</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QPushButton" name="selectCookButton"> + <property name="geometry"> + <rect> + <x>584</x> + <y>480</y> + <width>288</width> + <height>70</height> + </rect> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>10</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { +border-image: url(:/images/button/288.png); +} +QPushButton::pressed, QPushButton:focus { +border-image: url(:/images/button/288_ov.png); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QLabel" name="configMaxLabel_2"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>700</x> + <y>780</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>증가</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="Slider" name="configSlider_5" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>1325</y> + <width>666</width> + <height>60</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + </widget> + <widget class="QLabel" name="configMinLabel_3"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>950</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>감소</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMaxLabel_5"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>700</x> + <y>1300</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>증가</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QPushButton" name="configButton_2"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>27</x> + <y>765</y> + <width>140</width> + <height>140</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="style" stdset="0"> + <string notr="true">icon</string> + </property> + </widget> + <widget class="QLabel" name="configCurrentLabel_3"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>199</x> + <y>1020</y> + <width>641</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>스팀</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMaxLabel_1"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>700</x> + <y>620</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>증가</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="Slider" name="configSlider_4" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>1155</y> + <width>666</width> + <height>60</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + </widget> + <widget class="QLabel" name="configCurrentLabel_2"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>199</x> + <y>850</y> + <width>641</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>스팀</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="configMinLabel_1"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>185</x> + <y>620</y> + <width>151</width> + <height>51</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>감소</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + </widget> + </widget> + <customwidgets> + <customwidget> + <class>Clock</class> + <extends>QWidget</extends> + <header>clock.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>WashWarnIcon</class> + <extends>QLabel</extends> + <header>washwarnicon.h</header> + </customwidget> + <customwidget> + <class>Slider</class> + <extends>QWidget</extends> + <header>slider.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>backButton</tabstop> + <tabstop>configButton_5</tabstop> + <tabstop>configButton_4</tabstop> + <tabstop>configButton_3</tabstop> + <tabstop>configButton_1</tabstop> + <tabstop>configButton_2</tabstop> + </tabstops> + <resources> + <include location="resources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/app/gui/oven_control/autocookcheckwindow.cpp b/app/gui/oven_control/autocookcheckwindow.cpp new file mode 100644 index 0000000..a23f92a --- /dev/null +++ b/app/gui/oven_control/autocookcheckwindow.cpp @@ -0,0 +1,357 @@ +#include "autocookcheckwindow.h" +#include "ui_autocookcheckwindow.h" + +#include <QKeyEvent> + +#include "mainwindow.h" +#include "configwindow.h" +#include "washwindow.h" +#include "confirmpopup.h" +#include "favoritenamepopup.h" +#include "stringer.h" +#include "soundplayer.h" + +AutoCookCheckWindow::AutoCookCheckWindow(QWidget *parent, Cook cook) : + QMainWindow(parent), + ui(new Ui::AutoCookCheckWindow), + cook(cook) +{ + ui->setupUi(this); + + ui->clockContainer->setParent(ui->upperStack); + setAttribute(Qt::WA_DeleteOnClose); + + if (!this->cook.isLoaded()) + this->cook.load(); + + setupUi(); + + foreach (QPushButton *button, findChildren<QPushButton *>()) + connect(button, &QPushButton::pressed, SoundPlayer::playClick); + + foreach (QWidget *w, findChildren<QWidget *>()) + w->installEventFilter(this); + + afterThreeSecsTimer.setSingleShot(true); + afterThreeSecsTimer.setInterval(3000); + afterThreeSecsTimer.start(); + connect(&afterThreeSecsTimer, SIGNAL(timeout()), SLOT(afterThreeSecs())); + + setFocus(); +} + +AutoCookCheckWindow::~AutoCookCheckWindow() +{ + delete ui; +} + +bool AutoCookCheckWindow::eventFilter(QObject */*watched*/, QEvent *event) +{ + switch (event->type()) + { + case QEvent::KeyPress: + case QEvent::KeyRelease: + case QEvent::MouseButtonPress: + case QEvent::MouseButtonRelease: + case QEvent::MouseMove: + afterThreeSecsTimer.start(); + break; + default: + break; + } + + return false; +} + +void AutoCookCheckWindow::keyPressEvent(QKeyEvent *event) +{ + switch (event->key()) + { + case 0x01000030: // Turn left + onEncoderLeft(); + break; + case 0x01000031: // Push + pushed = focusWidget(); + break; + case 0x01000032: // Turn right + onEncoderRight(); + break; + } +} + +void AutoCookCheckWindow::keyReleaseEvent(QKeyEvent *event) +{ + switch (event->key()) + { + case 0x01000030: // Turn left + onEncoderLeft(); + break; + case 0x01000031: // Push + if (focusWidget() == pushed) + onEncoderClicked(pushed); + + pushed = NULL; + break; + case 0x01000032: // Turn right + onEncoderRight(); + break; + } +} + +void AutoCookCheckWindow::setupUi() +{ + steamModeIcon.load(":/images/cook_mode/small_steam.png"); + dryModeIcon.load(":/images/cook_mode/small_dryheat.png"); + combiModeIcon.load(":/images/cook_mode/small_combi.png"); + + ui->cookTypeIcon->setPixmap(Define::icon(cook.type)); + ui->selectCookButton->setText(cook.name); + + int msecs = 0; + for (int i = 0; i < cook.steps.size(); i++) + msecs += cook.steps[i].time * 1000; + + ui->timeLabel->setText(Stringer::remainingTime(msecs)); + + if (cook.isCoreTempValid()) + ui->interTempLabel->setText(Stringer::temperature(cook.coreTemp())); + else + { + ui->interTempIcon->hide(); + ui->interTempLabel->hide(); + } + + ui->stepIndicator->setMaximum(cook.steps.size() - 1); + + ui->cookStepAnimation->start(300); + + ui->humidityGauge->setMinimum(0); + ui->humidityGauge->setMaximum(100); + ui->humidityGauge->setValue(0); + + ui->heatGauge->setMinimum(30); + ui->heatGauge->setMaximum(300); + ui->heatGauge->setValue(30); + + ui->doorStepLabel->hide(); + + selectedStepIndex = 0; + lastViewCookMode = Define::InvalidMode; + lastViewCookType = Define::Invalid; + lastViewDoorType = Define::Invalid; + + updateView(); +} + +void AutoCookCheckWindow::onEncoderLeft() +{ + focusPreviousChild(); +} + +void AutoCookCheckWindow::onEncoderRight() +{ + focusNextChild(); +} + +void AutoCookCheckWindow::onEncoderClicked(QWidget *clicked) +{ + QPushButton *b = qobject_cast<QPushButton *>(clicked); + if (b) + b->click(); +} + +void AutoCookCheckWindow::updateView() +{ + ui->stepIndicator->setCurrentIndex(selectedStepIndex); + + CookStep showingStep = cook.steps[selectedStepIndex]; + if (Define::classify(showingStep.type) == Define::DoorClass) + { + ui->cookStepIcon->hide(); + ui->cookStepLabel->hide(); + ui->cookModeIcon->hide(); + ui->humidityGauge->hide(); + ui->humidityLabel->hide(); + ui->heatGauge->hide(); + ui->heatLabel->hide(); + ui->doorStepLabel->show(); + ui->cookStepAnimation->show(); + + if (showingStep.type != lastViewDoorType) + { + lastViewDoorType = showingStep.type; + + ui->doorStepLabel->setText(Define::name(showingStep.type)); + ui->cookStepAnimation->clear(); + switch (showingStep.type) + { + case Define::PutThermometer: + ui->doorStepLabel->setText(tr("중심 온도계 삽입")); + ui->cookStepAnimation->load(":/images/animation/thermometer_01.png"); + ui->cookStepAnimation->load(":/images/animation/thermometer_02.png"); + ui->cookStepAnimation->setGeometry((900-210)/2, 800, 210, 307); + ui->cookStepAnimation->start(300); + break; + case Define::Load: + ui->doorStepLabel->setText(tr("식재료 적재")); + ui->cookStepAnimation->load(":/images/animation/load_01.png"); + ui->cookStepAnimation->load(":/images/animation/load_02.png"); + ui->cookStepAnimation->load(":/images/animation/load_03.png"); + ui->cookStepAnimation->load(":/images/animation/load_04.png"); + ui->cookStepAnimation->load(":/images/animation/load_03.png"); + ui->cookStepAnimation->load(":/images/animation/load_02.png"); + ui->cookStepAnimation->load(":/images/animation/load_01.png"); + ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); + ui->cookStepAnimation->start(300); + break; + case Define::Cut: + ui->doorStepLabel->setText(tr("자르기")); + ui->cookStepAnimation->load(":/images/animation/cut_01.png"); + ui->cookStepAnimation->load(":/images/animation/cut_02.png"); + ui->cookStepAnimation->load(":/images/animation/cut_03.png"); + ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); + ui->cookStepAnimation->start(300); + break; + case Define::Pour: + ui->doorStepLabel->setText(tr("물 붓기")); + ui->cookStepAnimation->load(":/images/animation/pour_01.png"); + ui->cookStepAnimation->load(":/images/animation/pour_02.png"); + ui->cookStepAnimation->load(":/images/animation/pour_03.png"); + ui->cookStepAnimation->load(":/images/animation/pour_04.png"); + ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); + ui->cookStepAnimation->start(300); + break; + default: + ui->doorStepLabel->hide(); + ui->cookStepAnimation->hide(); + } + } + } + else + { + ui->doorStepLabel->hide(); + ui->cookStepAnimation->hide(); + ui->cookStepIcon->show(); + ui->cookStepLabel->show(); + ui->cookModeIcon->show(); + ui->humidityGauge->show(); + ui->humidityLabel->show(); + ui->heatGauge->show(); + ui->heatLabel->show(); + + if (showingStep.type != lastViewCookType) + { + lastViewCookType = showingStep.type; + + ui->cookStepIcon->setPixmap(Define::icon(showingStep.type)); + ui->cookStepLabel->setText(Define::name(showingStep.type)); + } + + if (showingStep.mode != lastViewCookMode) + { + lastViewCookMode = showingStep.mode; + + switch (showingStep.mode) + { + case Define::SteamMode: + ui->cookModeIcon->setPixmap(steamModeIcon); + break; + case Define::CombiMode: + ui->cookModeIcon->setPixmap(combiModeIcon); + break; + case Define::DryMode: + ui->cookModeIcon->setPixmap(dryModeIcon); + break; + case Define::InvalidClass: + ui->cookModeIcon->hide(); + break; + } + } + + ui->humidityLabel->setText(QString("%1%").arg(showingStep.humidity)); + ui->humidityGauge->setValue(showingStep.humidity); + + ui->heatLabel->setText(Stringer::temperature(showingStep.temp)); + ui->heatGauge->setValue(showingStep.temp); + } +} + +void AutoCookCheckWindow::addFavorite() +{ + AutoCookSetting s; + s.type = cook.type; + s.root = cook.root; + for (int i = 0; i < 5; i++) + s.configs[i] = cook.configs[i].current; + + FavoriteNamePopup *p = new FavoriteNamePopup(this, s); + p->showFullScreen(); +} + +void AutoCookCheckWindow::afterThreeSecs() +{ + emit back(); + close(); +} + +void AutoCookCheckWindow::on_selectCookButton_clicked() +{ + +} + +void AutoCookCheckWindow::on_showPrevStepButton_clicked() +{ + if (selectedStepIndex > 0) + { + selectedStepIndex--; + updateView(); + } +} + +void AutoCookCheckWindow::on_showNextStepButton_clicked() +{ + if (selectedStepIndex + 1 < cook.steps.size()) + { + selectedStepIndex++; + updateView(); + } +} + +void AutoCookCheckWindow::on_backButton_clicked() +{ + emit back(); + close(); +} + +void AutoCookCheckWindow::on_configButton_clicked() +{ + ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); + + MainWindow::jump(w); +} + +void AutoCookCheckWindow::on_favoritesButton_clicked() +{ + ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); + p->showFullScreen(); + + connect(p, SIGNAL(accepted()), SLOT(addFavorite())); +} + +void AutoCookCheckWindow::on_washButton_clicked() +{ + WashWindow *w = new WashWindow(MainWindow::getInstance()); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); + + MainWindow::jump(w); +} + +void AutoCookCheckWindow::on_helpButton_clicked() +{ + +} diff --git a/app/gui/oven_control/autocookcheckwindow.h b/app/gui/oven_control/autocookcheckwindow.h new file mode 100644 index 0000000..aae636a --- /dev/null +++ b/app/gui/oven_control/autocookcheckwindow.h @@ -0,0 +1,69 @@ +#ifndef AUTOCOOKCHECKWINDOW_H +#define AUTOCOOKCHECKWINDOW_H + +#include <QMainWindow> + +#include "cook.h" + +namespace Ui { +class AutoCookCheckWindow; +} + +class AutoCookCheckWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit AutoCookCheckWindow(QWidget *parent, Cook cook); + ~AutoCookCheckWindow(); + + bool eventFilter(QObject *watched, QEvent *event); + +protected: + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *event); + +private: + Ui::AutoCookCheckWindow *ui; + + Cook cook; + + QPixmap steamModeIcon; + QPixmap dryModeIcon; + QPixmap combiModeIcon; + + int selectedStepIndex; + + Define::StepType lastViewDoorType; + Define::StepType lastViewCookType; + Define::Mode lastViewCookMode; + + void setupUi(); + + QTimer afterThreeSecsTimer; + + QWidget *pushed = NULL; + + void onEncoderLeft(); + void onEncoderRight(); + void onEncoderClicked(QWidget *clicked); + +private slots: + void updateView(); + void addFavorite(); + void afterThreeSecs(); + + void on_selectCookButton_clicked(); + void on_showPrevStepButton_clicked(); + void on_showNextStepButton_clicked(); + void on_backButton_clicked(); + void on_configButton_clicked(); + void on_favoritesButton_clicked(); + void on_washButton_clicked(); + void on_helpButton_clicked(); + +signals: + void back(); +}; + +#endif // AUTOCOOKCHECKWINDOW_H diff --git a/app/gui/oven_control/autocookcheckwindow.ui b/app/gui/oven_control/autocookcheckwindow.ui new file mode 100644 index 0000000..d74770b --- /dev/null +++ b/app/gui/oven_control/autocookcheckwindow.ui @@ -0,0 +1,907 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AutoCookCheckWindow</class> + <widget class="QMainWindow" name="AutoCookCheckWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>1600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <property name="styleSheet"> + <string notr="true">#centralwidget { background-image: url(:/images/background/auto_steps.png); } +#bottomBar { background-image: url(:/images/bottom_bar/background.png); } + +QPushButton { +background-repeat: no-repeat; +background-position: center; +border: none; +}</string> + </property> + <widget class="QWidget" name="centralwidget"> + <widget class="AnimatedImageBox" name="cookStepAnimation"> + <property name="geometry"> + <rect> + <x>340</x> + <y>800</y> + <width>231</width> + <height>281</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QPushButton" name="showPrevStepButton"> + <property name="geometry"> + <rect> + <x>10</x> + <y>715</y> + <width>60</width> + <height>400</height> + </rect> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { background-image: url(:/images/auto_button/prev_step.png); } +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/auto_button/prev_step_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QLabel" name="doorStepLabel"> + <property name="geometry"> + <rect> + <x>110</x> + <y>710</y> + <width>541</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>14</pointsize> + </font> + </property> + <property name="text"> + <string notr="true">Preheat</string> + </property> + </widget> + <widget class="QStackedWidget" name="upperStack"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>426</height> + </rect> + </property> + <widget class="QWidget" name="clockContainer"> + <property name="styleSheet"> + <string notr="true">#clockContainer { background-image: url(:/images/clock/background.png); }</string> + </property> + <widget class="Clock" name="clock" native="true"> + <property name="geometry"> + <rect> + <x>272</x> + <y>36</y> + <width>356</width> + <height>355</height> + </rect> + </property> + </widget> + <widget class="WashWarnIcon" name="label"> + <property name="geometry"> + <rect> + <x>800</x> + <y>320</y> + <width>80</width> + <height>84</height> + </rect> + </property> + </widget> + </widget> + <widget class="QWidget" name="page_2"/> + </widget> + <widget class="QLabel" name="label_3"> + <property name="geometry"> + <rect> + <x>130</x> + <y>600</y> + <width>100</width> + <height>100</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/symbol/time.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="HeatCircularGauge" name="heatGauge" native="true"> + <property name="geometry"> + <rect> + <x>510</x> + <y>810</y> + <width>291</width> + <height>290</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + </widget> + <widget class="QPushButton" name="selectCookButton"> + <property name="geometry"> + <rect> + <x>584</x> + <y>480</y> + <width>288</width> + <height>70</height> + </rect> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>10</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/button/288.png); } +QPushButton::pressed, QPushButton:focus { border-image: url(:/images/button/288_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QLabel" name="cookModeIcon"> + <property name="geometry"> + <rect> + <x>80</x> + <y>1020</y> + <width>741</width> + <height>81</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>:/images/images/auto/window_icon_06.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="BulletIndicator" name="stepIndicator" native="true"> + <property name="geometry"> + <rect> + <x>100</x> + <y>1130</y> + <width>700</width> + <height>50</height> + </rect> + </property> + </widget> + <widget class="QLabel" name="interTempIcon"> + <property name="geometry"> + <rect> + <x>460</x> + <y>600</y> + <width>100</width> + <height>100</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/symbol/core_temp.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="cookStepLabel"> + <property name="geometry"> + <rect> + <x>180</x> + <y>710</y> + <width>541</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>14</pointsize> + </font> + </property> + <property name="text"> + <string notr="true">Preheat</string> + </property> + </widget> + <widget class="QLabel" name="heatLabel"> + <property name="geometry"> + <rect> + <x>490</x> + <y>960</y> + <width>321</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true">10</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="interTempLabel"> + <property name="geometry"> + <rect> + <x>560</x> + <y>600</y> + <width>231</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true">000/000</string> + </property> + </widget> + <widget class="QPushButton" name="showNextStepButton"> + <property name="geometry"> + <rect> + <x>830</x> + <y>715</y> + <width>60</width> + <height>400</height> + </rect> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { background-image: url(:/images/auto_button/next_step.png); } +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/auto_button/next_step_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QLabel" name="cookTypeIcon"> + <property name="geometry"> + <rect> + <x>0</x> + <y>430</y> + <width>250</width> + <height>150</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>:/images/images/auto/005_auto_icon_01_ov.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="timeLabel"> + <property name="geometry"> + <rect> + <x>230</x> + <y>600</y> + <width>231</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true">00:00</string> + </property> + </widget> + <widget class="QWidget" name="bottomBar" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>1450</y> + <width>900</width> + <height>150</height> + </rect> + </property> + <widget class="QPushButton" name="backButton"> + <property name="geometry"> + <rect> + <x>175</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QPushButton" name="washButton"> + <property name="geometry"> + <rect> + <x>514</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/wash.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/wash_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QPushButton" name="configButton"> + <property name="geometry"> + <rect> + <x>288</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/config_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QPushButton" name="helpButton"> + <property name="geometry"> + <rect> + <x>627</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QPushButton" name="favoritesButton"> + <property name="geometry"> + <rect> + <x>401</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/favorites.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/favorites_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </widget> + <widget class="QLabel" name="cookStepIcon"> + <property name="geometry"> + <rect> + <x>80</x> + <y>710</y> + <width>100</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>14</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/cook_step_type/sys_icon_05.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="HumidityCircularGauge" name="humidityGauge" native="true"> + <property name="geometry"> + <rect> + <x>100</x> + <y>810</y> + <width>291</width> + <height>290</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + </widget> + <widget class="QLabel" name="humidityLabel"> + <property name="geometry"> + <rect> + <x>90</x> + <y>960</y> + <width>321</width> + <height>100</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>123</red> + <green>123</green> + <blue>123</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true">10</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </widget> + </widget> + <customwidgets> + <customwidget> + <class>Clock</class> + <extends>QWidget</extends> + <header>clock.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>WashWarnIcon</class> + <extends>QLabel</extends> + <header>washwarnicon.h</header> + </customwidget> + <customwidget> + <class>AnimatedImageBox</class> + <extends>QLabel</extends> + <header>animatedimagebox.h</header> + </customwidget> + <customwidget> + <class>HumidityCircularGauge</class> + <extends>QWidget</extends> + <header>humiditycirculargauge.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>HeatCircularGauge</class> + <extends>QWidget</extends> + <header>heatcirculargauge.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>BulletIndicator</class> + <extends>QWidget</extends> + <header>bulletindicator.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>selectCookButton</tabstop> + <tabstop>showPrevStepButton</tabstop> + <tabstop>showNextStepButton</tabstop> + <tabstop>backButton</tabstop> + <tabstop>configButton</tabstop> + <tabstop>favoritesButton</tabstop> + <tabstop>washButton</tabstop> + <tabstop>helpButton</tabstop> + </tabstops> + <resources> + <include location="resources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/app/gui/oven_control/autocookconfigwindow.cpp b/app/gui/oven_control/autocookconfigwindow.cpp index 0b04cb5..8f3ae81 100644 --- a/app/gui/oven_control/autocookconfigwindow.cpp +++ b/app/gui/oven_control/autocookconfigwindow.cpp @@ -12,6 +12,7 @@ #include "washwindow.h" #include "mainwindow.h" #include "autocookselectionpopup.h" +#include "autocookcheckwindow.h" AutoCookConfigWindow::AutoCookConfigWindow(QWidget *parent, Cook cook) : QMainWindow(parent), @@ -325,6 +326,8 @@ void AutoCookConfigWindow::updateConfig() void AutoCookConfigWindow::start() { + setFocus(); + AutoCookWindow *w = new AutoCookWindow(parentWidget(), cook); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); @@ -412,11 +415,15 @@ void AutoCookConfigWindow::on_configButton_5_clicked() void AutoCookConfigWindow::on_selectCookButton_clicked() { + setFocus(); + AutoCookSelectionPopup *p = new AutoCookSelectionPopup(this, cook.type); p->showFullScreen(); p->raise(); connect(p, SIGNAL(selected(Cook)), SLOT(changeCook(Cook))); + connect(p, SIGNAL(selected(Cook)), SLOT(setFocus())); + connect(p, SIGNAL(canceled()), SLOT(setFocus())); if (afterThreeSecsTimer.isActive()) { @@ -425,3 +432,19 @@ void AutoCookConfigWindow::on_selectCookButton_clicked() connect(p, SIGNAL(canceled()), &afterThreeSecsTimer, SLOT(start())); } } + +void AutoCookConfigWindow::on_checkCookButton_clicked() +{ + setFocus(); + + AutoCookCheckWindow *w = new AutoCookCheckWindow(this, cook); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); + + if (afterThreeSecsTimer.isActive()) + { + afterThreeSecsTimer.stop(); + connect(w, SIGNAL(back()), &afterThreeSecsTimer, SLOT(start())); + } +} diff --git a/app/gui/oven_control/autocookconfigwindow.h b/app/gui/oven_control/autocookconfigwindow.h index 0b99047..b4edbbf 100644 --- a/app/gui/oven_control/autocookconfigwindow.h +++ b/app/gui/oven_control/autocookconfigwindow.h @@ -74,6 +74,7 @@ private slots: void on_configButton_4_clicked(); void on_configButton_5_clicked(); void on_selectCookButton_clicked(); + void on_checkCookButton_clicked(); }; #endif // AUTOCOOKCONFIGWINDOW_H diff --git a/app/gui/oven_control/autocookconfigwindow.ui b/app/gui/oven_control/autocookconfigwindow.ui index 68369d6..c9643e7 100644 --- a/app/gui/oven_control/autocookconfigwindow.ui +++ b/app/gui/oven_control/autocookconfigwindow.ui @@ -626,7 +626,7 @@ border-image: url(:/images/button/288_ov.png); <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> </widget> - <widget class="QPushButton" name="pushButton_4"> + <widget class="QPushButton" name="checkCookButton"> <property name="geometry"> <rect> <x>720</x> @@ -1410,7 +1410,7 @@ border-image: url(:/images/button/152_ov.png); </customwidgets> <tabstops> <tabstop>selectCookButton</tabstop> - <tabstop>pushButton_4</tabstop> + <tabstop>checkCookButton</tabstop> <tabstop>configButton_1</tabstop> <tabstop>configButton_2</tabstop> <tabstop>configButton_3</tabstop> diff --git a/app/gui/oven_control/autocookwindow.cpp b/app/gui/oven_control/autocookwindow.cpp index a6e3d1a..ae1322b 100644 --- a/app/gui/oven_control/autocookwindow.cpp +++ b/app/gui/oven_control/autocookwindow.cpp @@ -15,6 +15,7 @@ #include "config.h" #include "errorpopupdlg.h" #include "autocookselectionpopup.h" +#include "autocookcheckconfigwindow.h" AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) : QMainWindow(parent), @@ -938,7 +939,12 @@ void AutoCookWindow::on_homeButton_clicked() void AutoCookWindow::on_configCookButton_clicked() { + setFocus(); + AutoCookCheckConfigWindow *w = new AutoCookCheckConfigWindow(this, cook); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); } void AutoCookWindow::on_humidityGaugeButton_pressed() diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index 11a4b26..45c57ca 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -119,7 +119,9 @@ SOURCES += main.cpp\ configdoormonitoring.cpp \ config1digitsetandenablesetdlg.cpp \ slider.cpp \ - autocookselectionpopup.cpp + autocookselectionpopup.cpp \ + autocookcheckwindow.cpp \ + autocookcheckconfigwindow.cpp HEADERS += mainwindow.h \ cook.h \ @@ -228,7 +230,9 @@ HEADERS += mainwindow.h \ configdoormonitoring.h \ config1digitsetandenablesetdlg.h \ slider.h \ - autocookselectionpopup.h + autocookselectionpopup.h \ + autocookcheckwindow.h \ + autocookcheckconfigwindow.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -303,7 +307,9 @@ FORMS += mainwindow.ui \ reservedtimepopup.ui \ configdoormonitoring.ui \ config1digitsetandenablesetdlg.ui \ - autocookselectionpopup.ui + autocookselectionpopup.ui \ + autocookcheckwindow.ui \ + autocookcheckconfigwindow.ui RESOURCES += \ resources.qrc