Commit af879dd59ee8dd0592cdc87e453223b03f375c13
1 parent
b7ae9e8303
Exists in
master
and in
2 other branches
자동 요리 만들기 누락 기능 추가
Showing
6 changed files
with
103 additions
and
195 deletions
Show diff stats
app/gui/oven_control/autocookcheckwindow.cpp
| ... | ... | @@ -322,36 +322,3 @@ void AutoCookCheckWindow::on_backButton_clicked() |
| 322 | 322 | emit back(); |
| 323 | 323 | close(); |
| 324 | 324 | } |
| 325 | - | |
| 326 | -void AutoCookCheckWindow::on_configButton_clicked() | |
| 327 | -{ | |
| 328 | - ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); | |
| 329 | - w->setWindowModality(Qt::WindowModal); | |
| 330 | - w->showFullScreen(); | |
| 331 | - w->raise(); | |
| 332 | - | |
| 333 | - MainWindow::jump(w); | |
| 334 | -} | |
| 335 | - | |
| 336 | -void AutoCookCheckWindow::on_favoritesButton_clicked() | |
| 337 | -{ | |
| 338 | - ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); | |
| 339 | - p->showFullScreen(); | |
| 340 | - | |
| 341 | - connect(p, SIGNAL(accepted()), SLOT(addFavorite())); | |
| 342 | -} | |
| 343 | - | |
| 344 | -void AutoCookCheckWindow::on_washButton_clicked() | |
| 345 | -{ | |
| 346 | - WashWindow *w = new WashWindow(MainWindow::getInstance()); | |
| 347 | - w->setWindowModality(Qt::WindowModal); | |
| 348 | - w->showFullScreen(); | |
| 349 | - w->raise(); | |
| 350 | - | |
| 351 | - MainWindow::jump(w); | |
| 352 | -} | |
| 353 | - | |
| 354 | -void AutoCookCheckWindow::on_helpButton_clicked() | |
| 355 | -{ | |
| 356 | - | |
| 357 | -} | ... | ... |
app/gui/oven_control/autocookcheckwindow.h
| ... | ... | @@ -57,10 +57,6 @@ private slots: |
| 57 | 57 | void on_showPrevStepButton_clicked(); |
| 58 | 58 | void on_showNextStepButton_clicked(); |
| 59 | 59 | void on_backButton_clicked(); |
| 60 | - void on_configButton_clicked(); | |
| 61 | - void on_favoritesButton_clicked(); | |
| 62 | - void on_washButton_clicked(); | |
| 63 | - void on_helpButton_clicked(); | |
| 64 | 60 | |
| 65 | 61 | signals: |
| 66 | 62 | void back(); | ... | ... |
app/gui/oven_control/autocookcheckwindow.ui
| ... | ... | @@ -235,7 +235,7 @@ QPushButton::pressed, QPushButton:focus { background-image: url(:/images/auto_bu |
| 235 | 235 | <widget class="QPushButton" name="selectCookButton"> |
| 236 | 236 | <property name="geometry"> |
| 237 | 237 | <rect> |
| 238 | - <x>584</x> | |
| 238 | + <x>420</x> | |
| 239 | 239 | <y>480</y> |
| 240 | 240 | <width>288</width> |
| 241 | 241 | <height>70</height> |
| ... | ... | @@ -589,7 +589,7 @@ QPushButton::pressed, QPushButton:focus { background-image: url(:/images/auto_bu |
| 589 | 589 | <widget class="QPushButton" name="backButton"> |
| 590 | 590 | <property name="geometry"> |
| 591 | 591 | <rect> |
| 592 | - <x>175</x> | |
| 592 | + <x>401</x> | |
| 593 | 593 | <y>26</y> |
| 594 | 594 | <width>97</width> |
| 595 | 595 | <height>97</height> |
| ... | ... | @@ -609,98 +609,6 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
| 609 | 609 | <string/> |
| 610 | 610 | </property> |
| 611 | 611 | </widget> |
| 612 | - <widget class="QPushButton" name="washButton"> | |
| 613 | - <property name="geometry"> | |
| 614 | - <rect> | |
| 615 | - <x>514</x> | |
| 616 | - <y>26</y> | |
| 617 | - <width>97</width> | |
| 618 | - <height>97</height> | |
| 619 | - </rect> | |
| 620 | - </property> | |
| 621 | - <property name="sizePolicy"> | |
| 622 | - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 623 | - <horstretch>0</horstretch> | |
| 624 | - <verstretch>0</verstretch> | |
| 625 | - </sizepolicy> | |
| 626 | - </property> | |
| 627 | - <property name="styleSheet"> | |
| 628 | - <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/wash.png); } | |
| 629 | -QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/wash_ov.png); }</string> | |
| 630 | - </property> | |
| 631 | - <property name="text"> | |
| 632 | - <string/> | |
| 633 | - </property> | |
| 634 | - </widget> | |
| 635 | - <widget class="QPushButton" name="configButton"> | |
| 636 | - <property name="geometry"> | |
| 637 | - <rect> | |
| 638 | - <x>288</x> | |
| 639 | - <y>26</y> | |
| 640 | - <width>97</width> | |
| 641 | - <height>97</height> | |
| 642 | - </rect> | |
| 643 | - </property> | |
| 644 | - <property name="sizePolicy"> | |
| 645 | - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 646 | - <horstretch>0</horstretch> | |
| 647 | - <verstretch>0</verstretch> | |
| 648 | - </sizepolicy> | |
| 649 | - </property> | |
| 650 | - <property name="styleSheet"> | |
| 651 | - <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } | |
| 652 | -QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/config_ov.png); }</string> | |
| 653 | - </property> | |
| 654 | - <property name="text"> | |
| 655 | - <string/> | |
| 656 | - </property> | |
| 657 | - </widget> | |
| 658 | - <widget class="QPushButton" name="helpButton"> | |
| 659 | - <property name="geometry"> | |
| 660 | - <rect> | |
| 661 | - <x>627</x> | |
| 662 | - <y>26</y> | |
| 663 | - <width>97</width> | |
| 664 | - <height>97</height> | |
| 665 | - </rect> | |
| 666 | - </property> | |
| 667 | - <property name="sizePolicy"> | |
| 668 | - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 669 | - <horstretch>0</horstretch> | |
| 670 | - <verstretch>0</verstretch> | |
| 671 | - </sizepolicy> | |
| 672 | - </property> | |
| 673 | - <property name="styleSheet"> | |
| 674 | - <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } | |
| 675 | -QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); }</string> | |
| 676 | - </property> | |
| 677 | - <property name="text"> | |
| 678 | - <string/> | |
| 679 | - </property> | |
| 680 | - </widget> | |
| 681 | - <widget class="QPushButton" name="favoritesButton"> | |
| 682 | - <property name="geometry"> | |
| 683 | - <rect> | |
| 684 | - <x>401</x> | |
| 685 | - <y>26</y> | |
| 686 | - <width>97</width> | |
| 687 | - <height>97</height> | |
| 688 | - </rect> | |
| 689 | - </property> | |
| 690 | - <property name="sizePolicy"> | |
| 691 | - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
| 692 | - <horstretch>0</horstretch> | |
| 693 | - <verstretch>0</verstretch> | |
| 694 | - </sizepolicy> | |
| 695 | - </property> | |
| 696 | - <property name="styleSheet"> | |
| 697 | - <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/favorites.png); } | |
| 698 | -QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/favorites_ov.png); }</string> | |
| 699 | - </property> | |
| 700 | - <property name="text"> | |
| 701 | - <string/> | |
| 702 | - </property> | |
| 703 | - </widget> | |
| 704 | 612 | </widget> |
| 705 | 613 | <widget class="QLabel" name="cookStepIcon"> |
| 706 | 614 | <property name="geometry"> |
| ... | ... | @@ -925,10 +833,6 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/f |
| 925 | 833 | <tabstop>showPrevStepButton</tabstop> |
| 926 | 834 | <tabstop>showNextStepButton</tabstop> |
| 927 | 835 | <tabstop>backButton</tabstop> |
| 928 | - <tabstop>configButton</tabstop> | |
| 929 | - <tabstop>favoritesButton</tabstop> | |
| 930 | - <tabstop>washButton</tabstop> | |
| 931 | - <tabstop>helpButton</tabstop> | |
| 932 | 836 | </tabstops> |
| 933 | 837 | <resources> |
| 934 | 838 | <include location="resources.qrc"/> | ... | ... |
app/gui/oven_control/programmingautoconfigwindow.cpp
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | #include "cookprogram.h" |
| 9 | 9 | #include "configwindow.h" |
| 10 | 10 | #include "mainwindow.h" |
| 11 | +#include "autocookselectionpopup.h" | |
| 12 | +#include "autocookcheckwindow.h" | |
| 11 | 13 | |
| 12 | 14 | ProgrammingAutoConfigWindow::ProgrammingAutoConfigWindow(QWidget *parent, Cook cook) : |
| 13 | 15 | QMainWindow(parent), |
| ... | ... | @@ -75,8 +77,6 @@ ProgrammingAutoConfigWindow::ProgrammingAutoConfigWindow(QWidget *parent, Cook c |
| 75 | 77 | foreach (QWidget *w, findChildren<QWidget *>()) |
| 76 | 78 | w->installEventFilter(this); |
| 77 | 79 | |
| 78 | - installEventFilter(this); | |
| 79 | - | |
| 80 | 80 | setFocus(); |
| 81 | 81 | } |
| 82 | 82 | |
| ... | ... | @@ -150,31 +150,26 @@ void ProgrammingAutoConfigWindow::onEncoderRight() |
| 150 | 150 | |
| 151 | 151 | void ProgrammingAutoConfigWindow::onEncoderClicked(QWidget *clicked) |
| 152 | 152 | { |
| 153 | - if (clicked == NULL) | |
| 154 | - return; | |
| 155 | - | |
| 156 | - if (clicked->inherits("QPushButton")) | |
| 153 | + QPushButton *pb = qobject_cast<QPushButton *>(clicked); | |
| 154 | + if (pb) | |
| 157 | 155 | { |
| 158 | - QPushButton *pb = qobject_cast<QPushButton *>(clicked); | |
| 159 | - if (pb) | |
| 160 | - pb->click(); | |
| 156 | + pb->click(); | |
| 157 | + return; | |
| 161 | 158 | } |
| 162 | - else if (clicked->inherits("Slider")) | |
| 159 | + | |
| 160 | + Slider *slider = qobject_cast<Slider *>(clicked); | |
| 161 | + if (slider) | |
| 163 | 162 | { |
| 164 | - Slider *slider = qobject_cast<Slider *>(clicked); | |
| 165 | - if (slider) | |
| 166 | - { | |
| 167 | - if (slider == ui->configSlider_1) | |
| 168 | - ui->configButton_1->setFocus(); | |
| 169 | - else if (slider == ui->configSlider_2) | |
| 170 | - ui->configButton_2->setFocus(); | |
| 171 | - else if (slider == ui->configSlider_3) | |
| 172 | - ui->configButton_3->setFocus(); | |
| 173 | - else if (slider == ui->configSlider_4) | |
| 174 | - ui->configButton_4->setFocus(); | |
| 175 | - else if (slider == ui->configSlider_5) | |
| 176 | - ui->configButton_5->setFocus(); | |
| 177 | - } | |
| 163 | + if (slider == ui->configSlider_1) | |
| 164 | + ui->configButton_1->setFocus(); | |
| 165 | + else if (slider == ui->configSlider_2) | |
| 166 | + ui->configButton_2->setFocus(); | |
| 167 | + else if (slider == ui->configSlider_3) | |
| 168 | + ui->configButton_3->setFocus(); | |
| 169 | + else if (slider == ui->configSlider_4) | |
| 170 | + ui->configButton_4->setFocus(); | |
| 171 | + else if (slider == ui->configSlider_5) | |
| 172 | + ui->configButton_5->setFocus(); | |
| 178 | 173 | } |
| 179 | 174 | } |
| 180 | 175 | |
| ... | ... | @@ -204,6 +199,12 @@ QPushButton:checked { image: url(%3); }"); |
| 204 | 199 | } |
| 205 | 200 | else |
| 206 | 201 | { |
| 202 | + cw.button->show(); | |
| 203 | + cw.minimum->show(); | |
| 204 | + cw.maximum->show(); | |
| 205 | + cw.current->show(); | |
| 206 | + cw.slider->show(); | |
| 207 | + | |
| 207 | 208 | cw.button->setStyleSheet(styleSheet |
| 208 | 209 | .arg(Define::icon(config.type)) |
| 209 | 210 | .arg(Define::iconOverlay(config.type)) |
| ... | ... | @@ -268,6 +269,13 @@ void ProgrammingAutoConfigWindow::updateView() |
| 268 | 269 | break; |
| 269 | 270 | } |
| 270 | 271 | } |
| 272 | + | |
| 273 | + QWidget *focused = focusWidget(); | |
| 274 | + ui->configButton_1->setChecked(focused == ui->configSlider_1); | |
| 275 | + ui->configButton_2->setChecked(focused == ui->configSlider_2); | |
| 276 | + ui->configButton_3->setChecked(focused == ui->configSlider_3); | |
| 277 | + ui->configButton_4->setChecked(focused == ui->configSlider_4); | |
| 278 | + ui->configButton_5->setChecked(focused == ui->configSlider_5); | |
| 271 | 279 | } |
| 272 | 280 | |
| 273 | 281 | void ProgrammingAutoConfigWindow::updateConfig() |
| ... | ... | @@ -299,65 +307,101 @@ void ProgrammingAutoConfigWindow::afterThreeSecs() |
| 299 | 307 | } |
| 300 | 308 | } |
| 301 | 309 | |
| 302 | -void ProgrammingAutoConfigWindow::on_backButton_clicked() | |
| 310 | +void ProgrammingAutoConfigWindow::changeCook(Cook cook) | |
| 303 | 311 | { |
| 304 | - close(); | |
| 305 | -} | |
| 312 | + if (this->cook.root == cook.root) | |
| 313 | + return; | |
| 306 | 314 | |
| 307 | -void ProgrammingAutoConfigWindow::on_configButton_clicked() | |
| 308 | -{ | |
| 309 | - ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); | |
| 310 | - w->setWindowModality(Qt::WindowModal); | |
| 311 | - w->showFullScreen(); | |
| 312 | - w->raise(); | |
| 315 | + this->cook = cook; | |
| 313 | 316 | |
| 314 | - MainWindow::jump(w); | |
| 317 | + setupUi(); | |
| 315 | 318 | } |
| 316 | 319 | |
| 317 | -void ProgrammingAutoConfigWindow::on_helpButton_clicked() | |
| 320 | +void ProgrammingAutoConfigWindow::on_selectCookButton_clicked() | |
| 318 | 321 | { |
| 322 | + AutoCookSelectionPopup *p = new AutoCookSelectionPopup(this, cook.type); | |
| 323 | + p->showFullScreen(); | |
| 324 | + p->raise(); | |
| 319 | 325 | |
| 326 | + connect(p, SIGNAL(selected(Cook)), SLOT(changeCook(Cook))); | |
| 327 | + connect(p, SIGNAL(selected(Cook)), SLOT(setFocus())); | |
| 328 | + connect(p, SIGNAL(canceled()), SLOT(setFocus())); | |
| 320 | 329 | } |
| 321 | 330 | |
| 322 | -void ProgrammingAutoConfigWindow::on_okButton_clicked() | |
| 331 | +void ProgrammingAutoConfigWindow::on_checkCookButton_clicked() | |
| 323 | 332 | { |
| 324 | - if (!cook.isLoaded()) | |
| 325 | - cook.load(); | |
| 326 | - | |
| 327 | - AutoCookSetting s; | |
| 328 | - s.type = cook.type; | |
| 329 | - s.name = cook.name; | |
| 330 | - s.root = cook.root; | |
| 331 | - for (int i = 0; i < 5; i++) | |
| 332 | - s.configs[i] = cook.configs[i].current; | |
| 333 | + setFocus(); | |
| 333 | 334 | |
| 334 | - CookProgram::add(s); | |
| 335 | + AutoCookCheckWindow *w = new AutoCookCheckWindow(this, cook); | |
| 336 | + w->setWindowModality(Qt::WindowModal); | |
| 337 | + w->showFullScreen(); | |
| 338 | + w->raise(); | |
| 339 | +} | |
| 335 | 340 | |
| 336 | - emit added(); | |
| 341 | +void ProgrammingAutoConfigWindow::on_backButton_clicked() | |
| 342 | +{ | |
| 337 | 343 | close(); |
| 338 | 344 | } |
| 339 | 345 | |
| 340 | 346 | void ProgrammingAutoConfigWindow::on_configButton_1_clicked() |
| 341 | 347 | { |
| 342 | 348 | ui->configSlider_1->setFocus(); |
| 349 | + updateView(); | |
| 343 | 350 | } |
| 344 | 351 | |
| 345 | 352 | void ProgrammingAutoConfigWindow::on_configButton_2_clicked() |
| 346 | 353 | { |
| 347 | 354 | ui->configSlider_2->setFocus(); |
| 355 | + updateView(); | |
| 348 | 356 | } |
| 349 | 357 | |
| 350 | 358 | void ProgrammingAutoConfigWindow::on_configButton_3_clicked() |
| 351 | 359 | { |
| 352 | 360 | ui->configSlider_3->setFocus(); |
| 361 | + updateView(); | |
| 353 | 362 | } |
| 354 | 363 | |
| 355 | 364 | void ProgrammingAutoConfigWindow::on_configButton_4_clicked() |
| 356 | 365 | { |
| 357 | 366 | ui->configSlider_4->setFocus(); |
| 367 | + updateView(); | |
| 358 | 368 | } |
| 359 | 369 | |
| 360 | 370 | void ProgrammingAutoConfigWindow::on_configButton_5_clicked() |
| 361 | 371 | { |
| 362 | 372 | ui->configSlider_5->setFocus(); |
| 373 | + updateView(); | |
| 374 | +} | |
| 375 | + | |
| 376 | +void ProgrammingAutoConfigWindow::on_configButton_clicked() | |
| 377 | +{ | |
| 378 | + ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); | |
| 379 | + w->setWindowModality(Qt::WindowModal); | |
| 380 | + w->showFullScreen(); | |
| 381 | + w->raise(); | |
| 382 | + | |
| 383 | + MainWindow::jump(w); | |
| 384 | +} | |
| 385 | + | |
| 386 | +void ProgrammingAutoConfigWindow::on_helpButton_clicked() | |
| 387 | +{ | |
| 388 | + | |
| 389 | +} | |
| 390 | + | |
| 391 | +void ProgrammingAutoConfigWindow::on_okButton_clicked() | |
| 392 | +{ | |
| 393 | + if (!cook.isLoaded()) | |
| 394 | + cook.load(); | |
| 395 | + | |
| 396 | + AutoCookSetting s; | |
| 397 | + s.type = cook.type; | |
| 398 | + s.name = cook.name; | |
| 399 | + s.root = cook.root; | |
| 400 | + for (int i = 0; i < 5; i++) | |
| 401 | + s.configs[i] = cook.configs[i].current; | |
| 402 | + | |
| 403 | + CookProgram::add(s); | |
| 404 | + | |
| 405 | + emit added(); | |
| 406 | + close(); | |
| 363 | 407 | } | ... | ... |
app/gui/oven_control/programmingautoconfigwindow.h
| ... | ... | @@ -54,25 +54,22 @@ private slots: |
| 54 | 54 | void updateView(); |
| 55 | 55 | void updateConfig(); |
| 56 | 56 | void afterThreeSecs(); |
| 57 | + void changeCook(Cook cook); | |
| 57 | 58 | |
| 58 | - void on_backButton_clicked(); | |
| 59 | - | |
| 60 | - void on_configButton_clicked(); | |
| 61 | - | |
| 62 | - void on_helpButton_clicked(); | |
| 63 | - | |
| 64 | - void on_okButton_clicked(); | |
| 59 | + void on_selectCookButton_clicked(); | |
| 60 | + void on_checkCookButton_clicked(); | |
| 65 | 61 | |
| 66 | 62 | void on_configButton_1_clicked(); |
| 67 | - | |
| 68 | 63 | void on_configButton_2_clicked(); |
| 69 | - | |
| 70 | 64 | void on_configButton_3_clicked(); |
| 71 | - | |
| 72 | 65 | void on_configButton_4_clicked(); |
| 73 | - | |
| 74 | 66 | void on_configButton_5_clicked(); |
| 75 | 67 | |
| 68 | + void on_backButton_clicked(); | |
| 69 | + void on_configButton_clicked(); | |
| 70 | + void on_helpButton_clicked(); | |
| 71 | + void on_okButton_clicked(); | |
| 72 | + | |
| 76 | 73 | signals: |
| 77 | 74 | void added(); |
| 78 | 75 | }; | ... | ... |
app/gui/oven_control/programmingautoconfigwindow.ui
| ... | ... | @@ -124,7 +124,7 @@ border: none; |
| 124 | 124 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
| 125 | 125 | </property> |
| 126 | 126 | </widget> |
| 127 | - <widget class="QPushButton" name="pushButton_4"> | |
| 127 | + <widget class="QPushButton" name="checkCookButton"> | |
| 128 | 128 | <property name="geometry"> |
| 129 | 129 | <rect> |
| 130 | 130 | <x>720</x> |
| ... | ... | @@ -1432,7 +1432,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c |
| 1432 | 1432 | </customwidgets> |
| 1433 | 1433 | <tabstops> |
| 1434 | 1434 | <tabstop>selectCookButton</tabstop> |
| 1435 | - <tabstop>pushButton_4</tabstop> | |
| 1435 | + <tabstop>checkCookButton</tabstop> | |
| 1436 | 1436 | <tabstop>configButton_1</tabstop> |
| 1437 | 1437 | <tabstop>configButton_2</tabstop> |
| 1438 | 1438 | <tabstop>configButton_3</tabstop> | ... | ... |