Commit f588aa273e875883f46c192d147b65e4a1f4edf3
1 parent
748830a16e
Exists in
master
and in
2 other branches
부가 기능 로직 추가
Showing
33 changed files
with
4965 additions
and
51 deletions
Show diff stats
app/gui/oven_control/autocookconfigwindow.cpp
| ... | ... | @@ -2,6 +2,8 @@ |
| 2 | 2 | #include "ui_autocookconfigwindow.h" |
| 3 | 3 | |
| 4 | 4 | #include "autocookwindow.h" |
| 5 | +#include "confirmpopup.h" | |
| 6 | +#include "favoritenamepopup.h" | |
| 5 | 7 | |
| 6 | 8 | AutoCookConfigWindow::AutoCookConfigWindow(QWidget *parent, Cook cook) : |
| 7 | 9 | QMainWindow(parent), |
| ... | ... | @@ -223,7 +225,33 @@ void AutoCookConfigWindow::start() |
| 223 | 225 | w->raise(); |
| 224 | 226 | } |
| 225 | 227 | |
| 228 | +void AutoCookConfigWindow::addFavorite() | |
| 229 | +{ | |
| 230 | + AutoCookSetting s; | |
| 231 | + s.type = cook.type; | |
| 232 | + s.root = cook.root; | |
| 233 | + for (int i = 0; i < 5; i++) | |
| 234 | + s.configs[i] = cook.configs[i].current; | |
| 235 | + | |
| 236 | + FavoriteNamePopup *p = new FavoriteNamePopup(this, s); | |
| 237 | + p->showFullScreen(); | |
| 238 | +} | |
| 239 | + | |
| 226 | 240 | void AutoCookConfigWindow::on_backButton_clicked() |
| 227 | 241 | { |
| 228 | 242 | close(); |
| 229 | 243 | } |
| 244 | + | |
| 245 | +void AutoCookConfigWindow::on_favoritesButton_clicked() | |
| 246 | +{ | |
| 247 | + ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); | |
| 248 | + p->showFullScreen(); | |
| 249 | + | |
| 250 | + connect(p, SIGNAL(accepted()), SLOT(addFavorite())); | |
| 251 | + | |
| 252 | + if (cookStartTimer.isActive()) | |
| 253 | + { | |
| 254 | + cookStartTimer.stop(); | |
| 255 | + connect(p, SIGNAL(rejected()), &cookStartTimer, SLOT(start())); | |
| 256 | + } | |
| 257 | +} | ... | ... |
app/gui/oven_control/autocookconfigwindow.h
app/gui/oven_control/autocooksettingwidget.cpp
| ... | ... | @@ -0,0 +1,159 @@ |
| 1 | +#include "autocooksettingwidget.h" | |
| 2 | +#include "ui_autocooksettingwidget.h" | |
| 3 | + | |
| 4 | + | |
| 5 | +AutoCookSettingWidget::AutoCookSettingWidget(AutoCookSetting setting, QWidget *parent) : | |
| 6 | + QWidget(parent), | |
| 7 | + ui(new Ui::AutoCookSettingWidget) | |
| 8 | +{ | |
| 9 | + ui->setupUi(this); | |
| 10 | + | |
| 11 | + Cook cook(setting.type, setting.root, setting.name); | |
| 12 | + cook.setConfig(setting.configs[0], | |
| 13 | + setting.configs[1], | |
| 14 | + setting.configs[2], | |
| 15 | + setting.configs[3], | |
| 16 | + setting.configs[4]); | |
| 17 | + | |
| 18 | + configWidgets.append( | |
| 19 | + ConfigWidget { | |
| 20 | + ui->configButton_1, | |
| 21 | + ui->configMinLabel_1, | |
| 22 | + ui->configMaxLabel_1, | |
| 23 | + ui->configCurrentLabel_1, | |
| 24 | + ui->configSlider_1 | |
| 25 | + }); | |
| 26 | + configWidgets.append( | |
| 27 | + ConfigWidget { | |
| 28 | + ui->configButton_2, | |
| 29 | + ui->configMinLabel_2, | |
| 30 | + ui->configMaxLabel_2, | |
| 31 | + ui->configCurrentLabel_2, | |
| 32 | + ui->configSlider_2 | |
| 33 | + }); | |
| 34 | + configWidgets.append( | |
| 35 | + ConfigWidget { | |
| 36 | + ui->configButton_3, | |
| 37 | + ui->configMinLabel_3, | |
| 38 | + ui->configMaxLabel_3, | |
| 39 | + ui->configCurrentLabel_3, | |
| 40 | + ui->configSlider_3 | |
| 41 | + }); | |
| 42 | + configWidgets.append( | |
| 43 | + ConfigWidget { | |
| 44 | + ui->configButton_4, | |
| 45 | + ui->configMinLabel_4, | |
| 46 | + ui->configMaxLabel_4, | |
| 47 | + ui->configCurrentLabel_4, | |
| 48 | + ui->configSlider_4 | |
| 49 | + }); | |
| 50 | + configWidgets.append( | |
| 51 | + ConfigWidget { | |
| 52 | + ui->configButton_5, | |
| 53 | + ui->configMinLabel_5, | |
| 54 | + ui->configMaxLabel_5, | |
| 55 | + ui->configCurrentLabel_5, | |
| 56 | + ui->configSlider_5 | |
| 57 | + }); | |
| 58 | + | |
| 59 | + setupUi(cook); | |
| 60 | +} | |
| 61 | + | |
| 62 | +AutoCookSettingWidget::~AutoCookSettingWidget() | |
| 63 | +{ | |
| 64 | + delete ui; | |
| 65 | +} | |
| 66 | + | |
| 67 | +void AutoCookSettingWidget::setupUi(Cook cook) | |
| 68 | +{ | |
| 69 | + ui->cookTypeIcon->setPixmap(Define::icon(cook.type)); | |
| 70 | + ui->selectCookButton->setText(cook.name); | |
| 71 | + | |
| 72 | + for (int idx = 0; idx < 5; idx++) | |
| 73 | + { | |
| 74 | + ConfigWidget cw = configWidgets.at(idx); | |
| 75 | + | |
| 76 | + CookConfig config = cook.configs[idx]; | |
| 77 | + if (config.type == Define::ConfigNotUsed) | |
| 78 | + { | |
| 79 | + cw.button->hide(); | |
| 80 | + cw.minimum->hide(); | |
| 81 | + cw.maximum->hide(); | |
| 82 | + cw.current->hide(); | |
| 83 | + cw.slider->hide(); | |
| 84 | + } | |
| 85 | + else | |
| 86 | + { | |
| 87 | + cw.button->setStyleSheet( | |
| 88 | + QString("QPushButton { image: url(%1); } QPushButton:pressed { image: url(%2); }") | |
| 89 | + .arg(Define::icon(config.type)) | |
| 90 | + .arg(Define::iconOverlay(config.type))); | |
| 91 | + | |
| 92 | + cw.minimum->setText(Define::minimum(config.type)); | |
| 93 | + cw.maximum->setText(Define::maximum(config.type)); | |
| 94 | + cw.slider->blockSignals(true); | |
| 95 | + cw.slider->setMinimum(1); | |
| 96 | + cw.slider->setMaximum(config.maximum); | |
| 97 | + cw.slider->setValue(config.current); | |
| 98 | + cw.slider->blockSignals(false); | |
| 99 | + | |
| 100 | + switch (config.type) | |
| 101 | + { | |
| 102 | + case Define::Time: | |
| 103 | + cw.slider->setProperty("sliderColor", "white"); | |
| 104 | + break; | |
| 105 | + case Define::BurnDegree: | |
| 106 | + cw.slider->setProperty("sliderColor", "yellow"); | |
| 107 | + break; | |
| 108 | + case Define::Brightness: | |
| 109 | + cw.slider->setProperty("sliderColor", "red"); | |
| 110 | + break; | |
| 111 | + default: | |
| 112 | + cw.slider->setProperty("sliderColor", "blue"); | |
| 113 | + break; | |
| 114 | + } | |
| 115 | + | |
| 116 | + switch (config.type) | |
| 117 | + { | |
| 118 | + case Define::Time: | |
| 119 | + { | |
| 120 | + int time = cook.time(); | |
| 121 | + if (time >= 3600) | |
| 122 | + cw.current->setText(QString().sprintf( | |
| 123 | + "%d" | |
| 124 | + "<span style=\"font-size:11pt;\">시간</span>" | |
| 125 | + " %02d" | |
| 126 | + "<span style=\"font-size:11pt;\">분</span>", | |
| 127 | + time / 3600, | |
| 128 | + (time % 3600) / 60)); | |
| 129 | + else if (time >= 60) | |
| 130 | + cw.current->setText(QString().sprintf( | |
| 131 | + "%d" | |
| 132 | + "<span style=\"font-size:11pt;\">분</span>" | |
| 133 | + " %02d" | |
| 134 | + "<span style=\"font-size:11pt;\">초</span>", | |
| 135 | + time / 60, | |
| 136 | + time % 60)); | |
| 137 | + else | |
| 138 | + cw.current->setText(QString().sprintf( | |
| 139 | + "%d" | |
| 140 | + "<span style=\"font-size:11pt;\">초</span>", | |
| 141 | + time)); | |
| 142 | + break; | |
| 143 | + } | |
| 144 | + case Define::BurnDegree: | |
| 145 | + cw.current->setText(QString().sprintf( | |
| 146 | + "%d" | |
| 147 | + "<span style=\"font-size:11pt;\">℃</span>", | |
| 148 | + cook.coreTemp())); | |
| 149 | + break; | |
| 150 | + default: | |
| 151 | + cw.current->setText(QString().sprintf( | |
| 152 | + "%d" | |
| 153 | + "<span style=\"font-size:11pt;\">/%d</span>", | |
| 154 | + config.current, config.maximum)); | |
| 155 | + break; | |
| 156 | + } | |
| 157 | + } | |
| 158 | + } | |
| 159 | +} | ... | ... |
app/gui/oven_control/autocooksettingwidget.h
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +#ifndef AUTOCOOKSETTINGWIDGET_H | |
| 2 | +#define AUTOCOOKSETTINGWIDGET_H | |
| 3 | + | |
| 4 | +#include <QWidget> | |
| 5 | +#include <QPushButton> | |
| 6 | +#include <QLabel> | |
| 7 | +#include <QSlider> | |
| 8 | + | |
| 9 | +#include "define.h" | |
| 10 | +#include "cook.h" | |
| 11 | +#include "cookhistory.h" | |
| 12 | + | |
| 13 | +namespace Ui { | |
| 14 | +class AutoCookSettingWidget; | |
| 15 | +} | |
| 16 | + | |
| 17 | +class AutoCookSettingWidget : public QWidget | |
| 18 | +{ | |
| 19 | + Q_OBJECT | |
| 20 | + | |
| 21 | + struct ConfigWidget { | |
| 22 | + QPushButton *button; | |
| 23 | + QLabel *minimum; | |
| 24 | + QLabel *maximum; | |
| 25 | + QLabel *current; | |
| 26 | + QSlider *slider; | |
| 27 | + }; | |
| 28 | + | |
| 29 | +public: | |
| 30 | + explicit AutoCookSettingWidget(AutoCookSetting setting, QWidget *parent = 0); | |
| 31 | + ~AutoCookSettingWidget(); | |
| 32 | + | |
| 33 | +private: | |
| 34 | + Ui::AutoCookSettingWidget *ui; | |
| 35 | + QList<ConfigWidget> configWidgets; | |
| 36 | + | |
| 37 | + void setupUi(Cook cook); | |
| 38 | +}; | |
| 39 | + | |
| 40 | +#endif // AUTOCOOKSETTINGWIDGET_H | ... | ... |
app/gui/oven_control/autocooksettingwidget.ui
| ... | ... | @@ -0,0 +1,1347 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<ui version="4.0"> | |
| 3 | + <class>AutoCookSettingWidget</class> | |
| 4 | + <widget class="QWidget" name="AutoCookSettingWidget"> | |
| 5 | + <property name="geometry"> | |
| 6 | + <rect> | |
| 7 | + <x>0</x> | |
| 8 | + <y>0</y> | |
| 9 | + <width>900</width> | |
| 10 | + <height>1024</height> | |
| 11 | + </rect> | |
| 12 | + </property> | |
| 13 | + <property name="windowTitle"> | |
| 14 | + <string>Form</string> | |
| 15 | + </property> | |
| 16 | + <property name="styleSheet"> | |
| 17 | + <string notr="true">#background { | |
| 18 | +background-image: url(:/images/background/auto.png); | |
| 19 | +margin-top: -426px; | |
| 20 | +border-top: 426px; | |
| 21 | +} | |
| 22 | + | |
| 23 | +QSlider::groove { | |
| 24 | +background-image: url(:/images/slider/groove.png); | |
| 25 | +background-repeat: no-repeat; | |
| 26 | +background-position: center; | |
| 27 | +} | |
| 28 | + | |
| 29 | +QSlider::sub-page { | |
| 30 | +background-repeat: no-repeat; | |
| 31 | +background-position: left center; | |
| 32 | +margin: 0px 5px; | |
| 33 | +} | |
| 34 | + | |
| 35 | +QSlider[sliderColor="red"]::sub-page { | |
| 36 | +background-image: url(:/images/slider/sub_red.png); | |
| 37 | +} | |
| 38 | + | |
| 39 | +QSlider[sliderColor="yellow"]::sub-page { | |
| 40 | +background-image: url(:/images/slider/sub_yellow.png); | |
| 41 | +} | |
| 42 | + | |
| 43 | +QSlider[sliderColor="white"]::sub-page { | |
| 44 | +background-image: url(:/images/slider/sub_white.png); | |
| 45 | +} | |
| 46 | + | |
| 47 | +QSlider[sliderColor="blue"]::sub-page { | |
| 48 | +background-image: url(:/images/slider/sub_blue.png); | |
| 49 | +} | |
| 50 | + | |
| 51 | +QSlider[sliderColor="green"]::sub-page { | |
| 52 | +background-image: url(:/images/slider/sub_green.png); | |
| 53 | +} | |
| 54 | + | |
| 55 | +QSlider::handle { | |
| 56 | +background-image: url(:/images/slider/handle_big.png); | |
| 57 | +background-repeat: no-repeat; | |
| 58 | +background-position: center; | |
| 59 | +width: 23px; | |
| 60 | +height: 33px; | |
| 61 | +} | |
| 62 | + | |
| 63 | +QPushButton[style="icon"] { | |
| 64 | +background-image: url(:/images/slider_icon/background.png); | |
| 65 | +background-repeat: no-repeat; | |
| 66 | +background-position: center; | |
| 67 | +border: none; | |
| 68 | +}</string> | |
| 69 | + </property> | |
| 70 | + <widget class="QLabel" name="configMaxLabel_2"> | |
| 71 | + <property name="enabled"> | |
| 72 | + <bool>true</bool> | |
| 73 | + </property> | |
| 74 | + <property name="geometry"> | |
| 75 | + <rect> | |
| 76 | + <x>700</x> | |
| 77 | + <y>354</y> | |
| 78 | + <width>151</width> | |
| 79 | + <height>51</height> | |
| 80 | + </rect> | |
| 81 | + </property> | |
| 82 | + <property name="palette"> | |
| 83 | + <palette> | |
| 84 | + <active> | |
| 85 | + <colorrole role="WindowText"> | |
| 86 | + <brush brushstyle="SolidPattern"> | |
| 87 | + <color alpha="255"> | |
| 88 | + <red>255</red> | |
| 89 | + <green>255</green> | |
| 90 | + <blue>255</blue> | |
| 91 | + </color> | |
| 92 | + </brush> | |
| 93 | + </colorrole> | |
| 94 | + </active> | |
| 95 | + <inactive> | |
| 96 | + <colorrole role="WindowText"> | |
| 97 | + <brush brushstyle="SolidPattern"> | |
| 98 | + <color alpha="255"> | |
| 99 | + <red>255</red> | |
| 100 | + <green>255</green> | |
| 101 | + <blue>255</blue> | |
| 102 | + </color> | |
| 103 | + </brush> | |
| 104 | + </colorrole> | |
| 105 | + </inactive> | |
| 106 | + <disabled> | |
| 107 | + <colorrole role="WindowText"> | |
| 108 | + <brush brushstyle="SolidPattern"> | |
| 109 | + <color alpha="255"> | |
| 110 | + <red>123</red> | |
| 111 | + <green>123</green> | |
| 112 | + <blue>123</blue> | |
| 113 | + </color> | |
| 114 | + </brush> | |
| 115 | + </colorrole> | |
| 116 | + </disabled> | |
| 117 | + </palette> | |
| 118 | + </property> | |
| 119 | + <property name="font"> | |
| 120 | + <font> | |
| 121 | + <family>Malgun Gothic</family> | |
| 122 | + <pointsize>9</pointsize> | |
| 123 | + </font> | |
| 124 | + </property> | |
| 125 | + <property name="text"> | |
| 126 | + <string>증가</string> | |
| 127 | + </property> | |
| 128 | + <property name="alignment"> | |
| 129 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 130 | + </property> | |
| 131 | + </widget> | |
| 132 | + <widget class="QPushButton" name="configButton_4"> | |
| 133 | + <property name="geometry"> | |
| 134 | + <rect> | |
| 135 | + <x>27</x> | |
| 136 | + <y>689</y> | |
| 137 | + <width>140</width> | |
| 138 | + <height>140</height> | |
| 139 | + </rect> | |
| 140 | + </property> | |
| 141 | + <property name="text"> | |
| 142 | + <string/> | |
| 143 | + </property> | |
| 144 | + <property name="style" stdset="0"> | |
| 145 | + <string notr="true">icon</string> | |
| 146 | + </property> | |
| 147 | + </widget> | |
| 148 | + <widget class="QPushButton" name="configButton_3"> | |
| 149 | + <property name="geometry"> | |
| 150 | + <rect> | |
| 151 | + <x>27</x> | |
| 152 | + <y>509</y> | |
| 153 | + <width>140</width> | |
| 154 | + <height>140</height> | |
| 155 | + </rect> | |
| 156 | + </property> | |
| 157 | + <property name="text"> | |
| 158 | + <string/> | |
| 159 | + </property> | |
| 160 | + <property name="style" stdset="0"> | |
| 161 | + <string notr="true">icon</string> | |
| 162 | + </property> | |
| 163 | + </widget> | |
| 164 | + <widget class="QLabel" name="configMaxLabel_5"> | |
| 165 | + <property name="enabled"> | |
| 166 | + <bool>true</bool> | |
| 167 | + </property> | |
| 168 | + <property name="geometry"> | |
| 169 | + <rect> | |
| 170 | + <x>700</x> | |
| 171 | + <y>874</y> | |
| 172 | + <width>151</width> | |
| 173 | + <height>51</height> | |
| 174 | + </rect> | |
| 175 | + </property> | |
| 176 | + <property name="palette"> | |
| 177 | + <palette> | |
| 178 | + <active> | |
| 179 | + <colorrole role="WindowText"> | |
| 180 | + <brush brushstyle="SolidPattern"> | |
| 181 | + <color alpha="255"> | |
| 182 | + <red>255</red> | |
| 183 | + <green>255</green> | |
| 184 | + <blue>255</blue> | |
| 185 | + </color> | |
| 186 | + </brush> | |
| 187 | + </colorrole> | |
| 188 | + </active> | |
| 189 | + <inactive> | |
| 190 | + <colorrole role="WindowText"> | |
| 191 | + <brush brushstyle="SolidPattern"> | |
| 192 | + <color alpha="255"> | |
| 193 | + <red>255</red> | |
| 194 | + <green>255</green> | |
| 195 | + <blue>255</blue> | |
| 196 | + </color> | |
| 197 | + </brush> | |
| 198 | + </colorrole> | |
| 199 | + </inactive> | |
| 200 | + <disabled> | |
| 201 | + <colorrole role="WindowText"> | |
| 202 | + <brush brushstyle="SolidPattern"> | |
| 203 | + <color alpha="255"> | |
| 204 | + <red>123</red> | |
| 205 | + <green>123</green> | |
| 206 | + <blue>123</blue> | |
| 207 | + </color> | |
| 208 | + </brush> | |
| 209 | + </colorrole> | |
| 210 | + </disabled> | |
| 211 | + </palette> | |
| 212 | + </property> | |
| 213 | + <property name="font"> | |
| 214 | + <font> | |
| 215 | + <family>Malgun Gothic</family> | |
| 216 | + <pointsize>9</pointsize> | |
| 217 | + </font> | |
| 218 | + </property> | |
| 219 | + <property name="text"> | |
| 220 | + <string>증가</string> | |
| 221 | + </property> | |
| 222 | + <property name="alignment"> | |
| 223 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 224 | + </property> | |
| 225 | + </widget> | |
| 226 | + <widget class="QLabel" name="configCurrentLabel_1"> | |
| 227 | + <property name="enabled"> | |
| 228 | + <bool>true</bool> | |
| 229 | + </property> | |
| 230 | + <property name="geometry"> | |
| 231 | + <rect> | |
| 232 | + <x>199</x> | |
| 233 | + <y>264</y> | |
| 234 | + <width>641</width> | |
| 235 | + <height>51</height> | |
| 236 | + </rect> | |
| 237 | + </property> | |
| 238 | + <property name="palette"> | |
| 239 | + <palette> | |
| 240 | + <active> | |
| 241 | + <colorrole role="WindowText"> | |
| 242 | + <brush brushstyle="SolidPattern"> | |
| 243 | + <color alpha="255"> | |
| 244 | + <red>255</red> | |
| 245 | + <green>255</green> | |
| 246 | + <blue>255</blue> | |
| 247 | + </color> | |
| 248 | + </brush> | |
| 249 | + </colorrole> | |
| 250 | + </active> | |
| 251 | + <inactive> | |
| 252 | + <colorrole role="WindowText"> | |
| 253 | + <brush brushstyle="SolidPattern"> | |
| 254 | + <color alpha="255"> | |
| 255 | + <red>255</red> | |
| 256 | + <green>255</green> | |
| 257 | + <blue>255</blue> | |
| 258 | + </color> | |
| 259 | + </brush> | |
| 260 | + </colorrole> | |
| 261 | + </inactive> | |
| 262 | + <disabled> | |
| 263 | + <colorrole role="WindowText"> | |
| 264 | + <brush brushstyle="SolidPattern"> | |
| 265 | + <color alpha="255"> | |
| 266 | + <red>123</red> | |
| 267 | + <green>123</green> | |
| 268 | + <blue>123</blue> | |
| 269 | + </color> | |
| 270 | + </brush> | |
| 271 | + </colorrole> | |
| 272 | + </disabled> | |
| 273 | + </palette> | |
| 274 | + </property> | |
| 275 | + <property name="font"> | |
| 276 | + <font> | |
| 277 | + <family>Roboto</family> | |
| 278 | + <pointsize>16</pointsize> | |
| 279 | + <weight>75</weight> | |
| 280 | + <bold>true</bold> | |
| 281 | + </font> | |
| 282 | + </property> | |
| 283 | + <property name="text"> | |
| 284 | + <string>스팀</string> | |
| 285 | + </property> | |
| 286 | + <property name="alignment"> | |
| 287 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 288 | + </property> | |
| 289 | + </widget> | |
| 290 | + <widget class="QLabel" name="configMinLabel_5"> | |
| 291 | + <property name="enabled"> | |
| 292 | + <bool>true</bool> | |
| 293 | + </property> | |
| 294 | + <property name="geometry"> | |
| 295 | + <rect> | |
| 296 | + <x>185</x> | |
| 297 | + <y>874</y> | |
| 298 | + <width>151</width> | |
| 299 | + <height>51</height> | |
| 300 | + </rect> | |
| 301 | + </property> | |
| 302 | + <property name="palette"> | |
| 303 | + <palette> | |
| 304 | + <active> | |
| 305 | + <colorrole role="WindowText"> | |
| 306 | + <brush brushstyle="SolidPattern"> | |
| 307 | + <color alpha="255"> | |
| 308 | + <red>255</red> | |
| 309 | + <green>255</green> | |
| 310 | + <blue>255</blue> | |
| 311 | + </color> | |
| 312 | + </brush> | |
| 313 | + </colorrole> | |
| 314 | + </active> | |
| 315 | + <inactive> | |
| 316 | + <colorrole role="WindowText"> | |
| 317 | + <brush brushstyle="SolidPattern"> | |
| 318 | + <color alpha="255"> | |
| 319 | + <red>255</red> | |
| 320 | + <green>255</green> | |
| 321 | + <blue>255</blue> | |
| 322 | + </color> | |
| 323 | + </brush> | |
| 324 | + </colorrole> | |
| 325 | + </inactive> | |
| 326 | + <disabled> | |
| 327 | + <colorrole role="WindowText"> | |
| 328 | + <brush brushstyle="SolidPattern"> | |
| 329 | + <color alpha="255"> | |
| 330 | + <red>123</red> | |
| 331 | + <green>123</green> | |
| 332 | + <blue>123</blue> | |
| 333 | + </color> | |
| 334 | + </brush> | |
| 335 | + </colorrole> | |
| 336 | + </disabled> | |
| 337 | + </palette> | |
| 338 | + </property> | |
| 339 | + <property name="font"> | |
| 340 | + <font> | |
| 341 | + <family>Malgun Gothic</family> | |
| 342 | + <pointsize>9</pointsize> | |
| 343 | + </font> | |
| 344 | + </property> | |
| 345 | + <property name="text"> | |
| 346 | + <string>감소</string> | |
| 347 | + </property> | |
| 348 | + <property name="alignment"> | |
| 349 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | |
| 350 | + </property> | |
| 351 | + </widget> | |
| 352 | + <widget class="QPushButton" name="configButton_2"> | |
| 353 | + <property name="geometry"> | |
| 354 | + <rect> | |
| 355 | + <x>27</x> | |
| 356 | + <y>339</y> | |
| 357 | + <width>140</width> | |
| 358 | + <height>140</height> | |
| 359 | + </rect> | |
| 360 | + </property> | |
| 361 | + <property name="text"> | |
| 362 | + <string/> | |
| 363 | + </property> | |
| 364 | + <property name="style" stdset="0"> | |
| 365 | + <string notr="true">icon</string> | |
| 366 | + </property> | |
| 367 | + </widget> | |
| 368 | + <widget class="QSlider" name="configSlider_5"> | |
| 369 | + <property name="geometry"> | |
| 370 | + <rect> | |
| 371 | + <x>185</x> | |
| 372 | + <y>917</y> | |
| 373 | + <width>666</width> | |
| 374 | + <height>33</height> | |
| 375 | + </rect> | |
| 376 | + </property> | |
| 377 | + <property name="maximum"> | |
| 378 | + <number>100</number> | |
| 379 | + </property> | |
| 380 | + <property name="pageStep"> | |
| 381 | + <number>1</number> | |
| 382 | + </property> | |
| 383 | + <property name="value"> | |
| 384 | + <number>0</number> | |
| 385 | + </property> | |
| 386 | + <property name="tracking"> | |
| 387 | + <bool>true</bool> | |
| 388 | + </property> | |
| 389 | + <property name="orientation"> | |
| 390 | + <enum>Qt::Horizontal</enum> | |
| 391 | + </property> | |
| 392 | + </widget> | |
| 393 | + <widget class="QLabel" name="configCurrentLabel_2"> | |
| 394 | + <property name="enabled"> | |
| 395 | + <bool>true</bool> | |
| 396 | + </property> | |
| 397 | + <property name="geometry"> | |
| 398 | + <rect> | |
| 399 | + <x>199</x> | |
| 400 | + <y>424</y> | |
| 401 | + <width>641</width> | |
| 402 | + <height>51</height> | |
| 403 | + </rect> | |
| 404 | + </property> | |
| 405 | + <property name="palette"> | |
| 406 | + <palette> | |
| 407 | + <active> | |
| 408 | + <colorrole role="WindowText"> | |
| 409 | + <brush brushstyle="SolidPattern"> | |
| 410 | + <color alpha="255"> | |
| 411 | + <red>255</red> | |
| 412 | + <green>255</green> | |
| 413 | + <blue>255</blue> | |
| 414 | + </color> | |
| 415 | + </brush> | |
| 416 | + </colorrole> | |
| 417 | + </active> | |
| 418 | + <inactive> | |
| 419 | + <colorrole role="WindowText"> | |
| 420 | + <brush brushstyle="SolidPattern"> | |
| 421 | + <color alpha="255"> | |
| 422 | + <red>255</red> | |
| 423 | + <green>255</green> | |
| 424 | + <blue>255</blue> | |
| 425 | + </color> | |
| 426 | + </brush> | |
| 427 | + </colorrole> | |
| 428 | + </inactive> | |
| 429 | + <disabled> | |
| 430 | + <colorrole role="WindowText"> | |
| 431 | + <brush brushstyle="SolidPattern"> | |
| 432 | + <color alpha="255"> | |
| 433 | + <red>123</red> | |
| 434 | + <green>123</green> | |
| 435 | + <blue>123</blue> | |
| 436 | + </color> | |
| 437 | + </brush> | |
| 438 | + </colorrole> | |
| 439 | + </disabled> | |
| 440 | + </palette> | |
| 441 | + </property> | |
| 442 | + <property name="font"> | |
| 443 | + <font> | |
| 444 | + <family>Roboto</family> | |
| 445 | + <pointsize>16</pointsize> | |
| 446 | + <weight>75</weight> | |
| 447 | + <bold>true</bold> | |
| 448 | + </font> | |
| 449 | + </property> | |
| 450 | + <property name="text"> | |
| 451 | + <string>스팀</string> | |
| 452 | + </property> | |
| 453 | + <property name="alignment"> | |
| 454 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 455 | + </property> | |
| 456 | + </widget> | |
| 457 | + <widget class="QLabel" name="configCurrentLabel_5"> | |
| 458 | + <property name="enabled"> | |
| 459 | + <bool>true</bool> | |
| 460 | + </property> | |
| 461 | + <property name="geometry"> | |
| 462 | + <rect> | |
| 463 | + <x>189</x> | |
| 464 | + <y>944</y> | |
| 465 | + <width>651</width> | |
| 466 | + <height>51</height> | |
| 467 | + </rect> | |
| 468 | + </property> | |
| 469 | + <property name="palette"> | |
| 470 | + <palette> | |
| 471 | + <active> | |
| 472 | + <colorrole role="WindowText"> | |
| 473 | + <brush brushstyle="SolidPattern"> | |
| 474 | + <color alpha="255"> | |
| 475 | + <red>255</red> | |
| 476 | + <green>255</green> | |
| 477 | + <blue>255</blue> | |
| 478 | + </color> | |
| 479 | + </brush> | |
| 480 | + </colorrole> | |
| 481 | + </active> | |
| 482 | + <inactive> | |
| 483 | + <colorrole role="WindowText"> | |
| 484 | + <brush brushstyle="SolidPattern"> | |
| 485 | + <color alpha="255"> | |
| 486 | + <red>255</red> | |
| 487 | + <green>255</green> | |
| 488 | + <blue>255</blue> | |
| 489 | + </color> | |
| 490 | + </brush> | |
| 491 | + </colorrole> | |
| 492 | + </inactive> | |
| 493 | + <disabled> | |
| 494 | + <colorrole role="WindowText"> | |
| 495 | + <brush brushstyle="SolidPattern"> | |
| 496 | + <color alpha="255"> | |
| 497 | + <red>123</red> | |
| 498 | + <green>123</green> | |
| 499 | + <blue>123</blue> | |
| 500 | + </color> | |
| 501 | + </brush> | |
| 502 | + </colorrole> | |
| 503 | + </disabled> | |
| 504 | + </palette> | |
| 505 | + </property> | |
| 506 | + <property name="font"> | |
| 507 | + <font> | |
| 508 | + <family>Roboto</family> | |
| 509 | + <pointsize>16</pointsize> | |
| 510 | + <weight>75</weight> | |
| 511 | + <bold>true</bold> | |
| 512 | + </font> | |
| 513 | + </property> | |
| 514 | + <property name="text"> | |
| 515 | + <string>스팀</string> | |
| 516 | + </property> | |
| 517 | + <property name="alignment"> | |
| 518 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 519 | + </property> | |
| 520 | + </widget> | |
| 521 | + <widget class="QSlider" name="configSlider_3"> | |
| 522 | + <property name="geometry"> | |
| 523 | + <rect> | |
| 524 | + <x>185</x> | |
| 525 | + <y>567</y> | |
| 526 | + <width>666</width> | |
| 527 | + <height>33</height> | |
| 528 | + </rect> | |
| 529 | + </property> | |
| 530 | + <property name="maximum"> | |
| 531 | + <number>100</number> | |
| 532 | + </property> | |
| 533 | + <property name="pageStep"> | |
| 534 | + <number>1</number> | |
| 535 | + </property> | |
| 536 | + <property name="value"> | |
| 537 | + <number>0</number> | |
| 538 | + </property> | |
| 539 | + <property name="tracking"> | |
| 540 | + <bool>true</bool> | |
| 541 | + </property> | |
| 542 | + <property name="orientation"> | |
| 543 | + <enum>Qt::Horizontal</enum> | |
| 544 | + </property> | |
| 545 | + </widget> | |
| 546 | + <widget class="QSlider" name="configSlider_2"> | |
| 547 | + <property name="geometry"> | |
| 548 | + <rect> | |
| 549 | + <x>185</x> | |
| 550 | + <y>397</y> | |
| 551 | + <width>666</width> | |
| 552 | + <height>33</height> | |
| 553 | + </rect> | |
| 554 | + </property> | |
| 555 | + <property name="maximum"> | |
| 556 | + <number>100</number> | |
| 557 | + </property> | |
| 558 | + <property name="pageStep"> | |
| 559 | + <number>1</number> | |
| 560 | + </property> | |
| 561 | + <property name="value"> | |
| 562 | + <number>10</number> | |
| 563 | + </property> | |
| 564 | + <property name="tracking"> | |
| 565 | + <bool>true</bool> | |
| 566 | + </property> | |
| 567 | + <property name="orientation"> | |
| 568 | + <enum>Qt::Horizontal</enum> | |
| 569 | + </property> | |
| 570 | + </widget> | |
| 571 | + <widget class="QLabel" name="configCurrentLabel_3"> | |
| 572 | + <property name="enabled"> | |
| 573 | + <bool>true</bool> | |
| 574 | + </property> | |
| 575 | + <property name="geometry"> | |
| 576 | + <rect> | |
| 577 | + <x>199</x> | |
| 578 | + <y>594</y> | |
| 579 | + <width>641</width> | |
| 580 | + <height>51</height> | |
| 581 | + </rect> | |
| 582 | + </property> | |
| 583 | + <property name="palette"> | |
| 584 | + <palette> | |
| 585 | + <active> | |
| 586 | + <colorrole role="WindowText"> | |
| 587 | + <brush brushstyle="SolidPattern"> | |
| 588 | + <color alpha="255"> | |
| 589 | + <red>255</red> | |
| 590 | + <green>255</green> | |
| 591 | + <blue>255</blue> | |
| 592 | + </color> | |
| 593 | + </brush> | |
| 594 | + </colorrole> | |
| 595 | + </active> | |
| 596 | + <inactive> | |
| 597 | + <colorrole role="WindowText"> | |
| 598 | + <brush brushstyle="SolidPattern"> | |
| 599 | + <color alpha="255"> | |
| 600 | + <red>255</red> | |
| 601 | + <green>255</green> | |
| 602 | + <blue>255</blue> | |
| 603 | + </color> | |
| 604 | + </brush> | |
| 605 | + </colorrole> | |
| 606 | + </inactive> | |
| 607 | + <disabled> | |
| 608 | + <colorrole role="WindowText"> | |
| 609 | + <brush brushstyle="SolidPattern"> | |
| 610 | + <color alpha="255"> | |
| 611 | + <red>123</red> | |
| 612 | + <green>123</green> | |
| 613 | + <blue>123</blue> | |
| 614 | + </color> | |
| 615 | + </brush> | |
| 616 | + </colorrole> | |
| 617 | + </disabled> | |
| 618 | + </palette> | |
| 619 | + </property> | |
| 620 | + <property name="font"> | |
| 621 | + <font> | |
| 622 | + <family>Roboto</family> | |
| 623 | + <pointsize>16</pointsize> | |
| 624 | + <weight>75</weight> | |
| 625 | + <bold>true</bold> | |
| 626 | + </font> | |
| 627 | + </property> | |
| 628 | + <property name="text"> | |
| 629 | + <string>스팀</string> | |
| 630 | + </property> | |
| 631 | + <property name="alignment"> | |
| 632 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 633 | + </property> | |
| 634 | + </widget> | |
| 635 | + <widget class="QLabel" name="cookTypeIcon"> | |
| 636 | + <property name="geometry"> | |
| 637 | + <rect> | |
| 638 | + <x>0</x> | |
| 639 | + <y>4</y> | |
| 640 | + <width>250</width> | |
| 641 | + <height>150</height> | |
| 642 | + </rect> | |
| 643 | + </property> | |
| 644 | + <property name="text"> | |
| 645 | + <string/> | |
| 646 | + </property> | |
| 647 | + <property name="pixmap"> | |
| 648 | + <pixmap>:/images/images/auto/005_auto_icon_01_ov.png</pixmap> | |
| 649 | + </property> | |
| 650 | + <property name="alignment"> | |
| 651 | + <set>Qt::AlignCenter</set> | |
| 652 | + </property> | |
| 653 | + </widget> | |
| 654 | + <widget class="QLabel" name="configMaxLabel_4"> | |
| 655 | + <property name="enabled"> | |
| 656 | + <bool>true</bool> | |
| 657 | + </property> | |
| 658 | + <property name="geometry"> | |
| 659 | + <rect> | |
| 660 | + <x>700</x> | |
| 661 | + <y>704</y> | |
| 662 | + <width>151</width> | |
| 663 | + <height>51</height> | |
| 664 | + </rect> | |
| 665 | + </property> | |
| 666 | + <property name="palette"> | |
| 667 | + <palette> | |
| 668 | + <active> | |
| 669 | + <colorrole role="WindowText"> | |
| 670 | + <brush brushstyle="SolidPattern"> | |
| 671 | + <color alpha="255"> | |
| 672 | + <red>255</red> | |
| 673 | + <green>255</green> | |
| 674 | + <blue>255</blue> | |
| 675 | + </color> | |
| 676 | + </brush> | |
| 677 | + </colorrole> | |
| 678 | + </active> | |
| 679 | + <inactive> | |
| 680 | + <colorrole role="WindowText"> | |
| 681 | + <brush brushstyle="SolidPattern"> | |
| 682 | + <color alpha="255"> | |
| 683 | + <red>255</red> | |
| 684 | + <green>255</green> | |
| 685 | + <blue>255</blue> | |
| 686 | + </color> | |
| 687 | + </brush> | |
| 688 | + </colorrole> | |
| 689 | + </inactive> | |
| 690 | + <disabled> | |
| 691 | + <colorrole role="WindowText"> | |
| 692 | + <brush brushstyle="SolidPattern"> | |
| 693 | + <color alpha="255"> | |
| 694 | + <red>123</red> | |
| 695 | + <green>123</green> | |
| 696 | + <blue>123</blue> | |
| 697 | + </color> | |
| 698 | + </brush> | |
| 699 | + </colorrole> | |
| 700 | + </disabled> | |
| 701 | + </palette> | |
| 702 | + </property> | |
| 703 | + <property name="font"> | |
| 704 | + <font> | |
| 705 | + <family>Malgun Gothic</family> | |
| 706 | + <pointsize>9</pointsize> | |
| 707 | + </font> | |
| 708 | + </property> | |
| 709 | + <property name="text"> | |
| 710 | + <string>증가</string> | |
| 711 | + </property> | |
| 712 | + <property name="alignment"> | |
| 713 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 714 | + </property> | |
| 715 | + </widget> | |
| 716 | + <widget class="QPushButton" name="configButton_5"> | |
| 717 | + <property name="geometry"> | |
| 718 | + <rect> | |
| 719 | + <x>27</x> | |
| 720 | + <y>859</y> | |
| 721 | + <width>140</width> | |
| 722 | + <height>140</height> | |
| 723 | + </rect> | |
| 724 | + </property> | |
| 725 | + <property name="text"> | |
| 726 | + <string/> | |
| 727 | + </property> | |
| 728 | + <property name="style" stdset="0"> | |
| 729 | + <string notr="true">icon</string> | |
| 730 | + </property> | |
| 731 | + </widget> | |
| 732 | + <widget class="QLabel" name="configMinLabel_1"> | |
| 733 | + <property name="enabled"> | |
| 734 | + <bool>true</bool> | |
| 735 | + </property> | |
| 736 | + <property name="geometry"> | |
| 737 | + <rect> | |
| 738 | + <x>185</x> | |
| 739 | + <y>194</y> | |
| 740 | + <width>151</width> | |
| 741 | + <height>51</height> | |
| 742 | + </rect> | |
| 743 | + </property> | |
| 744 | + <property name="palette"> | |
| 745 | + <palette> | |
| 746 | + <active> | |
| 747 | + <colorrole role="WindowText"> | |
| 748 | + <brush brushstyle="SolidPattern"> | |
| 749 | + <color alpha="255"> | |
| 750 | + <red>255</red> | |
| 751 | + <green>255</green> | |
| 752 | + <blue>255</blue> | |
| 753 | + </color> | |
| 754 | + </brush> | |
| 755 | + </colorrole> | |
| 756 | + </active> | |
| 757 | + <inactive> | |
| 758 | + <colorrole role="WindowText"> | |
| 759 | + <brush brushstyle="SolidPattern"> | |
| 760 | + <color alpha="255"> | |
| 761 | + <red>255</red> | |
| 762 | + <green>255</green> | |
| 763 | + <blue>255</blue> | |
| 764 | + </color> | |
| 765 | + </brush> | |
| 766 | + </colorrole> | |
| 767 | + </inactive> | |
| 768 | + <disabled> | |
| 769 | + <colorrole role="WindowText"> | |
| 770 | + <brush brushstyle="SolidPattern"> | |
| 771 | + <color alpha="255"> | |
| 772 | + <red>123</red> | |
| 773 | + <green>123</green> | |
| 774 | + <blue>123</blue> | |
| 775 | + </color> | |
| 776 | + </brush> | |
| 777 | + </colorrole> | |
| 778 | + </disabled> | |
| 779 | + </palette> | |
| 780 | + </property> | |
| 781 | + <property name="font"> | |
| 782 | + <font> | |
| 783 | + <family>Malgun Gothic</family> | |
| 784 | + <pointsize>9</pointsize> | |
| 785 | + </font> | |
| 786 | + </property> | |
| 787 | + <property name="text"> | |
| 788 | + <string>감소</string> | |
| 789 | + </property> | |
| 790 | + <property name="alignment"> | |
| 791 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | |
| 792 | + </property> | |
| 793 | + </widget> | |
| 794 | + <widget class="QPushButton" name="pushButton_4"> | |
| 795 | + <property name="geometry"> | |
| 796 | + <rect> | |
| 797 | + <x>720</x> | |
| 798 | + <y>54</y> | |
| 799 | + <width>152</width> | |
| 800 | + <height>70</height> | |
| 801 | + </rect> | |
| 802 | + </property> | |
| 803 | + <property name="styleSheet"> | |
| 804 | + <string notr="true">QPushButton { | |
| 805 | +border-image: url(:/images/button/152.png); | |
| 806 | +} | |
| 807 | +QPushButton::pressed { | |
| 808 | +border-image: url(:/images/button/152_ov.png); | |
| 809 | +}</string> | |
| 810 | + </property> | |
| 811 | + <property name="text"> | |
| 812 | + <string/> | |
| 813 | + </property> | |
| 814 | + <property name="icon"> | |
| 815 | + <iconset resource="resources.qrc"> | |
| 816 | + <normaloff>:/images/auto_button/btn_icon_01.png</normaloff>:/images/auto_button/btn_icon_01.png</iconset> | |
| 817 | + </property> | |
| 818 | + <property name="iconSize"> | |
| 819 | + <size> | |
| 820 | + <width>40</width> | |
| 821 | + <height>51</height> | |
| 822 | + </size> | |
| 823 | + </property> | |
| 824 | + </widget> | |
| 825 | + <widget class="QPushButton" name="configButton_1"> | |
| 826 | + <property name="geometry"> | |
| 827 | + <rect> | |
| 828 | + <x>27</x> | |
| 829 | + <y>179</y> | |
| 830 | + <width>140</width> | |
| 831 | + <height>140</height> | |
| 832 | + </rect> | |
| 833 | + </property> | |
| 834 | + <property name="text"> | |
| 835 | + <string/> | |
| 836 | + </property> | |
| 837 | + <property name="style" stdset="0"> | |
| 838 | + <string notr="true">icon</string> | |
| 839 | + </property> | |
| 840 | + </widget> | |
| 841 | + <widget class="QLabel" name="configMinLabel_2"> | |
| 842 | + <property name="enabled"> | |
| 843 | + <bool>true</bool> | |
| 844 | + </property> | |
| 845 | + <property name="geometry"> | |
| 846 | + <rect> | |
| 847 | + <x>185</x> | |
| 848 | + <y>354</y> | |
| 849 | + <width>151</width> | |
| 850 | + <height>51</height> | |
| 851 | + </rect> | |
| 852 | + </property> | |
| 853 | + <property name="palette"> | |
| 854 | + <palette> | |
| 855 | + <active> | |
| 856 | + <colorrole role="WindowText"> | |
| 857 | + <brush brushstyle="SolidPattern"> | |
| 858 | + <color alpha="255"> | |
| 859 | + <red>255</red> | |
| 860 | + <green>255</green> | |
| 861 | + <blue>255</blue> | |
| 862 | + </color> | |
| 863 | + </brush> | |
| 864 | + </colorrole> | |
| 865 | + </active> | |
| 866 | + <inactive> | |
| 867 | + <colorrole role="WindowText"> | |
| 868 | + <brush brushstyle="SolidPattern"> | |
| 869 | + <color alpha="255"> | |
| 870 | + <red>255</red> | |
| 871 | + <green>255</green> | |
| 872 | + <blue>255</blue> | |
| 873 | + </color> | |
| 874 | + </brush> | |
| 875 | + </colorrole> | |
| 876 | + </inactive> | |
| 877 | + <disabled> | |
| 878 | + <colorrole role="WindowText"> | |
| 879 | + <brush brushstyle="SolidPattern"> | |
| 880 | + <color alpha="255"> | |
| 881 | + <red>123</red> | |
| 882 | + <green>123</green> | |
| 883 | + <blue>123</blue> | |
| 884 | + </color> | |
| 885 | + </brush> | |
| 886 | + </colorrole> | |
| 887 | + </disabled> | |
| 888 | + </palette> | |
| 889 | + </property> | |
| 890 | + <property name="font"> | |
| 891 | + <font> | |
| 892 | + <family>Malgun Gothic</family> | |
| 893 | + <pointsize>9</pointsize> | |
| 894 | + </font> | |
| 895 | + </property> | |
| 896 | + <property name="text"> | |
| 897 | + <string>감소</string> | |
| 898 | + </property> | |
| 899 | + <property name="alignment"> | |
| 900 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | |
| 901 | + </property> | |
| 902 | + </widget> | |
| 903 | + <widget class="QSlider" name="configSlider_4"> | |
| 904 | + <property name="geometry"> | |
| 905 | + <rect> | |
| 906 | + <x>185</x> | |
| 907 | + <y>747</y> | |
| 908 | + <width>666</width> | |
| 909 | + <height>33</height> | |
| 910 | + </rect> | |
| 911 | + </property> | |
| 912 | + <property name="maximum"> | |
| 913 | + <number>100</number> | |
| 914 | + </property> | |
| 915 | + <property name="pageStep"> | |
| 916 | + <number>1</number> | |
| 917 | + </property> | |
| 918 | + <property name="value"> | |
| 919 | + <number>0</number> | |
| 920 | + </property> | |
| 921 | + <property name="tracking"> | |
| 922 | + <bool>true</bool> | |
| 923 | + </property> | |
| 924 | + <property name="orientation"> | |
| 925 | + <enum>Qt::Horizontal</enum> | |
| 926 | + </property> | |
| 927 | + </widget> | |
| 928 | + <widget class="QLabel" name="configCurrentLabel_4"> | |
| 929 | + <property name="enabled"> | |
| 930 | + <bool>true</bool> | |
| 931 | + </property> | |
| 932 | + <property name="geometry"> | |
| 933 | + <rect> | |
| 934 | + <x>199</x> | |
| 935 | + <y>774</y> | |
| 936 | + <width>641</width> | |
| 937 | + <height>51</height> | |
| 938 | + </rect> | |
| 939 | + </property> | |
| 940 | + <property name="palette"> | |
| 941 | + <palette> | |
| 942 | + <active> | |
| 943 | + <colorrole role="WindowText"> | |
| 944 | + <brush brushstyle="SolidPattern"> | |
| 945 | + <color alpha="255"> | |
| 946 | + <red>255</red> | |
| 947 | + <green>255</green> | |
| 948 | + <blue>255</blue> | |
| 949 | + </color> | |
| 950 | + </brush> | |
| 951 | + </colorrole> | |
| 952 | + </active> | |
| 953 | + <inactive> | |
| 954 | + <colorrole role="WindowText"> | |
| 955 | + <brush brushstyle="SolidPattern"> | |
| 956 | + <color alpha="255"> | |
| 957 | + <red>255</red> | |
| 958 | + <green>255</green> | |
| 959 | + <blue>255</blue> | |
| 960 | + </color> | |
| 961 | + </brush> | |
| 962 | + </colorrole> | |
| 963 | + </inactive> | |
| 964 | + <disabled> | |
| 965 | + <colorrole role="WindowText"> | |
| 966 | + <brush brushstyle="SolidPattern"> | |
| 967 | + <color alpha="255"> | |
| 968 | + <red>123</red> | |
| 969 | + <green>123</green> | |
| 970 | + <blue>123</blue> | |
| 971 | + </color> | |
| 972 | + </brush> | |
| 973 | + </colorrole> | |
| 974 | + </disabled> | |
| 975 | + </palette> | |
| 976 | + </property> | |
| 977 | + <property name="font"> | |
| 978 | + <font> | |
| 979 | + <family>Roboto</family> | |
| 980 | + <pointsize>16</pointsize> | |
| 981 | + <weight>75</weight> | |
| 982 | + <bold>true</bold> | |
| 983 | + </font> | |
| 984 | + </property> | |
| 985 | + <property name="text"> | |
| 986 | + <string>스팀</string> | |
| 987 | + </property> | |
| 988 | + <property name="alignment"> | |
| 989 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 990 | + </property> | |
| 991 | + </widget> | |
| 992 | + <widget class="QLabel" name="configMaxLabel_1"> | |
| 993 | + <property name="enabled"> | |
| 994 | + <bool>true</bool> | |
| 995 | + </property> | |
| 996 | + <property name="geometry"> | |
| 997 | + <rect> | |
| 998 | + <x>700</x> | |
| 999 | + <y>194</y> | |
| 1000 | + <width>151</width> | |
| 1001 | + <height>51</height> | |
| 1002 | + </rect> | |
| 1003 | + </property> | |
| 1004 | + <property name="palette"> | |
| 1005 | + <palette> | |
| 1006 | + <active> | |
| 1007 | + <colorrole role="WindowText"> | |
| 1008 | + <brush brushstyle="SolidPattern"> | |
| 1009 | + <color alpha="255"> | |
| 1010 | + <red>255</red> | |
| 1011 | + <green>255</green> | |
| 1012 | + <blue>255</blue> | |
| 1013 | + </color> | |
| 1014 | + </brush> | |
| 1015 | + </colorrole> | |
| 1016 | + </active> | |
| 1017 | + <inactive> | |
| 1018 | + <colorrole role="WindowText"> | |
| 1019 | + <brush brushstyle="SolidPattern"> | |
| 1020 | + <color alpha="255"> | |
| 1021 | + <red>255</red> | |
| 1022 | + <green>255</green> | |
| 1023 | + <blue>255</blue> | |
| 1024 | + </color> | |
| 1025 | + </brush> | |
| 1026 | + </colorrole> | |
| 1027 | + </inactive> | |
| 1028 | + <disabled> | |
| 1029 | + <colorrole role="WindowText"> | |
| 1030 | + <brush brushstyle="SolidPattern"> | |
| 1031 | + <color alpha="255"> | |
| 1032 | + <red>123</red> | |
| 1033 | + <green>123</green> | |
| 1034 | + <blue>123</blue> | |
| 1035 | + </color> | |
| 1036 | + </brush> | |
| 1037 | + </colorrole> | |
| 1038 | + </disabled> | |
| 1039 | + </palette> | |
| 1040 | + </property> | |
| 1041 | + <property name="font"> | |
| 1042 | + <font> | |
| 1043 | + <family>Malgun Gothic</family> | |
| 1044 | + <pointsize>9</pointsize> | |
| 1045 | + </font> | |
| 1046 | + </property> | |
| 1047 | + <property name="text"> | |
| 1048 | + <string>증가</string> | |
| 1049 | + </property> | |
| 1050 | + <property name="alignment"> | |
| 1051 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 1052 | + </property> | |
| 1053 | + </widget> | |
| 1054 | + <widget class="QLabel" name="configMinLabel_3"> | |
| 1055 | + <property name="enabled"> | |
| 1056 | + <bool>true</bool> | |
| 1057 | + </property> | |
| 1058 | + <property name="geometry"> | |
| 1059 | + <rect> | |
| 1060 | + <x>185</x> | |
| 1061 | + <y>524</y> | |
| 1062 | + <width>151</width> | |
| 1063 | + <height>51</height> | |
| 1064 | + </rect> | |
| 1065 | + </property> | |
| 1066 | + <property name="palette"> | |
| 1067 | + <palette> | |
| 1068 | + <active> | |
| 1069 | + <colorrole role="WindowText"> | |
| 1070 | + <brush brushstyle="SolidPattern"> | |
| 1071 | + <color alpha="255"> | |
| 1072 | + <red>255</red> | |
| 1073 | + <green>255</green> | |
| 1074 | + <blue>255</blue> | |
| 1075 | + </color> | |
| 1076 | + </brush> | |
| 1077 | + </colorrole> | |
| 1078 | + </active> | |
| 1079 | + <inactive> | |
| 1080 | + <colorrole role="WindowText"> | |
| 1081 | + <brush brushstyle="SolidPattern"> | |
| 1082 | + <color alpha="255"> | |
| 1083 | + <red>255</red> | |
| 1084 | + <green>255</green> | |
| 1085 | + <blue>255</blue> | |
| 1086 | + </color> | |
| 1087 | + </brush> | |
| 1088 | + </colorrole> | |
| 1089 | + </inactive> | |
| 1090 | + <disabled> | |
| 1091 | + <colorrole role="WindowText"> | |
| 1092 | + <brush brushstyle="SolidPattern"> | |
| 1093 | + <color alpha="255"> | |
| 1094 | + <red>123</red> | |
| 1095 | + <green>123</green> | |
| 1096 | + <blue>123</blue> | |
| 1097 | + </color> | |
| 1098 | + </brush> | |
| 1099 | + </colorrole> | |
| 1100 | + </disabled> | |
| 1101 | + </palette> | |
| 1102 | + </property> | |
| 1103 | + <property name="font"> | |
| 1104 | + <font> | |
| 1105 | + <family>Malgun Gothic</family> | |
| 1106 | + <pointsize>9</pointsize> | |
| 1107 | + </font> | |
| 1108 | + </property> | |
| 1109 | + <property name="text"> | |
| 1110 | + <string>감소</string> | |
| 1111 | + </property> | |
| 1112 | + <property name="alignment"> | |
| 1113 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | |
| 1114 | + </property> | |
| 1115 | + </widget> | |
| 1116 | + <widget class="QLabel" name="configMinLabel_4"> | |
| 1117 | + <property name="enabled"> | |
| 1118 | + <bool>true</bool> | |
| 1119 | + </property> | |
| 1120 | + <property name="geometry"> | |
| 1121 | + <rect> | |
| 1122 | + <x>185</x> | |
| 1123 | + <y>704</y> | |
| 1124 | + <width>151</width> | |
| 1125 | + <height>51</height> | |
| 1126 | + </rect> | |
| 1127 | + </property> | |
| 1128 | + <property name="palette"> | |
| 1129 | + <palette> | |
| 1130 | + <active> | |
| 1131 | + <colorrole role="WindowText"> | |
| 1132 | + <brush brushstyle="SolidPattern"> | |
| 1133 | + <color alpha="255"> | |
| 1134 | + <red>255</red> | |
| 1135 | + <green>255</green> | |
| 1136 | + <blue>255</blue> | |
| 1137 | + </color> | |
| 1138 | + </brush> | |
| 1139 | + </colorrole> | |
| 1140 | + </active> | |
| 1141 | + <inactive> | |
| 1142 | + <colorrole role="WindowText"> | |
| 1143 | + <brush brushstyle="SolidPattern"> | |
| 1144 | + <color alpha="255"> | |
| 1145 | + <red>255</red> | |
| 1146 | + <green>255</green> | |
| 1147 | + <blue>255</blue> | |
| 1148 | + </color> | |
| 1149 | + </brush> | |
| 1150 | + </colorrole> | |
| 1151 | + </inactive> | |
| 1152 | + <disabled> | |
| 1153 | + <colorrole role="WindowText"> | |
| 1154 | + <brush brushstyle="SolidPattern"> | |
| 1155 | + <color alpha="255"> | |
| 1156 | + <red>123</red> | |
| 1157 | + <green>123</green> | |
| 1158 | + <blue>123</blue> | |
| 1159 | + </color> | |
| 1160 | + </brush> | |
| 1161 | + </colorrole> | |
| 1162 | + </disabled> | |
| 1163 | + </palette> | |
| 1164 | + </property> | |
| 1165 | + <property name="font"> | |
| 1166 | + <font> | |
| 1167 | + <family>Malgun Gothic</family> | |
| 1168 | + <pointsize>9</pointsize> | |
| 1169 | + </font> | |
| 1170 | + </property> | |
| 1171 | + <property name="text"> | |
| 1172 | + <string>감소</string> | |
| 1173 | + </property> | |
| 1174 | + <property name="alignment"> | |
| 1175 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | |
| 1176 | + </property> | |
| 1177 | + </widget> | |
| 1178 | + <widget class="QSlider" name="configSlider_1"> | |
| 1179 | + <property name="geometry"> | |
| 1180 | + <rect> | |
| 1181 | + <x>185</x> | |
| 1182 | + <y>237</y> | |
| 1183 | + <width>666</width> | |
| 1184 | + <height>33</height> | |
| 1185 | + </rect> | |
| 1186 | + </property> | |
| 1187 | + <property name="maximum"> | |
| 1188 | + <number>100</number> | |
| 1189 | + </property> | |
| 1190 | + <property name="pageStep"> | |
| 1191 | + <number>1</number> | |
| 1192 | + </property> | |
| 1193 | + <property name="value"> | |
| 1194 | + <number>39</number> | |
| 1195 | + </property> | |
| 1196 | + <property name="tracking"> | |
| 1197 | + <bool>true</bool> | |
| 1198 | + </property> | |
| 1199 | + <property name="orientation"> | |
| 1200 | + <enum>Qt::Horizontal</enum> | |
| 1201 | + </property> | |
| 1202 | + <property name="tickPosition"> | |
| 1203 | + <enum>QSlider::TicksBelow</enum> | |
| 1204 | + </property> | |
| 1205 | + <property name="tickInterval"> | |
| 1206 | + <number>1</number> | |
| 1207 | + </property> | |
| 1208 | + </widget> | |
| 1209 | + <widget class="QLabel" name="configMaxLabel_3"> | |
| 1210 | + <property name="enabled"> | |
| 1211 | + <bool>true</bool> | |
| 1212 | + </property> | |
| 1213 | + <property name="geometry"> | |
| 1214 | + <rect> | |
| 1215 | + <x>700</x> | |
| 1216 | + <y>524</y> | |
| 1217 | + <width>151</width> | |
| 1218 | + <height>51</height> | |
| 1219 | + </rect> | |
| 1220 | + </property> | |
| 1221 | + <property name="palette"> | |
| 1222 | + <palette> | |
| 1223 | + <active> | |
| 1224 | + <colorrole role="WindowText"> | |
| 1225 | + <brush brushstyle="SolidPattern"> | |
| 1226 | + <color alpha="255"> | |
| 1227 | + <red>255</red> | |
| 1228 | + <green>255</green> | |
| 1229 | + <blue>255</blue> | |
| 1230 | + </color> | |
| 1231 | + </brush> | |
| 1232 | + </colorrole> | |
| 1233 | + </active> | |
| 1234 | + <inactive> | |
| 1235 | + <colorrole role="WindowText"> | |
| 1236 | + <brush brushstyle="SolidPattern"> | |
| 1237 | + <color alpha="255"> | |
| 1238 | + <red>255</red> | |
| 1239 | + <green>255</green> | |
| 1240 | + <blue>255</blue> | |
| 1241 | + </color> | |
| 1242 | + </brush> | |
| 1243 | + </colorrole> | |
| 1244 | + </inactive> | |
| 1245 | + <disabled> | |
| 1246 | + <colorrole role="WindowText"> | |
| 1247 | + <brush brushstyle="SolidPattern"> | |
| 1248 | + <color alpha="255"> | |
| 1249 | + <red>123</red> | |
| 1250 | + <green>123</green> | |
| 1251 | + <blue>123</blue> | |
| 1252 | + </color> | |
| 1253 | + </brush> | |
| 1254 | + </colorrole> | |
| 1255 | + </disabled> | |
| 1256 | + </palette> | |
| 1257 | + </property> | |
| 1258 | + <property name="font"> | |
| 1259 | + <font> | |
| 1260 | + <family>Malgun Gothic</family> | |
| 1261 | + <pointsize>9</pointsize> | |
| 1262 | + </font> | |
| 1263 | + </property> | |
| 1264 | + <property name="text"> | |
| 1265 | + <string>증가</string> | |
| 1266 | + </property> | |
| 1267 | + <property name="alignment"> | |
| 1268 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 1269 | + </property> | |
| 1270 | + </widget> | |
| 1271 | + <widget class="QPushButton" name="selectCookButton"> | |
| 1272 | + <property name="geometry"> | |
| 1273 | + <rect> | |
| 1274 | + <x>420</x> | |
| 1275 | + <y>54</y> | |
| 1276 | + <width>288</width> | |
| 1277 | + <height>70</height> | |
| 1278 | + </rect> | |
| 1279 | + </property> | |
| 1280 | + <property name="font"> | |
| 1281 | + <font> | |
| 1282 | + <family>Roboto</family> | |
| 1283 | + <pointsize>10</pointsize> | |
| 1284 | + <weight>75</weight> | |
| 1285 | + <bold>true</bold> | |
| 1286 | + </font> | |
| 1287 | + </property> | |
| 1288 | + <property name="styleSheet"> | |
| 1289 | + <string notr="true">QPushButton { | |
| 1290 | +border-image: url(:/images/button/288.png); | |
| 1291 | +} | |
| 1292 | +QPushButton::pressed { | |
| 1293 | +border-image: url(:/images/button/288_ov.png); | |
| 1294 | +}</string> | |
| 1295 | + </property> | |
| 1296 | + <property name="text"> | |
| 1297 | + <string/> | |
| 1298 | + </property> | |
| 1299 | + </widget> | |
| 1300 | + <widget class="QLabel" name="background"> | |
| 1301 | + <property name="geometry"> | |
| 1302 | + <rect> | |
| 1303 | + <x>0</x> | |
| 1304 | + <y>0</y> | |
| 1305 | + <width>900</width> | |
| 1306 | + <height>1024</height> | |
| 1307 | + </rect> | |
| 1308 | + </property> | |
| 1309 | + <property name="text"> | |
| 1310 | + <string/> | |
| 1311 | + </property> | |
| 1312 | + </widget> | |
| 1313 | + <zorder>background</zorder> | |
| 1314 | + <zorder>configMaxLabel_2</zorder> | |
| 1315 | + <zorder>configButton_4</zorder> | |
| 1316 | + <zorder>configButton_3</zorder> | |
| 1317 | + <zorder>configMaxLabel_5</zorder> | |
| 1318 | + <zorder>configCurrentLabel_1</zorder> | |
| 1319 | + <zorder>configMinLabel_5</zorder> | |
| 1320 | + <zorder>configButton_2</zorder> | |
| 1321 | + <zorder>configSlider_5</zorder> | |
| 1322 | + <zorder>configCurrentLabel_2</zorder> | |
| 1323 | + <zorder>configCurrentLabel_5</zorder> | |
| 1324 | + <zorder>configSlider_3</zorder> | |
| 1325 | + <zorder>configSlider_2</zorder> | |
| 1326 | + <zorder>configCurrentLabel_3</zorder> | |
| 1327 | + <zorder>cookTypeIcon</zorder> | |
| 1328 | + <zorder>configMaxLabel_4</zorder> | |
| 1329 | + <zorder>configButton_5</zorder> | |
| 1330 | + <zorder>configMinLabel_1</zorder> | |
| 1331 | + <zorder>pushButton_4</zorder> | |
| 1332 | + <zorder>configButton_1</zorder> | |
| 1333 | + <zorder>configMinLabel_2</zorder> | |
| 1334 | + <zorder>configSlider_4</zorder> | |
| 1335 | + <zorder>configCurrentLabel_4</zorder> | |
| 1336 | + <zorder>configMaxLabel_1</zorder> | |
| 1337 | + <zorder>configMinLabel_3</zorder> | |
| 1338 | + <zorder>configMinLabel_4</zorder> | |
| 1339 | + <zorder>configSlider_1</zorder> | |
| 1340 | + <zorder>configMaxLabel_3</zorder> | |
| 1341 | + <zorder>selectCookButton</zorder> | |
| 1342 | + </widget> | |
| 1343 | + <resources> | |
| 1344 | + <include location="resources.qrc"/> | |
| 1345 | + </resources> | |
| 1346 | + <connections/> | |
| 1347 | +</ui> | ... | ... |
app/gui/oven_control/autocookwindow.cpp
| ... | ... | @@ -2,6 +2,9 @@ |
| 2 | 2 | #include "ui_autocookwindow.h" |
| 3 | 3 | |
| 4 | 4 | #include "keepwarmpopup.h" |
| 5 | +#include "cookhistory.h" | |
| 6 | +#include "confirmpopup.h" | |
| 7 | +#include "favoritenamepopup.h" | |
| 5 | 8 | |
| 6 | 9 | AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) : |
| 7 | 10 | QMainWindow(parent), |
| ... | ... | @@ -13,7 +16,10 @@ AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) : |
| 13 | 16 | ui->clockContainer->setParent(ui->upperStack); |
| 14 | 17 | setAttribute(Qt::WA_DeleteOnClose); |
| 15 | 18 | |
| 16 | - autocook = AutoCook(cook); | |
| 19 | + if (!this->cook.isLoaded()) | |
| 20 | + this->cook.load(); | |
| 21 | + | |
| 22 | + autocook = AutoCook(this->cook); | |
| 17 | 23 | processSelected = false; |
| 18 | 24 | |
| 19 | 25 | setupUi(); |
| ... | ... | @@ -37,6 +43,16 @@ AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) : |
| 37 | 43 | checkCookTimer.start(100); |
| 38 | 44 | |
| 39 | 45 | connect(&checkProcessTimer, SIGNAL(timeout()), SLOT(checkProcess())); |
| 46 | + | |
| 47 | + AutoCookSetting setting; | |
| 48 | + setting.type = cook.type; | |
| 49 | + setting.root = cook.root; | |
| 50 | + setting.name = cook.name; | |
| 51 | + | |
| 52 | + for (int i = 0; i < 5; i++) | |
| 53 | + setting.configs[i] = cook.configs[i].current; | |
| 54 | + | |
| 55 | + CookHistory::record(setting); | |
| 40 | 56 | } |
| 41 | 57 | |
| 42 | 58 | AutoCookWindow::~AutoCookWindow() |
| ... | ... | @@ -164,6 +180,7 @@ void AutoCookWindow::setupUi() |
| 164 | 180 | } |
| 165 | 181 | |
| 166 | 182 | ui->processContainer->hide(); |
| 183 | + ui->doorStepLabel->hide(); | |
| 167 | 184 | |
| 168 | 185 | updateView(); |
| 169 | 186 | } |
| ... | ... | @@ -631,6 +648,18 @@ void AutoCookWindow::showCurrentTemp() |
| 631 | 648 | updateView(); |
| 632 | 649 | } |
| 633 | 650 | |
| 651 | +void AutoCookWindow::addFavorite() | |
| 652 | +{ | |
| 653 | + AutoCookSetting s; | |
| 654 | + s.type = cook.type; | |
| 655 | + s.root = cook.root; | |
| 656 | + for (int i = 0; i < 5; i++) | |
| 657 | + s.configs[i] = cook.configs[i].current; | |
| 658 | + | |
| 659 | + FavoriteNamePopup *p = new FavoriteNamePopup(this, s); | |
| 660 | + p->showFullScreen(); | |
| 661 | +} | |
| 662 | + | |
| 634 | 663 | void AutoCookWindow::on_humidityGaugeButton_pressed() |
| 635 | 664 | { |
| 636 | 665 | showCurrentHumidityTimer.start(); |
| ... | ... | @@ -692,3 +721,14 @@ void AutoCookWindow::on_showNextStepButton_clicked() |
| 692 | 721 | updateView(); |
| 693 | 722 | } |
| 694 | 723 | } |
| 724 | + | |
| 725 | +void AutoCookWindow::on_favoritesButton_clicked() | |
| 726 | +{ | |
| 727 | + if (!autocook.done()) | |
| 728 | + return; | |
| 729 | + | |
| 730 | + ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); | |
| 731 | + p->showFullScreen(); | |
| 732 | + | |
| 733 | + connect(p, SIGNAL(accepted()), SLOT(addFavorite())); | |
| 734 | +} | ... | ... |
app/gui/oven_control/autocookwindow.h
| ... | ... | @@ -65,6 +65,7 @@ private slots: |
| 65 | 65 | void returnToCurrentStep(); |
| 66 | 66 | void showCurrentHumidity(); |
| 67 | 67 | void showCurrentTemp(); |
| 68 | + void addFavorite(); | |
| 68 | 69 | void on_humidityGaugeButton_pressed(); |
| 69 | 70 | void on_humidityGaugeButton_released(); |
| 70 | 71 | void on_heatGaugeButton_pressed(); |
| ... | ... | @@ -72,6 +73,7 @@ private slots: |
| 72 | 73 | void on_backButton_clicked(); |
| 73 | 74 | void on_showPrevStepButton_clicked(); |
| 74 | 75 | void on_showNextStepButton_clicked(); |
| 76 | + void on_favoritesButton_clicked(); | |
| 75 | 77 | }; |
| 76 | 78 | |
| 77 | 79 | #endif // AUTOCOOKWINDOW_H | ... | ... |
app/gui/oven_control/confirmpopup.cpp
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +#include "confirmpopup.h" | |
| 2 | +#include "ui_confirmpopup.h" | |
| 3 | + | |
| 4 | +ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) : | |
| 5 | + QWidget(parent), | |
| 6 | + ui(new Ui::ConfirmPopup) | |
| 7 | +{ | |
| 8 | + ui->setupUi(this); | |
| 9 | + ui->text->setText(text); | |
| 10 | +} | |
| 11 | + | |
| 12 | +ConfirmPopup::~ConfirmPopup() | |
| 13 | +{ | |
| 14 | + delete ui; | |
| 15 | +} | |
| 16 | + | |
| 17 | +void ConfirmPopup::on_okButton_clicked() | |
| 18 | +{ | |
| 19 | + deleteLater(); | |
| 20 | + emit accepted(); | |
| 21 | +} | |
| 22 | + | |
| 23 | +void ConfirmPopup::on_cancelButton_clicked() | |
| 24 | +{ | |
| 25 | + deleteLater(); | |
| 26 | + emit rejected(); | |
| 27 | +} | ... | ... |
app/gui/oven_control/confirmpopup.h
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +#ifndef CONFIRMPOPUP_H | |
| 2 | +#define CONFIRMPOPUP_H | |
| 3 | + | |
| 4 | +#include <QWidget> | |
| 5 | + | |
| 6 | +namespace Ui { | |
| 7 | +class ConfirmPopup; | |
| 8 | +} | |
| 9 | + | |
| 10 | +class ConfirmPopup : public QWidget | |
| 11 | +{ | |
| 12 | + Q_OBJECT | |
| 13 | + | |
| 14 | +signals: | |
| 15 | + void accepted(); | |
| 16 | + void rejected(); | |
| 17 | + | |
| 18 | +public: | |
| 19 | + explicit ConfirmPopup(QWidget *parent, QString text); | |
| 20 | + ~ConfirmPopup(); | |
| 21 | + | |
| 22 | +private slots: | |
| 23 | + void on_okButton_clicked(); | |
| 24 | + | |
| 25 | + void on_cancelButton_clicked(); | |
| 26 | + | |
| 27 | +private: | |
| 28 | + Ui::ConfirmPopup *ui; | |
| 29 | +}; | |
| 30 | + | |
| 31 | +#endif // CONFIRMPOPUP_H | ... | ... |
app/gui/oven_control/confirmpopup.ui
| ... | ... | @@ -0,0 +1,138 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<ui version="4.0"> | |
| 3 | + <class>ConfirmPopup</class> | |
| 4 | + <widget class="QWidget" name="ConfirmPopup"> | |
| 5 | + <property name="geometry"> | |
| 6 | + <rect> | |
| 7 | + <x>0</x> | |
| 8 | + <y>0</y> | |
| 9 | + <width>900</width> | |
| 10 | + <height>1600</height> | |
| 11 | + </rect> | |
| 12 | + </property> | |
| 13 | + <property name="windowTitle"> | |
| 14 | + <string>Form</string> | |
| 15 | + </property> | |
| 16 | + <property name="styleSheet"> | |
| 17 | + <string notr="true">#text { color: white; } | |
| 18 | +QPushButton { color: white; border: none; } | |
| 19 | +QPushButton:pressed, QPushButton:focus { color: yellow; }</string> | |
| 20 | + </property> | |
| 21 | + <widget class="QLabel" name="label"> | |
| 22 | + <property name="geometry"> | |
| 23 | + <rect> | |
| 24 | + <x>0</x> | |
| 25 | + <y>426</y> | |
| 26 | + <width>900</width> | |
| 27 | + <height>150</height> | |
| 28 | + </rect> | |
| 29 | + </property> | |
| 30 | + <property name="text"> | |
| 31 | + <string/> | |
| 32 | + </property> | |
| 33 | + <property name="pixmap"> | |
| 34 | + <pixmap resource="resources.qrc">:/images/symbol/warning_big.png</pixmap> | |
| 35 | + </property> | |
| 36 | + <property name="alignment"> | |
| 37 | + <set>Qt::AlignBottom|Qt::AlignHCenter</set> | |
| 38 | + </property> | |
| 39 | + </widget> | |
| 40 | + <widget class="QLabel" name="text"> | |
| 41 | + <property name="geometry"> | |
| 42 | + <rect> | |
| 43 | + <x>0</x> | |
| 44 | + <y>576</y> | |
| 45 | + <width>900</width> | |
| 46 | + <height>200</height> | |
| 47 | + </rect> | |
| 48 | + </property> | |
| 49 | + <property name="font"> | |
| 50 | + <font> | |
| 51 | + <pointsize>14</pointsize> | |
| 52 | + </font> | |
| 53 | + </property> | |
| 54 | + <property name="text"> | |
| 55 | + <string>즐겨찾기 항목에 추가하시겠습니까?</string> | |
| 56 | + </property> | |
| 57 | + <property name="alignment"> | |
| 58 | + <set>Qt::AlignCenter</set> | |
| 59 | + </property> | |
| 60 | + </widget> | |
| 61 | + <widget class="QWidget" name="horizontalLayoutWidget"> | |
| 62 | + <property name="geometry"> | |
| 63 | + <rect> | |
| 64 | + <x>430</x> | |
| 65 | + <y>776</y> | |
| 66 | + <width>261</width> | |
| 67 | + <height>100</height> | |
| 68 | + </rect> | |
| 69 | + </property> | |
| 70 | + <layout class="QHBoxLayout" name="horizontalLayout"> | |
| 71 | + <item> | |
| 72 | + <widget class="QPushButton" name="okButton"> | |
| 73 | + <property name="sizePolicy"> | |
| 74 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 75 | + <horstretch>0</horstretch> | |
| 76 | + <verstretch>0</verstretch> | |
| 77 | + </sizepolicy> | |
| 78 | + </property> | |
| 79 | + <property name="font"> | |
| 80 | + <font> | |
| 81 | + <weight>75</weight> | |
| 82 | + <bold>true</bold> | |
| 83 | + <underline>true</underline> | |
| 84 | + </font> | |
| 85 | + </property> | |
| 86 | + <property name="text"> | |
| 87 | + <string>예</string> | |
| 88 | + </property> | |
| 89 | + </widget> | |
| 90 | + </item> | |
| 91 | + <item> | |
| 92 | + <widget class="QPushButton" name="cancelButton"> | |
| 93 | + <property name="sizePolicy"> | |
| 94 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 95 | + <horstretch>0</horstretch> | |
| 96 | + <verstretch>0</verstretch> | |
| 97 | + </sizepolicy> | |
| 98 | + </property> | |
| 99 | + <property name="font"> | |
| 100 | + <font> | |
| 101 | + <weight>75</weight> | |
| 102 | + <bold>true</bold> | |
| 103 | + <underline>true</underline> | |
| 104 | + </font> | |
| 105 | + </property> | |
| 106 | + <property name="text"> | |
| 107 | + <string>아니오</string> | |
| 108 | + </property> | |
| 109 | + </widget> | |
| 110 | + </item> | |
| 111 | + </layout> | |
| 112 | + </widget> | |
| 113 | + <widget class="QLabel" name="background"> | |
| 114 | + <property name="geometry"> | |
| 115 | + <rect> | |
| 116 | + <x>0</x> | |
| 117 | + <y>426</y> | |
| 118 | + <width>900</width> | |
| 119 | + <height>503</height> | |
| 120 | + </rect> | |
| 121 | + </property> | |
| 122 | + <property name="text"> | |
| 123 | + <string/> | |
| 124 | + </property> | |
| 125 | + <property name="pixmap"> | |
| 126 | + <pixmap resource="resources.qrc">:/images/background/popup/503.png</pixmap> | |
| 127 | + </property> | |
| 128 | + </widget> | |
| 129 | + <zorder>background</zorder> | |
| 130 | + <zorder>label</zorder> | |
| 131 | + <zorder>text</zorder> | |
| 132 | + <zorder>horizontalLayoutWidget</zorder> | |
| 133 | + </widget> | |
| 134 | + <resources> | |
| 135 | + <include location="resources.qrc"/> | |
| 136 | + </resources> | |
| 137 | + <connections/> | |
| 138 | +</ui> | ... | ... |
app/gui/oven_control/cookbook.cpp
| ... | ... | @@ -100,3 +100,15 @@ Cook CookBook::get(int index) |
| 100 | 100 | return Cook(); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | +QString CookBook::name(QString root) | |
| 104 | +{ | |
| 105 | + QString directory = root.replace(this->root, "").replace("/", "").trimmed(); | |
| 106 | + foreach (ListEntity e, book) | |
| 107 | + { | |
| 108 | + if (e.directory == directory) | |
| 109 | + return e.name; | |
| 110 | + } | |
| 111 | + | |
| 112 | + return QString(); | |
| 113 | +} | |
| 114 | + | ... | ... |
app/gui/oven_control/cookbook.h
app/gui/oven_control/cookhistory.cpp
| 1 | 1 | #include "cookhistory.h" |
| 2 | 2 | |
| 3 | -CookHistory::CookHistory() | |
| 3 | +#include "autocookwindow.h" | |
| 4 | +#include "manualcookwindow.h" | |
| 5 | +#include "manualcooksettingwidget.h" | |
| 6 | +#include "autocooksettingwidget.h" | |
| 7 | +#include "cookbook.h" | |
| 8 | + | |
| 9 | +namespace { | |
| 10 | + | |
| 11 | +Define::CookType toCookType(QString type) | |
| 12 | +{ | |
| 13 | + if (type == "poutry") | |
| 14 | + return Define::Poultry; | |
| 15 | + if (type == "meat") | |
| 16 | + return Define::Meat; | |
| 17 | + if (type == "fish") | |
| 18 | + return Define::Fish; | |
| 19 | + if (type == "desert") | |
| 20 | + return Define::Desert; | |
| 21 | + if (type == "vegetable") | |
| 22 | + return Define::Vegetable; | |
| 23 | + if (type == "bread") | |
| 24 | + return Define::Bread; | |
| 25 | + if (type == "etc") | |
| 26 | + return Define::Etc; | |
| 27 | + | |
| 28 | + return Define::InvalidCookType; | |
| 29 | +} | |
| 30 | + | |
| 31 | +QString toString(Define::CookType type) | |
| 32 | +{ | |
| 33 | + switch (type) | |
| 34 | + { | |
| 35 | + case Define::Poultry: | |
| 36 | + return "poultry"; | |
| 37 | + case Define::Meat: | |
| 38 | + return "meat"; | |
| 39 | + case Define::Fish: | |
| 40 | + return "fish"; | |
| 41 | + case Define::Desert: | |
| 42 | + return "desert"; | |
| 43 | + case Define::Vegetable: | |
| 44 | + return "vegetable"; | |
| 45 | + case Define::Bread: | |
| 46 | + return "bread"; | |
| 47 | + case Define::Etc: | |
| 48 | + return "etc"; | |
| 49 | + default: | |
| 50 | + return QString(); | |
| 51 | + } | |
| 52 | +} | |
| 53 | + | |
| 54 | +Define::Mode toMode(QString mode) | |
| 55 | +{ | |
| 56 | + if (mode == "steam") | |
| 57 | + return Define::SteamMode; | |
| 58 | + if (mode == "combi") | |
| 59 | + return Define::CombiMode; | |
| 60 | + if (mode == "dry") | |
| 61 | + return Define::DryMode; | |
| 62 | + | |
| 63 | + return Define::InvalidMode; | |
| 64 | +} | |
| 65 | + | |
| 66 | +QString toString(Define::Mode mode) | |
| 67 | +{ | |
| 68 | + switch (mode) | |
| 69 | + { | |
| 70 | + case Define::SteamMode: | |
| 71 | + return "steam"; | |
| 72 | + case Define::CombiMode: | |
| 73 | + return "combi"; | |
| 74 | + case Define::DryMode: | |
| 75 | + return "dry"; | |
| 76 | + default: | |
| 77 | + return QString(); | |
| 78 | + } | |
| 79 | +} | |
| 80 | + | |
| 81 | +QString name(Define::CookType type, QString root) | |
| 82 | +{ | |
| 83 | + CookBook book(type); | |
| 84 | + return book.name(root); | |
| 85 | +} | |
| 86 | + | |
| 87 | +} | |
| 88 | + | |
| 89 | +namespace { | |
| 90 | + | |
| 91 | +const int maxMostCooked = 20; | |
| 92 | +const int maxRecents = 20; | |
| 93 | +const int maxFavorites = 20; | |
| 94 | + | |
| 95 | +struct CountsEntry | |
| 96 | +{ | |
| 97 | + QString root; | |
| 98 | + Define::CookType type; | |
| 99 | + int count; | |
| 100 | + int configs[5]; | |
| 101 | +}; | |
| 102 | + | |
| 103 | +struct RecentsEntry | |
| 104 | +{ | |
| 105 | + enum Type { Manual, Auto } type; | |
| 106 | + struct { | |
| 107 | + Define::CookType type; | |
| 108 | + QString root; | |
| 109 | + int configs[5]; | |
| 110 | + } autoCook; | |
| 111 | + struct { | |
| 112 | + Define::Mode mode; | |
| 113 | + int humidity; | |
| 114 | + int temp; | |
| 115 | + int time; | |
| 116 | + int fan; | |
| 117 | + int coreTemp; | |
| 118 | + QDateTime cookedTime; | |
| 119 | + } manualCook; | |
| 120 | + | |
| 121 | + bool operator==(const RecentsEntry &other); | |
| 122 | +}; | |
| 123 | + | |
| 124 | +struct FavoritesEntry | |
| 125 | +{ | |
| 126 | + int id; | |
| 127 | + QString name; | |
| 128 | + enum Type { Manual, Auto } type; | |
| 129 | + struct { | |
| 130 | + Define::CookType type; | |
| 131 | + QString root; | |
| 132 | + int configs[5]; | |
| 133 | + } autoCook; | |
| 134 | + struct { | |
| 135 | + Define::Mode mode; | |
| 136 | + int humidity; | |
| 137 | + int temp; | |
| 138 | + int time; | |
| 139 | + int fan; | |
| 140 | + int coreTemp; | |
| 141 | + } manualCook; | |
| 142 | + | |
| 143 | + bool operator==(const FavoritesEntry &other); | |
| 144 | +}; | |
| 145 | + | |
| 146 | +QMap<QString, CountsEntry> countMap; | |
| 147 | +QList<CountsEntry> countList; | |
| 148 | +QList<RecentsEntry> recentList; | |
| 149 | +QList<FavoritesEntry> favoriteList; | |
| 150 | + | |
| 151 | +QTimer saveCounts; | |
| 152 | +QTimer saveRecents; | |
| 153 | +QTimer saveFavorites; | |
| 154 | + | |
| 155 | +bool RecentsEntry::operator==(const RecentsEntry &other) | |
| 156 | +{ | |
| 157 | + if (type != other.type) | |
| 158 | + return false; | |
| 159 | + | |
| 160 | + switch (type) | |
| 161 | + { | |
| 162 | + case Manual: | |
| 163 | + if (manualCook.mode != other.manualCook.mode) | |
| 164 | + return false; | |
| 165 | + if (manualCook.humidity != other.manualCook.humidity) | |
| 166 | + return false; | |
| 167 | + if (manualCook.temp != other.manualCook.temp) | |
| 168 | + return false; | |
| 169 | + if (manualCook.time != other.manualCook.time) | |
| 170 | + return false; | |
| 171 | + if (manualCook.fan != other.manualCook.fan) | |
| 172 | + return false; | |
| 173 | + if (manualCook.coreTemp != other.manualCook.coreTemp) | |
| 174 | + return false; | |
| 175 | + if (manualCook.cookedTime != other.manualCook.cookedTime) | |
| 176 | + return false; | |
| 177 | + return true; | |
| 178 | + case Auto: | |
| 179 | + if (autoCook.type != other.autoCook.type) | |
| 180 | + return false; | |
| 181 | + if (autoCook.root != other.autoCook.root) | |
| 182 | + return false; | |
| 183 | + return true; | |
| 184 | + default: | |
| 185 | + return false; | |
| 186 | + } | |
| 187 | +} | |
| 188 | + | |
| 189 | +bool FavoritesEntry::operator==(const FavoritesEntry &other) | |
| 190 | +{ | |
| 191 | + return id == other.id; | |
| 192 | +} | |
| 193 | + | |
| 194 | +void sortCounts() | |
| 195 | +{ | |
| 196 | + countList.clear(); | |
| 197 | + foreach (CountsEntry e, countMap) | |
| 198 | + { | |
| 199 | + bool inserted = false; | |
| 200 | + for (int i = 0; i < countList.size(); i++) | |
| 201 | + if (countList.at(i).count < e.count) | |
| 202 | + { | |
| 203 | + inserted = true; | |
| 204 | + countList.insert(i, e); | |
| 205 | + break; | |
| 206 | + } | |
| 207 | + | |
| 208 | + if (!inserted) | |
| 209 | + countList.append(e); | |
| 210 | + | |
| 211 | + while (countList.size() > maxMostCooked) | |
| 212 | + countList.takeLast(); | |
| 213 | + } | |
| 214 | +} | |
| 215 | + | |
| 216 | +void readCounts() | |
| 217 | +{ | |
| 218 | + QFile file("/prime/history/counts.csv"); | |
| 219 | + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) | |
| 220 | + { | |
| 221 | + qDebug() << "File not found: " + file.fileName(); | |
| 222 | + return; | |
| 223 | + } | |
| 224 | + | |
| 225 | + QString errorMessage = QString("%3: %1, line %2").arg(file.fileName()); | |
| 226 | + int lineCount = 0; | |
| 227 | + while (!file.atEnd()) | |
| 228 | + { | |
| 229 | + lineCount++; | |
| 230 | + | |
| 231 | + QString line = QString::fromUtf8(file.readLine()).trimmed(); | |
| 232 | + if (line.isEmpty()) | |
| 233 | + continue; | |
| 234 | + | |
| 235 | + QString error = errorMessage.arg(lineCount); | |
| 236 | + | |
| 237 | + QString root = line.section(',', 0, 0).trimmed(); | |
| 238 | + if (root.isEmpty()) | |
| 239 | + { | |
| 240 | + qDebug() << error.arg("Invalid root"); | |
| 241 | + continue; | |
| 242 | + } | |
| 243 | + | |
| 244 | + QString type = line.section(',', 1, 1).trimmed(); | |
| 245 | + if (type.isEmpty()) | |
| 246 | + { | |
| 247 | + qDebug() << error.arg("Invalid type"); | |
| 248 | + continue; | |
| 249 | + } | |
| 250 | + | |
| 251 | + QString count = line.section(',', 2, 2).trimmed(); | |
| 252 | + if (count.isEmpty()) | |
| 253 | + { | |
| 254 | + qDebug() << error.arg("Invalid count"); | |
| 255 | + continue; | |
| 256 | + } | |
| 257 | + | |
| 258 | + QString config1 = line.section(',', 3, 3).trimmed(); | |
| 259 | + if (config1.isEmpty()) | |
| 260 | + { | |
| 261 | + qDebug() << error.arg("Invalid config1"); | |
| 262 | + continue; | |
| 263 | + } | |
| 264 | + | |
| 265 | + QString config2 = line.section(',', 4, 4).trimmed(); | |
| 266 | + if (config2.isEmpty()) | |
| 267 | + { | |
| 268 | + qDebug() << error.arg("Invalid config2"); | |
| 269 | + continue; | |
| 270 | + } | |
| 271 | + | |
| 272 | + QString config3 = line.section(',', 5, 5).trimmed(); | |
| 273 | + if (config3.isEmpty()) | |
| 274 | + { | |
| 275 | + qDebug() << error.arg("Invalid config3"); | |
| 276 | + continue; | |
| 277 | + } | |
| 278 | + | |
| 279 | + QString config4 = line.section(',', 6, 6).trimmed(); | |
| 280 | + if (config4.isEmpty()) | |
| 281 | + { | |
| 282 | + qDebug() << error.arg("Invalid config4"); | |
| 283 | + continue; | |
| 284 | + } | |
| 285 | + | |
| 286 | + QString config5 = line.section(',', 7, 7).trimmed(); | |
| 287 | + if (config5.isEmpty()) | |
| 288 | + { | |
| 289 | + qDebug() << error.arg("Invalid config5"); | |
| 290 | + continue; | |
| 291 | + } | |
| 292 | + | |
| 293 | + CountsEntry e; | |
| 294 | + e.root = root; | |
| 295 | + | |
| 296 | + e.type = toCookType(type); | |
| 297 | + if (e.type == Define::InvalidCookType) | |
| 298 | + { | |
| 299 | + qDebug() << error.arg("Invalid type"); | |
| 300 | + continue; | |
| 301 | + } | |
| 302 | + | |
| 303 | + bool ok; | |
| 304 | + e.count = count.toInt(&ok); | |
| 305 | + if (!ok) | |
| 306 | + { | |
| 307 | + qDebug() << error.arg("Invalid count"); | |
| 308 | + continue; | |
| 309 | + } | |
| 310 | + | |
| 311 | + e.configs[0] = config1.toInt(&ok); | |
| 312 | + if (!ok) | |
| 313 | + { | |
| 314 | + qDebug() << error.arg("Invalid config1"); | |
| 315 | + continue; | |
| 316 | + } | |
| 317 | + | |
| 318 | + e.configs[1] = config2.toInt(&ok); | |
| 319 | + if (!ok) | |
| 320 | + { | |
| 321 | + qDebug() << error.arg("Invalid config2"); | |
| 322 | + continue; | |
| 323 | + } | |
| 324 | + | |
| 325 | + e.configs[2] = config3.toInt(&ok); | |
| 326 | + if (!ok) | |
| 327 | + { | |
| 328 | + qDebug() << error.arg("Invalid config3"); | |
| 329 | + continue; | |
| 330 | + } | |
| 331 | + | |
| 332 | + e.configs[3] = config4.toInt(&ok); | |
| 333 | + if (!ok) | |
| 334 | + { | |
| 335 | + qDebug() << error.arg("Invalid config4"); | |
| 336 | + continue; | |
| 337 | + } | |
| 338 | + | |
| 339 | + e.configs[4] = config5.toInt(&ok); | |
| 340 | + if (!ok) | |
| 341 | + { | |
| 342 | + qDebug() << error.arg("Invalid config5"); | |
| 343 | + continue; | |
| 344 | + } | |
| 345 | + | |
| 346 | + countMap.insert(root, e); | |
| 347 | + } | |
| 348 | + | |
| 349 | + sortCounts(); | |
| 350 | +} | |
| 351 | + | |
| 352 | +void writeCounts() | |
| 4 | 353 | { |
| 354 | + qDebug() << "Writing counts"; | |
| 355 | + QFile file("/prime/history/counts.csv"); | |
| 356 | + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) | |
| 357 | + { | |
| 358 | + qDebug() << "File not opened: " + file.fileName(); | |
| 359 | + return; | |
| 360 | + } | |
| 361 | + | |
| 362 | + QTextStream stream(&file); | |
| 363 | + foreach (CountsEntry e, countMap) | |
| 364 | + { | |
| 365 | + stream << e.root << "," << toString(e.type) << "," << e.count; | |
| 366 | + for (int i = 0; i < 5; i++) | |
| 367 | + stream << "," << e.configs[i]; | |
| 368 | + | |
| 369 | + stream << "\n"; | |
| 370 | + } | |
| 371 | +} | |
| 372 | + | |
| 373 | +void appendRecent(RecentsEntry e) | |
| 374 | +{ | |
| 375 | + if (e.type == RecentsEntry::Auto) | |
| 376 | + { | |
| 377 | + for (int i = 0; i < recentList.size(); i++) | |
| 378 | + { | |
| 379 | + RecentsEntry entry = recentList.at(i); | |
| 380 | + if (entry.autoCook.root == e.autoCook.root) | |
| 381 | + { | |
| 382 | + recentList.removeAt(i); | |
| 383 | + break; | |
| 384 | + } | |
| 385 | + } | |
| 386 | + } | |
| 387 | + | |
| 388 | + recentList.prepend(e); | |
| 389 | + | |
| 390 | + while (recentList.size() > maxRecents) | |
| 391 | + recentList.takeLast(); | |
| 392 | +} | |
| 393 | + | |
| 394 | +void readRecents() | |
| 395 | +{ | |
| 396 | + QFile file("/prime/history/recents.csv"); | |
| 397 | + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) | |
| 398 | + { | |
| 399 | + qDebug() << "File not found: " + file.fileName(); | |
| 400 | + return; | |
| 401 | + } | |
| 402 | + | |
| 403 | + QString errorMessage = QString("%3: %1, line %2").arg(file.fileName()); | |
| 404 | + int lineCount = 0; | |
| 405 | + while (!file.atEnd()) | |
| 406 | + { | |
| 407 | + lineCount++; | |
| 408 | + | |
| 409 | + QString line = QString::fromUtf8(file.readLine()).trimmed(); | |
| 410 | + if (line.isEmpty()) | |
| 411 | + continue; | |
| 412 | + | |
| 413 | + QString error = errorMessage.arg(lineCount); | |
| 414 | + | |
| 415 | + RecentsEntry e; | |
| 416 | + | |
| 417 | + QString type = line.section(',', 0, 0).trimmed(); | |
| 418 | + if (type.isEmpty()) | |
| 419 | + { | |
| 420 | + qDebug() << error.arg("Invalid type"); | |
| 421 | + continue; | |
| 422 | + } | |
| 423 | + | |
| 424 | + if (type == "manual") | |
| 425 | + { | |
| 426 | + QString mode = line.section(',', 1, 1).trimmed(); | |
| 427 | + if (mode.isEmpty()) | |
| 428 | + { | |
| 429 | + qDebug() << error.arg("Invalid mode"); | |
| 430 | + continue; | |
| 431 | + } | |
| 432 | + | |
| 433 | + QString humidity = line.section(',', 2, 2).trimmed(); | |
| 434 | + if (humidity.isEmpty()) | |
| 435 | + { | |
| 436 | + qDebug() << error.arg("Invalid humidity"); | |
| 437 | + continue; | |
| 438 | + } | |
| 439 | + | |
| 440 | + QString temp = line.section(',', 3, 3).trimmed(); | |
| 441 | + if (temp.isEmpty()) | |
| 442 | + { | |
| 443 | + qDebug() << error.arg("Invalid temp"); | |
| 444 | + continue; | |
| 445 | + } | |
| 446 | + | |
| 447 | + QString time = line.section(',', 4, 4).trimmed(); | |
| 448 | + if (time.isEmpty()) | |
| 449 | + { | |
| 450 | + qDebug() << error.arg("Invalid time"); | |
| 451 | + continue; | |
| 452 | + } | |
| 453 | + | |
| 454 | + QString fan = line.section(',', 5, 5).trimmed(); | |
| 455 | + if (fan.isEmpty()) | |
| 456 | + { | |
| 457 | + qDebug() << error.arg("Invalid fan"); | |
| 458 | + continue; | |
| 459 | + } | |
| 460 | + | |
| 461 | + QString coreTemp = line.section(',', 6, 6).trimmed(); | |
| 462 | + if (coreTemp.isEmpty()) | |
| 463 | + { | |
| 464 | + qDebug() << error.arg("Invalid coreTemp"); | |
| 465 | + continue; | |
| 466 | + } | |
| 467 | + | |
| 468 | + QString cookedTime = line.section(',', 7, 7).trimmed(); | |
| 469 | + if (cookedTime.isEmpty()) | |
| 470 | + { | |
| 471 | + qDebug() << error.arg("Invalid cookedTime"); | |
| 472 | + continue; | |
| 473 | + } | |
| 474 | + | |
| 475 | + e.type = RecentsEntry::Manual; | |
| 476 | + | |
| 477 | + e.manualCook.mode = toMode(mode); | |
| 478 | + if (e.manualCook.mode == Define::InvalidMode) | |
| 479 | + { | |
| 480 | + qDebug() << error.arg("Invalid mode"); | |
| 481 | + continue; | |
| 482 | + } | |
| 483 | + | |
| 484 | + bool ok; | |
| 485 | + e.manualCook.humidity = humidity.toInt(&ok); | |
| 486 | + if (!ok) | |
| 487 | + { | |
| 488 | + qDebug() << error.arg("Invalid humidity"); | |
| 489 | + continue; | |
| 490 | + } | |
| 491 | + | |
| 492 | + e.manualCook.temp = temp.toInt(&ok); | |
| 493 | + if (!ok) | |
| 494 | + { | |
| 495 | + qDebug() << error.arg("Invalid temp"); | |
| 496 | + continue; | |
| 497 | + } | |
| 498 | + | |
| 499 | + e.manualCook.time = time.toInt(&ok); | |
| 500 | + if (!ok) | |
| 501 | + { | |
| 502 | + qDebug() << error.arg("Invalid time"); | |
| 503 | + continue; | |
| 504 | + } | |
| 505 | + | |
| 506 | + e.manualCook.fan = fan.toInt(&ok); | |
| 507 | + if (!ok) | |
| 508 | + { | |
| 509 | + qDebug() << error.arg("Invalid fan"); | |
| 510 | + continue; | |
| 511 | + } | |
| 512 | + | |
| 513 | + e.manualCook.coreTemp = coreTemp.toInt(&ok); | |
| 514 | + if (!ok) | |
| 515 | + { | |
| 516 | + qDebug() << error.arg("Invalid coreTemp"); | |
| 517 | + continue; | |
| 518 | + } | |
| 519 | + | |
| 520 | + e.manualCook.cookedTime = QDateTime::fromString(cookedTime); | |
| 521 | + if (!e.manualCook.cookedTime.isValid()) | |
| 522 | + { | |
| 523 | + qDebug() << error.arg("Invalid cookedTime"); | |
| 524 | + continue; | |
| 525 | + } | |
| 526 | + } | |
| 527 | + else if (type == "auto") | |
| 528 | + { | |
| 529 | + QString type = line.section(',', 1, 1).trimmed(); | |
| 530 | + if (type.isEmpty()) | |
| 531 | + { | |
| 532 | + qDebug() << error.arg("Invalid cooktype"); | |
| 533 | + continue; | |
| 534 | + } | |
| 535 | + | |
| 536 | + QString root = line.section(',', 2, 2).trimmed(); | |
| 537 | + if (root.isEmpty()) | |
| 538 | + { | |
| 539 | + qDebug() << error.arg("Invalid root"); | |
| 540 | + continue; | |
| 541 | + } | |
| 542 | + | |
| 543 | + QString config1 = line.section(',', 3, 3).trimmed(); | |
| 544 | + if (config1.isEmpty()) | |
| 545 | + { | |
| 546 | + qDebug() << error.arg("Invalid config1"); | |
| 547 | + continue; | |
| 548 | + } | |
| 549 | + | |
| 550 | + QString config2 = line.section(',', 4, 4).trimmed(); | |
| 551 | + if (config2.isEmpty()) | |
| 552 | + { | |
| 553 | + qDebug() << error.arg("Invalid config2"); | |
| 554 | + continue; | |
| 555 | + } | |
| 556 | + | |
| 557 | + QString config3 = line.section(',', 5, 5).trimmed(); | |
| 558 | + if (config3.isEmpty()) | |
| 559 | + { | |
| 560 | + qDebug() << error.arg("Invalid config3"); | |
| 561 | + continue; | |
| 562 | + } | |
| 563 | + | |
| 564 | + QString config4 = line.section(',', 6, 6).trimmed(); | |
| 565 | + if (config4.isEmpty()) | |
| 566 | + { | |
| 567 | + qDebug() << error.arg("Invalid config4"); | |
| 568 | + continue; | |
| 569 | + } | |
| 570 | + | |
| 571 | + QString config5 = line.section(',', 7, 7).trimmed(); | |
| 572 | + if (config5.isEmpty()) | |
| 573 | + { | |
| 574 | + qDebug() << error.arg("Invalid config5"); | |
| 575 | + continue; | |
| 576 | + } | |
| 577 | + | |
| 578 | + e.type = RecentsEntry::Auto; | |
| 579 | + | |
| 580 | + e.autoCook.type = toCookType(type); | |
| 581 | + if (e.autoCook.type == Define::InvalidCookType) | |
| 582 | + { | |
| 583 | + qDebug() << error.arg("Invalid cooktype"); | |
| 584 | + continue; | |
| 585 | + } | |
| 586 | + | |
| 587 | + e.autoCook.root = root; | |
| 588 | + | |
| 589 | + bool ok; | |
| 590 | + e.autoCook.configs[0] = config1.toInt(&ok); | |
| 591 | + if (!ok) | |
| 592 | + { | |
| 593 | + qDebug() << error.arg("Invalid config1"); | |
| 594 | + continue; | |
| 595 | + } | |
| 596 | + | |
| 597 | + e.autoCook.configs[1] = config2.toInt(&ok); | |
| 598 | + if (!ok) | |
| 599 | + { | |
| 600 | + qDebug() << error.arg("Invalid config2"); | |
| 601 | + continue; | |
| 602 | + } | |
| 603 | + | |
| 604 | + e.autoCook.configs[2] = config3.toInt(&ok); | |
| 605 | + if (!ok) | |
| 606 | + { | |
| 607 | + qDebug() << error.arg("Invalid config3"); | |
| 608 | + continue; | |
| 609 | + } | |
| 610 | + | |
| 611 | + e.autoCook.configs[3] = config4.toInt(&ok); | |
| 612 | + if (!ok) | |
| 613 | + { | |
| 614 | + qDebug() << error.arg("Invalid config4"); | |
| 615 | + continue; | |
| 616 | + } | |
| 617 | + | |
| 618 | + e.autoCook.configs[4] = config5.toInt(&ok); | |
| 619 | + if (!ok) | |
| 620 | + { | |
| 621 | + qDebug() << error.arg("Invalid config5"); | |
| 622 | + continue; | |
| 623 | + } | |
| 624 | + } | |
| 625 | + else | |
| 626 | + continue; | |
| 627 | + | |
| 628 | + appendRecent(e); | |
| 629 | + } | |
| 630 | +} | |
| 631 | + | |
| 632 | +void writeRecents() | |
| 633 | +{ | |
| 634 | + qDebug() << "Writing recents"; | |
| 635 | + QFile file("/prime/history/recents.csv"); | |
| 636 | + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) | |
| 637 | + { | |
| 638 | + qDebug() << "File not opened: " + file.fileName(); | |
| 639 | + return; | |
| 640 | + } | |
| 641 | + | |
| 642 | + QTextStream stream(&file); | |
| 643 | + foreach (RecentsEntry e, recentList) | |
| 644 | + { | |
| 645 | + switch (e.type) | |
| 646 | + { | |
| 647 | + case RecentsEntry::Manual: | |
| 648 | + stream << "manual," | |
| 649 | + << toString(e.manualCook.mode) << "," | |
| 650 | + << e.manualCook.humidity << "," | |
| 651 | + << e.manualCook.temp << "," | |
| 652 | + << e.manualCook.time << "," | |
| 653 | + << e.manualCook.fan << "," | |
| 654 | + << e.manualCook.coreTemp << "," | |
| 655 | + << e.manualCook.cookedTime.toString() << "\n"; | |
| 656 | + break; | |
| 657 | + case RecentsEntry::Auto: | |
| 658 | + stream << "auto," | |
| 659 | + << toString(e.autoCook.type) << "," | |
| 660 | + << e.autoCook.root; | |
| 661 | + for (int i = 0; i < 5; i++) | |
| 662 | + stream << "," << e.autoCook.configs[i]; | |
| 663 | + | |
| 664 | + stream << "\n"; | |
| 665 | + break; | |
| 666 | + } | |
| 667 | + } | |
| 668 | +} | |
| 669 | + | |
| 670 | +void appendFavorite(FavoritesEntry e) | |
| 671 | +{ | |
| 672 | + favoriteList.prepend(e); | |
| 673 | + while (favoriteList.size() > maxFavorites) | |
| 674 | + favoriteList.takeLast(); | |
| 675 | +} | |
| 676 | + | |
| 677 | +int newFavoriteId() | |
| 678 | +{ | |
| 679 | + for (int i = 0; i < 10000; i++) | |
| 680 | + { | |
| 681 | + bool absent = true; | |
| 682 | + foreach (FavoritesEntry e, favoriteList) | |
| 683 | + if (e.id == i) | |
| 684 | + { | |
| 685 | + absent = false; | |
| 686 | + break; | |
| 687 | + } | |
| 688 | + | |
| 689 | + if (absent) | |
| 690 | + return i; | |
| 691 | + } | |
| 692 | + | |
| 693 | + return -1; | |
| 694 | +} | |
| 695 | + | |
| 696 | +void readFavorites() | |
| 697 | +{ | |
| 698 | + QFile file("/prime/history/favorites.csv"); | |
| 699 | + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) | |
| 700 | + { | |
| 701 | + qDebug() << "File not found: " + file.fileName(); | |
| 702 | + return; | |
| 703 | + } | |
| 704 | + | |
| 705 | + QString errorMessage = QString("%3: %1, line %2").arg(file.fileName()); | |
| 706 | + int lineCount = 0; | |
| 707 | + while (!file.atEnd()) | |
| 708 | + { | |
| 709 | + lineCount++; | |
| 710 | + | |
| 711 | + QString line = QString::fromUtf8(file.readLine()).trimmed(); | |
| 712 | + if (line.isEmpty()) | |
| 713 | + continue; | |
| 714 | + | |
| 715 | + QString error = errorMessage.arg(lineCount); | |
| 716 | + | |
| 717 | + FavoritesEntry e; | |
| 718 | + | |
| 719 | + QString id = line.section(',', 0, 0).trimmed(); | |
| 720 | + if (id.isEmpty()) | |
| 721 | + { | |
| 722 | + qDebug() << error.arg("Invalid id"); | |
| 723 | + continue; | |
| 724 | + } | |
| 725 | + | |
| 726 | + QString name = line.section(',', 1, 1).trimmed(); | |
| 727 | + if (name.isEmpty()) | |
| 728 | + { | |
| 729 | + qDebug() << error.arg("Invalid name"); | |
| 730 | + continue; | |
| 731 | + } | |
| 732 | + | |
| 733 | + bool ok; | |
| 734 | + e.id = id.toInt(&ok); | |
| 735 | + if (!ok) | |
| 736 | + { | |
| 737 | + qDebug() << error.arg("Invalid id"); | |
| 738 | + continue; | |
| 739 | + } | |
| 740 | + | |
| 741 | + e.name = name.replace("\\c", ","); | |
| 742 | + | |
| 743 | + QString type = line.section(',', 2, 2).trimmed(); | |
| 744 | + if (type.isEmpty()) | |
| 745 | + { | |
| 746 | + qDebug() << error.arg("Invalid type"); | |
| 747 | + continue; | |
| 748 | + } | |
| 749 | + | |
| 750 | + if (type == "manual") | |
| 751 | + { | |
| 752 | + QString mode = line.section(',', 3, 3).trimmed(); | |
| 753 | + if (mode.isEmpty()) | |
| 754 | + { | |
| 755 | + qDebug() << error.arg("Invalid mode"); | |
| 756 | + continue; | |
| 757 | + } | |
| 758 | + | |
| 759 | + QString humidity = line.section(',', 4, 4).trimmed(); | |
| 760 | + if (humidity.isEmpty()) | |
| 761 | + { | |
| 762 | + qDebug() << error.arg("Invalid humidity"); | |
| 763 | + continue; | |
| 764 | + } | |
| 765 | + | |
| 766 | + QString temp = line.section(',', 5, 5).trimmed(); | |
| 767 | + if (temp.isEmpty()) | |
| 768 | + { | |
| 769 | + qDebug() << error.arg("Invalid temp"); | |
| 770 | + continue; | |
| 771 | + } | |
| 772 | + | |
| 773 | + QString time = line.section(',', 6, 6).trimmed(); | |
| 774 | + if (time.isEmpty()) | |
| 775 | + { | |
| 776 | + qDebug() << error.arg("Invalid time"); | |
| 777 | + continue; | |
| 778 | + } | |
| 779 | + | |
| 780 | + QString fan = line.section(',', 7, 7).trimmed(); | |
| 781 | + if (fan.isEmpty()) | |
| 782 | + { | |
| 783 | + qDebug() << error.arg("Invalid fan"); | |
| 784 | + continue; | |
| 785 | + } | |
| 786 | + | |
| 787 | + QString coreTemp = line.section(',', 8, 8).trimmed(); | |
| 788 | + if (coreTemp.isEmpty()) | |
| 789 | + { | |
| 790 | + qDebug() << error.arg("Invalid coreTemp"); | |
| 791 | + continue; | |
| 792 | + } | |
| 793 | + | |
| 794 | + e.type = FavoritesEntry::Manual; | |
| 795 | + | |
| 796 | + e.manualCook.mode = toMode(mode); | |
| 797 | + if (e.manualCook.mode == Define::InvalidMode) | |
| 798 | + { | |
| 799 | + qDebug() << error.arg("Invalid mode"); | |
| 800 | + continue; | |
| 801 | + } | |
| 802 | + | |
| 803 | + bool ok; | |
| 804 | + e.manualCook.humidity = humidity.toInt(&ok); | |
| 805 | + if (!ok) | |
| 806 | + { | |
| 807 | + qDebug() << error.arg("Invalid humidity"); | |
| 808 | + continue; | |
| 809 | + } | |
| 810 | + | |
| 811 | + e.manualCook.temp = temp.toInt(&ok); | |
| 812 | + if (!ok) | |
| 813 | + { | |
| 814 | + qDebug() << error.arg("Invalid temp"); | |
| 815 | + continue; | |
| 816 | + } | |
| 817 | + | |
| 818 | + e.manualCook.time = time.toInt(&ok); | |
| 819 | + if (!ok) | |
| 820 | + { | |
| 821 | + qDebug() << error.arg("Invalid time"); | |
| 822 | + continue; | |
| 823 | + } | |
| 824 | + | |
| 825 | + e.manualCook.fan = fan.toInt(&ok); | |
| 826 | + if (!ok) | |
| 827 | + { | |
| 828 | + qDebug() << error.arg("Invalid fan"); | |
| 829 | + continue; | |
| 830 | + } | |
| 831 | + | |
| 832 | + e.manualCook.coreTemp = coreTemp.toInt(&ok); | |
| 833 | + if (!ok) | |
| 834 | + { | |
| 835 | + qDebug() << error.arg("Invalid coreTemp"); | |
| 836 | + continue; | |
| 837 | + } | |
| 838 | + } | |
| 839 | + else if (type == "auto") | |
| 840 | + { | |
| 841 | + QString type = line.section(',', 3, 3).trimmed(); | |
| 842 | + if (type.isEmpty()) | |
| 843 | + { | |
| 844 | + qDebug() << error.arg("Invalid cooktype"); | |
| 845 | + continue; | |
| 846 | + } | |
| 847 | + | |
| 848 | + QString root = line.section(',', 4, 4).trimmed(); | |
| 849 | + if (root.isEmpty()) | |
| 850 | + { | |
| 851 | + qDebug() << error.arg("Invalid root"); | |
| 852 | + continue; | |
| 853 | + } | |
| 854 | + | |
| 855 | + QString config1 = line.section(',', 5, 5).trimmed(); | |
| 856 | + if (config1.isEmpty()) | |
| 857 | + { | |
| 858 | + qDebug() << error.arg("Invalid config1"); | |
| 859 | + continue; | |
| 860 | + } | |
| 861 | + | |
| 862 | + QString config2 = line.section(',', 6, 6).trimmed(); | |
| 863 | + if (config2.isEmpty()) | |
| 864 | + { | |
| 865 | + qDebug() << error.arg("Invalid config2"); | |
| 866 | + continue; | |
| 867 | + } | |
| 868 | + | |
| 869 | + QString config3 = line.section(',', 7, 7).trimmed(); | |
| 870 | + if (config3.isEmpty()) | |
| 871 | + { | |
| 872 | + qDebug() << error.arg("Invalid config3"); | |
| 873 | + continue; | |
| 874 | + } | |
| 875 | + | |
| 876 | + QString config4 = line.section(',', 8, 8).trimmed(); | |
| 877 | + if (config4.isEmpty()) | |
| 878 | + { | |
| 879 | + qDebug() << error.arg("Invalid config4"); | |
| 880 | + continue; | |
| 881 | + } | |
| 882 | + | |
| 883 | + QString config5 = line.section(',', 9, 9).trimmed(); | |
| 884 | + if (config5.isEmpty()) | |
| 885 | + { | |
| 886 | + qDebug() << error.arg("Invalid config5"); | |
| 887 | + continue; | |
| 888 | + } | |
| 889 | + | |
| 890 | + e.type = FavoritesEntry::Auto; | |
| 891 | + | |
| 892 | + e.autoCook.type = toCookType(type); | |
| 893 | + if (e.autoCook.type == Define::InvalidCookType) | |
| 894 | + { | |
| 895 | + qDebug() << error.arg("Invalid cooktype"); | |
| 896 | + continue; | |
| 897 | + } | |
| 898 | + | |
| 899 | + e.autoCook.root = root; | |
| 900 | + | |
| 901 | + bool ok; | |
| 902 | + e.autoCook.configs[0] = config1.toInt(&ok); | |
| 903 | + if (!ok) | |
| 904 | + { | |
| 905 | + qDebug() << error.arg("Invalid config1"); | |
| 906 | + continue; | |
| 907 | + } | |
| 908 | + | |
| 909 | + e.autoCook.configs[1] = config2.toInt(&ok); | |
| 910 | + if (!ok) | |
| 911 | + { | |
| 912 | + qDebug() << error.arg("Invalid config2"); | |
| 913 | + continue; | |
| 914 | + } | |
| 915 | + | |
| 916 | + e.autoCook.configs[2] = config3.toInt(&ok); | |
| 917 | + if (!ok) | |
| 918 | + { | |
| 919 | + qDebug() << error.arg("Invalid config3"); | |
| 920 | + continue; | |
| 921 | + } | |
| 922 | + | |
| 923 | + e.autoCook.configs[3] = config4.toInt(&ok); | |
| 924 | + if (!ok) | |
| 925 | + { | |
| 926 | + qDebug() << error.arg("Invalid config4"); | |
| 927 | + continue; | |
| 928 | + } | |
| 929 | + | |
| 930 | + e.autoCook.configs[4] = config5.toInt(&ok); | |
| 931 | + if (!ok) | |
| 932 | + { | |
| 933 | + qDebug() << error.arg("Invalid config5"); | |
| 934 | + continue; | |
| 935 | + } | |
| 936 | + } | |
| 937 | + else | |
| 938 | + continue; | |
| 939 | + | |
| 940 | + if (favoriteList.size() < maxFavorites) | |
| 941 | + favoriteList.append(e); | |
| 942 | + } | |
| 943 | +} | |
| 944 | + | |
| 945 | +void writeFavorites() | |
| 946 | +{ | |
| 947 | + qDebug() << "Writing favorites"; | |
| 948 | + QFile file("/prime/history/favorites.csv"); | |
| 949 | + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) | |
| 950 | + { | |
| 951 | + qDebug() << "File not opened: " + file.fileName(); | |
| 952 | + return; | |
| 953 | + } | |
| 954 | + | |
| 955 | + QTextStream stream(&file); | |
| 956 | + stream.setCodec("UTF-8"); | |
| 957 | + foreach (FavoritesEntry e, favoriteList) | |
| 958 | + { | |
| 959 | + stream << e.id << "," << e.name.replace(",", "\\c").toUtf8() << ","; | |
| 960 | + switch (e.type) | |
| 961 | + { | |
| 962 | + case FavoritesEntry::Manual: | |
| 963 | + stream << "manual," | |
| 964 | + << toString(e.manualCook.mode) << "," | |
| 965 | + << e.manualCook.humidity << "," | |
| 966 | + << e.manualCook.temp << "," | |
| 967 | + << e.manualCook.time << "," | |
| 968 | + << e.manualCook.fan << "," | |
| 969 | + << e.manualCook.coreTemp << "\n"; | |
| 970 | + break; | |
| 971 | + case FavoritesEntry::Auto: | |
| 972 | + stream << "auto," | |
| 973 | + << toString(e.autoCook.type) << "," | |
| 974 | + << e.autoCook.root; | |
| 975 | + for (int i = 0; i < 5; i++) | |
| 976 | + stream << "," << e.autoCook.configs[i]; | |
| 977 | + | |
| 978 | + stream << "\n"; | |
| 979 | + break; | |
| 980 | + } | |
| 981 | + } | |
| 982 | +} | |
| 983 | + | |
| 984 | +bool initialized = false; | |
| 985 | +void initialize() | |
| 986 | +{ | |
| 987 | + initialized = true; | |
| 988 | + | |
| 989 | + readCounts(); | |
| 990 | + readRecents(); | |
| 991 | + readFavorites(); | |
| 992 | + | |
| 993 | + saveCounts.setSingleShot(true); | |
| 994 | + saveCounts.setInterval(1 * 1000); | |
| 995 | + QObject::connect(&saveCounts, &QTimer::timeout, writeCounts); | |
| 996 | + | |
| 997 | + saveRecents.setSingleShot(true); | |
| 998 | + saveRecents.setInterval(1 * 1000); | |
| 999 | + QObject::connect(&saveRecents, &QTimer::timeout, writeRecents); | |
| 1000 | + | |
| 1001 | + saveFavorites.setSingleShot(true); | |
| 1002 | + saveFavorites.setInterval(1 * 1000); | |
| 1003 | + QObject::connect(&saveFavorites, &QTimer::timeout, writeFavorites); | |
| 1004 | +} | |
| 1005 | + | |
| 1006 | +void checkInitialized() | |
| 1007 | +{ | |
| 1008 | + if (!initialized) | |
| 1009 | + initialize(); | |
| 1010 | +} | |
| 1011 | + | |
| 1012 | +} | |
| 1013 | + | |
| 1014 | +void CookHistory::record(ManualCookSetting cook) | |
| 1015 | +{ | |
| 1016 | + checkInitialized(); | |
| 1017 | + | |
| 1018 | + RecentsEntry e; | |
| 1019 | + e.type = RecentsEntry::Manual; | |
| 1020 | + e.manualCook.mode = cook.mode; | |
| 1021 | + e.manualCook.humidity = cook.humidity; | |
| 1022 | + e.manualCook.temp = cook.temp; | |
| 1023 | + e.manualCook.time = cook.time; | |
| 1024 | + e.manualCook.fan = cook.fan; | |
| 1025 | + e.manualCook.coreTemp = cook.coreTempEnabled ? cook.coreTemp : -1; | |
| 1026 | + e.manualCook.cookedTime = QDateTime::currentDateTime(); | |
| 1027 | + | |
| 1028 | + appendRecent(e); | |
| 1029 | + saveRecents.start(); | |
| 1030 | +} | |
| 1031 | + | |
| 1032 | +void CookHistory::record(AutoCookSetting cook) | |
| 1033 | +{ | |
| 1034 | + checkInitialized(); | |
| 1035 | + | |
| 1036 | + RecentsEntry e; | |
| 1037 | + e.type = RecentsEntry::Auto; | |
| 1038 | + e.autoCook.type = cook.type; | |
| 1039 | + e.autoCook.root = cook.root; | |
| 1040 | + | |
| 1041 | + for (int i = 0; i < 5; i++) | |
| 1042 | + e.autoCook.configs[i] = cook.configs[i]; | |
| 1043 | + | |
| 1044 | + appendRecent(e); | |
| 1045 | + saveRecents.start(); | |
| 1046 | + | |
| 1047 | + if (countMap.contains(cook.root)) | |
| 1048 | + { | |
| 1049 | + CountsEntry &e = countMap[cook.root]; | |
| 1050 | + e.count++; | |
| 1051 | + | |
| 1052 | + for (int i = 0; i < 5; i++) | |
| 1053 | + e.configs[i] = cook.configs[i]; | |
| 1054 | + } | |
| 1055 | + else | |
| 1056 | + { | |
| 1057 | + CountsEntry e; | |
| 1058 | + e.type = cook.type; | |
| 1059 | + e.root = cook.root; | |
| 1060 | + | |
| 1061 | + for (int i = 0; i < 5; i++) | |
| 1062 | + e.configs[i] = cook.configs[i]; | |
| 1063 | + | |
| 1064 | + e.count = 1; | |
| 1065 | + | |
| 1066 | + countMap.insert(cook.root, e); | |
| 1067 | + } | |
| 1068 | + | |
| 1069 | + sortCounts(); | |
| 1070 | + saveCounts.start(); | |
| 1071 | +} | |
| 1072 | + | |
| 1073 | +int CookHistory::addFavorite(ManualCookSetting cook, QString name) | |
| 1074 | +{ | |
| 1075 | + checkInitialized(); | |
| 1076 | + | |
| 1077 | + FavoritesEntry e; | |
| 1078 | + e.id = newFavoriteId(); | |
| 1079 | + e.name = name; | |
| 1080 | + e.type = FavoritesEntry::Manual; | |
| 1081 | + e.manualCook.mode = cook.mode; | |
| 1082 | + e.manualCook.humidity = cook.humidity; | |
| 1083 | + e.manualCook.temp = cook.temp; | |
| 1084 | + e.manualCook.time = cook.time; | |
| 1085 | + e.manualCook.fan = cook.fan; | |
| 1086 | + e.manualCook.coreTemp = cook.coreTempEnabled ? cook.coreTemp : -1; | |
| 1087 | + | |
| 1088 | + appendFavorite(e); | |
| 1089 | + saveFavorites.start(); | |
| 1090 | + | |
| 1091 | + return e.id; | |
| 1092 | +} | |
| 1093 | + | |
| 1094 | +int CookHistory::addFavorite(AutoCookSetting cook, QString name) | |
| 1095 | +{ | |
| 1096 | + checkInitialized(); | |
| 1097 | + | |
| 1098 | + FavoritesEntry e; | |
| 1099 | + e.id = newFavoriteId(); | |
| 1100 | + e.name = name; | |
| 1101 | + e.type = FavoritesEntry::Auto; | |
| 1102 | + e.autoCook.type = cook.type; | |
| 1103 | + e.autoCook.root = cook.root; | |
| 1104 | + | |
| 1105 | + for (int i = 0; i < 5; i++) | |
| 1106 | + e.autoCook.configs[i] = cook.configs[i]; | |
| 1107 | + | |
| 1108 | + appendFavorite(e); | |
| 1109 | + saveFavorites.start(); | |
| 1110 | + | |
| 1111 | + return e.id; | |
| 1112 | +} | |
| 1113 | + | |
| 1114 | +QList<CookRecord> CookHistory::listMostCooked() | |
| 1115 | +{ | |
| 1116 | + checkInitialized(); | |
| 1117 | + | |
| 1118 | + QList<CookRecord> list; | |
| 1119 | + foreach (CountsEntry e, countList) | |
| 1120 | + { | |
| 1121 | + CookRecord r; | |
| 1122 | + r.type = CookRecord::Auto; | |
| 1123 | + r.name = name(e.type, e.root); | |
| 1124 | + r.autoRecord.setting.name = r.name; | |
| 1125 | + r.autoRecord.setting.root = e.root; | |
| 1126 | + r.autoRecord.setting.type = e.type; | |
| 1127 | + | |
| 1128 | + for (int i = 0; i < 5; i++) | |
| 1129 | + r.autoRecord.setting.configs[i] = e.configs[i]; | |
| 1130 | + | |
| 1131 | + list.append(r); | |
| 1132 | + } | |
| 1133 | + | |
| 1134 | + return list; | |
| 1135 | +} | |
| 1136 | + | |
| 1137 | +QList<CookRecord> CookHistory::listRecents() | |
| 1138 | +{ | |
| 1139 | + checkInitialized(); | |
| 1140 | + | |
| 1141 | + QList<CookRecord> list; | |
| 1142 | + foreach (RecentsEntry e, recentList) | |
| 1143 | + { | |
| 1144 | + CookRecord r; | |
| 1145 | + | |
| 1146 | + switch (e.type) | |
| 1147 | + { | |
| 1148 | + case RecentsEntry::Auto: | |
| 1149 | + r.type = CookRecord::Auto; | |
| 1150 | + r.name = name(e.autoCook.type, e.autoCook.root); | |
| 1151 | + r.autoRecord.setting.name = r.name; | |
| 1152 | + r.autoRecord.setting.type = e.autoCook.type; | |
| 1153 | + r.autoRecord.setting.root = e.autoCook.root; | |
| 1154 | + | |
| 1155 | + for (int i = 0; i < 5; i++) | |
| 1156 | + r.autoRecord.setting.configs[i] = e.autoCook.configs[i]; | |
| 1157 | + | |
| 1158 | + break; | |
| 1159 | + case RecentsEntry::Manual: | |
| 1160 | + r.type = CookRecord::Manual; | |
| 1161 | + r.name = e.manualCook.cookedTime.toString("yy.MM.dd HH:mm:ss"); | |
| 1162 | + switch (e.manualCook.mode) | |
| 1163 | + { | |
| 1164 | + case Define::SteamMode: | |
| 1165 | + r.name += " - " + QObject::tr("스팀"); | |
| 1166 | + break; | |
| 1167 | + case Define::CombiMode: | |
| 1168 | + r.name += " - " + QObject::tr("콤비"); | |
| 1169 | + break; | |
| 1170 | + case Define::DryMode: | |
| 1171 | + r.name += " - " + QObject::tr("건열"); | |
| 1172 | + break; | |
| 1173 | + default: | |
| 1174 | + break; | |
| 1175 | + } | |
| 1176 | + | |
| 1177 | + r.manualRecord.cookedTime = e.manualCook.cookedTime; | |
| 1178 | + r.manualRecord.setting.mode = e.manualCook.mode; | |
| 1179 | + r.manualRecord.setting.humidity = e.manualCook.humidity; | |
| 1180 | + r.manualRecord.setting.temp = e.manualCook.temp; | |
| 1181 | + r.manualRecord.setting.time = e.manualCook.time; | |
| 1182 | + r.manualRecord.setting.fan = e.manualCook.fan; | |
| 1183 | + r.manualRecord.setting.coreTempEnabled = e.manualCook.coreTemp > 0; | |
| 1184 | + r.manualRecord.setting.coreTemp = e.manualCook.coreTemp; | |
| 1185 | + break; | |
| 1186 | + default: | |
| 1187 | + continue; | |
| 1188 | + } | |
| 1189 | + | |
| 1190 | + list.append(r); | |
| 1191 | + } | |
| 1192 | + | |
| 1193 | + return list; | |
| 1194 | +} | |
| 1195 | + | |
| 1196 | +QList<CookRecord> CookHistory::listFavorites() | |
| 1197 | +{ | |
| 1198 | + checkInitialized(); | |
| 1199 | + | |
| 1200 | + QList<CookRecord> list; | |
| 1201 | + foreach (FavoritesEntry e, favoriteList) | |
| 1202 | + { | |
| 1203 | + CookRecord r; | |
| 1204 | + r.id = e.id; | |
| 1205 | + r.name = e.name; | |
| 1206 | + | |
| 1207 | + switch (e.type) | |
| 1208 | + { | |
| 1209 | + case FavoritesEntry::Auto: | |
| 1210 | + r.type = CookRecord::Auto; | |
| 1211 | + r.autoRecord.setting.name = name(e.autoCook.type, e.autoCook.root); | |
| 1212 | + r.autoRecord.setting.type = e.autoCook.type; | |
| 1213 | + r.autoRecord.setting.root = e.autoCook.root; | |
| 1214 | + | |
| 1215 | + for (int i = 0; i < 5; i++) | |
| 1216 | + r.autoRecord.setting.configs[i] = e.autoCook.configs[i]; | |
| 1217 | + | |
| 1218 | + break; | |
| 1219 | + case FavoritesEntry::Manual: | |
| 1220 | + r.type = CookRecord::Manual; | |
| 1221 | + r.manualRecord.setting.mode = e.manualCook.mode; | |
| 1222 | + r.manualRecord.setting.humidity = e.manualCook.humidity; | |
| 1223 | + r.manualRecord.setting.temp = e.manualCook.temp; | |
| 1224 | + r.manualRecord.setting.time = e.manualCook.time; | |
| 1225 | + r.manualRecord.setting.fan = e.manualCook.fan; | |
| 1226 | + r.manualRecord.setting.coreTempEnabled = e.manualCook.coreTemp > 0; | |
| 1227 | + r.manualRecord.setting.coreTemp = e.manualCook.coreTemp; | |
| 1228 | + break; | |
| 1229 | + default: | |
| 1230 | + continue; | |
| 1231 | + } | |
| 1232 | + | |
| 1233 | + list.append(r); | |
| 1234 | + } | |
| 1235 | + | |
| 1236 | + return list; | |
| 1237 | +} | |
| 1238 | + | |
| 1239 | +QPixmap CookHistory::render(CookRecord record) | |
| 1240 | +{ | |
| 1241 | + if (record.type == CookRecord::Manual) | |
| 1242 | + { | |
| 1243 | + ManualCookSettingWidget *w = new ManualCookSettingWidget(record.manualRecord.setting); | |
| 1244 | + | |
| 1245 | + QPixmap p = w->grab().scaledToHeight(630, Qt::SmoothTransformation); | |
| 1246 | + | |
| 1247 | + w->deleteLater(); | |
| 1248 | + | |
| 1249 | + return p; | |
| 1250 | + } | |
| 1251 | + else if (record.type == CookRecord::Auto) | |
| 1252 | + { | |
| 1253 | + AutoCookSettingWidget *w = new AutoCookSettingWidget(record.autoRecord.setting); | |
| 1254 | + | |
| 1255 | + QPixmap p = w->grab().scaledToHeight(630, Qt::SmoothTransformation); | |
| 1256 | + | |
| 1257 | + w->deleteLater(); | |
| 1258 | + | |
| 1259 | + return p; | |
| 1260 | + } | |
| 1261 | + | |
| 1262 | + return QPixmap(); | |
| 1263 | +} | |
| 1264 | + | |
| 1265 | +void CookHistory::start(CookRecord record, QWidget *parent) | |
| 1266 | +{ | |
| 1267 | + if (record.type == CookRecord::Manual) | |
| 1268 | + { | |
| 1269 | + ManualCookWindow *w = new ManualCookWindow(parent, record.manualRecord.setting); | |
| 1270 | + w->setWindowModality(Qt::WindowModal); | |
| 1271 | + w->showFullScreen(); | |
| 1272 | + w->raise(); | |
| 1273 | + } | |
| 1274 | + else if (record.type == CookRecord::Auto) | |
| 1275 | + { | |
| 1276 | + Cook cook(record.autoRecord.setting.type, record.autoRecord.setting.root, record.autoRecord.setting.name); | |
| 1277 | + int *configs = record.autoRecord.setting.configs; | |
| 1278 | + cook.setConfig(configs[0], | |
| 1279 | + configs[1], | |
| 1280 | + configs[2], | |
| 1281 | + configs[3], | |
| 1282 | + configs[4]); | |
| 1283 | + | |
| 1284 | + AutoCookWindow *w = new AutoCookWindow(parent, cook); | |
| 1285 | + w->setWindowModality(Qt::WindowModal); | |
| 1286 | + w->showFullScreen(); | |
| 1287 | + w->raise(); | |
| 1288 | + } | |
| 1289 | +} | |
| 1290 | + | |
| 1291 | +void CookHistory::removeMostCooked(CookRecord record) | |
| 1292 | +{ | |
| 1293 | + if (countMap.contains(record.autoRecord.setting.root)) | |
| 1294 | + { | |
| 1295 | + countMap.remove(record.autoRecord.setting.root); | |
| 1296 | + sortCounts(); | |
| 1297 | + | |
| 1298 | + saveCounts.start(); | |
| 1299 | + } | |
| 1300 | +} | |
| 1301 | + | |
| 1302 | +void CookHistory::removeRecent(CookRecord record) | |
| 1303 | +{ | |
| 1304 | + RecentsEntry e; | |
| 1305 | + switch (record.type) | |
| 1306 | + { | |
| 1307 | + case CookRecord::Manual: | |
| 1308 | + e.type = RecentsEntry::Manual; | |
| 1309 | + e.manualCook.mode = record.manualRecord.setting.mode; | |
| 1310 | + e.manualCook.humidity = record.manualRecord.setting.humidity; | |
| 1311 | + e.manualCook.temp = record.manualRecord.setting.temp; | |
| 1312 | + e.manualCook.time = record.manualRecord.setting.time; | |
| 1313 | + e.manualCook.fan = record.manualRecord.setting.fan; | |
| 1314 | + e.manualCook.coreTemp = record.manualRecord.setting.coreTempEnabled ? record.manualRecord.setting.coreTemp : -1; | |
| 1315 | + e.manualCook.cookedTime = record.manualRecord.cookedTime; | |
| 1316 | + break; | |
| 1317 | + case CookRecord::Auto: | |
| 1318 | + e.type = RecentsEntry::Auto; | |
| 1319 | + e.autoCook.type = record.autoRecord.setting.type; | |
| 1320 | + e.autoCook.root = record.autoRecord.setting.root; | |
| 1321 | + break; | |
| 1322 | + default: | |
| 1323 | + return; | |
| 1324 | + } | |
| 1325 | + | |
| 1326 | + recentList.removeAll(e); | |
| 1327 | + | |
| 1328 | + saveRecents.start(); | |
| 1329 | +} | |
| 1330 | + | |
| 1331 | +void CookHistory::removeFavorite(CookRecord record) | |
| 1332 | +{ | |
| 1333 | + FavoritesEntry e; | |
| 1334 | + e.id = record.id; | |
| 1335 | + | |
| 1336 | + favoriteList.removeAll(e); | |
| 5 | 1337 | |
| 1338 | + saveFavorites.start(); | |
| 6 | 1339 | } | ... | ... |
app/gui/oven_control/cookhistory.h
| ... | ... | @@ -2,14 +2,67 @@ |
| 2 | 2 | #define COOKHISTORY_H |
| 3 | 3 | |
| 4 | 4 | |
| 5 | -class CookHistory | |
| 5 | +#include <QList> | |
| 6 | + | |
| 7 | +#include "cook.h" | |
| 8 | + | |
| 9 | +struct ManualCookSetting | |
| 6 | 10 | { |
| 7 | - static CookHistory *instance; | |
| 11 | + Define::Mode mode; | |
| 12 | + int humidity; | |
| 13 | + int temp; | |
| 14 | + int time; | |
| 15 | + bool coreTempEnabled; | |
| 16 | + int coreTemp; | |
| 17 | + int fan; | |
| 18 | +}; | |
| 8 | 19 | |
| 9 | - CookHistory(); | |
| 20 | +struct ManualCookRecord | |
| 21 | +{ | |
| 22 | + ManualCookSetting setting; | |
| 23 | + QDateTime cookedTime; | |
| 24 | +}; | |
| 10 | 25 | |
| 11 | -public: | |
| 12 | - static CookHistory *getInstance(); | |
| 26 | +struct AutoCookSetting | |
| 27 | +{ | |
| 28 | + Define::CookType type; | |
| 29 | + QString name; | |
| 30 | + QString root; | |
| 31 | + int configs[5]; | |
| 32 | +}; | |
| 33 | + | |
| 34 | +struct AutoCookRecord | |
| 35 | +{ | |
| 36 | + AutoCookSetting setting; | |
| 37 | + int count; | |
| 13 | 38 | }; |
| 14 | 39 | |
| 40 | +struct CookRecord | |
| 41 | +{ | |
| 42 | + QString name; | |
| 43 | + int id; | |
| 44 | + enum Type { Manual, Auto } type; | |
| 45 | + ManualCookRecord manualRecord; | |
| 46 | + AutoCookRecord autoRecord; | |
| 47 | +}; | |
| 48 | + | |
| 49 | +namespace CookHistory | |
| 50 | +{ | |
| 51 | +void record(ManualCookSetting cook); | |
| 52 | +void record(AutoCookSetting cook); | |
| 53 | +int addFavorite(ManualCookSetting cook, QString name); | |
| 54 | +int addFavorite(AutoCookSetting cook, QString name); | |
| 55 | + | |
| 56 | +void removeMostCooked(CookRecord record); | |
| 57 | +void removeRecent(CookRecord record); | |
| 58 | +void removeFavorite(CookRecord record); | |
| 59 | + | |
| 60 | +QList<CookRecord> listMostCooked(); | |
| 61 | +QList<CookRecord> listRecents(); | |
| 62 | +QList<CookRecord> listFavorites(); | |
| 63 | + | |
| 64 | +QPixmap render(CookRecord record); | |
| 65 | +void start(CookRecord record, QWidget *parent = 0); | |
| 66 | +} | |
| 67 | + | |
| 15 | 68 | #endif // COOKHISTORY_H | ... | ... |
app/gui/oven_control/cookpanelbutton.cpp
| 1 | 1 | #include "cookpanelbutton.h" |
| 2 | 2 | #include "ui_cookpanelbutton.h" |
| 3 | 3 | |
| 4 | -CookPanelButton::CookPanelButton(QWidget *parent) : | |
| 4 | +#include "manualcooksettingwidget.h" | |
| 5 | + | |
| 6 | +CookPanelButton::CookPanelButton(CookRecord record, QWidget *parent) : | |
| 5 | 7 | QWidget(parent), |
| 6 | - ui(new Ui::CookPanelButton) | |
| 8 | + record(record), | |
| 9 | + ui(new Ui::CookPanelButton), | |
| 10 | + rendered(false) | |
| 7 | 11 | { |
| 8 | 12 | ui->setupUi(this); |
| 13 | + | |
| 14 | + setText(record.name); | |
| 9 | 15 | } |
| 10 | 16 | |
| 11 | 17 | CookPanelButton::~CookPanelButton() |
| ... | ... | @@ -17,3 +23,55 @@ void CookPanelButton::setText(QString text) |
| 17 | 23 | { |
| 18 | 24 | ui->pushButton->setText(text); |
| 19 | 25 | } |
| 26 | + | |
| 27 | +void CookPanelButton::showInfo() | |
| 28 | +{ | |
| 29 | + if (!rendered) | |
| 30 | + { | |
| 31 | + QPixmap p = CookHistory::render(record); | |
| 32 | + | |
| 33 | + label = new QLabel(this); | |
| 34 | + label->setPixmap(p); | |
| 35 | + label->setGeometry((width() - p.width()) / 2, 65, p.width(), p.height()); | |
| 36 | + } | |
| 37 | + | |
| 38 | + label->show(); | |
| 39 | + setMinimumHeight(ui->pushButton->height() + label->height()); | |
| 40 | +} | |
| 41 | + | |
| 42 | +void CookPanelButton::hideInfo() | |
| 43 | +{ | |
| 44 | + label->hide(); | |
| 45 | + setMinimumHeight(ui->pushButton->height()); | |
| 46 | +} | |
| 47 | + | |
| 48 | +void CookPanelButton::focusBar() | |
| 49 | +{ | |
| 50 | + ui->pushButton->setFocus(); | |
| 51 | +} | |
| 52 | + | |
| 53 | +void CookPanelButton::focusInfoButton() | |
| 54 | +{ | |
| 55 | + ui->showInfoButton->setFocus(); | |
| 56 | +} | |
| 57 | + | |
| 58 | +void CookPanelButton::focusDeleteButton() | |
| 59 | +{ | |
| 60 | + ui->deleteButton->setFocus(); | |
| 61 | +} | |
| 62 | + | |
| 63 | + | |
| 64 | +void CookPanelButton::on_showInfoButton_toggled(bool checked) | |
| 65 | +{ | |
| 66 | + emit infoClicked(this); | |
| 67 | +} | |
| 68 | + | |
| 69 | +void CookPanelButton::on_pushButton_clicked() | |
| 70 | +{ | |
| 71 | + CookHistory::start(record, parentWidget()); | |
| 72 | +} | |
| 73 | + | |
| 74 | +void CookPanelButton::on_deleteButton_clicked() | |
| 75 | +{ | |
| 76 | + emit deleteClicked(this); | |
| 77 | +} | ... | ... |
app/gui/oven_control/cookpanelbutton.h
| ... | ... | @@ -2,6 +2,10 @@ |
| 2 | 2 | #define COOKPANELBUTTON_H |
| 3 | 3 | |
| 4 | 4 | #include <QWidget> |
| 5 | +#include <QLabel> | |
| 6 | +#include <QButtonGroup> | |
| 7 | + | |
| 8 | +#include "cookhistory.h" | |
| 5 | 9 | |
| 6 | 10 | namespace Ui { |
| 7 | 11 | class CookPanelButton; |
| ... | ... | @@ -12,18 +16,39 @@ class CookPanelButton : public QWidget |
| 12 | 16 | Q_OBJECT |
| 13 | 17 | |
| 14 | 18 | signals: |
| 15 | - void clicked(QWidget *); | |
| 16 | - void showInfoRequested(QWidget *); | |
| 17 | - void deleteRequested(QWidget *); | |
| 19 | + void resized(); | |
| 20 | + void clicked(CookPanelButton *); | |
| 21 | + void infoClicked(CookPanelButton *); | |
| 22 | + void deleteClicked(CookPanelButton *); | |
| 18 | 23 | |
| 19 | 24 | public: |
| 20 | - explicit CookPanelButton(QWidget *parent = 0); | |
| 25 | + explicit CookPanelButton(CookRecord record, QWidget *parent = 0); | |
| 21 | 26 | ~CookPanelButton(); |
| 22 | 27 | |
| 23 | 28 | void setText(QString text); |
| 29 | + void showInfo(); | |
| 30 | + void hideInfo(); | |
| 31 | + | |
| 32 | + void focusBar(); | |
| 33 | + void focusInfoButton(); | |
| 34 | + void focusDeleteButton(); | |
| 35 | + | |
| 36 | + CookRecord record; | |
| 37 | + | |
| 38 | +private slots: | |
| 39 | + | |
| 40 | + | |
| 41 | + void on_showInfoButton_toggled(bool checked); | |
| 42 | + | |
| 43 | + void on_pushButton_clicked(); | |
| 44 | + | |
| 45 | + void on_deleteButton_clicked(); | |
| 24 | 46 | |
| 25 | 47 | private: |
| 26 | 48 | Ui::CookPanelButton *ui; |
| 49 | + | |
| 50 | + bool rendered; | |
| 51 | + QLabel *label; | |
| 27 | 52 | }; |
| 28 | 53 | |
| 29 | 54 | #endif // COOKPANELBUTTON_H | ... | ... |
app/gui/oven_control/cookpanelbutton.ui
| ... | ... | @@ -96,6 +96,12 @@ QPushButton:focus { background-image: url(:/images/etc/bar_icon_01_ov.png); }</s |
| 96 | 96 | <property name="text"> |
| 97 | 97 | <string/> |
| 98 | 98 | </property> |
| 99 | + <property name="checkable"> | |
| 100 | + <bool>true</bool> | |
| 101 | + </property> | |
| 102 | + <property name="autoExclusive"> | |
| 103 | + <bool>true</bool> | |
| 104 | + </property> | |
| 99 | 105 | </widget> |
| 100 | 106 | <widget class="QPushButton" name="deleteButton"> |
| 101 | 107 | <property name="geometry"> | ... | ... |
app/gui/oven_control/favoritenamepopup.cpp
| ... | ... | @@ -0,0 +1,71 @@ |
| 1 | +#include "favoritenamepopup.h" | |
| 2 | +#include "ui_favoritenamepopup.h" | |
| 3 | + | |
| 4 | +#include "primewindow.h" | |
| 5 | + | |
| 6 | +FavoriteNamePopup::FavoriteNamePopup(QWidget *parent) : | |
| 7 | + QWidget(parent), | |
| 8 | + ui(new Ui::FavoriteNamePopup) | |
| 9 | +{ | |
| 10 | + ui->setupUi(this); | |
| 11 | + | |
| 12 | + ui->lineEdit->setFocus(); | |
| 13 | + ui->lineEdit->selectAll(); | |
| 14 | +} | |
| 15 | + | |
| 16 | +FavoriteNamePopup::FavoriteNamePopup(QWidget *parent, ManualCookSetting setting) : FavoriteNamePopup(parent) | |
| 17 | +{ | |
| 18 | + type = Manual; | |
| 19 | + manualSetting = setting; | |
| 20 | +} | |
| 21 | + | |
| 22 | +FavoriteNamePopup::FavoriteNamePopup(QWidget *parent, AutoCookSetting setting) : FavoriteNamePopup(parent) | |
| 23 | +{ | |
| 24 | + type = Auto; | |
| 25 | + autoSetting = setting; | |
| 26 | +} | |
| 27 | + | |
| 28 | +FavoriteNamePopup::~FavoriteNamePopup() | |
| 29 | +{ | |
| 30 | + delete ui; | |
| 31 | +} | |
| 32 | + | |
| 33 | +void FavoriteNamePopup::ok() | |
| 34 | +{ | |
| 35 | + int id; | |
| 36 | + switch (type) | |
| 37 | + { | |
| 38 | + case Manual: | |
| 39 | + id = CookHistory::addFavorite(manualSetting, ui->lineEdit->text()); | |
| 40 | + break; | |
| 41 | + case Auto: | |
| 42 | + id = CookHistory::addFavorite(autoSetting, ui->lineEdit->text()); | |
| 43 | + break; | |
| 44 | + default: | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + | |
| 48 | + PrimeWindow *w = new PrimeWindow(parentWidget()); | |
| 49 | + w->setWindowModality(Qt::WindowModal); | |
| 50 | + w->listFavorites(); | |
| 51 | + w->focusFavorite(id); | |
| 52 | + w->showFullScreen(); | |
| 53 | + w->raise(); | |
| 54 | + | |
| 55 | + deleteLater(); | |
| 56 | +} | |
| 57 | + | |
| 58 | +void FavoriteNamePopup::cancel() | |
| 59 | +{ | |
| 60 | + deleteLater(); | |
| 61 | +} | |
| 62 | + | |
| 63 | +void FavoriteNamePopup::on_okButton_clicked() | |
| 64 | +{ | |
| 65 | + ok(); | |
| 66 | +} | |
| 67 | + | |
| 68 | +void FavoriteNamePopup::on_cancelButton_clicked() | |
| 69 | +{ | |
| 70 | + cancel(); | |
| 71 | +} | ... | ... |
app/gui/oven_control/favoritenamepopup.h
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +#ifndef FAVORITENAMEPOPUP_H | |
| 2 | +#define FAVORITENAMEPOPUP_H | |
| 3 | + | |
| 4 | +#include <QWidget> | |
| 5 | + | |
| 6 | +#include "cookhistory.h" | |
| 7 | + | |
| 8 | +namespace Ui { | |
| 9 | +class FavoriteNamePopup; | |
| 10 | +} | |
| 11 | + | |
| 12 | +class FavoriteNamePopup : public QWidget | |
| 13 | +{ | |
| 14 | + Q_OBJECT | |
| 15 | + | |
| 16 | + explicit FavoriteNamePopup(QWidget *parent); | |
| 17 | + | |
| 18 | +public: | |
| 19 | + explicit FavoriteNamePopup(QWidget *parent, ManualCookSetting setting); | |
| 20 | + explicit FavoriteNamePopup(QWidget *parent, AutoCookSetting setting); | |
| 21 | + ~FavoriteNamePopup(); | |
| 22 | + | |
| 23 | +private: | |
| 24 | + Ui::FavoriteNamePopup *ui; | |
| 25 | + | |
| 26 | + enum { Manual, Auto } type; | |
| 27 | + ManualCookSetting manualSetting; | |
| 28 | + AutoCookSetting autoSetting; | |
| 29 | + | |
| 30 | +private slots: | |
| 31 | + void ok(); | |
| 32 | + void cancel(); | |
| 33 | + void on_okButton_clicked(); | |
| 34 | + void on_cancelButton_clicked(); | |
| 35 | +}; | |
| 36 | + | |
| 37 | +#endif // FAVORITENAMEPOPUP_H | ... | ... |
app/gui/oven_control/favoritenamepopup.ui
| ... | ... | @@ -0,0 +1,176 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<ui version="4.0"> | |
| 3 | + <class>FavoriteNamePopup</class> | |
| 4 | + <widget class="QWidget" name="FavoriteNamePopup"> | |
| 5 | + <property name="geometry"> | |
| 6 | + <rect> | |
| 7 | + <x>0</x> | |
| 8 | + <y>0</y> | |
| 9 | + <width>900</width> | |
| 10 | + <height>1600</height> | |
| 11 | + </rect> | |
| 12 | + </property> | |
| 13 | + <property name="windowTitle"> | |
| 14 | + <string>Form</string> | |
| 15 | + </property> | |
| 16 | + <property name="styleSheet"> | |
| 17 | + <string notr="true">#background { background-image: url(:/images/background/popup/503.png); } | |
| 18 | +QLabel, QPushButton, QLineEdit { color: white; } | |
| 19 | +QLineEdit { background : transparent; border: none; } | |
| 20 | +QPushButton { border: none; } | |
| 21 | +QPushButton:pressed { color: yellow; }</string> | |
| 22 | + </property> | |
| 23 | + <widget class="QWidget" name="background" native="true"> | |
| 24 | + <property name="geometry"> | |
| 25 | + <rect> | |
| 26 | + <x>0</x> | |
| 27 | + <y>426</y> | |
| 28 | + <width>900</width> | |
| 29 | + <height>1024</height> | |
| 30 | + </rect> | |
| 31 | + </property> | |
| 32 | + <widget class="Line" name="line"> | |
| 33 | + <property name="geometry"> | |
| 34 | + <rect> | |
| 35 | + <x>0</x> | |
| 36 | + <y>95</y> | |
| 37 | + <width>900</width> | |
| 38 | + <height>3</height> | |
| 39 | + </rect> | |
| 40 | + </property> | |
| 41 | + <property name="styleSheet"> | |
| 42 | + <string notr="true">color: rgb(255, 255, 255);</string> | |
| 43 | + </property> | |
| 44 | + <property name="orientation"> | |
| 45 | + <enum>Qt::Horizontal</enum> | |
| 46 | + </property> | |
| 47 | + </widget> | |
| 48 | + <widget class="QWidget" name="horizontalLayoutWidget"> | |
| 49 | + <property name="geometry"> | |
| 50 | + <rect> | |
| 51 | + <x>460</x> | |
| 52 | + <y>320</y> | |
| 53 | + <width>371</width> | |
| 54 | + <height>101</height> | |
| 55 | + </rect> | |
| 56 | + </property> | |
| 57 | + <layout class="QHBoxLayout" name="horizontalLayout"> | |
| 58 | + <item> | |
| 59 | + <widget class="QPushButton" name="okButton"> | |
| 60 | + <property name="sizePolicy"> | |
| 61 | + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | |
| 62 | + <horstretch>0</horstretch> | |
| 63 | + <verstretch>0</verstretch> | |
| 64 | + </sizepolicy> | |
| 65 | + </property> | |
| 66 | + <property name="font"> | |
| 67 | + <font> | |
| 68 | + <family>나눔고딕</family> | |
| 69 | + <pointsize>12</pointsize> | |
| 70 | + <underline>true</underline> | |
| 71 | + </font> | |
| 72 | + </property> | |
| 73 | + <property name="text"> | |
| 74 | + <string>확인</string> | |
| 75 | + </property> | |
| 76 | + <property name="flat"> | |
| 77 | + <bool>true</bool> | |
| 78 | + </property> | |
| 79 | + </widget> | |
| 80 | + </item> | |
| 81 | + <item> | |
| 82 | + <widget class="QPushButton" name="cancelButton"> | |
| 83 | + <property name="sizePolicy"> | |
| 84 | + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | |
| 85 | + <horstretch>0</horstretch> | |
| 86 | + <verstretch>0</verstretch> | |
| 87 | + </sizepolicy> | |
| 88 | + </property> | |
| 89 | + <property name="font"> | |
| 90 | + <font> | |
| 91 | + <family>나눔고딕</family> | |
| 92 | + <pointsize>12</pointsize> | |
| 93 | + <underline>true</underline> | |
| 94 | + </font> | |
| 95 | + </property> | |
| 96 | + <property name="text"> | |
| 97 | + <string>취소</string> | |
| 98 | + </property> | |
| 99 | + <property name="flat"> | |
| 100 | + <bool>true</bool> | |
| 101 | + </property> | |
| 102 | + </widget> | |
| 103 | + </item> | |
| 104 | + </layout> | |
| 105 | + </widget> | |
| 106 | + <widget class="QLabel" name="titleLabel"> | |
| 107 | + <property name="geometry"> | |
| 108 | + <rect> | |
| 109 | + <x>0</x> | |
| 110 | + <y>0</y> | |
| 111 | + <width>900</width> | |
| 112 | + <height>95</height> | |
| 113 | + </rect> | |
| 114 | + </property> | |
| 115 | + <property name="font"> | |
| 116 | + <font> | |
| 117 | + <pointsize>14</pointsize> | |
| 118 | + </font> | |
| 119 | + </property> | |
| 120 | + <property name="text"> | |
| 121 | + <string>즐겨찾기 추가</string> | |
| 122 | + </property> | |
| 123 | + <property name="alignment"> | |
| 124 | + <set>Qt::AlignCenter</set> | |
| 125 | + </property> | |
| 126 | + </widget> | |
| 127 | + <widget class="QLineEdit" name="lineEdit"> | |
| 128 | + <property name="geometry"> | |
| 129 | + <rect> | |
| 130 | + <x>0</x> | |
| 131 | + <y>100</y> | |
| 132 | + <width>900</width> | |
| 133 | + <height>200</height> | |
| 134 | + </rect> | |
| 135 | + </property> | |
| 136 | + <property name="font"> | |
| 137 | + <font> | |
| 138 | + <pointsize>12</pointsize> | |
| 139 | + <underline>true</underline> | |
| 140 | + </font> | |
| 141 | + </property> | |
| 142 | + <property name="text"> | |
| 143 | + <string>즐겨찾기 이름</string> | |
| 144 | + </property> | |
| 145 | + <property name="alignment"> | |
| 146 | + <set>Qt::AlignCenter</set> | |
| 147 | + </property> | |
| 148 | + </widget> | |
| 149 | + <zorder>line</zorder> | |
| 150 | + <zorder>horizontalLayoutWidget</zorder> | |
| 151 | + <zorder>titleLabel</zorder> | |
| 152 | + <zorder>lineEdit</zorder> | |
| 153 | + <zorder>keyboard</zorder> | |
| 154 | + </widget> | |
| 155 | + <widget class="KeyboardWidget" name="keyboard" native="true"> | |
| 156 | + <property name="geometry"> | |
| 157 | + <rect> | |
| 158 | + <x>0</x> | |
| 159 | + <y>850</y> | |
| 160 | + <width>900</width> | |
| 161 | + <height>600</height> | |
| 162 | + </rect> | |
| 163 | + </property> | |
| 164 | + </widget> | |
| 165 | + </widget> | |
| 166 | + <customwidgets> | |
| 167 | + <customwidget> | |
| 168 | + <class>KeyboardWidget</class> | |
| 169 | + <extends>QWidget</extends> | |
| 170 | + <header>keyboardwidget.h</header> | |
| 171 | + <container>1</container> | |
| 172 | + </customwidget> | |
| 173 | + </customwidgets> | |
| 174 | + <resources/> | |
| 175 | + <connections/> | |
| 176 | +</ui> | ... | ... |
app/gui/oven_control/mainwindow.cpp
| ... | ... | @@ -95,10 +95,10 @@ void MainWindow::on_etcButton_clicked() |
| 95 | 95 | |
| 96 | 96 | void MainWindow::on_primeButton_clicked() |
| 97 | 97 | { |
| 98 | -// PrimeWindow *w = new PrimeWindow(this); | |
| 99 | -// w->setWindowModality(Qt::WindowModal); | |
| 100 | -// w->showFullScreen(); | |
| 101 | -// w->raise(); | |
| 98 | + PrimeWindow *w = new PrimeWindow(this); | |
| 99 | + w->setWindowModality(Qt::WindowModal); | |
| 100 | + w->showFullScreen(); | |
| 101 | + w->raise(); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | void MainWindow::on_washButton_clicked() |
| ... | ... | @@ -111,14 +111,14 @@ void MainWindow::on_washButton_clicked() |
| 111 | 111 | |
| 112 | 112 | void MainWindow::on_configButton_clicked() |
| 113 | 113 | { |
| 114 | -// ConfigWindow *w = new ConfigWindow(this); | |
| 115 | -// w->setWindowModality(Qt::WindowModal); | |
| 116 | -// w->showFullScreen(); | |
| 117 | -// w->raise(); | |
| 118 | - EngineerMenuWindow *w = new EngineerMenuWindow(this); | |
| 114 | + ConfigWindow *w = new ConfigWindow(this); | |
| 119 | 115 | w->setWindowModality(Qt::WindowModal); |
| 120 | 116 | w->showFullScreen(); |
| 121 | 117 | w->raise(); |
| 118 | +// EngineerMenuWindow *w = new EngineerMenuWindow(this); | |
| 119 | +// w->setWindowModality(Qt::WindowModal); | |
| 120 | +// w->showFullScreen(); | |
| 121 | +// w->raise(); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | void MainWindow::on_helpButton_clicked() |
| ... | ... | @@ -128,8 +128,8 @@ void MainWindow::on_helpButton_clicked() |
| 128 | 128 | |
| 129 | 129 | void MainWindow::on_programmingButton_clicked() |
| 130 | 130 | { |
| 131 | -// ProgrammingWindow *w = new ProgrammingWindow(this); | |
| 132 | -// w->setWindowModality(Qt::WindowModal); | |
| 133 | -// w->showFullScreen(); | |
| 134 | -// w->raise(); | |
| 131 | + ProgrammingWindow *w = new ProgrammingWindow(this); | |
| 132 | + w->setWindowModality(Qt::WindowModal); | |
| 133 | + w->showFullScreen(); | |
| 134 | + w->raise(); | |
| 135 | 135 | } | ... | ... |
app/gui/oven_control/manualcooksettingwidget.cpp
| ... | ... | @@ -0,0 +1,120 @@ |
| 1 | +#include "manualcooksettingwidget.h" | |
| 2 | +#include "ui_manualcooksettingwidget.h" | |
| 3 | + | |
| 4 | +ManualCookSettingWidget::ManualCookSettingWidget(ManualCookSetting setting, QWidget *parent) : | |
| 5 | + QWidget(parent), | |
| 6 | + ui(new Ui::ManualCookSettingWidget) | |
| 7 | +{ | |
| 8 | + ui->setupUi(this); | |
| 9 | + | |
| 10 | + setMode(setting.mode); | |
| 11 | + setHumidity(setting.humidity); | |
| 12 | + setTemp(setting.temp); | |
| 13 | + setTime(setting.time); | |
| 14 | + setCoreTempEnabled(setting.coreTempEnabled); | |
| 15 | + setCoreTemp(setting.coreTemp); | |
| 16 | + setFan(setting.fan); | |
| 17 | +} | |
| 18 | + | |
| 19 | +ManualCookSettingWidget::~ManualCookSettingWidget() | |
| 20 | +{ | |
| 21 | + delete ui; | |
| 22 | +} | |
| 23 | + | |
| 24 | +void ManualCookSettingWidget::setMode(Define::Mode mode) | |
| 25 | +{ | |
| 26 | + switch (mode) | |
| 27 | + { | |
| 28 | + case Define::SteamMode: | |
| 29 | + ui->steamButton->setChecked(true); | |
| 30 | + ui->tempSlider->setRange(30, 130); | |
| 31 | + break; | |
| 32 | + case Define::CombiMode: | |
| 33 | + ui->combiButton->setChecked(true); | |
| 34 | + ui->tempSlider->setRange(30, 300); | |
| 35 | + break; | |
| 36 | + case Define::DryMode: | |
| 37 | + ui->dryheatButton->setChecked(true); | |
| 38 | + ui->tempSlider->setRange(30, 300); | |
| 39 | + break; | |
| 40 | + } | |
| 41 | +} | |
| 42 | + | |
| 43 | +void ManualCookSettingWidget::setHumidity(int percentage) | |
| 44 | +{ | |
| 45 | + ui->humiditySlider->setValue(percentage); | |
| 46 | + ui->humidityLabel->setText(QString("%1%").arg(percentage)); | |
| 47 | +} | |
| 48 | + | |
| 49 | +void ManualCookSettingWidget::setTemp(int celsius) | |
| 50 | +{ | |
| 51 | + ui->tempSlider->setValue(celsius); | |
| 52 | + ui->tempLabel->setText(QString("%1<span style=\"font-size:11pt;\">℃</span>").arg(celsius)); | |
| 53 | +} | |
| 54 | + | |
| 55 | +void ManualCookSettingWidget::setTime(int secs) | |
| 56 | +{ | |
| 57 | + ui->timeSlider->setValue(secs); | |
| 58 | + | |
| 59 | + if (secs >= 3600) | |
| 60 | + ui->timeLabel->setText( | |
| 61 | + QString("%1<span style=\"font-size:11pt;\">시간</span> %2<span style=\"font-size:11pt;\">분</span>") | |
| 62 | + .arg(secs / 3600) | |
| 63 | + .arg((secs % 3600) / 60, 2, 10, QLatin1Char('0'))); | |
| 64 | + else if (secs >= 60) | |
| 65 | + ui->timeLabel->setText( | |
| 66 | + QString("%1<span style=\"font-size:11pt;\">분</span> %2<span style=\"font-size:11pt;\">초</span>") | |
| 67 | + .arg(secs / 60) | |
| 68 | + .arg(secs % 60, 2, 10, QLatin1Char('0'))); | |
| 69 | + else | |
| 70 | + ui->timeLabel->setText(QString("%1<span style=\"font-size:11pt;\">초</span>").arg(secs)); | |
| 71 | +} | |
| 72 | + | |
| 73 | +void ManualCookSettingWidget::setCoreTempEnabled(bool enabled) | |
| 74 | +{ | |
| 75 | + ui->coreTempButton->setEnabled(enabled); | |
| 76 | + ui->coreTempSlider->setEnabled(enabled); | |
| 77 | + | |
| 78 | + if (enabled) | |
| 79 | + ui->coreTempLabel->setText(QString("%1<span style=\"font-size:11pt;\">℃</span>").arg(ui->coreTempSlider->value())); | |
| 80 | + else | |
| 81 | + ui->coreTempLabel->setText("<span style=\"font-size:11pt;\">℃</span>"); | |
| 82 | +} | |
| 83 | + | |
| 84 | +void ManualCookSettingWidget::setCoreTemp(int celsius) | |
| 85 | +{ | |
| 86 | + ui->coreTempSlider->setValue(celsius); | |
| 87 | + if (ui->coreTempSlider->isEnabled()) | |
| 88 | + ui->coreTempLabel->setText(QString("%1<span style=\"font-size:11pt;\">℃</span>").arg(celsius)); | |
| 89 | +} | |
| 90 | + | |
| 91 | +void ManualCookSettingWidget::setFan(int level) | |
| 92 | +{ | |
| 93 | + switch (level) | |
| 94 | + { | |
| 95 | + case 1: | |
| 96 | + ui->fanButton->setStyleSheet( | |
| 97 | + "background-image: url(:/images/manual_button/fan_1.png)"); | |
| 98 | + break; | |
| 99 | + case 2: | |
| 100 | + ui->fanButton->setStyleSheet( | |
| 101 | + "background-image: url(:/images/manual_button/fan_2.png)"); | |
| 102 | + break; | |
| 103 | + case 3: | |
| 104 | + ui->fanButton->setStyleSheet( | |
| 105 | + "background-image: url(:/images/manual_button/fan_3.png)"); | |
| 106 | + break; | |
| 107 | + case 4: | |
| 108 | + ui->fanButton->setStyleSheet( | |
| 109 | + "background-image: url(:/images/manual_button/fan_4.png)"); | |
| 110 | + break; | |
| 111 | + case 5: | |
| 112 | + ui->fanButton->setStyleSheet( | |
| 113 | + "background-image: url(:/images/manual_button/fan_5.png)"); | |
| 114 | + break; | |
| 115 | + default: | |
| 116 | + ui->fanButton->setStyleSheet( | |
| 117 | + "background-image: url(:/images/manual_button/fan_1.png)"); | |
| 118 | + break; | |
| 119 | + } | |
| 120 | +} | ... | ... |
app/gui/oven_control/manualcooksettingwidget.h
| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | +#ifndef MANUALCOOKSETTINGWIDGET_H | |
| 2 | +#define MANUALCOOKSETTINGWIDGET_H | |
| 3 | + | |
| 4 | +#include <QWidget> | |
| 5 | + | |
| 6 | +#include "define.h" | |
| 7 | +#include "cookhistory.h" | |
| 8 | + | |
| 9 | +namespace Ui { | |
| 10 | +class ManualCookSettingWidget; | |
| 11 | +} | |
| 12 | + | |
| 13 | +class ManualCookSettingWidget : public QWidget | |
| 14 | +{ | |
| 15 | + Q_OBJECT | |
| 16 | + | |
| 17 | +public: | |
| 18 | + explicit ManualCookSettingWidget(ManualCookSetting setting, QWidget *parent = 0); | |
| 19 | + ~ManualCookSettingWidget(); | |
| 20 | + | |
| 21 | + void setMode(Define::Mode mode); | |
| 22 | + void setHumidity(int percentage); | |
| 23 | + void setTemp(int celsius); | |
| 24 | + void setTime(int secs); | |
| 25 | + void setCoreTempEnabled(bool enabled); | |
| 26 | + void setCoreTemp(int celsius); | |
| 27 | + void setFan(int level); | |
| 28 | + | |
| 29 | +private: | |
| 30 | + Ui::ManualCookSettingWidget *ui; | |
| 31 | +}; | |
| 32 | + | |
| 33 | +#endif // MANUALCOOKSETTINGWIDGET_H | ... | ... |
app/gui/oven_control/manualcooksettingwidget.ui
| ... | ... | @@ -0,0 +1,917 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<ui version="4.0"> | |
| 3 | + <class>ManualCookSettingWidget</class> | |
| 4 | + <widget class="QWidget" name="ManualCookSettingWidget"> | |
| 5 | + <property name="geometry"> | |
| 6 | + <rect> | |
| 7 | + <x>0</x> | |
| 8 | + <y>0</y> | |
| 9 | + <width>900</width> | |
| 10 | + <height>1024</height> | |
| 11 | + </rect> | |
| 12 | + </property> | |
| 13 | + <property name="windowTitle"> | |
| 14 | + <string>Form</string> | |
| 15 | + </property> | |
| 16 | + <property name="styleSheet"> | |
| 17 | + <string notr="true">#background { | |
| 18 | +background-image: url(:/images/background/manual.png); | |
| 19 | +margin-top: -426px; | |
| 20 | +border-top: 426px; | |
| 21 | +} | |
| 22 | + | |
| 23 | +QPushButton { | |
| 24 | +background-repeat: no-repeat; | |
| 25 | +background-position: center; | |
| 26 | +border: none; | |
| 27 | +} | |
| 28 | + | |
| 29 | +QPushButton[style="mode"] { | |
| 30 | +background-repeat: no-repeat; | |
| 31 | +background-position: center; | |
| 32 | +background-clip: border; | |
| 33 | +background-origin: border; | |
| 34 | +margin-bottom: 50px; | |
| 35 | + | |
| 36 | +border-top: 200px; | |
| 37 | +border-bottom: -50px; | |
| 38 | +border-style: hidden; | |
| 39 | +color: #7B7B7B; | |
| 40 | +font-size: 40px; | |
| 41 | +} | |
| 42 | + | |
| 43 | +QPushButton[style="mode"]:checked { | |
| 44 | +color: white; | |
| 45 | +image: url(:/images/cook_mode/indicator.png); | |
| 46 | +image-position: bottom; | |
| 47 | +} | |
| 48 | + | |
| 49 | +QPushButton[style="icon"] { | |
| 50 | +background-image: url(:/images/slider_icon/background.png); | |
| 51 | +background-repeat: no-repeat; | |
| 52 | +background-position: center; | |
| 53 | +border: none; | |
| 54 | +} | |
| 55 | + | |
| 56 | +QPushButton[style="interTemp"] { | |
| 57 | +background-repeat: no-repeat; | |
| 58 | +background-position: center; | |
| 59 | +background-clip: border; | |
| 60 | +background-origin: border; | |
| 61 | + | |
| 62 | +border-top: 130px; | |
| 63 | +border-style: hidden; | |
| 64 | +color: white; | |
| 65 | +font-size: 30px; | |
| 66 | +} | |
| 67 | + | |
| 68 | +QSlider::groove { | |
| 69 | +background-image: url(:/images/slider/groove_ticks.png); | |
| 70 | +background-repeat: no-repeat; | |
| 71 | +} | |
| 72 | + | |
| 73 | +QSlider::sub-page { | |
| 74 | +background-repeat: no-repeat; | |
| 75 | +margin: 5px; | |
| 76 | +} | |
| 77 | + | |
| 78 | +QSlider::handle { | |
| 79 | +background-image: url(:/images/slider/handle_big.png); | |
| 80 | +background-repeat: no-repeat; | |
| 81 | +width: 23px; | |
| 82 | +height: 33px; | |
| 83 | +}</string> | |
| 84 | + </property> | |
| 85 | + <widget class="QPushButton" name="dryheatButton"> | |
| 86 | + <property name="geometry"> | |
| 87 | + <rect> | |
| 88 | + <x>600</x> | |
| 89 | + <y>0</y> | |
| 90 | + <width>300</width> | |
| 91 | + <height>293</height> | |
| 92 | + </rect> | |
| 93 | + </property> | |
| 94 | + <property name="styleSheet"> | |
| 95 | + <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_dryheat_hide.png); } | |
| 96 | +QPushButton:pressed { background-image: url(:/images/cook_mode/big_dryheat_ov.png); } | |
| 97 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); }</string> | |
| 98 | + </property> | |
| 99 | + <property name="text"> | |
| 100 | + <string>건열</string> | |
| 101 | + </property> | |
| 102 | + <property name="checkable"> | |
| 103 | + <bool>true</bool> | |
| 104 | + </property> | |
| 105 | + <property name="autoExclusive"> | |
| 106 | + <bool>true</bool> | |
| 107 | + </property> | |
| 108 | + <property name="style" stdset="0"> | |
| 109 | + <string notr="true">mode</string> | |
| 110 | + </property> | |
| 111 | + </widget> | |
| 112 | + <widget class="QPushButton" name="steamButton"> | |
| 113 | + <property name="geometry"> | |
| 114 | + <rect> | |
| 115 | + <x>0</x> | |
| 116 | + <y>0</y> | |
| 117 | + <width>300</width> | |
| 118 | + <height>293</height> | |
| 119 | + </rect> | |
| 120 | + </property> | |
| 121 | + <property name="styleSheet"> | |
| 122 | + <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_steam_hide.png); } | |
| 123 | +QPushButton:pressed { background-image: url(:/images/cook_mode/big_steam_ov.png); } | |
| 124 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); }</string> | |
| 125 | + </property> | |
| 126 | + <property name="text"> | |
| 127 | + <string>스팀</string> | |
| 128 | + </property> | |
| 129 | + <property name="checkable"> | |
| 130 | + <bool>true</bool> | |
| 131 | + </property> | |
| 132 | + <property name="checked"> | |
| 133 | + <bool>true</bool> | |
| 134 | + </property> | |
| 135 | + <property name="autoExclusive"> | |
| 136 | + <bool>true</bool> | |
| 137 | + </property> | |
| 138 | + <property name="style" stdset="0"> | |
| 139 | + <string notr="true">mode</string> | |
| 140 | + </property> | |
| 141 | + </widget> | |
| 142 | + <widget class="QPushButton" name="combiButton"> | |
| 143 | + <property name="geometry"> | |
| 144 | + <rect> | |
| 145 | + <x>300</x> | |
| 146 | + <y>0</y> | |
| 147 | + <width>300</width> | |
| 148 | + <height>293</height> | |
| 149 | + </rect> | |
| 150 | + </property> | |
| 151 | + <property name="styleSheet"> | |
| 152 | + <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_combi_hide.png); } | |
| 153 | +QPushButton:pressed { background-image: url(:/images/cook_mode/big_combi_ov.png); } | |
| 154 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); }</string> | |
| 155 | + </property> | |
| 156 | + <property name="text"> | |
| 157 | + <string>콤비</string> | |
| 158 | + </property> | |
| 159 | + <property name="checkable"> | |
| 160 | + <bool>true</bool> | |
| 161 | + </property> | |
| 162 | + <property name="autoExclusive"> | |
| 163 | + <bool>true</bool> | |
| 164 | + </property> | |
| 165 | + <property name="style" stdset="0"> | |
| 166 | + <string notr="true">mode</string> | |
| 167 | + </property> | |
| 168 | + </widget> | |
| 169 | + <widget class="QLabel" name="humidityLabel"> | |
| 170 | + <property name="enabled"> | |
| 171 | + <bool>true</bool> | |
| 172 | + </property> | |
| 173 | + <property name="geometry"> | |
| 174 | + <rect> | |
| 175 | + <x>690</x> | |
| 176 | + <y>384</y> | |
| 177 | + <width>150</width> | |
| 178 | + <height>51</height> | |
| 179 | + </rect> | |
| 180 | + </property> | |
| 181 | + <property name="palette"> | |
| 182 | + <palette> | |
| 183 | + <active> | |
| 184 | + <colorrole role="WindowText"> | |
| 185 | + <brush brushstyle="SolidPattern"> | |
| 186 | + <color alpha="255"> | |
| 187 | + <red>255</red> | |
| 188 | + <green>255</green> | |
| 189 | + <blue>255</blue> | |
| 190 | + </color> | |
| 191 | + </brush> | |
| 192 | + </colorrole> | |
| 193 | + </active> | |
| 194 | + <inactive> | |
| 195 | + <colorrole role="WindowText"> | |
| 196 | + <brush brushstyle="SolidPattern"> | |
| 197 | + <color alpha="255"> | |
| 198 | + <red>255</red> | |
| 199 | + <green>255</green> | |
| 200 | + <blue>255</blue> | |
| 201 | + </color> | |
| 202 | + </brush> | |
| 203 | + </colorrole> | |
| 204 | + </inactive> | |
| 205 | + <disabled> | |
| 206 | + <colorrole role="WindowText"> | |
| 207 | + <brush brushstyle="SolidPattern"> | |
| 208 | + <color alpha="255"> | |
| 209 | + <red>123</red> | |
| 210 | + <green>123</green> | |
| 211 | + <blue>123</blue> | |
| 212 | + </color> | |
| 213 | + </brush> | |
| 214 | + </colorrole> | |
| 215 | + </disabled> | |
| 216 | + </palette> | |
| 217 | + </property> | |
| 218 | + <property name="font"> | |
| 219 | + <font> | |
| 220 | + <family>Roboto</family> | |
| 221 | + <pointsize>16</pointsize> | |
| 222 | + <weight>75</weight> | |
| 223 | + <bold>true</bold> | |
| 224 | + </font> | |
| 225 | + </property> | |
| 226 | + <property name="text"> | |
| 227 | + <string>100%</string> | |
| 228 | + </property> | |
| 229 | + <property name="alignment"> | |
| 230 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 231 | + </property> | |
| 232 | + </widget> | |
| 233 | + <widget class="QSlider" name="humiditySlider"> | |
| 234 | + <property name="geometry"> | |
| 235 | + <rect> | |
| 236 | + <x>185</x> | |
| 237 | + <y>357</y> | |
| 238 | + <width>666</width> | |
| 239 | + <height>33</height> | |
| 240 | + </rect> | |
| 241 | + </property> | |
| 242 | + <property name="styleSheet"> | |
| 243 | + <string notr="true">QSlider::sub-page { background-image: url(:/images/slider/humidity.png); }</string> | |
| 244 | + </property> | |
| 245 | + <property name="maximum"> | |
| 246 | + <number>100</number> | |
| 247 | + </property> | |
| 248 | + <property name="tracking"> | |
| 249 | + <bool>false</bool> | |
| 250 | + </property> | |
| 251 | + <property name="orientation"> | |
| 252 | + <enum>Qt::Horizontal</enum> | |
| 253 | + </property> | |
| 254 | + </widget> | |
| 255 | + <widget class="QLabel" name="steamLabel_2"> | |
| 256 | + <property name="enabled"> | |
| 257 | + <bool>true</bool> | |
| 258 | + </property> | |
| 259 | + <property name="geometry"> | |
| 260 | + <rect> | |
| 261 | + <x>160</x> | |
| 262 | + <y>314</y> | |
| 263 | + <width>91</width> | |
| 264 | + <height>51</height> | |
| 265 | + </rect> | |
| 266 | + </property> | |
| 267 | + <property name="palette"> | |
| 268 | + <palette> | |
| 269 | + <active> | |
| 270 | + <colorrole role="WindowText"> | |
| 271 | + <brush brushstyle="SolidPattern"> | |
| 272 | + <color alpha="255"> | |
| 273 | + <red>255</red> | |
| 274 | + <green>255</green> | |
| 275 | + <blue>255</blue> | |
| 276 | + </color> | |
| 277 | + </brush> | |
| 278 | + </colorrole> | |
| 279 | + </active> | |
| 280 | + <inactive> | |
| 281 | + <colorrole role="WindowText"> | |
| 282 | + <brush brushstyle="SolidPattern"> | |
| 283 | + <color alpha="255"> | |
| 284 | + <red>255</red> | |
| 285 | + <green>255</green> | |
| 286 | + <blue>255</blue> | |
| 287 | + </color> | |
| 288 | + </brush> | |
| 289 | + </colorrole> | |
| 290 | + </inactive> | |
| 291 | + <disabled> | |
| 292 | + <colorrole role="WindowText"> | |
| 293 | + <brush brushstyle="SolidPattern"> | |
| 294 | + <color alpha="255"> | |
| 295 | + <red>123</red> | |
| 296 | + <green>123</green> | |
| 297 | + <blue>123</blue> | |
| 298 | + </color> | |
| 299 | + </brush> | |
| 300 | + </colorrole> | |
| 301 | + </disabled> | |
| 302 | + </palette> | |
| 303 | + </property> | |
| 304 | + <property name="font"> | |
| 305 | + <font> | |
| 306 | + <family>Malgun Gothic</family> | |
| 307 | + <pointsize>9</pointsize> | |
| 308 | + </font> | |
| 309 | + </property> | |
| 310 | + <property name="text"> | |
| 311 | + <string>감소</string> | |
| 312 | + </property> | |
| 313 | + <property name="alignment"> | |
| 314 | + <set>Qt::AlignCenter</set> | |
| 315 | + </property> | |
| 316 | + </widget> | |
| 317 | + <widget class="QSlider" name="coreTempSlider"> | |
| 318 | + <property name="enabled"> | |
| 319 | + <bool>false</bool> | |
| 320 | + </property> | |
| 321 | + <property name="geometry"> | |
| 322 | + <rect> | |
| 323 | + <x>185</x> | |
| 324 | + <y>807</y> | |
| 325 | + <width>666</width> | |
| 326 | + <height>33</height> | |
| 327 | + </rect> | |
| 328 | + </property> | |
| 329 | + <property name="styleSheet"> | |
| 330 | + <string notr="true">QSlider::sub-page { background-image: url(:/images/slider/core.png); } | |
| 331 | +QSlider::sub-page:disabled { background: #00000000; } | |
| 332 | +QSlider::handle:disabled { background: #00000000; }</string> | |
| 333 | + </property> | |
| 334 | + <property name="minimum"> | |
| 335 | + <number>30</number> | |
| 336 | + </property> | |
| 337 | + <property name="maximum"> | |
| 338 | + <number>99</number> | |
| 339 | + </property> | |
| 340 | + <property name="value"> | |
| 341 | + <number>30</number> | |
| 342 | + </property> | |
| 343 | + <property name="tracking"> | |
| 344 | + <bool>false</bool> | |
| 345 | + </property> | |
| 346 | + <property name="orientation"> | |
| 347 | + <enum>Qt::Horizontal</enum> | |
| 348 | + </property> | |
| 349 | + </widget> | |
| 350 | + <widget class="QPushButton" name="timeButton"> | |
| 351 | + <property name="geometry"> | |
| 352 | + <rect> | |
| 353 | + <x>27</x> | |
| 354 | + <y>599</y> | |
| 355 | + <width>140</width> | |
| 356 | + <height>140</height> | |
| 357 | + </rect> | |
| 358 | + </property> | |
| 359 | + <property name="styleSheet"> | |
| 360 | + <string notr="true">QPushButton { image: url(:/images/slider_icon/time.png); } | |
| 361 | +QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | |
| 362 | + </property> | |
| 363 | + <property name="text"> | |
| 364 | + <string notr="true"/> | |
| 365 | + </property> | |
| 366 | + <property name="style" stdset="0"> | |
| 367 | + <string notr="true">icon</string> | |
| 368 | + </property> | |
| 369 | + </widget> | |
| 370 | + <widget class="QPushButton" name="humidityButton"> | |
| 371 | + <property name="geometry"> | |
| 372 | + <rect> | |
| 373 | + <x>27</x> | |
| 374 | + <y>299</y> | |
| 375 | + <width>140</width> | |
| 376 | + <height>140</height> | |
| 377 | + </rect> | |
| 378 | + </property> | |
| 379 | + <property name="styleSheet"> | |
| 380 | + <string notr="true">QPushButton { image: url(:/images/slider_icon/humidity.png); } | |
| 381 | +QPushButton:pressed { image: url(:/images/slider_icon/humidity_ov.png); }</string> | |
| 382 | + </property> | |
| 383 | + <property name="text"> | |
| 384 | + <string notr="true"/> | |
| 385 | + </property> | |
| 386 | + <property name="style" stdset="0"> | |
| 387 | + <string notr="true">icon</string> | |
| 388 | + </property> | |
| 389 | + </widget> | |
| 390 | + <widget class="QSlider" name="tempSlider"> | |
| 391 | + <property name="geometry"> | |
| 392 | + <rect> | |
| 393 | + <x>185</x> | |
| 394 | + <y>507</y> | |
| 395 | + <width>666</width> | |
| 396 | + <height>33</height> | |
| 397 | + </rect> | |
| 398 | + </property> | |
| 399 | + <property name="styleSheet"> | |
| 400 | + <string notr="true">QSlider::sub-page { background-image: url(:/images/slider/temp.png); }</string> | |
| 401 | + </property> | |
| 402 | + <property name="minimum"> | |
| 403 | + <number>30</number> | |
| 404 | + </property> | |
| 405 | + <property name="maximum"> | |
| 406 | + <number>130</number> | |
| 407 | + </property> | |
| 408 | + <property name="tracking"> | |
| 409 | + <bool>false</bool> | |
| 410 | + </property> | |
| 411 | + <property name="orientation"> | |
| 412 | + <enum>Qt::Horizontal</enum> | |
| 413 | + </property> | |
| 414 | + </widget> | |
| 415 | + <widget class="QLabel" name="tempLabel"> | |
| 416 | + <property name="enabled"> | |
| 417 | + <bool>true</bool> | |
| 418 | + </property> | |
| 419 | + <property name="geometry"> | |
| 420 | + <rect> | |
| 421 | + <x>690</x> | |
| 422 | + <y>534</y> | |
| 423 | + <width>150</width> | |
| 424 | + <height>51</height> | |
| 425 | + </rect> | |
| 426 | + </property> | |
| 427 | + <property name="palette"> | |
| 428 | + <palette> | |
| 429 | + <active> | |
| 430 | + <colorrole role="WindowText"> | |
| 431 | + <brush brushstyle="SolidPattern"> | |
| 432 | + <color alpha="255"> | |
| 433 | + <red>255</red> | |
| 434 | + <green>255</green> | |
| 435 | + <blue>255</blue> | |
| 436 | + </color> | |
| 437 | + </brush> | |
| 438 | + </colorrole> | |
| 439 | + </active> | |
| 440 | + <inactive> | |
| 441 | + <colorrole role="WindowText"> | |
| 442 | + <brush brushstyle="SolidPattern"> | |
| 443 | + <color alpha="255"> | |
| 444 | + <red>255</red> | |
| 445 | + <green>255</green> | |
| 446 | + <blue>255</blue> | |
| 447 | + </color> | |
| 448 | + </brush> | |
| 449 | + </colorrole> | |
| 450 | + </inactive> | |
| 451 | + <disabled> | |
| 452 | + <colorrole role="WindowText"> | |
| 453 | + <brush brushstyle="SolidPattern"> | |
| 454 | + <color alpha="255"> | |
| 455 | + <red>123</red> | |
| 456 | + <green>123</green> | |
| 457 | + <blue>123</blue> | |
| 458 | + </color> | |
| 459 | + </brush> | |
| 460 | + </colorrole> | |
| 461 | + </disabled> | |
| 462 | + </palette> | |
| 463 | + </property> | |
| 464 | + <property name="font"> | |
| 465 | + <font> | |
| 466 | + <family>Roboto</family> | |
| 467 | + <pointsize>16</pointsize> | |
| 468 | + <weight>75</weight> | |
| 469 | + <bold>true</bold> | |
| 470 | + </font> | |
| 471 | + </property> | |
| 472 | + <property name="text"> | |
| 473 | + <string>30<span style="font-size:11pt;">℃</span></string> | |
| 474 | + </property> | |
| 475 | + <property name="alignment"> | |
| 476 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 477 | + </property> | |
| 478 | + </widget> | |
| 479 | + <widget class="QLabel" name="steamLabel_4"> | |
| 480 | + <property name="enabled"> | |
| 481 | + <bool>true</bool> | |
| 482 | + </property> | |
| 483 | + <property name="geometry"> | |
| 484 | + <rect> | |
| 485 | + <x>160</x> | |
| 486 | + <y>464</y> | |
| 487 | + <width>91</width> | |
| 488 | + <height>51</height> | |
| 489 | + </rect> | |
| 490 | + </property> | |
| 491 | + <property name="palette"> | |
| 492 | + <palette> | |
| 493 | + <active> | |
| 494 | + <colorrole role="WindowText"> | |
| 495 | + <brush brushstyle="SolidPattern"> | |
| 496 | + <color alpha="255"> | |
| 497 | + <red>255</red> | |
| 498 | + <green>255</green> | |
| 499 | + <blue>255</blue> | |
| 500 | + </color> | |
| 501 | + </brush> | |
| 502 | + </colorrole> | |
| 503 | + </active> | |
| 504 | + <inactive> | |
| 505 | + <colorrole role="WindowText"> | |
| 506 | + <brush brushstyle="SolidPattern"> | |
| 507 | + <color alpha="255"> | |
| 508 | + <red>255</red> | |
| 509 | + <green>255</green> | |
| 510 | + <blue>255</blue> | |
| 511 | + </color> | |
| 512 | + </brush> | |
| 513 | + </colorrole> | |
| 514 | + </inactive> | |
| 515 | + <disabled> | |
| 516 | + <colorrole role="WindowText"> | |
| 517 | + <brush brushstyle="SolidPattern"> | |
| 518 | + <color alpha="255"> | |
| 519 | + <red>123</red> | |
| 520 | + <green>123</green> | |
| 521 | + <blue>123</blue> | |
| 522 | + </color> | |
| 523 | + </brush> | |
| 524 | + </colorrole> | |
| 525 | + </disabled> | |
| 526 | + </palette> | |
| 527 | + </property> | |
| 528 | + <property name="font"> | |
| 529 | + <font> | |
| 530 | + <family>Malgun Gothic</family> | |
| 531 | + <pointsize>9</pointsize> | |
| 532 | + </font> | |
| 533 | + </property> | |
| 534 | + <property name="text"> | |
| 535 | + <string>감소</string> | |
| 536 | + </property> | |
| 537 | + <property name="alignment"> | |
| 538 | + <set>Qt::AlignCenter</set> | |
| 539 | + </property> | |
| 540 | + </widget> | |
| 541 | + <widget class="QLabel" name="coreTempLabel"> | |
| 542 | + <property name="enabled"> | |
| 543 | + <bool>true</bool> | |
| 544 | + </property> | |
| 545 | + <property name="geometry"> | |
| 546 | + <rect> | |
| 547 | + <x>690</x> | |
| 548 | + <y>834</y> | |
| 549 | + <width>150</width> | |
| 550 | + <height>50</height> | |
| 551 | + </rect> | |
| 552 | + </property> | |
| 553 | + <property name="palette"> | |
| 554 | + <palette> | |
| 555 | + <active> | |
| 556 | + <colorrole role="WindowText"> | |
| 557 | + <brush brushstyle="SolidPattern"> | |
| 558 | + <color alpha="255"> | |
| 559 | + <red>255</red> | |
| 560 | + <green>255</green> | |
| 561 | + <blue>255</blue> | |
| 562 | + </color> | |
| 563 | + </brush> | |
| 564 | + </colorrole> | |
| 565 | + </active> | |
| 566 | + <inactive> | |
| 567 | + <colorrole role="WindowText"> | |
| 568 | + <brush brushstyle="SolidPattern"> | |
| 569 | + <color alpha="255"> | |
| 570 | + <red>255</red> | |
| 571 | + <green>255</green> | |
| 572 | + <blue>255</blue> | |
| 573 | + </color> | |
| 574 | + </brush> | |
| 575 | + </colorrole> | |
| 576 | + </inactive> | |
| 577 | + <disabled> | |
| 578 | + <colorrole role="WindowText"> | |
| 579 | + <brush brushstyle="SolidPattern"> | |
| 580 | + <color alpha="255"> | |
| 581 | + <red>123</red> | |
| 582 | + <green>123</green> | |
| 583 | + <blue>123</blue> | |
| 584 | + </color> | |
| 585 | + </brush> | |
| 586 | + </colorrole> | |
| 587 | + </disabled> | |
| 588 | + </palette> | |
| 589 | + </property> | |
| 590 | + <property name="font"> | |
| 591 | + <font> | |
| 592 | + <family>Roboto</family> | |
| 593 | + <pointsize>16</pointsize> | |
| 594 | + <weight>75</weight> | |
| 595 | + <bold>true</bold> | |
| 596 | + </font> | |
| 597 | + </property> | |
| 598 | + <property name="text"> | |
| 599 | + <string><span style="font-size:11pt;">℃</span></string> | |
| 600 | + </property> | |
| 601 | + <property name="alignment"> | |
| 602 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 603 | + </property> | |
| 604 | + </widget> | |
| 605 | + <widget class="QLabel" name="steamLabel_5"> | |
| 606 | + <property name="enabled"> | |
| 607 | + <bool>true</bool> | |
| 608 | + </property> | |
| 609 | + <property name="geometry"> | |
| 610 | + <rect> | |
| 611 | + <x>780</x> | |
| 612 | + <y>464</y> | |
| 613 | + <width>91</width> | |
| 614 | + <height>51</height> | |
| 615 | + </rect> | |
| 616 | + </property> | |
| 617 | + <property name="palette"> | |
| 618 | + <palette> | |
| 619 | + <active> | |
| 620 | + <colorrole role="WindowText"> | |
| 621 | + <brush brushstyle="SolidPattern"> | |
| 622 | + <color alpha="255"> | |
| 623 | + <red>255</red> | |
| 624 | + <green>255</green> | |
| 625 | + <blue>255</blue> | |
| 626 | + </color> | |
| 627 | + </brush> | |
| 628 | + </colorrole> | |
| 629 | + </active> | |
| 630 | + <inactive> | |
| 631 | + <colorrole role="WindowText"> | |
| 632 | + <brush brushstyle="SolidPattern"> | |
| 633 | + <color alpha="255"> | |
| 634 | + <red>255</red> | |
| 635 | + <green>255</green> | |
| 636 | + <blue>255</blue> | |
| 637 | + </color> | |
| 638 | + </brush> | |
| 639 | + </colorrole> | |
| 640 | + </inactive> | |
| 641 | + <disabled> | |
| 642 | + <colorrole role="WindowText"> | |
| 643 | + <brush brushstyle="SolidPattern"> | |
| 644 | + <color alpha="255"> | |
| 645 | + <red>123</red> | |
| 646 | + <green>123</green> | |
| 647 | + <blue>123</blue> | |
| 648 | + </color> | |
| 649 | + </brush> | |
| 650 | + </colorrole> | |
| 651 | + </disabled> | |
| 652 | + </palette> | |
| 653 | + </property> | |
| 654 | + <property name="font"> | |
| 655 | + <font> | |
| 656 | + <family>Malgun Gothic</family> | |
| 657 | + <pointsize>9</pointsize> | |
| 658 | + </font> | |
| 659 | + </property> | |
| 660 | + <property name="text"> | |
| 661 | + <string>증가</string> | |
| 662 | + </property> | |
| 663 | + <property name="alignment"> | |
| 664 | + <set>Qt::AlignCenter</set> | |
| 665 | + </property> | |
| 666 | + </widget> | |
| 667 | + <widget class="QPushButton" name="coreTempButton"> | |
| 668 | + <property name="enabled"> | |
| 669 | + <bool>false</bool> | |
| 670 | + </property> | |
| 671 | + <property name="geometry"> | |
| 672 | + <rect> | |
| 673 | + <x>27</x> | |
| 674 | + <y>749</y> | |
| 675 | + <width>140</width> | |
| 676 | + <height>140</height> | |
| 677 | + </rect> | |
| 678 | + </property> | |
| 679 | + <property name="styleSheet"> | |
| 680 | + <string notr="true">QPushButton:disabled { image: url(:/images/slider_icon/core_temp.png); } | |
| 681 | +QPushButton:enabled { image: url(:/images/slider_icon/core_temp_enabled.png); }</string> | |
| 682 | + </property> | |
| 683 | + <property name="text"> | |
| 684 | + <string notr="true"/> | |
| 685 | + </property> | |
| 686 | + <property name="style" stdset="0"> | |
| 687 | + <string notr="true">icon</string> | |
| 688 | + </property> | |
| 689 | + </widget> | |
| 690 | + <widget class="QLabel" name="timeLabel"> | |
| 691 | + <property name="enabled"> | |
| 692 | + <bool>true</bool> | |
| 693 | + </property> | |
| 694 | + <property name="geometry"> | |
| 695 | + <rect> | |
| 696 | + <x>539</x> | |
| 697 | + <y>684</y> | |
| 698 | + <width>301</width> | |
| 699 | + <height>51</height> | |
| 700 | + </rect> | |
| 701 | + </property> | |
| 702 | + <property name="palette"> | |
| 703 | + <palette> | |
| 704 | + <active> | |
| 705 | + <colorrole role="WindowText"> | |
| 706 | + <brush brushstyle="SolidPattern"> | |
| 707 | + <color alpha="255"> | |
| 708 | + <red>255</red> | |
| 709 | + <green>255</green> | |
| 710 | + <blue>255</blue> | |
| 711 | + </color> | |
| 712 | + </brush> | |
| 713 | + </colorrole> | |
| 714 | + </active> | |
| 715 | + <inactive> | |
| 716 | + <colorrole role="WindowText"> | |
| 717 | + <brush brushstyle="SolidPattern"> | |
| 718 | + <color alpha="255"> | |
| 719 | + <red>255</red> | |
| 720 | + <green>255</green> | |
| 721 | + <blue>255</blue> | |
| 722 | + </color> | |
| 723 | + </brush> | |
| 724 | + </colorrole> | |
| 725 | + </inactive> | |
| 726 | + <disabled> | |
| 727 | + <colorrole role="WindowText"> | |
| 728 | + <brush brushstyle="SolidPattern"> | |
| 729 | + <color alpha="255"> | |
| 730 | + <red>123</red> | |
| 731 | + <green>123</green> | |
| 732 | + <blue>123</blue> | |
| 733 | + </color> | |
| 734 | + </brush> | |
| 735 | + </colorrole> | |
| 736 | + </disabled> | |
| 737 | + </palette> | |
| 738 | + </property> | |
| 739 | + <property name="font"> | |
| 740 | + <font> | |
| 741 | + <family>Roboto</family> | |
| 742 | + <pointsize>16</pointsize> | |
| 743 | + <weight>75</weight> | |
| 744 | + <bold>true</bold> | |
| 745 | + </font> | |
| 746 | + </property> | |
| 747 | + <property name="text"> | |
| 748 | + <string>0<span style="font-size:11pt;">초</span></string> | |
| 749 | + </property> | |
| 750 | + <property name="alignment"> | |
| 751 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
| 752 | + </property> | |
| 753 | + </widget> | |
| 754 | + <widget class="QSlider" name="timeSlider"> | |
| 755 | + <property name="geometry"> | |
| 756 | + <rect> | |
| 757 | + <x>185</x> | |
| 758 | + <y>657</y> | |
| 759 | + <width>666</width> | |
| 760 | + <height>33</height> | |
| 761 | + </rect> | |
| 762 | + </property> | |
| 763 | + <property name="styleSheet"> | |
| 764 | + <string notr="true">QSlider::sub-page { background-image: url(:/images/slider/time.png); }</string> | |
| 765 | + </property> | |
| 766 | + <property name="maximum"> | |
| 767 | + <number>86400</number> | |
| 768 | + </property> | |
| 769 | + <property name="singleStep"> | |
| 770 | + <number>60</number> | |
| 771 | + </property> | |
| 772 | + <property name="pageStep"> | |
| 773 | + <number>3600</number> | |
| 774 | + </property> | |
| 775 | + <property name="tracking"> | |
| 776 | + <bool>false</bool> | |
| 777 | + </property> | |
| 778 | + <property name="orientation"> | |
| 779 | + <enum>Qt::Horizontal</enum> | |
| 780 | + </property> | |
| 781 | + </widget> | |
| 782 | + <widget class="QPushButton" name="tempButton"> | |
| 783 | + <property name="geometry"> | |
| 784 | + <rect> | |
| 785 | + <x>27</x> | |
| 786 | + <y>449</y> | |
| 787 | + <width>140</width> | |
| 788 | + <height>140</height> | |
| 789 | + </rect> | |
| 790 | + </property> | |
| 791 | + <property name="styleSheet"> | |
| 792 | + <string notr="true">QPushButton { image: url(:/images/slider_icon/temp.png); } | |
| 793 | +QPushButton:pressed { image: url(:/images/slider_icon/temp_ov.png); }</string> | |
| 794 | + </property> | |
| 795 | + <property name="text"> | |
| 796 | + <string notr="true"/> | |
| 797 | + </property> | |
| 798 | + <property name="style" stdset="0"> | |
| 799 | + <string notr="true">icon</string> | |
| 800 | + </property> | |
| 801 | + </widget> | |
| 802 | + <widget class="QLabel" name="steamLabel_3"> | |
| 803 | + <property name="enabled"> | |
| 804 | + <bool>true</bool> | |
| 805 | + </property> | |
| 806 | + <property name="geometry"> | |
| 807 | + <rect> | |
| 808 | + <x>780</x> | |
| 809 | + <y>314</y> | |
| 810 | + <width>91</width> | |
| 811 | + <height>51</height> | |
| 812 | + </rect> | |
| 813 | + </property> | |
| 814 | + <property name="palette"> | |
| 815 | + <palette> | |
| 816 | + <active> | |
| 817 | + <colorrole role="WindowText"> | |
| 818 | + <brush brushstyle="SolidPattern"> | |
| 819 | + <color alpha="255"> | |
| 820 | + <red>255</red> | |
| 821 | + <green>255</green> | |
| 822 | + <blue>255</blue> | |
| 823 | + </color> | |
| 824 | + </brush> | |
| 825 | + </colorrole> | |
| 826 | + </active> | |
| 827 | + <inactive> | |
| 828 | + <colorrole role="WindowText"> | |
| 829 | + <brush brushstyle="SolidPattern"> | |
| 830 | + <color alpha="255"> | |
| 831 | + <red>255</red> | |
| 832 | + <green>255</green> | |
| 833 | + <blue>255</blue> | |
| 834 | + </color> | |
| 835 | + </brush> | |
| 836 | + </colorrole> | |
| 837 | + </inactive> | |
| 838 | + <disabled> | |
| 839 | + <colorrole role="WindowText"> | |
| 840 | + <brush brushstyle="SolidPattern"> | |
| 841 | + <color alpha="255"> | |
| 842 | + <red>123</red> | |
| 843 | + <green>123</green> | |
| 844 | + <blue>123</blue> | |
| 845 | + </color> | |
| 846 | + </brush> | |
| 847 | + </colorrole> | |
| 848 | + </disabled> | |
| 849 | + </palette> | |
| 850 | + </property> | |
| 851 | + <property name="font"> | |
| 852 | + <font> | |
| 853 | + <family>Malgun Gothic</family> | |
| 854 | + <pointsize>9</pointsize> | |
| 855 | + </font> | |
| 856 | + </property> | |
| 857 | + <property name="text"> | |
| 858 | + <string>증가</string> | |
| 859 | + </property> | |
| 860 | + <property name="alignment"> | |
| 861 | + <set>Qt::AlignCenter</set> | |
| 862 | + </property> | |
| 863 | + </widget> | |
| 864 | + <widget class="QPushButton" name="fanButton"> | |
| 865 | + <property name="geometry"> | |
| 866 | + <rect> | |
| 867 | + <x>449</x> | |
| 868 | + <y>893</y> | |
| 869 | + <width>112</width> | |
| 870 | + <height>131</height> | |
| 871 | + </rect> | |
| 872 | + </property> | |
| 873 | + <property name="styleSheet"> | |
| 874 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/fan_4.png); }</string> | |
| 875 | + </property> | |
| 876 | + <property name="text"> | |
| 877 | + <string/> | |
| 878 | + </property> | |
| 879 | + </widget> | |
| 880 | + <widget class="QLabel" name="background"> | |
| 881 | + <property name="geometry"> | |
| 882 | + <rect> | |
| 883 | + <x>0</x> | |
| 884 | + <y>0</y> | |
| 885 | + <width>900</width> | |
| 886 | + <height>1024</height> | |
| 887 | + </rect> | |
| 888 | + </property> | |
| 889 | + <property name="text"> | |
| 890 | + <string notr="true"/> | |
| 891 | + </property> | |
| 892 | + </widget> | |
| 893 | + <zorder>background</zorder> | |
| 894 | + <zorder>dryheatButton</zorder> | |
| 895 | + <zorder>steamButton</zorder> | |
| 896 | + <zorder>combiButton</zorder> | |
| 897 | + <zorder>humidityLabel</zorder> | |
| 898 | + <zorder>humiditySlider</zorder> | |
| 899 | + <zorder>steamLabel_2</zorder> | |
| 900 | + <zorder>coreTempSlider</zorder> | |
| 901 | + <zorder>timeButton</zorder> | |
| 902 | + <zorder>humidityButton</zorder> | |
| 903 | + <zorder>tempSlider</zorder> | |
| 904 | + <zorder>tempLabel</zorder> | |
| 905 | + <zorder>steamLabel_4</zorder> | |
| 906 | + <zorder>coreTempLabel</zorder> | |
| 907 | + <zorder>steamLabel_5</zorder> | |
| 908 | + <zorder>coreTempButton</zorder> | |
| 909 | + <zorder>timeLabel</zorder> | |
| 910 | + <zorder>timeSlider</zorder> | |
| 911 | + <zorder>tempButton</zorder> | |
| 912 | + <zorder>steamLabel_3</zorder> | |
| 913 | + <zorder>fanButton</zorder> | |
| 914 | + </widget> | |
| 915 | + <resources/> | |
| 916 | + <connections/> | |
| 917 | +</ui> | ... | ... |
app/gui/oven_control/manualcookwindow.cpp
| ... | ... | @@ -7,6 +7,9 @@ |
| 7 | 7 | |
| 8 | 8 | #include "preheatpopup.h" |
| 9 | 9 | #include "cooldownpopup.h" |
| 10 | +#include "cookhistory.h" | |
| 11 | +#include "favoritenamepopup.h" | |
| 12 | +#include "confirmpopup.h" | |
| 10 | 13 | |
| 11 | 14 | #include <QTime> |
| 12 | 15 | |
| ... | ... | @@ -65,6 +68,21 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : |
| 65 | 68 | setupAnimationTimer->start(0); |
| 66 | 69 | } |
| 67 | 70 | |
| 71 | +ManualCookWindow::ManualCookWindow(QWidget *parent, ManualCookSetting setting) | |
| 72 | + : ManualCookWindow(parent, setting.mode) | |
| 73 | +{ | |
| 74 | + oven->setHumidity(setting.humidity); | |
| 75 | + oven->setTemp(setting.temp); | |
| 76 | + oven->setTime(setting.time); | |
| 77 | + oven->setFan(setting.fan); | |
| 78 | + oven->setInterTempEnabled(setting.coreTempEnabled); | |
| 79 | + oven->setInterTemp(setting.coreTemp); | |
| 80 | + | |
| 81 | + startCookingTimer.start(); | |
| 82 | + | |
| 83 | + onOvenUpdated(oven); | |
| 84 | +} | |
| 85 | + | |
| 68 | 86 | ManualCookWindow::~ManualCookWindow() |
| 69 | 87 | { |
| 70 | 88 | delete ui; |
| ... | ... | @@ -315,8 +333,25 @@ void ManualCookWindow::setOvenDefault(Define::Mode mode) |
| 315 | 333 | |
| 316 | 334 | void ManualCookWindow::start() |
| 317 | 335 | { |
| 318 | - oven->startCooking(); | |
| 319 | - checkTimeTimer.start(); | |
| 336 | + if (oven->time() > 0) | |
| 337 | + { | |
| 338 | + if (startCookingTimer.isActive()) | |
| 339 | + startCookingTimer.stop(); | |
| 340 | + | |
| 341 | + oven->startCooking(); | |
| 342 | + checkTimeTimer.start(); | |
| 343 | + | |
| 344 | + ManualCookSetting s; | |
| 345 | + s.mode = oven->mode(); | |
| 346 | + s.humidity = oven->humidity(); | |
| 347 | + s.temp = oven->temp(); | |
| 348 | + s.time = oven->time(); | |
| 349 | + s.fan = oven->fan(); | |
| 350 | + s.coreTempEnabled = oven->interTempEnabled(); | |
| 351 | + s.coreTemp = oven->interTemp(); | |
| 352 | + | |
| 353 | + CookHistory::record(s); | |
| 354 | + } | |
| 320 | 355 | } |
| 321 | 356 | |
| 322 | 357 | void ManualCookWindow::stop() |
| ... | ... | @@ -391,11 +426,9 @@ void ManualCookWindow::on_applyButton_clicked() |
| 391 | 426 | void ManualCookWindow::on_runStopButton_clicked() |
| 392 | 427 | { |
| 393 | 428 | if (oven->cooking()) |
| 394 | - { | |
| 395 | 429 | stop(); |
| 396 | - } | |
| 397 | 430 | else |
| 398 | - oven->startCooking(); | |
| 431 | + start(); | |
| 399 | 432 | } |
| 400 | 433 | |
| 401 | 434 | void ManualCookWindow::on_fanButton_clicked() |
| ... | ... | @@ -453,7 +486,19 @@ void ManualCookWindow::on_reserveButton_clicked() |
| 453 | 486 | |
| 454 | 487 | void ManualCookWindow::on_favoritesButton_clicked() |
| 455 | 488 | { |
| 489 | + if (oven->cooking()) | |
| 490 | + return; | |
| 491 | + | |
| 492 | + ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); | |
| 493 | + p->showFullScreen(); | |
| 456 | 494 | |
| 495 | + connect(p, SIGNAL(accepted()), SLOT(addFavorite())); | |
| 496 | + | |
| 497 | + if (startCookingTimer.isActive()) | |
| 498 | + { | |
| 499 | + startCookingTimer.stop(); | |
| 500 | + connect(p, SIGNAL(rejected()), &startCookingTimer, SLOT(start())); | |
| 501 | + } | |
| 457 | 502 | } |
| 458 | 503 | |
| 459 | 504 | void ManualCookWindow::on_goBackStackButton_clicked() |
| ... | ... | @@ -471,3 +516,18 @@ void ManualCookWindow::on_backButton_clicked() |
| 471 | 516 | stop(); |
| 472 | 517 | close(); |
| 473 | 518 | } |
| 519 | + | |
| 520 | +void ManualCookWindow::addFavorite() | |
| 521 | +{ | |
| 522 | + ManualCookSetting s; | |
| 523 | + s.mode = oven->mode(); | |
| 524 | + s.humidity = oven->humidity(); | |
| 525 | + s.temp = oven->temp(); | |
| 526 | + s.time = oven->time(); | |
| 527 | + s.fan = oven->fan(); | |
| 528 | + s.coreTempEnabled = oven->interTempEnabled(); | |
| 529 | + s.coreTemp = oven->interTemp(); | |
| 530 | + | |
| 531 | + FavoriteNamePopup *p = new FavoriteNamePopup(this, s); | |
| 532 | + p->showFullScreen(); | |
| 533 | +} | ... | ... |
app/gui/oven_control/manualcookwindow.h
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | #include "oven.h" |
| 7 | 7 | #include "udphandler.h" |
| 8 | +#include "cookhistory.h" | |
| 8 | 9 | |
| 9 | 10 | namespace Ui { |
| 10 | 11 | class ManualCookWindow; |
| ... | ... | @@ -16,6 +17,7 @@ class ManualCookWindow : public QMainWindow |
| 16 | 17 | |
| 17 | 18 | public: |
| 18 | 19 | explicit ManualCookWindow(QWidget *parent, Define::Mode mode); |
| 20 | + explicit ManualCookWindow(QWidget *parent, ManualCookSetting setting); | |
| 19 | 21 | ~ManualCookWindow(); |
| 20 | 22 | |
| 21 | 23 | signals: |
| ... | ... | @@ -63,6 +65,7 @@ private slots: |
| 63 | 65 | |
| 64 | 66 | void on_backButton_clicked(); |
| 65 | 67 | |
| 68 | + void addFavorite(); | |
| 66 | 69 | |
| 67 | 70 | private: |
| 68 | 71 | Ui::ManualCookWindow *ui; | ... | ... |
app/gui/oven_control/oven_control.pro
| ... | ... | @@ -80,7 +80,11 @@ SOURCES += main.cpp\ |
| 80 | 80 | configtimeformatdlg.cpp \ |
| 81 | 81 | configresttimeformatdlg.cpp \ |
| 82 | 82 | configmastervolumedlg.cpp \ |
| 83 | - configsoundselelectdlg.cpp | |
| 83 | + configsoundselelectdlg.cpp \ | |
| 84 | + manualcooksettingwidget.cpp \ | |
| 85 | + autocooksettingwidget.cpp \ | |
| 86 | + favoritenamepopup.cpp \ | |
| 87 | + confirmpopup.cpp | |
| 84 | 88 | |
| 85 | 89 | HEADERS += mainwindow.h \ |
| 86 | 90 | cook.h \ |
| ... | ... | @@ -150,7 +154,11 @@ HEADERS += mainwindow.h \ |
| 150 | 154 | configtimeformatdlg.h \ |
| 151 | 155 | configresttimeformatdlg.h \ |
| 152 | 156 | configmastervolumedlg.h \ |
| 153 | - configsoundselelectdlg.h | |
| 157 | + configsoundselelectdlg.h \ | |
| 158 | + manualcooksettingwidget.h \ | |
| 159 | + autocooksettingwidget.h \ | |
| 160 | + favoritenamepopup.h \ | |
| 161 | + confirmpopup.h | |
| 154 | 162 | |
| 155 | 163 | FORMS += mainwindow.ui \ |
| 156 | 164 | manualcookwindow.ui \ |
| ... | ... | @@ -196,7 +204,11 @@ FORMS += mainwindow.ui \ |
| 196 | 204 | configtimeformatdlg.ui \ |
| 197 | 205 | configresttimeformatdlg.ui \ |
| 198 | 206 | configmastervolumedlg.ui \ |
| 199 | - configsoundselelectdlg.ui | |
| 207 | + configsoundselelectdlg.ui \ | |
| 208 | + manualcooksettingwidget.ui \ | |
| 209 | + autocooksettingwidget.ui \ | |
| 210 | + favoritenamepopup.ui \ | |
| 211 | + confirmpopup.ui | |
| 200 | 212 | |
| 201 | 213 | RESOURCES += \ |
| 202 | 214 | resources.qrc | ... | ... |
app/gui/oven_control/primewindow.cpp
| 1 | 1 | #include "primewindow.h" |
| 2 | 2 | #include "ui_primewindow.h" |
| 3 | 3 | |
| 4 | -#include "cookpanelbutton.h" | |
| 4 | +#include <QtDebug> | |
| 5 | +#include <QLabel> | |
| 6 | +#include <QPainter> | |
| 7 | + | |
| 8 | +#include "manualcooksettingwidget.h" | |
| 9 | +#include "cookhistory.h" | |
| 5 | 10 | |
| 6 | 11 | PrimeWindow::PrimeWindow(QWidget *parent) : |
| 7 | 12 | QMainWindow(parent), |
| ... | ... | @@ -13,6 +18,8 @@ PrimeWindow::PrimeWindow(QWidget *parent) : |
| 13 | 18 | setAttribute(Qt::WA_DeleteOnClose); |
| 14 | 19 | |
| 15 | 20 | ui->verticalScrollLayout->setAlignment(Qt::AlignTop); |
| 21 | + | |
| 22 | + lastInfoDisplayed = NULL; | |
| 16 | 23 | } |
| 17 | 24 | |
| 18 | 25 | PrimeWindow::~PrimeWindow() |
| ... | ... | @@ -20,6 +27,157 @@ PrimeWindow::~PrimeWindow() |
| 20 | 27 | delete ui; |
| 21 | 28 | } |
| 22 | 29 | |
| 30 | +void PrimeWindow::listMostCooked() | |
| 31 | +{ | |
| 32 | + if (!ui->mostCookedButton->isChecked()) | |
| 33 | + { | |
| 34 | + ui->mostCookedButton->blockSignals(true); | |
| 35 | + ui->mostCookedButton->setChecked(true); | |
| 36 | + ui->mostCookedButton->blockSignals(false); | |
| 37 | + } | |
| 38 | + | |
| 39 | + listButtons(CookHistory::listMostCooked()); | |
| 40 | +} | |
| 41 | + | |
| 42 | +void PrimeWindow::listRecents() | |
| 43 | +{ | |
| 44 | + if (!ui->recentsButton->isChecked()) | |
| 45 | + { | |
| 46 | + ui->recentsButton->blockSignals(true); | |
| 47 | + ui->recentsButton->setChecked(true); | |
| 48 | + ui->recentsButton->blockSignals(false); | |
| 49 | + } | |
| 50 | + | |
| 51 | + listButtons(CookHistory::listRecents()); | |
| 52 | +} | |
| 53 | + | |
| 54 | +void PrimeWindow::listFavorites() | |
| 55 | +{ | |
| 56 | + if (!ui->favoritesButton->isChecked()) | |
| 57 | + { | |
| 58 | + ui->favoritesButton->blockSignals(true); | |
| 59 | + ui->favoritesButton->setChecked(true); | |
| 60 | + ui->favoritesButton->blockSignals(false); | |
| 61 | + } | |
| 62 | + | |
| 63 | + listButtons(CookHistory::listFavorites()); | |
| 64 | +} | |
| 65 | + | |
| 66 | +void PrimeWindow::focusFavorite(int id) | |
| 67 | +{ | |
| 68 | + foreach (CookPanelButton *b, list) | |
| 69 | + { | |
| 70 | + qDebug() << "Favorite ID" << b->record.id; | |
| 71 | + if (b->record.id == id) | |
| 72 | + { | |
| 73 | +// b->setFocus(); | |
| 74 | + b->focusBar(); | |
| 75 | + break; | |
| 76 | + } | |
| 77 | + } | |
| 78 | +} | |
| 79 | + | |
| 80 | +void PrimeWindow::on_mostCookedButton_toggled(bool checked) | |
| 81 | +{ | |
| 82 | + if (!checked) | |
| 83 | + return; | |
| 84 | + | |
| 85 | + listButtons(CookHistory::listMostCooked()); | |
| 86 | +} | |
| 87 | + | |
| 88 | +void PrimeWindow::on_recentsButton_toggled(bool checked) | |
| 89 | +{ | |
| 90 | + if (!checked) | |
| 91 | + return; | |
| 92 | + | |
| 93 | + listButtons(CookHistory::listRecents()); | |
| 94 | +} | |
| 95 | + | |
| 96 | +void PrimeWindow::on_favoritesButton_toggled(bool checked) | |
| 97 | +{ | |
| 98 | + if (!checked) | |
| 99 | + return; | |
| 100 | + | |
| 101 | + listButtons(CookHistory::listFavorites()); | |
| 102 | +} | |
| 103 | + | |
| 104 | +void PrimeWindow::listButtons(QList<CookRecord> records) | |
| 105 | +{ | |
| 106 | + clear(); | |
| 107 | + | |
| 108 | + foreach(CookRecord r, records) | |
| 109 | + newButton(r); | |
| 110 | + | |
| 111 | + ui->scrollAreaWidgetContents->adjustSize(); | |
| 112 | +} | |
| 113 | + | |
| 114 | +void PrimeWindow::clear() | |
| 115 | +{ | |
| 116 | + lastInfoDisplayed = NULL; | |
| 117 | + while (!list.isEmpty()) | |
| 118 | + list.takeFirst()->deleteLater(); | |
| 119 | +} | |
| 120 | + | |
| 121 | +CookPanelButton *PrimeWindow::newButton(CookRecord record) | |
| 122 | +{ | |
| 123 | + CookPanelButton *button = new CookPanelButton(record, this); | |
| 124 | + connect(button, SIGNAL(infoClicked(CookPanelButton*)), SLOT(onInfoButtonClicked(CookPanelButton*))); | |
| 125 | + connect(button, SIGNAL(deleteClicked(CookPanelButton*)), SLOT(onDeleteButtonClicked(CookPanelButton*))); | |
| 126 | + | |
| 127 | + ui->verticalScrollLayout->addWidget(button); | |
| 128 | + list.append(button); | |
| 129 | + | |
| 130 | + return button; | |
| 131 | +} | |
| 132 | + | |
| 133 | +void PrimeWindow::onInfoButtonClicked(CookPanelButton *panelButton) | |
| 134 | +{ | |
| 135 | + if (lastInfoDisplayed) | |
| 136 | + { | |
| 137 | + if (panelButton == lastInfoDisplayed) | |
| 138 | + { | |
| 139 | + lastInfoDisplayed->hideInfo(); | |
| 140 | + lastInfoDisplayed = NULL; | |
| 141 | + | |
| 142 | + ui->scrollAreaWidgetContents->adjustSize(); | |
| 143 | + } | |
| 144 | + else | |
| 145 | + { | |
| 146 | + lastInfoDisplayed->hideInfo(); | |
| 147 | + lastInfoDisplayed = panelButton; | |
| 148 | + lastInfoDisplayed->showInfo(); | |
| 149 | + | |
| 150 | + ui->scrollAreaWidgetContents->adjustSize(); | |
| 151 | + ui->scrollArea->ensureWidgetVisible(lastInfoDisplayed); | |
| 152 | + } | |
| 153 | + } | |
| 154 | + else | |
| 155 | + { | |
| 156 | + lastInfoDisplayed = panelButton; | |
| 157 | + lastInfoDisplayed->showInfo(); | |
| 158 | + | |
| 159 | + ui->scrollAreaWidgetContents->adjustSize(); | |
| 160 | + ui->scrollArea->ensureWidgetVisible(lastInfoDisplayed); | |
| 161 | + } | |
| 162 | +} | |
| 163 | + | |
| 164 | +void PrimeWindow::onDeleteButtonClicked(CookPanelButton *panelButton) | |
| 165 | +{ | |
| 166 | + if (panelButton == lastInfoDisplayed) | |
| 167 | + lastInfoDisplayed = NULL; | |
| 168 | + | |
| 169 | + if (ui->mostCookedButton->isChecked()) | |
| 170 | + CookHistory::removeMostCooked(panelButton->record); | |
| 171 | + else if (ui->recentsButton->isChecked()) | |
| 172 | + CookHistory::removeRecent(panelButton->record); | |
| 173 | + else if (ui->favoritesButton->isChecked()) | |
| 174 | + CookHistory::removeFavorite(panelButton->record); | |
| 175 | + | |
| 176 | + list.removeAll(panelButton); | |
| 177 | + panelButton->deleteLater(); | |
| 178 | +} | |
| 179 | + | |
| 180 | + | |
| 23 | 181 | void PrimeWindow::on_backButton_clicked() |
| 24 | 182 | { |
| 25 | 183 | close(); | ... | ... |
app/gui/oven_control/primewindow.h
| ... | ... | @@ -3,8 +3,11 @@ |
| 3 | 3 | |
| 4 | 4 | #include <QMainWindow> |
| 5 | 5 | |
| 6 | +#include <QTimer> | |
| 6 | 7 | #include <QList> |
| 7 | 8 | |
| 9 | +#include "cookpanelbutton.h" | |
| 10 | + | |
| 8 | 11 | namespace Ui { |
| 9 | 12 | class PrimeWindow; |
| 10 | 13 | } |
| ... | ... | @@ -17,21 +20,32 @@ public: |
| 17 | 20 | explicit PrimeWindow(QWidget *parent = 0); |
| 18 | 21 | ~PrimeWindow(); |
| 19 | 22 | |
| 23 | + void listMostCooked(); | |
| 24 | + void listRecents(); | |
| 25 | + void listFavorites(); | |
| 26 | + void focusFavorite(int id); | |
| 27 | + | |
| 20 | 28 | private slots: |
| 21 | -// void showMostCooked(); | |
| 22 | -// void showRecents(); | |
| 23 | -// void showFavorites(); | |
| 24 | -// void array(); | |
| 29 | + void on_mostCookedButton_toggled(bool checked); | |
| 30 | + void on_recentsButton_toggled(bool checked); | |
| 31 | + void on_favoritesButton_toggled(bool checked); | |
| 32 | + | |
| 33 | + void listButtons(QList<CookRecord> records); | |
| 34 | + void clear(); | |
| 35 | + CookPanelButton *newButton(CookRecord record); | |
| 25 | 36 | |
| 26 | -// void onInfoButtonClicked(QWidget *entry); | |
| 27 | -// void onDeleteButtonClicked(QWidget *entry); | |
| 37 | + void onInfoButtonClicked(CookPanelButton *panelButton); | |
| 38 | + void onDeleteButtonClicked(CookPanelButton *panelButton); | |
| 28 | 39 | |
| 29 | 40 | void on_backButton_clicked(); |
| 30 | 41 | |
| 42 | + | |
| 43 | + | |
| 31 | 44 | private: |
| 32 | 45 | Ui::PrimeWindow *ui; |
| 33 | 46 | |
| 34 | - QList<QWidget *> list; | |
| 47 | + QList<CookPanelButton *> list; | |
| 48 | + CookPanelButton *lastInfoDisplayed; | |
| 35 | 49 | }; |
| 36 | 50 | |
| 37 | 51 | #endif // PRIMEWINDOW_H | ... | ... |
app/gui/oven_control/primewindow.ui
| ... | ... | @@ -76,7 +76,7 @@ background: none; |
| 76 | 76 | <number>0</number> |
| 77 | 77 | </property> |
| 78 | 78 | <item> |
| 79 | - <widget class="QPushButton" name="steamButton"> | |
| 79 | + <widget class="QPushButton" name="mostCookedButton"> | |
| 80 | 80 | <property name="sizePolicy"> |
| 81 | 81 | <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> |
| 82 | 82 | <horstretch>0</horstretch> |
| ... | ... | @@ -102,7 +102,7 @@ QPushButton:pressed { background-image: url(:/images/etc/main_btn_04_ov.png); }< |
| 102 | 102 | </widget> |
| 103 | 103 | </item> |
| 104 | 104 | <item> |
| 105 | - <widget class="QPushButton" name="steamButton_2"> | |
| 105 | + <widget class="QPushButton" name="recentsButton"> | |
| 106 | 106 | <property name="sizePolicy"> |
| 107 | 107 | <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> |
| 108 | 108 | <horstretch>0</horstretch> |
| ... | ... | @@ -128,7 +128,7 @@ QPushButton:pressed { background-image: url(:/images/etc/main_btn_03_ov.png); }< |
| 128 | 128 | </widget> |
| 129 | 129 | </item> |
| 130 | 130 | <item> |
| 131 | - <widget class="QPushButton" name="steamButton_3"> | |
| 131 | + <widget class="QPushButton" name="favoritesButton"> | |
| 132 | 132 | <property name="sizePolicy"> |
| 133 | 133 | <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> |
| 134 | 134 | <horstretch>0</horstretch> |
| ... | ... | @@ -269,9 +269,9 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s |
| 269 | 269 | <property name="geometry"> |
| 270 | 270 | <rect> |
| 271 | 271 | <x>0</x> |
| 272 | - <y>645</y> | |
| 272 | + <y>647</y> | |
| 273 | 273 | <width>900</width> |
| 274 | - <height>805</height> | |
| 274 | + <height>803</height> | |
| 275 | 275 | </rect> |
| 276 | 276 | </property> |
| 277 | 277 | <property name="widgetResizable"> |
| ... | ... | @@ -283,7 +283,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s |
| 283 | 283 | <x>0</x> |
| 284 | 284 | <y>0</y> |
| 285 | 285 | <width>898</width> |
| 286 | - <height>803</height> | |
| 286 | + <height>801</height> | |
| 287 | 287 | </rect> |
| 288 | 288 | </property> |
| 289 | 289 | <layout class="QVBoxLayout" name="verticalScrollLayout"> |
| ... | ... | @@ -294,10 +294,10 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s |
| 294 | 294 | <number>20</number> |
| 295 | 295 | </property> |
| 296 | 296 | <property name="topMargin"> |
| 297 | - <number>30</number> | |
| 297 | + <number>28</number> | |
| 298 | 298 | </property> |
| 299 | 299 | <property name="bottomMargin"> |
| 300 | - <number>30</number> | |
| 300 | + <number>28</number> | |
| 301 | 301 | </property> |
| 302 | 302 | </layout> |
| 303 | 303 | </widget> | ... | ... |
app/gui/oven_control/programmingwindow.cpp
| ... | ... | @@ -6,9 +6,17 @@ ProgrammingWindow::ProgrammingWindow(QWidget *parent) : |
| 6 | 6 | ui(new Ui::ProgrammingWindow) |
| 7 | 7 | { |
| 8 | 8 | ui->setupUi(this); |
| 9 | + | |
| 10 | + ui->clockContainer->setParent(ui->upperStack); | |
| 11 | + setAttribute(Qt::WA_DeleteOnClose); | |
| 9 | 12 | } |
| 10 | 13 | |
| 11 | 14 | ProgrammingWindow::~ProgrammingWindow() |
| 12 | 15 | { |
| 13 | 16 | delete ui; |
| 14 | 17 | } |
| 18 | + | |
| 19 | +void ProgrammingWindow::on_backButton_clicked() | |
| 20 | +{ | |
| 21 | + close(); | |
| 22 | +} | ... | ... |
app/gui/oven_control/programmingwindow.h
app/gui/oven_control/programmingwindow.ui
| ... | ... | @@ -101,7 +101,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str |
| 101 | 101 | </property> |
| 102 | 102 | <property name="styleSheet"> |
| 103 | 103 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/006_sys_icon_15.png); } |
| 104 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/006_sys_icon_15.png); }</string> | |
| 104 | +QPushButton:pressed { border-image: url(:/images/bottom_bar/006_sys_icon_15_ov.png); }</string> | |
| 105 | 105 | </property> |
| 106 | 106 | <property name="text"> |
| 107 | 107 | <string/> | ... | ... |