Commit 271dda4aeeda7c4b1af130baa230894c91700b09
1 parent
40f5d047f8
Exists in
master
and in
2 other branches
엔코더 구현
- 수동 요리 - 세척 모드
Showing
19 changed files
with
1257 additions
and
375 deletions
Show diff stats
app/gui/oven_control/confirmpopup.cpp
| 1 | #include "confirmpopup.h" | 1 | #include "confirmpopup.h" |
| 2 | #include "ui_confirmpopup.h" | 2 | #include "ui_confirmpopup.h" |
| 3 | 3 | ||
| 4 | +#include <QKeyEvent> | ||
| 5 | + | ||
| 4 | #include "soundplayer.h" | 6 | #include "soundplayer.h" |
| 5 | 7 | ||
| 6 | ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) : | 8 | ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) : |
| @@ -12,6 +14,8 @@ ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) : | @@ -12,6 +14,8 @@ ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) : | ||
| 12 | 14 | ||
| 13 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 15 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 14 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 16 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 17 | + | ||
| 18 | + setFocus(); | ||
| 15 | } | 19 | } |
| 16 | 20 | ||
| 17 | ConfirmPopup::~ConfirmPopup() | 21 | ConfirmPopup::~ConfirmPopup() |
| @@ -19,6 +23,41 @@ ConfirmPopup::~ConfirmPopup() | @@ -19,6 +23,41 @@ ConfirmPopup::~ConfirmPopup() | ||
| 19 | delete ui; | 23 | delete ui; |
| 20 | } | 24 | } |
| 21 | 25 | ||
| 26 | +void ConfirmPopup::keyPressEvent(QKeyEvent *event) | ||
| 27 | +{ | ||
| 28 | + switch (event->key()) | ||
| 29 | + { | ||
| 30 | + case 0x01000030: // Turn left | ||
| 31 | + onEncoderLeft(); | ||
| 32 | + break; | ||
| 33 | + case 0x01000031: // Push | ||
| 34 | + pushed = focusWidget(); | ||
| 35 | + break; | ||
| 36 | + case 0x01000032: // Turn right | ||
| 37 | + onEncoderRight(); | ||
| 38 | + break; | ||
| 39 | + } | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +void ConfirmPopup::keyReleaseEvent(QKeyEvent *event) | ||
| 43 | +{ | ||
| 44 | + switch (event->key()) | ||
| 45 | + { | ||
| 46 | + case 0x01000030: // Turn left | ||
| 47 | + onEncoderLeft(); | ||
| 48 | + break; | ||
| 49 | + case 0x01000031: // Push | ||
| 50 | + if (focusWidget() == pushed) | ||
| 51 | + onEncoderClicked(pushed); | ||
| 52 | + | ||
| 53 | + pushed = NULL; | ||
| 54 | + break; | ||
| 55 | + case 0x01000032: // Turn right | ||
| 56 | + onEncoderRight(); | ||
| 57 | + break; | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | + | ||
| 22 | void ConfirmPopup::on_okButton_clicked() | 61 | void ConfirmPopup::on_okButton_clicked() |
| 23 | { | 62 | { |
| 24 | deleteLater(); | 63 | deleteLater(); |
| @@ -30,3 +69,28 @@ void ConfirmPopup::on_cancelButton_clicked() | @@ -30,3 +69,28 @@ void ConfirmPopup::on_cancelButton_clicked() | ||
| 30 | deleteLater(); | 69 | deleteLater(); |
| 31 | emit rejected(); | 70 | emit rejected(); |
| 32 | } | 71 | } |
| 72 | + | ||
| 73 | +void ConfirmPopup::onEncoderLeft() | ||
| 74 | +{ | ||
| 75 | + QWidget *focused = focusWidget(); | ||
| 76 | + if (focused == this || focused == ui->okButton) | ||
| 77 | + ui->cancelButton->setFocus(); | ||
| 78 | + else | ||
| 79 | + focusPreviousChild(); | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +void ConfirmPopup::onEncoderRight() | ||
| 83 | +{ | ||
| 84 | + QWidget *focused = focusWidget(); | ||
| 85 | + if (focused == this || focused == ui->cancelButton) | ||
| 86 | + ui->okButton->setFocus(); | ||
| 87 | + else | ||
| 88 | + focusNextChild(); | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +void ConfirmPopup::onEncoderClicked(QWidget *clicked) | ||
| 92 | +{ | ||
| 93 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); | ||
| 94 | + if (b) | ||
| 95 | + b->click(); | ||
| 96 | +} |
app/gui/oven_control/confirmpopup.h
| @@ -19,6 +19,10 @@ public: | @@ -19,6 +19,10 @@ public: | ||
| 19 | explicit ConfirmPopup(QWidget *parent, QString text); | 19 | explicit ConfirmPopup(QWidget *parent, QString text); |
| 20 | ~ConfirmPopup(); | 20 | ~ConfirmPopup(); |
| 21 | 21 | ||
| 22 | +protected: | ||
| 23 | + void keyPressEvent(QKeyEvent *event); | ||
| 24 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 25 | + | ||
| 22 | private slots: | 26 | private slots: |
| 23 | void on_okButton_clicked(); | 27 | void on_okButton_clicked(); |
| 24 | 28 | ||
| @@ -26,6 +30,12 @@ private slots: | @@ -26,6 +30,12 @@ private slots: | ||
| 26 | 30 | ||
| 27 | private: | 31 | private: |
| 28 | Ui::ConfirmPopup *ui; | 32 | Ui::ConfirmPopup *ui; |
| 33 | + | ||
| 34 | + QWidget *pushed = NULL; | ||
| 35 | + | ||
| 36 | + void onEncoderLeft(); | ||
| 37 | + void onEncoderRight(); | ||
| 38 | + void onEncoderClicked(QWidget *clicked); | ||
| 29 | }; | 39 | }; |
| 30 | 40 | ||
| 31 | #endif // CONFIRMPOPUP_H | 41 | #endif // CONFIRMPOPUP_H |
app/gui/oven_control/cooldownpopup.cpp
| 1 | #include "cooldownpopup.h" | 1 | #include "cooldownpopup.h" |
| 2 | #include "ui_cooldownpopup.h" | 2 | #include "ui_cooldownpopup.h" |
| 3 | 3 | ||
| 4 | +#include <QKeyEvent> | ||
| 5 | + | ||
| 4 | #include "soundplayer.h" | 6 | #include "soundplayer.h" |
| 5 | #include "stringer.h" | 7 | #include "stringer.h" |
| 6 | 8 | ||
| @@ -57,6 +59,14 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : | @@ -57,6 +59,14 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : | ||
| 57 | 59 | ||
| 58 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 60 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 59 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 61 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 62 | + | ||
| 63 | + focusTempButtonTimer.setSingleShot(true); | ||
| 64 | + focusTempButtonTimer.setInterval(3000); | ||
| 65 | + connect(&focusTempButtonTimer, SIGNAL(timeout()), SLOT(focusTempButton())); | ||
| 66 | + | ||
| 67 | + connect(ui->tempSlider, SIGNAL(sliderMoved(int)), &focusTempButtonTimer, SLOT(start())); | ||
| 68 | + | ||
| 69 | + ui->background->setFocus(); | ||
| 60 | } | 70 | } |
| 61 | 71 | ||
| 62 | CooldownPopup::~CooldownPopup() | 72 | CooldownPopup::~CooldownPopup() |
| @@ -64,6 +74,41 @@ CooldownPopup::~CooldownPopup() | @@ -64,6 +74,41 @@ CooldownPopup::~CooldownPopup() | ||
| 64 | delete ui; | 74 | delete ui; |
| 65 | } | 75 | } |
| 66 | 76 | ||
| 77 | +void CooldownPopup::keyPressEvent(QKeyEvent *event) | ||
| 78 | +{ | ||
| 79 | + switch (event->key()) | ||
| 80 | + { | ||
| 81 | + case 0x01000030: // Turn left | ||
| 82 | + onEncoderLeft(); | ||
| 83 | + break; | ||
| 84 | + case 0x01000031: // Push | ||
| 85 | + pushed = focusWidget(); | ||
| 86 | + break; | ||
| 87 | + case 0x01000032: // Turn right | ||
| 88 | + onEncoderRight(); | ||
| 89 | + break; | ||
| 90 | + } | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +void CooldownPopup::keyReleaseEvent(QKeyEvent *event) | ||
| 94 | +{ | ||
| 95 | + switch (event->key()) | ||
| 96 | + { | ||
| 97 | + case 0x01000030: // Turn left | ||
| 98 | + onEncoderLeft(); | ||
| 99 | + break; | ||
| 100 | + case 0x01000031: // Push | ||
| 101 | + if (focusWidget() == pushed) | ||
| 102 | + onEncoderClicked(pushed); | ||
| 103 | + | ||
| 104 | + pushed = NULL; | ||
| 105 | + break; | ||
| 106 | + case 0x01000032: // Turn right | ||
| 107 | + onEncoderRight(); | ||
| 108 | + break; | ||
| 109 | + } | ||
| 110 | +} | ||
| 111 | + | ||
| 67 | void CooldownPopup::start() | 112 | void CooldownPopup::start() |
| 68 | { | 113 | { |
| 69 | started = true; | 114 | started = true; |
| @@ -95,10 +140,8 @@ void CooldownPopup::updateView() | @@ -95,10 +140,8 @@ void CooldownPopup::updateView() | ||
| 95 | int temp; | 140 | int temp; |
| 96 | if (showingCurrentTemp) | 141 | if (showingCurrentTemp) |
| 97 | temp = oven->currentTemp(); | 142 | temp = oven->currentTemp(); |
| 98 | - else if (ui->tempSlider->isSliderDown()) | ||
| 99 | - temp = ui->tempSlider->sliderPosition(); | ||
| 100 | else | 143 | else |
| 101 | - temp = ui->tempSlider->value(); | 144 | + temp = ui->tempSlider->sliderPosition(); |
| 102 | 145 | ||
| 103 | ui->tempCurrentLabel->setText(Stringer::temperature(temp, Stringer::fontSize14)); | 146 | ui->tempCurrentLabel->setText(Stringer::temperature(temp, Stringer::fontSize14)); |
| 104 | 147 | ||
| @@ -129,11 +172,7 @@ void CooldownPopup::updateView() | @@ -129,11 +172,7 @@ void CooldownPopup::updateView() | ||
| 129 | if (lastDisplayedHumidification != oven->humidification()) | 172 | if (lastDisplayedHumidification != oven->humidification()) |
| 130 | { | 173 | { |
| 131 | lastDisplayedHumidification = oven->humidification(); | 174 | lastDisplayedHumidification = oven->humidification(); |
| 132 | - | ||
| 133 | - if (oven->humidification()) | ||
| 134 | - ui->humidificationButton->setStyleSheet("background-image: url(:/images/cooldown/side_nozzle_ov.png);"); | ||
| 135 | - else | ||
| 136 | - ui->humidificationButton->setStyleSheet("background-image: url(:/images/cooldown/side_nozzle.png);"); | 175 | + ui->humidificationButton->setChecked(oven->humidification()); |
| 137 | } | 176 | } |
| 138 | 177 | ||
| 139 | if (started && !oven->door()) | 178 | if (started && !oven->door()) |
| @@ -227,3 +266,50 @@ void CooldownPopup::on_humidificationButton_clicked() | @@ -227,3 +266,50 @@ void CooldownPopup::on_humidificationButton_clicked() | ||
| 227 | else | 266 | else |
| 228 | oven->startHumidification(); | 267 | oven->startHumidification(); |
| 229 | } | 268 | } |
| 269 | + | ||
| 270 | +void CooldownPopup::on_tempButton_clicked() | ||
| 271 | +{ | ||
| 272 | + ui->tempSlider->setFocus(); | ||
| 273 | + focusTempButtonTimer.start(); | ||
| 274 | +} | ||
| 275 | + | ||
| 276 | +void CooldownPopup::focusTempButton() | ||
| 277 | +{ | ||
| 278 | + if (focusWidget() == ui->tempSlider) | ||
| 279 | + ui->tempButton->setFocus(); | ||
| 280 | +} | ||
| 281 | + | ||
| 282 | +void CooldownPopup::onEncoderLeft() | ||
| 283 | +{ | ||
| 284 | + QWidget *focused = focusWidget(); | ||
| 285 | + if (focused == ui->background) | ||
| 286 | + ui->humidificationButton->setFocus(); | ||
| 287 | + else | ||
| 288 | + focusPreviousChild(); | ||
| 289 | +} | ||
| 290 | + | ||
| 291 | +void CooldownPopup::onEncoderRight() | ||
| 292 | +{ | ||
| 293 | + if (focusWidget() == ui->humidificationButton) | ||
| 294 | + ui->background->setFocus(); | ||
| 295 | + else | ||
| 296 | + focusNextChild(); | ||
| 297 | +} | ||
| 298 | + | ||
| 299 | +void CooldownPopup::onEncoderClicked(QWidget *clicked) | ||
| 300 | +{ | ||
| 301 | + if (clicked == ui->background) | ||
| 302 | + close(); | ||
| 303 | + else if (clicked->inherits("QPushButton")) | ||
| 304 | + { | ||
| 305 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); | ||
| 306 | + if (b) | ||
| 307 | + b->click(); | ||
| 308 | + } | ||
| 309 | + else if (clicked->inherits("Slider")) | ||
| 310 | + { | ||
| 311 | + Slider *slider = qobject_cast<Slider *>(clicked); | ||
| 312 | + if (slider == ui->tempSlider) | ||
| 313 | + ui->tempButton->setFocus(); | ||
| 314 | + } | ||
| 315 | +} |
app/gui/oven_control/cooldownpopup.h
| @@ -18,6 +18,10 @@ public: | @@ -18,6 +18,10 @@ public: | ||
| 18 | explicit CooldownPopup(QWidget *parent = 0, Oven *oven = 0); | 18 | explicit CooldownPopup(QWidget *parent = 0, Oven *oven = 0); |
| 19 | ~CooldownPopup(); | 19 | ~CooldownPopup(); |
| 20 | 20 | ||
| 21 | +protected: | ||
| 22 | + void keyPressEvent(QKeyEvent *event); | ||
| 23 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 24 | + | ||
| 21 | private slots: | 25 | private slots: |
| 22 | void start(); | 26 | void start(); |
| 23 | void stop(); | 27 | void stop(); |
| @@ -39,6 +43,10 @@ private slots: | @@ -39,6 +43,10 @@ private slots: | ||
| 39 | 43 | ||
| 40 | void on_humidificationButton_clicked(); | 44 | void on_humidificationButton_clicked(); |
| 41 | 45 | ||
| 46 | + void on_tempButton_clicked(); | ||
| 47 | + | ||
| 48 | + void focusTempButton(); | ||
| 49 | + | ||
| 42 | private: | 50 | private: |
| 43 | Ui::CooldownPopup *ui; | 51 | Ui::CooldownPopup *ui; |
| 44 | Oven *oven; | 52 | Oven *oven; |
| @@ -56,6 +64,13 @@ private: | @@ -56,6 +64,13 @@ private: | ||
| 56 | 64 | ||
| 57 | int lastDisplayedFanLevel; | 65 | int lastDisplayedFanLevel; |
| 58 | bool lastDisplayedHumidification; | 66 | bool lastDisplayedHumidification; |
| 67 | + | ||
| 68 | + QTimer focusTempButtonTimer; | ||
| 69 | + QWidget *pushed = NULL; | ||
| 70 | + | ||
| 71 | + void onEncoderLeft(); | ||
| 72 | + void onEncoderRight(); | ||
| 73 | + void onEncoderClicked(QWidget *clicked); | ||
| 59 | }; | 74 | }; |
| 60 | 75 | ||
| 61 | #endif // COOLDOWNPOPUP_H | 76 | #endif // COOLDOWNPOPUP_H |
app/gui/oven_control/cooldownpopup.ui
| @@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
| 14 | <string notr="true">#closeButton { border: none; } | 14 | <string notr="true">#closeButton { border: none; } |
| 15 | #closeButton_2 { border: none; } | 15 | #closeButton_2 { border: none; } |
| 16 | #background { background-image: url(:/images/background/popup/373.png); } | 16 | #background { background-image: url(:/images/background/popup/373.png); } |
| 17 | +#background:focus { border: 4px solid gray; } | ||
| 17 | 18 | ||
| 18 | QPushButton { | 19 | QPushButton { |
| 19 | background-position: center; | 20 | background-position: center; |
| @@ -85,6 +86,9 @@ height: 33px; | @@ -85,6 +86,9 @@ height: 33px; | ||
| 85 | <height>373</height> | 86 | <height>373</height> |
| 86 | </rect> | 87 | </rect> |
| 87 | </property> | 88 | </property> |
| 89 | + <property name="focusPolicy"> | ||
| 90 | + <enum>Qt::TabFocus</enum> | ||
| 91 | + </property> | ||
| 88 | <widget class="QPushButton" name="tempButton"> | 92 | <widget class="QPushButton" name="tempButton"> |
| 89 | <property name="geometry"> | 93 | <property name="geometry"> |
| 90 | <rect> | 94 | <rect> |
| @@ -96,7 +100,7 @@ height: 33px; | @@ -96,7 +100,7 @@ height: 33px; | ||
| 96 | </property> | 100 | </property> |
| 97 | <property name="styleSheet"> | 101 | <property name="styleSheet"> |
| 98 | <string notr="true">QPushButton { image: url(:/images/slider_icon/cooldown.png); } | 102 | <string notr="true">QPushButton { image: url(:/images/slider_icon/cooldown.png); } |
| 99 | -QPushButton::pressed { image: url(:/images/slider_icon/cooldown_ov.png); }</string> | 103 | +QPushButton::pressed, QPushButton:focus { image: url(:/images/slider_icon/cooldown_ov.png); }</string> |
| 100 | </property> | 104 | </property> |
| 101 | <property name="text"> | 105 | <property name="text"> |
| 102 | <string notr="true"/> | 106 | <string notr="true"/> |
| @@ -116,7 +120,7 @@ QPushButton::pressed { image: url(:/images/slider_icon/cooldown_ov.png); }</stri | @@ -116,7 +120,7 @@ QPushButton::pressed { image: url(:/images/slider_icon/cooldown_ov.png); }</stri | ||
| 116 | </property> | 120 | </property> |
| 117 | <property name="styleSheet"> | 121 | <property name="styleSheet"> |
| 118 | <string notr="true">QPushButton { background-image: url(:/images/cooldown/run.png); } | 122 | <string notr="true">QPushButton { background-image: url(:/images/cooldown/run.png); } |
| 119 | -QPushButton:pressed { background-image: url(:/images/cooldown/run_ov.png); }</string> | 123 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cooldown/run_ov.png); }</string> |
| 120 | </property> | 124 | </property> |
| 121 | <property name="text"> | 125 | <property name="text"> |
| 122 | <string/> | 126 | <string/> |
| @@ -149,11 +153,15 @@ QPushButton:pressed { background-image: url(:/images/cooldown/run_ov.png); }</st | @@ -149,11 +153,15 @@ QPushButton:pressed { background-image: url(:/images/cooldown/run_ov.png); }</st | ||
| 149 | </property> | 153 | </property> |
| 150 | <property name="styleSheet"> | 154 | <property name="styleSheet"> |
| 151 | <string notr="true">QPushButton { background-image: url(:/images/cooldown/side_nozzle.png); } | 155 | <string notr="true">QPushButton { background-image: url(:/images/cooldown/side_nozzle.png); } |
| 152 | -QPushButton:pressed { background-image: url(:/images/cooldown/side_nozzle_ov.png); }</string> | 156 | +QPushButton:checked { background-image: url(:/images/cooldown/side_nozzle_ov.png); } |
| 157 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cooldown/side_nozzle_ov.png); }</string> | ||
| 153 | </property> | 158 | </property> |
| 154 | <property name="text"> | 159 | <property name="text"> |
| 155 | <string/> | 160 | <string/> |
| 156 | </property> | 161 | </property> |
| 162 | + <property name="checkable"> | ||
| 163 | + <bool>true</bool> | ||
| 164 | + </property> | ||
| 157 | </widget> | 165 | </widget> |
| 158 | <widget class="QLabel" name="tempMaxLabel"> | 166 | <widget class="QLabel" name="tempMaxLabel"> |
| 159 | <property name="enabled"> | 167 | <property name="enabled"> |
app/gui/oven_control/coretempsettingpopup.cpp
| 1 | #include "coretempsettingpopup.h" | 1 | #include "coretempsettingpopup.h" |
| 2 | #include "ui_coretempsettingpopup.h" | 2 | #include "ui_coretempsettingpopup.h" |
| 3 | 3 | ||
| 4 | +#include <QKeyEvent> | ||
| 5 | + | ||
| 4 | #include "config.h" | 6 | #include "config.h" |
| 5 | #include "soundplayer.h" | 7 | #include "soundplayer.h" |
| 6 | #include "stringer.h" | 8 | #include "stringer.h" |
| @@ -77,6 +79,14 @@ CoreTempSettingPopup::CoreTempSettingPopup(QWidget *parent) : | @@ -77,6 +79,14 @@ CoreTempSettingPopup::CoreTempSettingPopup(QWidget *parent) : | ||
| 77 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 79 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 78 | 80 | ||
| 79 | updateView(); | 81 | updateView(); |
| 82 | + | ||
| 83 | + ui->background->setFocus(); | ||
| 84 | + | ||
| 85 | + focusCoreTempButtonTimer.setSingleShot(true); | ||
| 86 | + focusCoreTempButtonTimer.setInterval(3000); | ||
| 87 | + connect(&focusCoreTempButtonTimer, SIGNAL(timeout()), SLOT(focusCoreTempButton())); | ||
| 88 | + | ||
| 89 | + connect(ui->coreTempSlider, SIGNAL(sliderMoved(int)), &focusCoreTempButtonTimer, SLOT(start())); | ||
| 80 | } | 90 | } |
| 81 | 91 | ||
| 82 | CoreTempSettingPopup::~CoreTempSettingPopup() | 92 | CoreTempSettingPopup::~CoreTempSettingPopup() |
| @@ -84,6 +94,90 @@ CoreTempSettingPopup::~CoreTempSettingPopup() | @@ -84,6 +94,90 @@ CoreTempSettingPopup::~CoreTempSettingPopup() | ||
| 84 | delete ui; | 94 | delete ui; |
| 85 | } | 95 | } |
| 86 | 96 | ||
| 97 | +void CoreTempSettingPopup::keyPressEvent(QKeyEvent *event) | ||
| 98 | +{ | ||
| 99 | + switch (event->key()) | ||
| 100 | + { | ||
| 101 | + case 0x01000030: // Turn left | ||
| 102 | + onEncoderLeft(); | ||
| 103 | + break; | ||
| 104 | + case 0x01000031: // Push | ||
| 105 | + pushed = focusWidget(); | ||
| 106 | + break; | ||
| 107 | + case 0x01000032: // Turn right | ||
| 108 | + onEncoderRight(); | ||
| 109 | + break; | ||
| 110 | + } | ||
| 111 | +} | ||
| 112 | + | ||
| 113 | +void CoreTempSettingPopup::keyReleaseEvent(QKeyEvent *event) | ||
| 114 | +{ | ||
| 115 | + switch (event->key()) | ||
| 116 | + { | ||
| 117 | + case 0x01000030: // Turn left | ||
| 118 | + onEncoderLeft(); | ||
| 119 | + break; | ||
| 120 | + case 0x01000031: // Push | ||
| 121 | + if (focusWidget() == pushed) | ||
| 122 | + onEncoderClicked(pushed); | ||
| 123 | + | ||
| 124 | + pushed = NULL; | ||
| 125 | + break; | ||
| 126 | + case 0x01000032: // Turn right | ||
| 127 | + onEncoderRight(); | ||
| 128 | + break; | ||
| 129 | + } | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +void CoreTempSettingPopup::onEncoderLeft() | ||
| 133 | +{ | ||
| 134 | + QWidget *focused = focusWidget(); | ||
| 135 | + if (focused == ui->background) | ||
| 136 | + ui->applyButton->setFocus(); | ||
| 137 | + else if (focused->inherits("QPushButton")) | ||
| 138 | + focusPreviousChild(); | ||
| 139 | +} | ||
| 140 | + | ||
| 141 | +void CoreTempSettingPopup::onEncoderRight() | ||
| 142 | +{ | ||
| 143 | + QWidget *focused = focusWidget(); | ||
| 144 | + if (focused == ui->applyButton) | ||
| 145 | + ui->background->setFocus(); | ||
| 146 | + else if (focused == ui->background || focused->inherits("QPushButton")) | ||
| 147 | + focusNextChild(); | ||
| 148 | +} | ||
| 149 | + | ||
| 150 | +void CoreTempSettingPopup::onEncoderClicked(QWidget *clicked) | ||
| 151 | +{ | ||
| 152 | + QWidget *focused = clicked; | ||
| 153 | + if (focused == ui->background) | ||
| 154 | + close(); | ||
| 155 | + else if (focused->inherits("QPushButton")) | ||
| 156 | + { | ||
| 157 | + QPushButton *pb = qobject_cast<QPushButton *>(focused); | ||
| 158 | + if (pb) | ||
| 159 | + pb->click(); | ||
| 160 | + } | ||
| 161 | + else if (focused->inherits("Slider")) | ||
| 162 | + { | ||
| 163 | + Slider *slider = qobject_cast<Slider *>(focused); | ||
| 164 | + if (slider) | ||
| 165 | + { | ||
| 166 | + if (slider->value() != slider->sliderPosition()) | ||
| 167 | + slider->setValue(slider->sliderPosition()); | ||
| 168 | + | ||
| 169 | + if (slider == ui->coreTempSlider) | ||
| 170 | + ui->coreTempButton->setFocus(); | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +void CoreTempSettingPopup::focusCoreTempButton() | ||
| 176 | +{ | ||
| 177 | + if (focusWidget() == ui->coreTempSlider) | ||
| 178 | + ui->coreTempButton->setFocus(); | ||
| 179 | +} | ||
| 180 | + | ||
| 87 | void CoreTempSettingPopup::updateView() | 181 | void CoreTempSettingPopup::updateView() |
| 88 | { | 182 | { |
| 89 | int coreTemp = ui->coreTempSlider->sliderPosition(); | 183 | int coreTemp = ui->coreTempSlider->sliderPosition(); |
| @@ -117,3 +211,9 @@ void CoreTempSettingPopup::on_applyButton_clicked() | @@ -117,3 +211,9 @@ void CoreTempSettingPopup::on_applyButton_clicked() | ||
| 117 | oven->setInterTempEnabled(true); | 211 | oven->setInterTempEnabled(true); |
| 118 | close(); | 212 | close(); |
| 119 | } | 213 | } |
| 214 | + | ||
| 215 | +void CoreTempSettingPopup::on_coreTempButton_clicked() | ||
| 216 | +{ | ||
| 217 | + ui->coreTempSlider->setFocus(); | ||
| 218 | + focusCoreTempButtonTimer.start(); | ||
| 219 | +} |
app/gui/oven_control/coretempsettingpopup.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define CORETEMPSETTINGPOPUP_H | 2 | #define CORETEMPSETTINGPOPUP_H |
| 3 | 3 | ||
| 4 | #include <QWidget> | 4 | #include <QWidget> |
| 5 | +#include <QTimer> | ||
| 5 | 6 | ||
| 6 | #include "oven.h" | 7 | #include "oven.h" |
| 7 | 8 | ||
| @@ -17,14 +18,28 @@ public: | @@ -17,14 +18,28 @@ public: | ||
| 17 | explicit CoreTempSettingPopup(QWidget *parent = 0); | 18 | explicit CoreTempSettingPopup(QWidget *parent = 0); |
| 18 | ~CoreTempSettingPopup(); | 19 | ~CoreTempSettingPopup(); |
| 19 | 20 | ||
| 21 | +protected: | ||
| 22 | + void keyPressEvent(QKeyEvent *event); | ||
| 23 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 24 | + | ||
| 20 | private: | 25 | private: |
| 21 | Ui::CoreTempSettingPopup *ui; | 26 | Ui::CoreTempSettingPopup *ui; |
| 22 | Oven *oven; | 27 | Oven *oven; |
| 23 | 28 | ||
| 29 | + QTimer focusCoreTempButtonTimer; | ||
| 30 | + QWidget *pushed = NULL; | ||
| 31 | + | ||
| 32 | + void onEncoderLeft(); | ||
| 33 | + void onEncoderRight(); | ||
| 34 | + void onEncoderClicked(QWidget *clicked); | ||
| 35 | + | ||
| 36 | + | ||
| 24 | private slots: | 37 | private slots: |
| 25 | void updateView(); | 38 | void updateView(); |
| 26 | void on_cancelButton_clicked(); | 39 | void on_cancelButton_clicked(); |
| 27 | void on_applyButton_clicked(); | 40 | void on_applyButton_clicked(); |
| 41 | + void on_coreTempButton_clicked(); | ||
| 42 | + void focusCoreTempButton(); | ||
| 28 | }; | 43 | }; |
| 29 | 44 | ||
| 30 | #endif // CORETEMPSETTINGPOPUP_H | 45 | #endif // CORETEMPSETTINGPOPUP_H |
app/gui/oven_control/coretempsettingpopup.ui
| @@ -13,9 +13,15 @@ | @@ -13,9 +13,15 @@ | ||
| 13 | <property name="styleSheet"> | 13 | <property name="styleSheet"> |
| 14 | <string notr="true">#background { | 14 | <string notr="true">#background { |
| 15 | background-image: url(:/images/background/manual_core.png); | 15 | background-image: url(:/images/background/manual_core.png); |
| 16 | +background-origin: border; | ||
| 16 | margin-top: -720px; | 17 | margin-top: -720px; |
| 17 | } | 18 | } |
| 18 | 19 | ||
| 20 | +#background:focus { | ||
| 21 | +border: 4px solid gray; | ||
| 22 | +border-top: 724px solid gray; | ||
| 23 | +} | ||
| 24 | + | ||
| 19 | QPushButton[style="icon"] { | 25 | QPushButton[style="icon"] { |
| 20 | background-image: url(:/images/slider_icon/background.png); | 26 | background-image: url(:/images/slider_icon/background.png); |
| 21 | background-repeat: no-repeat; | 27 | background-repeat: no-repeat; |
| @@ -61,6 +67,9 @@ height: 33px; | @@ -61,6 +67,9 @@ height: 33px; | ||
| 61 | <height>730</height> | 67 | <height>730</height> |
| 62 | </rect> | 68 | </rect> |
| 63 | </property> | 69 | </property> |
| 70 | + <property name="focusPolicy"> | ||
| 71 | + <enum>Qt::TabFocus</enum> | ||
| 72 | + </property> | ||
| 64 | </widget> | 73 | </widget> |
| 65 | <widget class="QLabel" name="label_2"> | 74 | <widget class="QLabel" name="label_2"> |
| 66 | <property name="geometry"> | 75 | <property name="geometry"> |
| @@ -150,7 +159,7 @@ height: 33px; | @@ -150,7 +159,7 @@ height: 33px; | ||
| 150 | </property> | 159 | </property> |
| 151 | <property name="styleSheet"> | 160 | <property name="styleSheet"> |
| 152 | <string notr="true">QPushButton { background-image: url(:/images/manual_button/ok.png); } | 161 | <string notr="true">QPushButton { background-image: url(:/images/manual_button/ok.png); } |
| 153 | -QPushButton:pressed { background-image: url(:/images/manual_button/ok_ov.png); }</string> | 162 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/ok_ov.png); }</string> |
| 154 | </property> | 163 | </property> |
| 155 | <property name="text"> | 164 | <property name="text"> |
| 156 | <string>확인/적용하기</string> | 165 | <string>확인/적용하기</string> |
| @@ -437,7 +446,8 @@ QPushButton:pressed { background-image: url(:/images/manual_button/ok_ov.png); } | @@ -437,7 +446,8 @@ QPushButton:pressed { background-image: url(:/images/manual_button/ok_ov.png); } | ||
| 437 | </property> | 446 | </property> |
| 438 | <property name="styleSheet"> | 447 | <property name="styleSheet"> |
| 439 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp_enabled.png); } | 448 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp_enabled.png); } |
| 440 | -QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</string> | 449 | +QPushButton:checked { image: url(:/images/slider_icon/core_temp_ov.png); } |
| 450 | +QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/core_temp_ov.png); }</string> | ||
| 441 | </property> | 451 | </property> |
| 442 | <property name="style" stdset="0"> | 452 | <property name="style" stdset="0"> |
| 443 | <string>icon</string> | 453 | <string>icon</string> |
| @@ -657,7 +667,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</stri | @@ -657,7 +667,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</stri | ||
| 657 | </property> | 667 | </property> |
| 658 | <property name="styleSheet"> | 668 | <property name="styleSheet"> |
| 659 | <string notr="true">QPushButton { background-image: url(:/images/manual_button/back.png); } | 669 | <string notr="true">QPushButton { background-image: url(:/images/manual_button/back.png); } |
| 660 | -QPushButton:pressed { background-image: url(:/images/manual_button/back_ov.png); }</string> | 670 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/back_ov.png); }</string> |
| 661 | </property> | 671 | </property> |
| 662 | <property name="text"> | 672 | <property name="text"> |
| 663 | <string>이전으로</string> | 673 | <string>이전으로</string> |
| @@ -1004,6 +1014,9 @@ QPushButton:pressed { background-image: url(:/images/manual_button/back_ov.png); | @@ -1004,6 +1014,9 @@ QPushButton:pressed { background-image: url(:/images/manual_button/back_ov.png); | ||
| 1004 | <height>140</height> | 1014 | <height>140</height> |
| 1005 | </rect> | 1015 | </rect> |
| 1006 | </property> | 1016 | </property> |
| 1017 | + <property name="focusPolicy"> | ||
| 1018 | + <enum>Qt::ClickFocus</enum> | ||
| 1019 | + </property> | ||
| 1007 | </widget> | 1020 | </widget> |
| 1008 | </widget> | 1021 | </widget> |
| 1009 | <customwidgets> | 1022 | <customwidgets> |
| @@ -1014,6 +1027,12 @@ QPushButton:pressed { background-image: url(:/images/manual_button/back_ov.png); | @@ -1014,6 +1027,12 @@ QPushButton:pressed { background-image: url(:/images/manual_button/back_ov.png); | ||
| 1014 | <container>1</container> | 1027 | <container>1</container> |
| 1015 | </customwidget> | 1028 | </customwidget> |
| 1016 | </customwidgets> | 1029 | </customwidgets> |
| 1030 | + <tabstops> | ||
| 1031 | + <tabstop>background</tabstop> | ||
| 1032 | + <tabstop>coreTempButton</tabstop> | ||
| 1033 | + <tabstop>cancelButton</tabstop> | ||
| 1034 | + <tabstop>applyButton</tabstop> | ||
| 1035 | + </tabstops> | ||
| 1017 | <resources> | 1036 | <resources> |
| 1018 | <include location="resources.qrc"/> | 1037 | <include location="resources.qrc"/> |
| 1019 | </resources> | 1038 | </resources> |
app/gui/oven_control/manualcookwindow.cpp
| @@ -125,6 +125,27 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | @@ -125,6 +125,27 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | ||
| 125 | showCurrentTempTimer.setInterval(1000); | 125 | showCurrentTempTimer.setInterval(1000); |
| 126 | connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); | 126 | connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); |
| 127 | 127 | ||
| 128 | + focusHumidityButtonTimer.setSingleShot(true); | ||
| 129 | + focusHumidityButtonTimer.setInterval(3000); | ||
| 130 | + connect(&focusHumidityButtonTimer, SIGNAL(timeout()), SLOT(focusHumidityButton())); | ||
| 131 | + | ||
| 132 | + focusTempButtonTimer.setSingleShot(true); | ||
| 133 | + focusTempButtonTimer.setInterval(3000); | ||
| 134 | + connect(&focusTempButtonTimer, SIGNAL(timeout()), SLOT(focusTempButton())); | ||
| 135 | + | ||
| 136 | + focusTimeButtonTimer.setSingleShot(true); | ||
| 137 | + focusTimeButtonTimer.setInterval(3000); | ||
| 138 | + connect(&focusTimeButtonTimer, SIGNAL(timeout()), SLOT(focusTimeButton())); | ||
| 139 | + | ||
| 140 | + focusInterTempButtonTimer.setSingleShot(true); | ||
| 141 | + focusInterTempButtonTimer.setInterval(3000); | ||
| 142 | + connect(&focusInterTempButtonTimer, SIGNAL(timeout()), SLOT(focusInterTempButton())); | ||
| 143 | + | ||
| 144 | + connect(ui->humiditySlider, SIGNAL(sliderMoved(int)), &focusHumidityButtonTimer, SLOT(start())); | ||
| 145 | + connect(ui->tempSlider, SIGNAL(sliderMoved(int)), &focusTempButtonTimer, SLOT(start())); | ||
| 146 | + connect(ui->timeSlider, SIGNAL(sliderMoved(int)), &focusTimeButtonTimer, SLOT(start())); | ||
| 147 | + connect(ui->interTempSlider, SIGNAL(sliderMoved(int)), &focusInterTempButtonTimer, SLOT(start())); | ||
| 148 | + | ||
| 128 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); | 149 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); |
| 129 | oven->setDefault(mode); | 150 | oven->setDefault(mode); |
| 130 | 151 | ||
| @@ -135,6 +156,8 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | @@ -135,6 +156,8 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | ||
| 135 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 156 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 136 | 157 | ||
| 137 | QTimer::singleShot(0, this, SLOT(setupAnimation())); | 158 | QTimer::singleShot(0, this, SLOT(setupAnimation())); |
| 159 | + | ||
| 160 | + setFocus(); | ||
| 138 | } | 161 | } |
| 139 | 162 | ||
| 140 | ManualCookWindow::ManualCookWindow(QWidget *parent, ManualCookSetting setting) | 163 | ManualCookWindow::ManualCookWindow(QWidget *parent, ManualCookSetting setting) |
| @@ -159,6 +182,55 @@ ManualCookWindow::~ManualCookWindow() | @@ -159,6 +182,55 @@ ManualCookWindow::~ManualCookWindow() | ||
| 159 | delete ui; | 182 | delete ui; |
| 160 | } | 183 | } |
| 161 | 184 | ||
| 185 | +void ManualCookWindow::keyPressEvent(QKeyEvent *event) | ||
| 186 | +{ | ||
| 187 | + switch (event->key()) | ||
| 188 | + { | ||
| 189 | + case 0x01000030: // Turn left | ||
| 190 | + onEncoderLeft(); | ||
| 191 | + break; | ||
| 192 | + case 0x01000031: // Push | ||
| 193 | + if (focusWidget() != this) | ||
| 194 | + { | ||
| 195 | + pushed = focusWidget(); | ||
| 196 | + | ||
| 197 | + if (pushed == ui->humidityButton) | ||
| 198 | + on_humidityButton_pressed(); | ||
| 199 | + else if (pushed == ui->tempButton) | ||
| 200 | + on_tempButton_pressed(); | ||
| 201 | + | ||
| 202 | + } | ||
| 203 | + break; | ||
| 204 | + case 0x01000032: // Turn right | ||
| 205 | + onEncoderRight(); | ||
| 206 | + break; | ||
| 207 | + } | ||
| 208 | +} | ||
| 209 | + | ||
| 210 | +void ManualCookWindow::keyReleaseEvent(QKeyEvent *event) | ||
| 211 | +{ | ||
| 212 | + switch (event->key()) | ||
| 213 | + { | ||
| 214 | + case 0x01000030: // Turn left | ||
| 215 | + onEncoderLeft(); | ||
| 216 | + break; | ||
| 217 | + case 0x01000031: // Push | ||
| 218 | + if (focusWidget() == ui->humidityButton) | ||
| 219 | + on_humidityButton_released(); | ||
| 220 | + else if (focusWidget() == ui->tempButton) | ||
| 221 | + on_tempButton_released(); | ||
| 222 | + | ||
| 223 | + if (focusWidget() == pushed) | ||
| 224 | + onEncoderClicked(pushed); | ||
| 225 | + | ||
| 226 | + pushed = NULL; | ||
| 227 | + break; | ||
| 228 | + case 0x01000032: // Turn right | ||
| 229 | + onEncoderRight(); | ||
| 230 | + break; | ||
| 231 | + } | ||
| 232 | +} | ||
| 233 | + | ||
| 162 | void ManualCookWindow::setupAnimation() | 234 | void ManualCookWindow::setupAnimation() |
| 163 | { | 235 | { |
| 164 | ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); | 236 | ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); |
| @@ -178,16 +250,28 @@ void ManualCookWindow::updateView() | @@ -178,16 +250,28 @@ void ManualCookWindow::updateView() | ||
| 178 | switch (oven->mode()) | 250 | switch (oven->mode()) |
| 179 | { | 251 | { |
| 180 | case Define::DryMode: | 252 | case Define::DryMode: |
| 253 | + if (ui->steamButton->isChecked()) | ||
| 254 | + ui->steamButton->setChecked(false); | ||
| 255 | + if (ui->combiButton->isChecked()) | ||
| 256 | + ui->combiButton->setChecked(false); | ||
| 181 | if (!ui->dryheatButton->isChecked()) | 257 | if (!ui->dryheatButton->isChecked()) |
| 182 | ui->dryheatButton->setChecked(true); | 258 | ui->dryheatButton->setChecked(true); |
| 183 | break; | 259 | break; |
| 184 | case Define::SteamMode: | 260 | case Define::SteamMode: |
| 185 | if (!ui->steamButton->isChecked()) | 261 | if (!ui->steamButton->isChecked()) |
| 186 | ui->steamButton->setChecked(true); | 262 | ui->steamButton->setChecked(true); |
| 263 | + if (ui->combiButton->isChecked()) | ||
| 264 | + ui->combiButton->setChecked(false); | ||
| 265 | + if (ui->dryheatButton->isChecked()) | ||
| 266 | + ui->dryheatButton->setChecked(false); | ||
| 187 | break; | 267 | break; |
| 188 | case Define::CombiMode: | 268 | case Define::CombiMode: |
| 269 | + if (ui->steamButton->isChecked()) | ||
| 270 | + ui->steamButton->setChecked(false); | ||
| 189 | if (!ui->combiButton->isChecked()) | 271 | if (!ui->combiButton->isChecked()) |
| 190 | ui->combiButton->setChecked(true); | 272 | ui->combiButton->setChecked(true); |
| 273 | + if (ui->dryheatButton->isChecked()) | ||
| 274 | + ui->dryheatButton->setChecked(false); | ||
| 191 | break; | 275 | break; |
| 192 | default: | 276 | default: |
| 193 | break; | 277 | break; |
| @@ -196,7 +280,7 @@ void ManualCookWindow::updateView() | @@ -196,7 +280,7 @@ void ManualCookWindow::updateView() | ||
| 196 | int humidity; | 280 | int humidity; |
| 197 | if (showCurrentHumidity_) | 281 | if (showCurrentHumidity_) |
| 198 | humidity = oven->currentHumidity(); | 282 | humidity = oven->currentHumidity(); |
| 199 | - else if (ui->humiditySlider->isSliderDown()) | 283 | + else if (ui->humiditySlider->isSliderDown() || focusWidget() == ui->humiditySlider) |
| 200 | humidity = ui->humiditySlider->sliderPosition(); | 284 | humidity = ui->humiditySlider->sliderPosition(); |
| 201 | else | 285 | else |
| 202 | humidity = oven->humidity(); | 286 | humidity = oven->humidity(); |
| @@ -217,7 +301,7 @@ void ManualCookWindow::updateView() | @@ -217,7 +301,7 @@ void ManualCookWindow::updateView() | ||
| 217 | int temp; | 301 | int temp; |
| 218 | if (showCurrentTemp_) | 302 | if (showCurrentTemp_) |
| 219 | temp = oven->currentTemp(); | 303 | temp = oven->currentTemp(); |
| 220 | - else if (ui->tempSlider->isSliderDown()) | 304 | + else if (ui->tempSlider->isSliderDown() || focusWidget() == ui->tempSlider) |
| 221 | temp = ui->tempSlider->sliderPosition(); | 305 | temp = ui->tempSlider->sliderPosition(); |
| 222 | else | 306 | else |
| 223 | temp = oven->temp(); | 307 | temp = oven->temp(); |
| @@ -235,25 +319,21 @@ void ManualCookWindow::updateView() | @@ -235,25 +319,21 @@ void ManualCookWindow::updateView() | ||
| 235 | ui->tempSlider->setValue(temp); | 319 | ui->tempSlider->setValue(temp); |
| 236 | ui->tempSlider->blockSignals(old); | 320 | ui->tempSlider->blockSignals(old); |
| 237 | 321 | ||
| 238 | - int msecs; | ||
| 239 | - if (ui->timeSlider->isSliderDown()) | ||
| 240 | - msecs = sliderToTime(ui->timeSlider->sliderPosition()) * 1000; | 322 | + int msecs = oven->msecs(); |
| 323 | + if (ui->timeSlider->isSliderMoved()) | ||
| 324 | + ui->timeLabel->setText(Stringer::remainingTime(sliderToTime(ui->timeSlider->sliderPosition()) * 1000, Stringer::fontSize14)); | ||
| 241 | else | 325 | else |
| 242 | - msecs = oven->msecs(); | 326 | + ui->timeLabel->setText(Stringer::remainingTime(msecs, Stringer::fontSize14)); |
| 243 | 327 | ||
| 244 | - if (msecs != lastViewTime) | 328 | + if (focusWidget() != ui->timeSlider) |
| 245 | { | 329 | { |
| 246 | - lastViewTime = msecs; | ||
| 247 | - | ||
| 248 | bool old = ui->timeSlider->blockSignals(true); | 330 | bool old = ui->timeSlider->blockSignals(true); |
| 249 | ui->timeSlider->setSliderPosition(timeToSlider(msecs / 1000)); | 331 | ui->timeSlider->setSliderPosition(timeToSlider(msecs / 1000)); |
| 250 | ui->timeSlider->blockSignals(old); | 332 | ui->timeSlider->blockSignals(old); |
| 251 | - | ||
| 252 | - ui->timeLabel->setText(Stringer::remainingTime(msecs, Stringer::fontSize14)); | ||
| 253 | } | 333 | } |
| 254 | 334 | ||
| 255 | int interTemp; | 335 | int interTemp; |
| 256 | - if (ui->interTempSlider->isSliderDown()) | 336 | + if (ui->interTempSlider->isSliderDown() || focusWidget() == ui->interTempSlider) |
| 257 | interTemp = ui->interTempSlider->sliderPosition(); | 337 | interTemp = ui->interTempSlider->sliderPosition(); |
| 258 | else | 338 | else |
| 259 | interTemp = oven->interTemp(); | 339 | interTemp = oven->interTemp(); |
| @@ -264,23 +344,7 @@ void ManualCookWindow::updateView() | @@ -264,23 +344,7 @@ void ManualCookWindow::updateView() | ||
| 264 | if (interTempEnabled != lastViewInterTempEnabled) | 344 | if (interTempEnabled != lastViewInterTempEnabled) |
| 265 | { | 345 | { |
| 266 | lastViewInterTempEnabled = oven->interTempEnabled(); | 346 | lastViewInterTempEnabled = oven->interTempEnabled(); |
| 267 | - | ||
| 268 | - if (interTempEnabled) | ||
| 269 | - ui->interTempButton->setStyleSheet("\ | ||
| 270 | -QPushButton {\ | ||
| 271 | - image: url(:/images/slider_icon/core_temp_enabled.png);\ | ||
| 272 | -}\ | ||
| 273 | -QPushButton:pressed {\ | ||
| 274 | - image: url(:/images/slider_icon/core_temp_ov.png);\ | ||
| 275 | -}"); | ||
| 276 | - else | ||
| 277 | - ui->interTempButton->setStyleSheet("\ | ||
| 278 | -QPushButton {\ | ||
| 279 | - image: url(:/images/slider_icon/core_temp.png);\ | ||
| 280 | -}\ | ||
| 281 | -QPushButton:pressed {\ | ||
| 282 | - image: url(:/images/slider_icon/core_temp_ov.png);\ | ||
| 283 | -}"); | 347 | + ui->interTempButton->setChecked(interTempEnabled); |
| 284 | } | 348 | } |
| 285 | 349 | ||
| 286 | lastViewInterTemp = interTemp; | 350 | lastViewInterTemp = interTemp; |
| @@ -312,32 +376,70 @@ QPushButton:pressed {\ | @@ -312,32 +376,70 @@ QPushButton:pressed {\ | ||
| 312 | "border-image: url(:/images/manual_button/run.png)"); | 376 | "border-image: url(:/images/manual_button/run.png)"); |
| 313 | } | 377 | } |
| 314 | 378 | ||
| 315 | - bool damper = oven->damper(); | ||
| 316 | - if (damper != lastViewDamper) | 379 | + if (showFrontButtons) |
| 317 | { | 380 | { |
| 318 | - lastViewDamper = damper; | ||
| 319 | - | ||
| 320 | - if (damper) | ||
| 321 | - ui->damperButton->setStyleSheet( | ||
| 322 | - "background-image: url(:/images/manual_button/damper_open.png)"); | 381 | + ui->preheatButton->show(); |
| 382 | + ui->damperButton->show(); | ||
| 383 | + ui->humidificationButton->show(); | ||
| 384 | + if (oven->cooking()) | ||
| 385 | + ui->repeatButton->show(); | ||
| 323 | else | 386 | else |
| 324 | - ui->damperButton->setStyleSheet( | ||
| 325 | - "background-image: url(:/images/manual_button/damper_close.png)"); | ||
| 326 | - } | 387 | + ui->repeatButton->hide(); |
| 327 | 388 | ||
| 328 | - bool humidification = oven->humidification(); | ||
| 329 | - if (humidification != lastViewHumidification) | 389 | + ui->cooldownButton->hide(); |
| 390 | + ui->fanButton->hide(); | ||
| 391 | + ui->reserveButton->hide(); | ||
| 392 | + ui->favoriteButton->hide(); | ||
| 393 | + } | ||
| 394 | + else | ||
| 330 | { | 395 | { |
| 331 | - lastViewHumidification = humidification; | 396 | + ui->preheatButton->hide(); |
| 397 | + ui->damperButton->hide(); | ||
| 398 | + ui->humidificationButton->hide(); | ||
| 399 | + ui->repeatButton->hide(); | ||
| 332 | 400 | ||
| 333 | - if (humidification) | ||
| 334 | - ui->humidificationButton->setStyleSheet( | ||
| 335 | - "background-image: url(:/images/manual_button/side_nozzle_open.png)"); | 401 | + ui->cooldownButton->show(); |
| 402 | + ui->fanButton->show(); | ||
| 403 | + if (oven->cooking()) | ||
| 404 | + { | ||
| 405 | + ui->reserveButton->hide(); | ||
| 406 | + ui->favoriteButton->hide(); | ||
| 407 | + } | ||
| 336 | else | 408 | else |
| 337 | - ui->humidificationButton->setStyleSheet( | ||
| 338 | - "background-image: url(:/images/manual_button/side_nozzle_close.png)"); | 409 | + { |
| 410 | + ui->reserveButton->show(); | ||
| 411 | + ui->favoriteButton->show(); | ||
| 412 | + } | ||
| 339 | } | 413 | } |
| 340 | 414 | ||
| 415 | + bool damper = oven->damper(); | ||
| 416 | + ui->damperButton->setChecked(damper); | ||
| 417 | +// if (damper != lastViewDamper) | ||
| 418 | +// { | ||
| 419 | +// lastViewDamper = damper; | ||
| 420 | + | ||
| 421 | +// if (damper) | ||
| 422 | +// ui->damperButton->setStyleSheet( | ||
| 423 | +// "background-image: url(:/images/manual_button/damper_open.png)"); | ||
| 424 | +// else | ||
| 425 | +// ui->damperButton->setStyleSheet( | ||
| 426 | +// "background-image: url(:/images/manual_button/damper_close.png)"); | ||
| 427 | +// } | ||
| 428 | + | ||
| 429 | + bool humidification = oven->humidification(); | ||
| 430 | + ui->humidificationButton->setChecked(humidification); | ||
| 431 | +// if (humidification != lastViewHumidification) | ||
| 432 | +// { | ||
| 433 | +// lastViewHumidification = humidification; | ||
| 434 | + | ||
| 435 | +// if (humidification) | ||
| 436 | +// ui->humidificationButton->setStyleSheet( | ||
| 437 | +// "background-image: url(:/images/manual_button/side_nozzle_open.png)"); | ||
| 438 | +// else | ||
| 439 | +// ui->humidificationButton->setStyleSheet( | ||
| 440 | +// "background-image: url(:/images/manual_button/side_nozzle_close.png)"); | ||
| 441 | +// } | ||
| 442 | + | ||
| 341 | int fan = oven->fan(); | 443 | int fan = oven->fan(); |
| 342 | if (fan != lastViewFan) | 444 | if (fan != lastViewFan) |
| 343 | { | 445 | { |
| @@ -376,20 +478,6 @@ QPushButton:pressed {\ | @@ -376,20 +478,6 @@ QPushButton:pressed {\ | ||
| 376 | ui->upperStack->setCurrentIndex(1); | 478 | ui->upperStack->setCurrentIndex(1); |
| 377 | else | 479 | else |
| 378 | ui->upperStack->setCurrentIndex(0); | 480 | ui->upperStack->setCurrentIndex(0); |
| 379 | - | ||
| 380 | - if (oven->cooking()) | ||
| 381 | - { | ||
| 382 | - ui->reserveButton->hide(); | ||
| 383 | - ui->favoriteButton->hide(); | ||
| 384 | - ui->repeatButton->show(); | ||
| 385 | - } | ||
| 386 | - else | ||
| 387 | - { | ||
| 388 | - ui->reserveButton->show(); | ||
| 389 | - ui->favoriteButton->show(); | ||
| 390 | - ui->repeatButton->hide(); | ||
| 391 | - } | ||
| 392 | - | ||
| 393 | } | 481 | } |
| 394 | 482 | ||
| 395 | void ManualCookWindow::showCurrentHumidity() | 483 | void ManualCookWindow::showCurrentHumidity() |
| @@ -588,6 +676,159 @@ void ManualCookWindow::onMonitor3Timeout() | @@ -588,6 +676,159 @@ void ManualCookWindow::onMonitor3Timeout() | ||
| 588 | close(); | 676 | close(); |
| 589 | } | 677 | } |
| 590 | 678 | ||
| 679 | +void ManualCookWindow::onEncoderLeft() | ||
| 680 | +{ | ||
| 681 | + QWidget *focused = focusWidget(); | ||
| 682 | + if (focused == NULL) | ||
| 683 | + focusPreviousChild(); | ||
| 684 | + else if (focused == this || focused->inherits("QPushButton")) | ||
| 685 | + { | ||
| 686 | + focusPreviousChild(); | ||
| 687 | + focused = focusWidget(); | ||
| 688 | + | ||
| 689 | + if (focused == ui->steamButton) | ||
| 690 | + { | ||
| 691 | + if (oven->mode() == Define::SteamMode) | ||
| 692 | + focusPreviousChild(); | ||
| 693 | + } | ||
| 694 | + else if (focused == ui->combiButton) | ||
| 695 | + { | ||
| 696 | + if (oven->mode() == Define::CombiMode) | ||
| 697 | + focusPreviousChild(); | ||
| 698 | + } | ||
| 699 | + else if (focused == ui->dryheatButton) | ||
| 700 | + { | ||
| 701 | + if (oven->mode() == Define::DryMode) | ||
| 702 | + focusPreviousChild(); | ||
| 703 | + } | ||
| 704 | + } | ||
| 705 | +} | ||
| 706 | + | ||
| 707 | +void ManualCookWindow::onEncoderRight() | ||
| 708 | +{ | ||
| 709 | + QWidget *focused = focusWidget(); | ||
| 710 | + if (focused == NULL) | ||
| 711 | + focusNextChild(); | ||
| 712 | + else if (focused == this) | ||
| 713 | + { | ||
| 714 | + switch (oven->mode()) | ||
| 715 | + { | ||
| 716 | + case Define::DryMode: | ||
| 717 | + case Define::SteamMode: | ||
| 718 | + ui->tempButton->setFocus(); | ||
| 719 | + break; | ||
| 720 | + default: | ||
| 721 | + ui->humidityButton->setFocus(); | ||
| 722 | + } | ||
| 723 | + } | ||
| 724 | + else if (focused->inherits("QPushButton")) | ||
| 725 | + { | ||
| 726 | + focusNextChild(); | ||
| 727 | + focused = focusWidget(); | ||
| 728 | + | ||
| 729 | + if (focused == ui->steamButton) | ||
| 730 | + { | ||
| 731 | + if (oven->mode() == Define::SteamMode) | ||
| 732 | + focusNextChild(); | ||
| 733 | + } | ||
| 734 | + else if (focused == ui->combiButton) | ||
| 735 | + { | ||
| 736 | + if (oven->mode() == Define::CombiMode) | ||
| 737 | + focusNextChild(); | ||
| 738 | + } | ||
| 739 | + else if (focused == ui->dryheatButton) | ||
| 740 | + { | ||
| 741 | + if (oven->mode() == Define::DryMode) | ||
| 742 | + focusNextChild(); | ||
| 743 | + } | ||
| 744 | + } | ||
| 745 | +} | ||
| 746 | + | ||
| 747 | +void ManualCookWindow::onEncoderClicked(QWidget *clicked) | ||
| 748 | +{ | ||
| 749 | + QWidget *focused = clicked; | ||
| 750 | + if (focused == NULL) | ||
| 751 | + return; | ||
| 752 | + | ||
| 753 | + if (focused->inherits("QPushButton")) | ||
| 754 | + { | ||
| 755 | + QPushButton *pb = qobject_cast<QPushButton *>(focused); | ||
| 756 | + if (pb) | ||
| 757 | + { | ||
| 758 | + pb->click(); | ||
| 759 | + | ||
| 760 | + if (pb == ui->steamButton || pb == ui->dryheatButton) | ||
| 761 | + ui->tempButton->setFocus(); | ||
| 762 | + else if (pb == ui->combiButton) | ||
| 763 | + ui->humidityButton->setFocus(); | ||
| 764 | + } | ||
| 765 | + } | ||
| 766 | + else if (focused->inherits("Slider")) | ||
| 767 | + { | ||
| 768 | + Slider *slider = qobject_cast<Slider *>(focused); | ||
| 769 | + if (slider) | ||
| 770 | + { | ||
| 771 | + if (slider->value() != slider->sliderPosition()) | ||
| 772 | + slider->setValue(slider->sliderPosition()); | ||
| 773 | + | ||
| 774 | + if (slider == ui->humiditySlider) | ||
| 775 | + ui->humidityButton->setFocus(); | ||
| 776 | + else if (slider == ui->tempSlider) | ||
| 777 | + ui->tempButton->setFocus(); | ||
| 778 | + else if (slider == ui->timeSlider) | ||
| 779 | + ui->timeButton->setFocus(); | ||
| 780 | + else if (slider == ui->interTempSlider) | ||
| 781 | + ui->interTempButton->setFocus(); | ||
| 782 | + } | ||
| 783 | + } | ||
| 784 | +} | ||
| 785 | + | ||
| 786 | +void ManualCookWindow::focusHumidityButton() | ||
| 787 | +{ | ||
| 788 | + if (focusWidget() == ui->humiditySlider) | ||
| 789 | + { | ||
| 790 | + oven->setHumidity(ui->humiditySlider->value()); | ||
| 791 | + ui->humidityButton->setFocus(); | ||
| 792 | + } | ||
| 793 | +} | ||
| 794 | + | ||
| 795 | +void ManualCookWindow::focusTempButton() | ||
| 796 | +{ | ||
| 797 | + if (focusWidget() == ui->tempSlider) | ||
| 798 | + { | ||
| 799 | + oven->setTemp(ui->tempSlider->value()); | ||
| 800 | + ui->tempButton->setFocus(); | ||
| 801 | + } | ||
| 802 | +} | ||
| 803 | + | ||
| 804 | +void ManualCookWindow::focusTimeButton() | ||
| 805 | +{ | ||
| 806 | + if (focusWidget() == ui->timeSlider) | ||
| 807 | + { | ||
| 808 | + if (ui->timeSlider->isSliderMoved()) | ||
| 809 | + oven->setTime(sliderToTime(ui->timeSlider->value())); | ||
| 810 | + ui->timeButton->setFocus(); | ||
| 811 | + } | ||
| 812 | +} | ||
| 813 | + | ||
| 814 | +void ManualCookWindow::focusInterTempButton() | ||
| 815 | +{ | ||
| 816 | + if (focusWidget() == ui->interTempSlider) | ||
| 817 | + { | ||
| 818 | + oven->setInterTemp(ui->interTempSlider->value()); | ||
| 819 | + ui->interTempButton->setFocus(); | ||
| 820 | + } | ||
| 821 | +} | ||
| 822 | + | ||
| 823 | +void ManualCookWindow::focusAgain() | ||
| 824 | +{ | ||
| 825 | + if (focused) | ||
| 826 | + { | ||
| 827 | + focused->setFocus(); | ||
| 828 | + focused = NULL; | ||
| 829 | + } | ||
| 830 | +} | ||
| 831 | + | ||
| 591 | void ManualCookWindow::on_steamButton_clicked() | 832 | void ManualCookWindow::on_steamButton_clicked() |
| 592 | { | 833 | { |
| 593 | setOvenDefault(Define::SteamMode); | 834 | setOvenDefault(Define::SteamMode); |
| @@ -629,6 +870,27 @@ void ManualCookWindow::on_tempButton_released() | @@ -629,6 +870,27 @@ void ManualCookWindow::on_tempButton_released() | ||
| 629 | hideCurrentTemp(); | 870 | hideCurrentTemp(); |
| 630 | } | 871 | } |
| 631 | 872 | ||
| 873 | +void ManualCookWindow::on_humidityButton_clicked() | ||
| 874 | +{ | ||
| 875 | + ui->humiditySlider->setFocus(); | ||
| 876 | + | ||
| 877 | + focusHumidityButtonTimer.start(); | ||
| 878 | +} | ||
| 879 | + | ||
| 880 | +void ManualCookWindow::on_tempButton_clicked() | ||
| 881 | +{ | ||
| 882 | + ui->tempSlider->setFocus(); | ||
| 883 | + | ||
| 884 | + focusTempButtonTimer.start(); | ||
| 885 | +} | ||
| 886 | + | ||
| 887 | +void ManualCookWindow::on_timeButton_clicked() | ||
| 888 | +{ | ||
| 889 | + ui->timeSlider->setFocus(); | ||
| 890 | + | ||
| 891 | + focusTimeButtonTimer.start(); | ||
| 892 | +} | ||
| 893 | + | ||
| 632 | void ManualCookWindow::on_interTempButton_clicked() | 894 | void ManualCookWindow::on_interTempButton_clicked() |
| 633 | { | 895 | { |
| 634 | if (oven->interTempEnabled()) | 896 | if (oven->interTempEnabled()) |
| @@ -637,6 +899,9 @@ void ManualCookWindow::on_interTempButton_clicked() | @@ -637,6 +899,9 @@ void ManualCookWindow::on_interTempButton_clicked() | ||
| 637 | { | 899 | { |
| 638 | CoreTempSettingPopup *p = new CoreTempSettingPopup(this); | 900 | CoreTempSettingPopup *p = new CoreTempSettingPopup(this); |
| 639 | p->show(); | 901 | p->show(); |
| 902 | + | ||
| 903 | + focused = ui->interTempButton; | ||
| 904 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 640 | } | 905 | } |
| 641 | } | 906 | } |
| 642 | 907 | ||
| @@ -664,6 +929,9 @@ void ManualCookWindow::on_preheatButton_clicked() | @@ -664,6 +929,9 @@ void ManualCookWindow::on_preheatButton_clicked() | ||
| 664 | PreheatPopup *p = new PreheatPopup(this, oven); | 929 | PreheatPopup *p = new PreheatPopup(this, oven); |
| 665 | p->setWindowModality(Qt::WindowModal); | 930 | p->setWindowModality(Qt::WindowModal); |
| 666 | p->showFullScreen(); | 931 | p->showFullScreen(); |
| 932 | + | ||
| 933 | + focused = ui->preheatButton; | ||
| 934 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 667 | } | 935 | } |
| 668 | 936 | ||
| 669 | void ManualCookWindow::on_damperButton_clicked() | 937 | void ManualCookWindow::on_damperButton_clicked() |
| @@ -713,6 +981,9 @@ void ManualCookWindow::on_cooldownButton_clicked() | @@ -713,6 +981,9 @@ void ManualCookWindow::on_cooldownButton_clicked() | ||
| 713 | CooldownPopup *p = new CooldownPopup(this, oven); | 981 | CooldownPopup *p = new CooldownPopup(this, oven); |
| 714 | p->setWindowModality(Qt::WindowModal); | 982 | p->setWindowModality(Qt::WindowModal); |
| 715 | p->showFullScreen(); | 983 | p->showFullScreen(); |
| 984 | + | ||
| 985 | + focused = ui->cooldownButton; | ||
| 986 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 716 | } | 987 | } |
| 717 | 988 | ||
| 718 | void ManualCookWindow::on_reserveButton_clicked() | 989 | void ManualCookWindow::on_reserveButton_clicked() |
| @@ -725,6 +996,9 @@ void ManualCookWindow::on_reserveButton_clicked() | @@ -725,6 +996,9 @@ void ManualCookWindow::on_reserveButton_clicked() | ||
| 725 | connect(p, SIGNAL(timeout()), SLOT(start())); | 996 | connect(p, SIGNAL(timeout()), SLOT(start())); |
| 726 | connect(p, SIGNAL(canceled()), &startCookingTimer, SLOT(start())); | 997 | connect(p, SIGNAL(canceled()), &startCookingTimer, SLOT(start())); |
| 727 | p->showFullScreen(); | 998 | p->showFullScreen(); |
| 999 | + | ||
| 1000 | + focused = ui->reserveButton; | ||
| 1001 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 728 | } | 1002 | } |
| 729 | } | 1003 | } |
| 730 | 1004 | ||
| @@ -736,6 +1010,8 @@ void ManualCookWindow::on_favoriteButton_clicked() | @@ -736,6 +1010,8 @@ void ManualCookWindow::on_favoriteButton_clicked() | ||
| 736 | ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); | 1010 | ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); |
| 737 | p->showFullScreen(); | 1011 | p->showFullScreen(); |
| 738 | 1012 | ||
| 1013 | + focused = ui->favoriteButton; | ||
| 1014 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 739 | connect(p, SIGNAL(accepted()), SLOT(addFavorite())); | 1015 | connect(p, SIGNAL(accepted()), SLOT(addFavorite())); |
| 740 | 1016 | ||
| 741 | if (startCookingTimer.isActive()) | 1017 | if (startCookingTimer.isActive()) |
| @@ -745,14 +1021,11 @@ void ManualCookWindow::on_favoriteButton_clicked() | @@ -745,14 +1021,11 @@ void ManualCookWindow::on_favoriteButton_clicked() | ||
| 745 | } | 1021 | } |
| 746 | } | 1022 | } |
| 747 | 1023 | ||
| 748 | -void ManualCookWindow::on_goBackStackButton_clicked() | ||
| 749 | -{ | ||
| 750 | - ui->buttonStack->setCurrentIndex(1); | ||
| 751 | -} | ||
| 752 | - | ||
| 753 | void ManualCookWindow::on_goFrontStackButton_clicked() | 1024 | void ManualCookWindow::on_goFrontStackButton_clicked() |
| 754 | { | 1025 | { |
| 755 | - ui->buttonStack->setCurrentIndex(0); | 1026 | + showFrontButtons = !showFrontButtons; |
| 1027 | + | ||
| 1028 | + updateView(); | ||
| 756 | } | 1029 | } |
| 757 | 1030 | ||
| 758 | void ManualCookWindow::on_backButton_clicked() | 1031 | void ManualCookWindow::on_backButton_clicked() |
| @@ -769,6 +1042,9 @@ void ManualCookWindow::on_configButton_clicked() | @@ -769,6 +1042,9 @@ void ManualCookWindow::on_configButton_clicked() | ||
| 769 | p->showFullScreen(); | 1042 | p->showFullScreen(); |
| 770 | 1043 | ||
| 771 | connect(p, SIGNAL(accepted()), SLOT(jumpConfig())); | 1044 | connect(p, SIGNAL(accepted()), SLOT(jumpConfig())); |
| 1045 | + | ||
| 1046 | + focused = ui->configButton; | ||
| 1047 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 772 | } | 1048 | } |
| 773 | else | 1049 | else |
| 774 | { | 1050 | { |
| @@ -789,6 +1065,9 @@ void ManualCookWindow::on_favoritesButton_clicked() | @@ -789,6 +1065,9 @@ void ManualCookWindow::on_favoritesButton_clicked() | ||
| 789 | p->showFullScreen(); | 1065 | p->showFullScreen(); |
| 790 | 1066 | ||
| 791 | connect(p, SIGNAL(accepted()), SLOT(jumpFavorites())); | 1067 | connect(p, SIGNAL(accepted()), SLOT(jumpFavorites())); |
| 1068 | + | ||
| 1069 | + focused = ui->favoritesButton; | ||
| 1070 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 792 | } | 1071 | } |
| 793 | else | 1072 | else |
| 794 | { | 1073 | { |
| @@ -810,6 +1089,9 @@ void ManualCookWindow::on_washButton_clicked() | @@ -810,6 +1089,9 @@ void ManualCookWindow::on_washButton_clicked() | ||
| 810 | p->showFullScreen(); | 1089 | p->showFullScreen(); |
| 811 | 1090 | ||
| 812 | connect(p, SIGNAL(accepted()), SLOT(jumpWash())); | 1091 | connect(p, SIGNAL(accepted()), SLOT(jumpWash())); |
| 1092 | + | ||
| 1093 | + focused = ui->washButton; | ||
| 1094 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(focusAgain())); | ||
| 813 | } | 1095 | } |
| 814 | else | 1096 | else |
| 815 | { | 1097 | { |
| @@ -844,8 +1126,8 @@ int ManualCookWindow::sliderToTime(int value) | @@ -844,8 +1126,8 @@ int ManualCookWindow::sliderToTime(int value) | ||
| 844 | int ManualCookWindow::timeToSlider(int secs) | 1126 | int ManualCookWindow::timeToSlider(int secs) |
| 845 | { | 1127 | { |
| 846 | if (secs <= 180 * 60) | 1128 | if (secs <= 180 * 60) |
| 847 | - return secs / 60; | 1129 | + return qCeil((qreal) secs / 60); |
| 848 | if (secs <= 360 * 60) | 1130 | if (secs <= 360 * 60) |
| 849 | - return 180 + (secs - 180 * 60) / 2 / 60; | ||
| 850 | - return 270 + (secs - 360 * 60) / 15 / 60; | 1131 | + return 180 + qCeil((qreal) (secs - 180 * 60) / 2 / 60); |
| 1132 | + return 270 + qCeil((qreal) (secs - 360 * 60) / 15 / 60); | ||
| 851 | } | 1133 | } |
app/gui/oven_control/manualcookwindow.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define MANUALCOOKWINDOW_H | 2 | #define MANUALCOOKWINDOW_H |
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | +#include <QKeyEvent> | ||
| 5 | 6 | ||
| 6 | #include "oven.h" | 7 | #include "oven.h" |
| 7 | #include "udphandler.h" | 8 | #include "udphandler.h" |
| @@ -20,6 +21,10 @@ public: | @@ -20,6 +21,10 @@ public: | ||
| 20 | explicit ManualCookWindow(QWidget *parent, ManualCookSetting setting); | 21 | explicit ManualCookWindow(QWidget *parent, ManualCookSetting setting); |
| 21 | ~ManualCookWindow(); | 22 | ~ManualCookWindow(); |
| 22 | 23 | ||
| 24 | +protected: | ||
| 25 | + void keyPressEvent(QKeyEvent *event); | ||
| 26 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 27 | + | ||
| 23 | signals: | 28 | signals: |
| 24 | void cookStopRequested(); | 29 | void cookStopRequested(); |
| 25 | 30 | ||
| @@ -47,6 +52,16 @@ private slots: | @@ -47,6 +52,16 @@ private slots: | ||
| 47 | void onMonitor2Timeout(); | 52 | void onMonitor2Timeout(); |
| 48 | void onMonitor3Timeout(); | 53 | void onMonitor3Timeout(); |
| 49 | 54 | ||
| 55 | + void onEncoderLeft(); | ||
| 56 | + void onEncoderRight(); | ||
| 57 | + void onEncoderClicked(QWidget *clicked); | ||
| 58 | + | ||
| 59 | + void focusHumidityButton(); | ||
| 60 | + void focusTempButton(); | ||
| 61 | + void focusTimeButton(); | ||
| 62 | + void focusInterTempButton(); | ||
| 63 | + void focusAgain(); | ||
| 64 | + | ||
| 50 | void on_steamButton_clicked(); | 65 | void on_steamButton_clicked(); |
| 51 | void on_combiButton_clicked(); | 66 | void on_combiButton_clicked(); |
| 52 | void on_dryheatButton_clicked(); | 67 | void on_dryheatButton_clicked(); |
| @@ -55,6 +70,10 @@ private slots: | @@ -55,6 +70,10 @@ private slots: | ||
| 55 | void on_humidityButton_released(); | 70 | void on_humidityButton_released(); |
| 56 | void on_tempButton_pressed(); | 71 | void on_tempButton_pressed(); |
| 57 | void on_tempButton_released(); | 72 | void on_tempButton_released(); |
| 73 | + | ||
| 74 | + void on_humidityButton_clicked(); | ||
| 75 | + void on_tempButton_clicked(); | ||
| 76 | + void on_timeButton_clicked(); | ||
| 58 | void on_interTempButton_clicked(); | 77 | void on_interTempButton_clicked(); |
| 59 | 78 | ||
| 60 | void on_runStopButton_clicked(); | 79 | void on_runStopButton_clicked(); |
| @@ -66,7 +85,6 @@ private slots: | @@ -66,7 +85,6 @@ private slots: | ||
| 66 | void on_cooldownButton_clicked(); | 85 | void on_cooldownButton_clicked(); |
| 67 | void on_reserveButton_clicked(); | 86 | void on_reserveButton_clicked(); |
| 68 | void on_favoriteButton_clicked(); | 87 | void on_favoriteButton_clicked(); |
| 69 | - void on_goBackStackButton_clicked(); | ||
| 70 | void on_goFrontStackButton_clicked(); | 88 | void on_goFrontStackButton_clicked(); |
| 71 | 89 | ||
| 72 | void on_backButton_clicked(); | 90 | void on_backButton_clicked(); |
| @@ -77,6 +95,8 @@ private slots: | @@ -77,6 +95,8 @@ private slots: | ||
| 77 | 95 | ||
| 78 | void on_timeSlider_valueChanged(); | 96 | void on_timeSlider_valueChanged(); |
| 79 | 97 | ||
| 98 | + | ||
| 99 | + | ||
| 80 | private: | 100 | private: |
| 81 | Ui::ManualCookWindow *ui; | 101 | Ui::ManualCookWindow *ui; |
| 82 | Oven *oven; | 102 | Oven *oven; |
| @@ -105,6 +125,8 @@ private: | @@ -105,6 +125,8 @@ private: | ||
| 105 | bool lastViewHumidification; | 125 | bool lastViewHumidification; |
| 106 | int lastViewFan; | 126 | int lastViewFan; |
| 107 | 127 | ||
| 128 | + bool showFrontButtons = true; | ||
| 129 | + | ||
| 108 | int monitorLevel; | 130 | int monitorLevel; |
| 109 | QTimer monitor1; | 131 | QTimer monitor1; |
| 110 | QTimer monitor2; | 132 | QTimer monitor2; |
| @@ -117,6 +139,14 @@ private: | @@ -117,6 +139,14 @@ private: | ||
| 117 | 139 | ||
| 118 | int sliderToTime(int value); | 140 | int sliderToTime(int value); |
| 119 | int timeToSlider(int secs); | 141 | int timeToSlider(int secs); |
| 142 | + | ||
| 143 | + QWidget *pushed = NULL; | ||
| 144 | + QWidget *focused = NULL; | ||
| 145 | + | ||
| 146 | + QTimer focusHumidityButtonTimer; | ||
| 147 | + QTimer focusTempButtonTimer; | ||
| 148 | + QTimer focusTimeButtonTimer; | ||
| 149 | + QTimer focusInterTempButtonTimer; | ||
| 120 | }; | 150 | }; |
| 121 | 151 | ||
| 122 | #endif // MANUALCOOKWINDOW_H | 152 | #endif // MANUALCOOKWINDOW_H |
app/gui/oven_control/manualcookwindow.ui
| @@ -41,6 +41,12 @@ background-position: center; | @@ -41,6 +41,12 @@ background-position: center; | ||
| 41 | border: none; | 41 | border: none; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | +QPushButton[style="tool"] { | ||
| 45 | +border: none; | ||
| 46 | +background-repeat: no-repeat; | ||
| 47 | +background-position: center; | ||
| 48 | +} | ||
| 49 | + | ||
| 44 | QSlider::groove { | 50 | QSlider::groove { |
| 45 | background-image: url(:/images/slider/groove_ticks.png); | 51 | background-image: url(:/images/slider/groove_ticks.png); |
| 46 | background-repeat: no-repeat; | 52 | background-repeat: no-repeat; |
| @@ -133,8 +139,8 @@ height: 33px; | @@ -133,8 +139,8 @@ height: 33px; | ||
| 133 | </property> | 139 | </property> |
| 134 | <property name="styleSheet"> | 140 | <property name="styleSheet"> |
| 135 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_combi_hide.png); } | 141 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_combi_hide.png); } |
| 136 | -QPushButton:pressed { background-image: url(:/images/cook_mode/big_combi_ov.png); } | ||
| 137 | -QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); }</string> | 142 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } |
| 143 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cook_mode/big_combi_ov.png); }</string> | ||
| 138 | </property> | 144 | </property> |
| 139 | <property name="text"> | 145 | <property name="text"> |
| 140 | <string>콤비</string> | 146 | <string>콤비</string> |
| @@ -143,7 +149,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | @@ -143,7 +149,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | ||
| 143 | <bool>true</bool> | 149 | <bool>true</bool> |
| 144 | </property> | 150 | </property> |
| 145 | <property name="autoExclusive"> | 151 | <property name="autoExclusive"> |
| 146 | - <bool>true</bool> | 152 | + <bool>false</bool> |
| 147 | </property> | 153 | </property> |
| 148 | <property name="style" stdset="0"> | 154 | <property name="style" stdset="0"> |
| 149 | <string notr="true">mode</string> | 155 | <string notr="true">mode</string> |
| @@ -160,8 +166,8 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | @@ -160,8 +166,8 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | ||
| 160 | </property> | 166 | </property> |
| 161 | <property name="styleSheet"> | 167 | <property name="styleSheet"> |
| 162 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_steam_hide.png); } | 168 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_steam_hide.png); } |
| 163 | -QPushButton:pressed { background-image: url(:/images/cook_mode/big_steam_ov.png); } | ||
| 164 | -QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); }</string> | 169 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } |
| 170 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cook_mode/big_steam_ov.png); }</string> | ||
| 165 | </property> | 171 | </property> |
| 166 | <property name="text"> | 172 | <property name="text"> |
| 167 | <string>스팀</string> | 173 | <string>스팀</string> |
| @@ -170,7 +176,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | @@ -170,7 +176,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | ||
| 170 | <bool>true</bool> | 176 | <bool>true</bool> |
| 171 | </property> | 177 | </property> |
| 172 | <property name="autoExclusive"> | 178 | <property name="autoExclusive"> |
| 173 | - <bool>true</bool> | 179 | + <bool>false</bool> |
| 174 | </property> | 180 | </property> |
| 175 | <property name="style" stdset="0"> | 181 | <property name="style" stdset="0"> |
| 176 | <string notr="true">mode</string> | 182 | <string notr="true">mode</string> |
| @@ -187,8 +193,8 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | @@ -187,8 +193,8 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | ||
| 187 | </property> | 193 | </property> |
| 188 | <property name="styleSheet"> | 194 | <property name="styleSheet"> |
| 189 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_dryheat_hide.png); } | 195 | <string notr="true">QPushButton { background-image: url(:/images/cook_mode/big_dryheat_hide.png); } |
| 190 | -QPushButton:pressed { background-image: url(:/images/cook_mode/big_dryheat_ov.png); } | ||
| 191 | -QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); }</string> | 196 | +QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); } |
| 197 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cook_mode/big_dryheat_ov.png); }</string> | ||
| 192 | </property> | 198 | </property> |
| 193 | <property name="text"> | 199 | <property name="text"> |
| 194 | <string>건열</string> | 200 | <string>건열</string> |
| @@ -197,7 +203,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | @@ -197,7 +203,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | ||
| 197 | <bool>true</bool> | 203 | <bool>true</bool> |
| 198 | </property> | 204 | </property> |
| 199 | <property name="autoExclusive"> | 205 | <property name="autoExclusive"> |
| 200 | - <bool>true</bool> | 206 | + <bool>false</bool> |
| 201 | </property> | 207 | </property> |
| 202 | <property name="style" stdset="0"> | 208 | <property name="style" stdset="0"> |
| 203 | <string notr="true">mode</string> | 209 | <string notr="true">mode</string> |
| @@ -223,7 +229,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | @@ -223,7 +229,7 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | ||
| 223 | </property> | 229 | </property> |
| 224 | <property name="styleSheet"> | 230 | <property name="styleSheet"> |
| 225 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } | 231 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } |
| 226 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</string> | 232 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> |
| 227 | </property> | 233 | </property> |
| 228 | <property name="text"> | 234 | <property name="text"> |
| 229 | <string/> | 235 | <string/> |
| @@ -240,7 +246,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | @@ -240,7 +246,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | ||
| 240 | </property> | 246 | </property> |
| 241 | <property name="styleSheet"> | 247 | <property name="styleSheet"> |
| 242 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } | 248 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } |
| 243 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</string> | 249 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/config_ov.png); }</string> |
| 244 | </property> | 250 | </property> |
| 245 | <property name="text"> | 251 | <property name="text"> |
| 246 | <string/> | 252 | <string/> |
| @@ -257,7 +263,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | @@ -257,7 +263,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | ||
| 257 | </property> | 263 | </property> |
| 258 | <property name="styleSheet"> | 264 | <property name="styleSheet"> |
| 259 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/favorites_manual.png); } | 265 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/favorites_manual.png); } |
| 260 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/favorites_manual_ov.png); }</string> | 266 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/favorites_manual_ov.png); }</string> |
| 261 | </property> | 267 | </property> |
| 262 | <property name="text"> | 268 | <property name="text"> |
| 263 | <string/> | 269 | <string/> |
| @@ -274,7 +280,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/favorites_manual_ov. | @@ -274,7 +280,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/favorites_manual_ov. | ||
| 274 | </property> | 280 | </property> |
| 275 | <property name="styleSheet"> | 281 | <property name="styleSheet"> |
| 276 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/wash.png); } | 282 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/wash.png); } |
| 277 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/wash_ov.png); }</string> | 283 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/wash_ov.png); }</string> |
| 278 | </property> | 284 | </property> |
| 279 | <property name="text"> | 285 | <property name="text"> |
| 280 | <string/> | 286 | <string/> |
| @@ -291,7 +297,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/wash_ov.png); }</str | @@ -291,7 +297,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/wash_ov.png); }</str | ||
| 291 | </property> | 297 | </property> |
| 292 | <property name="styleSheet"> | 298 | <property name="styleSheet"> |
| 293 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } | 299 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } |
| 294 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</string> | 300 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); }</string> |
| 295 | </property> | 301 | </property> |
| 296 | <property name="text"> | 302 | <property name="text"> |
| 297 | <string/> | 303 | <string/> |
| @@ -497,7 +503,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</str | @@ -497,7 +503,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</str | ||
| 497 | </property> | 503 | </property> |
| 498 | <property name="styleSheet"> | 504 | <property name="styleSheet"> |
| 499 | <string notr="true">QPushButton { image: url(:/images/slider_icon/temp.png); } | 505 | <string notr="true">QPushButton { image: url(:/images/slider_icon/temp.png); } |
| 500 | -QPushButton:pressed { image: url(:/images/slider_icon/temp_ov.png); }</string> | 506 | +QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/temp_ov.png); }</string> |
| 501 | </property> | 507 | </property> |
| 502 | <property name="style" stdset="0"> | 508 | <property name="style" stdset="0"> |
| 503 | <string notr="true">icon</string> | 509 | <string notr="true">icon</string> |
| @@ -631,248 +637,6 @@ QPushButton:pressed { image: url(:/images/slider_icon/temp_ov.png); }</string> | @@ -631,248 +637,6 @@ QPushButton:pressed { image: url(:/images/slider_icon/temp_ov.png); }</string> | ||
| 631 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | 637 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
| 632 | </property> | 638 | </property> |
| 633 | </widget> | 639 | </widget> |
| 634 | - <widget class="QStackedWidget" name="buttonStack"> | ||
| 635 | - <property name="geometry"> | ||
| 636 | - <rect> | ||
| 637 | - <x>337</x> | ||
| 638 | - <y>1319</y> | ||
| 639 | - <width>563</width> | ||
| 640 | - <height>131</height> | ||
| 641 | - </rect> | ||
| 642 | - </property> | ||
| 643 | - <property name="styleSheet"> | ||
| 644 | - <string notr="true">QPushButton { | ||
| 645 | -background-repeat: no-repeat; | ||
| 646 | -background-position: center; | ||
| 647 | -border: none; | ||
| 648 | -}</string> | ||
| 649 | - </property> | ||
| 650 | - <property name="currentIndex"> | ||
| 651 | - <number>0</number> | ||
| 652 | - </property> | ||
| 653 | - <widget class="QWidget" name="frontButtonStack"> | ||
| 654 | - <widget class="QPushButton" name="goBackStackButton"> | ||
| 655 | - <property name="geometry"> | ||
| 656 | - <rect> | ||
| 657 | - <x>448</x> | ||
| 658 | - <y>0</y> | ||
| 659 | - <width>112</width> | ||
| 660 | - <height>131</height> | ||
| 661 | - </rect> | ||
| 662 | - </property> | ||
| 663 | - <property name="styleSheet"> | ||
| 664 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/next.png); } | ||
| 665 | -QPushButton:pressed { background-image: url(:/images/manual_button/next_ov.png); }</string> | ||
| 666 | - </property> | ||
| 667 | - </widget> | ||
| 668 | - <widget class="QWidget" name="sysLine_7" native="true"> | ||
| 669 | - <property name="geometry"> | ||
| 670 | - <rect> | ||
| 671 | - <x>336</x> | ||
| 672 | - <y>36</y> | ||
| 673 | - <width>2</width> | ||
| 674 | - <height>58</height> | ||
| 675 | - </rect> | ||
| 676 | - </property> | ||
| 677 | - <property name="styleSheet"> | ||
| 678 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 679 | - </property> | ||
| 680 | - </widget> | ||
| 681 | - <widget class="QPushButton" name="humidificationButton"> | ||
| 682 | - <property name="geometry"> | ||
| 683 | - <rect> | ||
| 684 | - <x>224</x> | ||
| 685 | - <y>0</y> | ||
| 686 | - <width>112</width> | ||
| 687 | - <height>131</height> | ||
| 688 | - </rect> | ||
| 689 | - </property> | ||
| 690 | - <property name="styleSheet"> | ||
| 691 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/side_nozzle_close.png); }</string> | ||
| 692 | - </property> | ||
| 693 | - </widget> | ||
| 694 | - <widget class="QWidget" name="sysLine_8" native="true"> | ||
| 695 | - <property name="geometry"> | ||
| 696 | - <rect> | ||
| 697 | - <x>224</x> | ||
| 698 | - <y>36</y> | ||
| 699 | - <width>2</width> | ||
| 700 | - <height>58</height> | ||
| 701 | - </rect> | ||
| 702 | - </property> | ||
| 703 | - <property name="styleSheet"> | ||
| 704 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 705 | - </property> | ||
| 706 | - </widget> | ||
| 707 | - <widget class="QPushButton" name="preheatButton"> | ||
| 708 | - <property name="geometry"> | ||
| 709 | - <rect> | ||
| 710 | - <x>0</x> | ||
| 711 | - <y>0</y> | ||
| 712 | - <width>112</width> | ||
| 713 | - <height>131</height> | ||
| 714 | - </rect> | ||
| 715 | - </property> | ||
| 716 | - <property name="styleSheet"> | ||
| 717 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/preheat.png); } | ||
| 718 | -QPushButton:pressed { background-image: url(:/images/manual_button/preheat_ov.png); }</string> | ||
| 719 | - </property> | ||
| 720 | - </widget> | ||
| 721 | - <widget class="QPushButton" name="repeatButton"> | ||
| 722 | - <property name="geometry"> | ||
| 723 | - <rect> | ||
| 724 | - <x>336</x> | ||
| 725 | - <y>0</y> | ||
| 726 | - <width>112</width> | ||
| 727 | - <height>131</height> | ||
| 728 | - </rect> | ||
| 729 | - </property> | ||
| 730 | - <property name="styleSheet"> | ||
| 731 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/repeat.png); } | ||
| 732 | -QPushButton:pressed { background-image: url(:/images/manual_button/repeat_ov.png); }</string> | ||
| 733 | - </property> | ||
| 734 | - </widget> | ||
| 735 | - <widget class="QWidget" name="sysLine_9" native="true"> | ||
| 736 | - <property name="geometry"> | ||
| 737 | - <rect> | ||
| 738 | - <x>112</x> | ||
| 739 | - <y>36</y> | ||
| 740 | - <width>2</width> | ||
| 741 | - <height>58</height> | ||
| 742 | - </rect> | ||
| 743 | - </property> | ||
| 744 | - <property name="styleSheet"> | ||
| 745 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 746 | - </property> | ||
| 747 | - </widget> | ||
| 748 | - <widget class="QPushButton" name="damperButton"> | ||
| 749 | - <property name="geometry"> | ||
| 750 | - <rect> | ||
| 751 | - <x>112</x> | ||
| 752 | - <y>0</y> | ||
| 753 | - <width>112</width> | ||
| 754 | - <height>131</height> | ||
| 755 | - </rect> | ||
| 756 | - </property> | ||
| 757 | - <property name="styleSheet"> | ||
| 758 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/damper_close.png); }</string> | ||
| 759 | - </property> | ||
| 760 | - </widget> | ||
| 761 | - </widget> | ||
| 762 | - <widget class="QWidget" name="backButtonStack"> | ||
| 763 | - <widget class="QPushButton" name="goFrontStackButton"> | ||
| 764 | - <property name="geometry"> | ||
| 765 | - <rect> | ||
| 766 | - <x>448</x> | ||
| 767 | - <y>0</y> | ||
| 768 | - <width>112</width> | ||
| 769 | - <height>131</height> | ||
| 770 | - </rect> | ||
| 771 | - </property> | ||
| 772 | - <property name="styleSheet"> | ||
| 773 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/next.png); } | ||
| 774 | -QPushButton:pressed { background-image: url(:/images/manual_button/next_ov.png); }</string> | ||
| 775 | - </property> | ||
| 776 | - </widget> | ||
| 777 | - <widget class="QWidget" name="sysLine_10" native="true"> | ||
| 778 | - <property name="geometry"> | ||
| 779 | - <rect> | ||
| 780 | - <x>112</x> | ||
| 781 | - <y>36</y> | ||
| 782 | - <width>2</width> | ||
| 783 | - <height>58</height> | ||
| 784 | - </rect> | ||
| 785 | - </property> | ||
| 786 | - <property name="styleSheet"> | ||
| 787 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 788 | - </property> | ||
| 789 | - </widget> | ||
| 790 | - <widget class="QPushButton" name="reserveButton"> | ||
| 791 | - <property name="geometry"> | ||
| 792 | - <rect> | ||
| 793 | - <x>224</x> | ||
| 794 | - <y>0</y> | ||
| 795 | - <width>112</width> | ||
| 796 | - <height>131</height> | ||
| 797 | - </rect> | ||
| 798 | - </property> | ||
| 799 | - <property name="styleSheet"> | ||
| 800 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/reserve.png); } | ||
| 801 | -QPushButton:pressed { background-image: url(:/images/manual_button/reserve_ov.png); }</string> | ||
| 802 | - </property> | ||
| 803 | - </widget> | ||
| 804 | - <widget class="QWidget" name="sysLine_11" native="true"> | ||
| 805 | - <property name="geometry"> | ||
| 806 | - <rect> | ||
| 807 | - <x>224</x> | ||
| 808 | - <y>36</y> | ||
| 809 | - <width>2</width> | ||
| 810 | - <height>58</height> | ||
| 811 | - </rect> | ||
| 812 | - </property> | ||
| 813 | - <property name="styleSheet"> | ||
| 814 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 815 | - </property> | ||
| 816 | - </widget> | ||
| 817 | - <widget class="QPushButton" name="cooldownButton"> | ||
| 818 | - <property name="geometry"> | ||
| 819 | - <rect> | ||
| 820 | - <x>0</x> | ||
| 821 | - <y>0</y> | ||
| 822 | - <width>112</width> | ||
| 823 | - <height>131</height> | ||
| 824 | - </rect> | ||
| 825 | - </property> | ||
| 826 | - <property name="styleSheet"> | ||
| 827 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/cooldown.png); } | ||
| 828 | -QPushButton:pressed { background-image: url(:/images/manual_button/cooldown_ov.png); }</string> | ||
| 829 | - </property> | ||
| 830 | - <property name="checkable"> | ||
| 831 | - <bool>true</bool> | ||
| 832 | - </property> | ||
| 833 | - </widget> | ||
| 834 | - <widget class="QPushButton" name="favoriteButton"> | ||
| 835 | - <property name="geometry"> | ||
| 836 | - <rect> | ||
| 837 | - <x>336</x> | ||
| 838 | - <y>0</y> | ||
| 839 | - <width>112</width> | ||
| 840 | - <height>131</height> | ||
| 841 | - </rect> | ||
| 842 | - </property> | ||
| 843 | - <property name="styleSheet"> | ||
| 844 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/favorites.png); } | ||
| 845 | -QPushButton:pressed { background-image: url(:/images/manual_button/favorites_ov.png); }</string> | ||
| 846 | - </property> | ||
| 847 | - </widget> | ||
| 848 | - <widget class="QWidget" name="sysLine_12" native="true"> | ||
| 849 | - <property name="geometry"> | ||
| 850 | - <rect> | ||
| 851 | - <x>336</x> | ||
| 852 | - <y>36</y> | ||
| 853 | - <width>2</width> | ||
| 854 | - <height>58</height> | ||
| 855 | - </rect> | ||
| 856 | - </property> | ||
| 857 | - <property name="styleSheet"> | ||
| 858 | - <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 859 | - </property> | ||
| 860 | - </widget> | ||
| 861 | - <widget class="QPushButton" name="fanButton"> | ||
| 862 | - <property name="geometry"> | ||
| 863 | - <rect> | ||
| 864 | - <x>112</x> | ||
| 865 | - <y>0</y> | ||
| 866 | - <width>112</width> | ||
| 867 | - <height>131</height> | ||
| 868 | - </rect> | ||
| 869 | - </property> | ||
| 870 | - <property name="styleSheet"> | ||
| 871 | - <string notr="true">QPushButton { background-image: url(:/images/manual_button/fan_4.png); }</string> | ||
| 872 | - </property> | ||
| 873 | - </widget> | ||
| 874 | - </widget> | ||
| 875 | - </widget> | ||
| 876 | <widget class="QLabel" name="steamLabel_4"> | 640 | <widget class="QLabel" name="steamLabel_4"> |
| 877 | <property name="enabled"> | 641 | <property name="enabled"> |
| 878 | <bool>true</bool> | 642 | <bool>true</bool> |
| @@ -946,7 +710,11 @@ QPushButton:pressed { background-image: url(:/images/manual_button/favorites_ov. | @@ -946,7 +710,11 @@ QPushButton:pressed { background-image: url(:/images/manual_button/favorites_ov. | ||
| 946 | </property> | 710 | </property> |
| 947 | <property name="styleSheet"> | 711 | <property name="styleSheet"> |
| 948 | <string notr="true">QPushButton { image: url(:/images/slider_icon/humidity.png); } | 712 | <string notr="true">QPushButton { image: url(:/images/slider_icon/humidity.png); } |
| 949 | -QPushButton:pressed { image: url(:/images/slider_icon/humidity_ov.png); }</string> | 713 | +QPushButton:checked { image: url(:/images/slider_icon/humidity_ov.png); } |
| 714 | +QPushButton:pressed, QPushButton:focus { border: 2px dotted white; border-radius: 70px; }</string> | ||
| 715 | + </property> | ||
| 716 | + <property name="checkable"> | ||
| 717 | + <bool>true</bool> | ||
| 950 | </property> | 718 | </property> |
| 951 | <property name="style" stdset="0"> | 719 | <property name="style" stdset="0"> |
| 952 | <string notr="true">icon</string> | 720 | <string notr="true">icon</string> |
| @@ -963,7 +731,11 @@ QPushButton:pressed { image: url(:/images/slider_icon/humidity_ov.png); }</strin | @@ -963,7 +731,11 @@ QPushButton:pressed { image: url(:/images/slider_icon/humidity_ov.png); }</strin | ||
| 963 | </property> | 731 | </property> |
| 964 | <property name="styleSheet"> | 732 | <property name="styleSheet"> |
| 965 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp.png); } | 733 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp.png); } |
| 966 | -QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</string> | 734 | +QPushButton:checked { image: url(:/images/slider_icon/core_temp_enabled.png); } |
| 735 | +QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/core_temp_ov.png); }</string> | ||
| 736 | + </property> | ||
| 737 | + <property name="checkable"> | ||
| 738 | + <bool>true</bool> | ||
| 967 | </property> | 739 | </property> |
| 968 | <property name="style" stdset="0"> | 740 | <property name="style" stdset="0"> |
| 969 | <string notr="true">icon</string> | 741 | <string notr="true">icon</string> |
| @@ -980,7 +752,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</stri | @@ -980,7 +752,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/core_temp_ov.png); }</stri | ||
| 980 | </property> | 752 | </property> |
| 981 | <property name="styleSheet"> | 753 | <property name="styleSheet"> |
| 982 | <string notr="true">QPushButton { image: url(:/images/slider_icon/time.png); } | 754 | <string notr="true">QPushButton { image: url(:/images/slider_icon/time.png); } |
| 983 | -QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | 755 | +QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/time_ov.png); }</string> |
| 984 | </property> | 756 | </property> |
| 985 | <property name="style" stdset="0"> | 757 | <property name="style" stdset="0"> |
| 986 | <string notr="true">icon</string> | 758 | <string notr="true">icon</string> |
| @@ -1132,42 +904,288 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | @@ -1132,42 +904,288 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | ||
| 1132 | <property name="geometry"> | 904 | <property name="geometry"> |
| 1133 | <rect> | 905 | <rect> |
| 1134 | <x>185</x> | 906 | <x>185</x> |
| 1135 | - <y>875</y> | 907 | + <y>915</y> |
| 1136 | <width>666</width> | 908 | <width>666</width> |
| 1137 | - <height>140</height> | 909 | + <height>60</height> |
| 1138 | </rect> | 910 | </rect> |
| 1139 | </property> | 911 | </property> |
| 912 | + <property name="focusPolicy"> | ||
| 913 | + <enum>Qt::ClickFocus</enum> | ||
| 914 | + </property> | ||
| 1140 | </widget> | 915 | </widget> |
| 1141 | <widget class="Slider" name="humiditySlider" native="true"> | 916 | <widget class="Slider" name="humiditySlider" native="true"> |
| 1142 | <property name="geometry"> | 917 | <property name="geometry"> |
| 1143 | <rect> | 918 | <rect> |
| 1144 | <x>185</x> | 919 | <x>185</x> |
| 1145 | - <y>725</y> | 920 | + <y>765</y> |
| 1146 | <width>666</width> | 921 | <width>666</width> |
| 1147 | - <height>140</height> | 922 | + <height>60</height> |
| 1148 | </rect> | 923 | </rect> |
| 1149 | </property> | 924 | </property> |
| 925 | + <property name="focusPolicy"> | ||
| 926 | + <enum>Qt::ClickFocus</enum> | ||
| 927 | + </property> | ||
| 1150 | </widget> | 928 | </widget> |
| 1151 | <widget class="Slider" name="timeSlider" native="true"> | 929 | <widget class="Slider" name="timeSlider" native="true"> |
| 1152 | <property name="geometry"> | 930 | <property name="geometry"> |
| 1153 | <rect> | 931 | <rect> |
| 1154 | <x>185</x> | 932 | <x>185</x> |
| 1155 | - <y>1025</y> | 933 | + <y>1065</y> |
| 1156 | <width>666</width> | 934 | <width>666</width> |
| 1157 | - <height>140</height> | 935 | + <height>60</height> |
| 1158 | </rect> | 936 | </rect> |
| 1159 | </property> | 937 | </property> |
| 938 | + <property name="focusPolicy"> | ||
| 939 | + <enum>Qt::ClickFocus</enum> | ||
| 940 | + </property> | ||
| 1160 | </widget> | 941 | </widget> |
| 1161 | <widget class="Slider" name="interTempSlider" native="true"> | 942 | <widget class="Slider" name="interTempSlider" native="true"> |
| 1162 | <property name="geometry"> | 943 | <property name="geometry"> |
| 1163 | <rect> | 944 | <rect> |
| 1164 | <x>185</x> | 945 | <x>185</x> |
| 1165 | - <y>1175</y> | 946 | + <y>1215</y> |
| 1166 | <width>666</width> | 947 | <width>666</width> |
| 1167 | - <height>140</height> | 948 | + <height>60</height> |
| 949 | + </rect> | ||
| 950 | + </property> | ||
| 951 | + <property name="focusPolicy"> | ||
| 952 | + <enum>Qt::ClickFocus</enum> | ||
| 953 | + </property> | ||
| 954 | + </widget> | ||
| 955 | + <widget class="QPushButton" name="cooldownButton"> | ||
| 956 | + <property name="geometry"> | ||
| 957 | + <rect> | ||
| 958 | + <x>337</x> | ||
| 959 | + <y>1319</y> | ||
| 960 | + <width>112</width> | ||
| 961 | + <height>131</height> | ||
| 962 | + </rect> | ||
| 963 | + </property> | ||
| 964 | + <property name="styleSheet"> | ||
| 965 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/cooldown.png); } | ||
| 966 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/cooldown_ov.png); }</string> | ||
| 967 | + </property> | ||
| 968 | + <property name="checkable"> | ||
| 969 | + <bool>true</bool> | ||
| 970 | + </property> | ||
| 971 | + <property name="style" stdset="0"> | ||
| 972 | + <string>tool</string> | ||
| 973 | + </property> | ||
| 974 | + </widget> | ||
| 975 | + <widget class="QPushButton" name="goFrontStackButton"> | ||
| 976 | + <property name="geometry"> | ||
| 977 | + <rect> | ||
| 978 | + <x>785</x> | ||
| 979 | + <y>1319</y> | ||
| 980 | + <width>112</width> | ||
| 981 | + <height>131</height> | ||
| 982 | + </rect> | ||
| 983 | + </property> | ||
| 984 | + <property name="styleSheet"> | ||
| 985 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/next.png); } | ||
| 986 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/next_ov.png); }</string> | ||
| 987 | + </property> | ||
| 988 | + <property name="style" stdset="0"> | ||
| 989 | + <string>tool</string> | ||
| 990 | + </property> | ||
| 991 | + </widget> | ||
| 992 | + <widget class="QPushButton" name="favoriteButton"> | ||
| 993 | + <property name="geometry"> | ||
| 994 | + <rect> | ||
| 995 | + <x>673</x> | ||
| 996 | + <y>1319</y> | ||
| 997 | + <width>112</width> | ||
| 998 | + <height>131</height> | ||
| 999 | + </rect> | ||
| 1000 | + </property> | ||
| 1001 | + <property name="styleSheet"> | ||
| 1002 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/favorites.png); } | ||
| 1003 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/favorites_ov.png); }</string> | ||
| 1004 | + </property> | ||
| 1005 | + <property name="style" stdset="0"> | ||
| 1006 | + <string>tool</string> | ||
| 1007 | + </property> | ||
| 1008 | + </widget> | ||
| 1009 | + <widget class="QPushButton" name="reserveButton"> | ||
| 1010 | + <property name="geometry"> | ||
| 1011 | + <rect> | ||
| 1012 | + <x>561</x> | ||
| 1013 | + <y>1319</y> | ||
| 1014 | + <width>112</width> | ||
| 1015 | + <height>131</height> | ||
| 1168 | </rect> | 1016 | </rect> |
| 1169 | </property> | 1017 | </property> |
| 1018 | + <property name="styleSheet"> | ||
| 1019 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/reserve.png); } | ||
| 1020 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/reserve_ov.png); }</string> | ||
| 1021 | + </property> | ||
| 1022 | + <property name="style" stdset="0"> | ||
| 1023 | + <string>tool</string> | ||
| 1024 | + </property> | ||
| 1025 | + </widget> | ||
| 1026 | + <widget class="QPushButton" name="fanButton"> | ||
| 1027 | + <property name="geometry"> | ||
| 1028 | + <rect> | ||
| 1029 | + <x>449</x> | ||
| 1030 | + <y>1319</y> | ||
| 1031 | + <width>112</width> | ||
| 1032 | + <height>131</height> | ||
| 1033 | + </rect> | ||
| 1034 | + </property> | ||
| 1035 | + <property name="styleSheet"> | ||
| 1036 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/fan_4.png); }</string> | ||
| 1037 | + </property> | ||
| 1038 | + <property name="style" stdset="0"> | ||
| 1039 | + <string>tool</string> | ||
| 1040 | + </property> | ||
| 1041 | + </widget> | ||
| 1042 | + <widget class="QWidget" name="sysLine_8" native="true"> | ||
| 1043 | + <property name="geometry"> | ||
| 1044 | + <rect> | ||
| 1045 | + <x>561</x> | ||
| 1046 | + <y>1355</y> | ||
| 1047 | + <width>2</width> | ||
| 1048 | + <height>58</height> | ||
| 1049 | + </rect> | ||
| 1050 | + </property> | ||
| 1051 | + <property name="styleSheet"> | ||
| 1052 | + <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 1053 | + </property> | ||
| 1054 | + </widget> | ||
| 1055 | + <widget class="QWidget" name="sysLine_7" native="true"> | ||
| 1056 | + <property name="geometry"> | ||
| 1057 | + <rect> | ||
| 1058 | + <x>673</x> | ||
| 1059 | + <y>1355</y> | ||
| 1060 | + <width>2</width> | ||
| 1061 | + <height>58</height> | ||
| 1062 | + </rect> | ||
| 1063 | + </property> | ||
| 1064 | + <property name="styleSheet"> | ||
| 1065 | + <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 1066 | + </property> | ||
| 1067 | + </widget> | ||
| 1068 | + <widget class="QPushButton" name="damperButton"> | ||
| 1069 | + <property name="geometry"> | ||
| 1070 | + <rect> | ||
| 1071 | + <x>449</x> | ||
| 1072 | + <y>1319</y> | ||
| 1073 | + <width>112</width> | ||
| 1074 | + <height>131</height> | ||
| 1075 | + </rect> | ||
| 1076 | + </property> | ||
| 1077 | + <property name="styleSheet"> | ||
| 1078 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/damper_close.png); } | ||
| 1079 | +QPushButton:checked, QPushButton:focus { background-image: url(:/images/manual_button/damper_open.png); }</string> | ||
| 1080 | + </property> | ||
| 1081 | + <property name="checkable"> | ||
| 1082 | + <bool>true</bool> | ||
| 1083 | + </property> | ||
| 1084 | + <property name="style" stdset="0"> | ||
| 1085 | + <string>tool</string> | ||
| 1086 | + </property> | ||
| 1087 | + </widget> | ||
| 1088 | + <widget class="QPushButton" name="repeatButton"> | ||
| 1089 | + <property name="geometry"> | ||
| 1090 | + <rect> | ||
| 1091 | + <x>673</x> | ||
| 1092 | + <y>1319</y> | ||
| 1093 | + <width>112</width> | ||
| 1094 | + <height>131</height> | ||
| 1095 | + </rect> | ||
| 1096 | + </property> | ||
| 1097 | + <property name="styleSheet"> | ||
| 1098 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/repeat.png); } | ||
| 1099 | +QPushButton:pressed { background-image: url(:/images/manual_button/repeat_ov.png); }</string> | ||
| 1100 | + </property> | ||
| 1101 | + <property name="style" stdset="0"> | ||
| 1102 | + <string>tool</string> | ||
| 1103 | + </property> | ||
| 1104 | + </widget> | ||
| 1105 | + <widget class="QPushButton" name="preheatButton"> | ||
| 1106 | + <property name="geometry"> | ||
| 1107 | + <rect> | ||
| 1108 | + <x>337</x> | ||
| 1109 | + <y>1319</y> | ||
| 1110 | + <width>112</width> | ||
| 1111 | + <height>131</height> | ||
| 1112 | + </rect> | ||
| 1113 | + </property> | ||
| 1114 | + <property name="styleSheet"> | ||
| 1115 | + <string notr="true">QPushButton { background-image: url(:/images/manual_button/preheat.png); } | ||
| 1116 | +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_button/preheat_ov.png); }</string> | ||
| 1117 | + </property> | ||
| 1118 | + <property name="style" stdset="0"> | ||
| 1119 | + <string>tool</string> | ||
| 1120 | + </property> | ||
| 1121 | + </widget> | ||
| 1122 | + <widget class="QPushButton" name="humidificationButton"> | ||
| 1123 | + <property name="geometry"> | ||
| 1124 | + <rect> | ||
| 1125 | + <x>561</x> | ||
| 1126 | + <y>1319</y> | ||
| 1127 | + <width>112</width> | ||
| 1128 | + <height>131</height> | ||
| 1129 | + </rect> | ||
| 1130 | + </property> | ||
| 1131 | + <property name="styleSheet"> | ||
| 1132 | + <string notr="true">QPushButton, QPushButton:checked:pressed { background-image: url(:/images/manual_button/side_nozzle_close.png); } | ||
| 1133 | +QPushButton:checked, QPushButton:focus, QPushButton:pressed { background-image: url(:/images/manual_button/side_nozzle_open.png); }</string> | ||
| 1134 | + </property> | ||
| 1135 | + <property name="checkable"> | ||
| 1136 | + <bool>true</bool> | ||
| 1137 | + </property> | ||
| 1138 | + <property name="style" stdset="0"> | ||
| 1139 | + <string>tool</string> | ||
| 1140 | + </property> | ||
| 1141 | + </widget> | ||
| 1142 | + <widget class="QWidget" name="sysLine_9" native="true"> | ||
| 1143 | + <property name="geometry"> | ||
| 1144 | + <rect> | ||
| 1145 | + <x>449</x> | ||
| 1146 | + <y>1355</y> | ||
| 1147 | + <width>2</width> | ||
| 1148 | + <height>58</height> | ||
| 1149 | + </rect> | ||
| 1150 | + </property> | ||
| 1151 | + <property name="styleSheet"> | ||
| 1152 | + <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | ||
| 1153 | + </property> | ||
| 1170 | </widget> | 1154 | </widget> |
| 1155 | + <zorder>goFrontStackButton</zorder> | ||
| 1156 | + <zorder>fanButton</zorder> | ||
| 1157 | + <zorder>reserveButton</zorder> | ||
| 1158 | + <zorder>favoriteButton</zorder> | ||
| 1159 | + <zorder>cooldownButton</zorder> | ||
| 1160 | + <zorder>preheatButton</zorder> | ||
| 1161 | + <zorder>damperButton</zorder> | ||
| 1162 | + <zorder>repeatButton</zorder> | ||
| 1163 | + <zorder>humidificationButton</zorder> | ||
| 1164 | + <zorder>upperStack</zorder> | ||
| 1165 | + <zorder>combiButton</zorder> | ||
| 1166 | + <zorder>steamButton</zorder> | ||
| 1167 | + <zorder>dryheatButton</zorder> | ||
| 1168 | + <zorder>bottomBar</zorder> | ||
| 1169 | + <zorder>steamLabel_3</zorder> | ||
| 1170 | + <zorder>steamLabel_2</zorder> | ||
| 1171 | + <zorder>timeLabel</zorder> | ||
| 1172 | + <zorder>tempButton</zorder> | ||
| 1173 | + <zorder>tempLabel</zorder> | ||
| 1174 | + <zorder>humidityLabel</zorder> | ||
| 1175 | + <zorder>steamLabel_4</zorder> | ||
| 1176 | + <zorder>humidityButton</zorder> | ||
| 1177 | + <zorder>interTempButton</zorder> | ||
| 1178 | + <zorder>timeButton</zorder> | ||
| 1179 | + <zorder>interTempLabel</zorder> | ||
| 1180 | + <zorder>steamLabel_5</zorder> | ||
| 1181 | + <zorder>runStopButton</zorder> | ||
| 1182 | + <zorder>tempSlider</zorder> | ||
| 1183 | + <zorder>humiditySlider</zorder> | ||
| 1184 | + <zorder>timeSlider</zorder> | ||
| 1185 | + <zorder>interTempSlider</zorder> | ||
| 1186 | + <zorder>sysLine_8</zorder> | ||
| 1187 | + <zorder>sysLine_7</zorder> | ||
| 1188 | + <zorder>sysLine_9</zorder> | ||
| 1171 | </widget> | 1189 | </widget> |
| 1172 | </widget> | 1190 | </widget> |
| 1173 | <customwidgets> | 1191 | <customwidgets> |
| @@ -1194,6 +1212,30 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | @@ -1194,6 +1212,30 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | ||
| 1194 | <container>1</container> | 1212 | <container>1</container> |
| 1195 | </customwidget> | 1213 | </customwidget> |
| 1196 | </customwidgets> | 1214 | </customwidgets> |
| 1215 | + <tabstops> | ||
| 1216 | + <tabstop>steamButton</tabstop> | ||
| 1217 | + <tabstop>combiButton</tabstop> | ||
| 1218 | + <tabstop>dryheatButton</tabstop> | ||
| 1219 | + <tabstop>humidityButton</tabstop> | ||
| 1220 | + <tabstop>tempButton</tabstop> | ||
| 1221 | + <tabstop>timeButton</tabstop> | ||
| 1222 | + <tabstop>interTempButton</tabstop> | ||
| 1223 | + <tabstop>runStopButton</tabstop> | ||
| 1224 | + <tabstop>preheatButton</tabstop> | ||
| 1225 | + <tabstop>cooldownButton</tabstop> | ||
| 1226 | + <tabstop>damperButton</tabstop> | ||
| 1227 | + <tabstop>fanButton</tabstop> | ||
| 1228 | + <tabstop>humidificationButton</tabstop> | ||
| 1229 | + <tabstop>reserveButton</tabstop> | ||
| 1230 | + <tabstop>repeatButton</tabstop> | ||
| 1231 | + <tabstop>favoriteButton</tabstop> | ||
| 1232 | + <tabstop>goFrontStackButton</tabstop> | ||
| 1233 | + <tabstop>backButton</tabstop> | ||
| 1234 | + <tabstop>configButton</tabstop> | ||
| 1235 | + <tabstop>favoritesButton</tabstop> | ||
| 1236 | + <tabstop>washButton</tabstop> | ||
| 1237 | + <tabstop>helpButton</tabstop> | ||
| 1238 | + </tabstops> | ||
| 1197 | <resources> | 1239 | <resources> |
| 1198 | <include location="resources.qrc"/> | 1240 | <include location="resources.qrc"/> |
| 1199 | </resources> | 1241 | </resources> |
app/gui/oven_control/preheatpopup.cpp
| 1 | #include "preheatpopup.h" | 1 | #include "preheatpopup.h" |
| 2 | #include "ui_preheatpopup.h" | 2 | #include "ui_preheatpopup.h" |
| 3 | 3 | ||
| 4 | +#include <QKeyEvent> | ||
| 5 | + | ||
| 4 | #include "stringer.h" | 6 | #include "stringer.h" |
| 5 | 7 | ||
| 6 | PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | 8 | PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : |
| @@ -28,9 +30,13 @@ PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | @@ -28,9 +30,13 @@ PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | ||
| 28 | ui->preheatGauge->setMinimum(oven->currentTemp()); | 30 | ui->preheatGauge->setMinimum(oven->currentTemp()); |
| 29 | ui->preheatGauge->setValue(oven->currentTemp()); | 31 | ui->preheatGauge->setValue(oven->currentTemp()); |
| 30 | 32 | ||
| 33 | + ui->infoButton->hide(); | ||
| 34 | + | ||
| 31 | updateView(); | 35 | updateView(); |
| 32 | 36 | ||
| 33 | start(); | 37 | start(); |
| 38 | + | ||
| 39 | + ui->background->setFocus(); | ||
| 34 | } | 40 | } |
| 35 | 41 | ||
| 36 | PreheatPopup::~PreheatPopup() | 42 | PreheatPopup::~PreheatPopup() |
| @@ -38,6 +44,21 @@ PreheatPopup::~PreheatPopup() | @@ -38,6 +44,21 @@ PreheatPopup::~PreheatPopup() | ||
| 38 | delete ui; | 44 | delete ui; |
| 39 | } | 45 | } |
| 40 | 46 | ||
| 47 | +void PreheatPopup::keyReleaseEvent(QKeyEvent *event) | ||
| 48 | +{ | ||
| 49 | + switch (event->key()) | ||
| 50 | + { | ||
| 51 | + case 0x01000030: // Turn left | ||
| 52 | + break; | ||
| 53 | + case 0x01000031: // Push | ||
| 54 | + stop(); | ||
| 55 | + close(); | ||
| 56 | + break; | ||
| 57 | + case 0x01000032: // Turn right | ||
| 58 | + break; | ||
| 59 | + } | ||
| 60 | +} | ||
| 61 | + | ||
| 41 | void PreheatPopup::updateView() | 62 | void PreheatPopup::updateView() |
| 42 | { | 63 | { |
| 43 | ui->timeLabel->setText(Stringer::remainingTime(oven->msecs(), Stringer::fontSize14)); | 64 | ui->timeLabel->setText(Stringer::remainingTime(oven->msecs(), Stringer::fontSize14)); |
app/gui/oven_control/preheatpopup.h
| @@ -18,6 +18,9 @@ public: | @@ -18,6 +18,9 @@ public: | ||
| 18 | explicit PreheatPopup(QWidget *parent = 0, Oven *oven = 0); | 18 | explicit PreheatPopup(QWidget *parent = 0, Oven *oven = 0); |
| 19 | ~PreheatPopup(); | 19 | ~PreheatPopup(); |
| 20 | 20 | ||
| 21 | +protected: | ||
| 22 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 23 | + | ||
| 21 | private slots: | 24 | private slots: |
| 22 | void updateView(); | 25 | void updateView(); |
| 23 | void start(); | 26 | void start(); |
app/gui/oven_control/preheatpopup.ui
| @@ -13,7 +13,10 @@ | @@ -13,7 +13,10 @@ | ||
| 13 | <property name="styleSheet"> | 13 | <property name="styleSheet"> |
| 14 | <string notr="true">#closeButton { border: none; } | 14 | <string notr="true">#closeButton { border: none; } |
| 15 | #closeButton_2 { border: none; } | 15 | #closeButton_2 { border: none; } |
| 16 | -#background { background-image: url(:/images/background/popup/696.png); }</string> | 16 | +#background { background-image: url(:/images/background/popup/696.png); } |
| 17 | + | ||
| 18 | + | ||
| 19 | +QWidget#background:focus { border: 4px solid gray; }</string> | ||
| 17 | </property> | 20 | </property> |
| 18 | <widget class="QPushButton" name="closeButton"> | 21 | <widget class="QPushButton" name="closeButton"> |
| 19 | <property name="geometry"> | 22 | <property name="geometry"> |
| @@ -24,6 +27,9 @@ | @@ -24,6 +27,9 @@ | ||
| 24 | <height>426</height> | 27 | <height>426</height> |
| 25 | </rect> | 28 | </rect> |
| 26 | </property> | 29 | </property> |
| 30 | + <property name="focusPolicy"> | ||
| 31 | + <enum>Qt::NoFocus</enum> | ||
| 32 | + </property> | ||
| 27 | <property name="text"> | 33 | <property name="text"> |
| 28 | <string/> | 34 | <string/> |
| 29 | </property> | 35 | </property> |
| @@ -37,6 +43,9 @@ | @@ -37,6 +43,9 @@ | ||
| 37 | <height>696</height> | 43 | <height>696</height> |
| 38 | </rect> | 44 | </rect> |
| 39 | </property> | 45 | </property> |
| 46 | + <property name="focusPolicy"> | ||
| 47 | + <enum>Qt::TabFocus</enum> | ||
| 48 | + </property> | ||
| 40 | <widget class="QLabel" name="humidityLabel"> | 49 | <widget class="QLabel" name="humidityLabel"> |
| 41 | <property name="geometry"> | 50 | <property name="geometry"> |
| 42 | <rect> | 51 | <rect> |
| @@ -378,6 +387,9 @@ | @@ -378,6 +387,9 @@ | ||
| 378 | <height>290</height> | 387 | <height>290</height> |
| 379 | </rect> | 388 | </rect> |
| 380 | </property> | 389 | </property> |
| 390 | + <property name="focusPolicy"> | ||
| 391 | + <enum>Qt::NoFocus</enum> | ||
| 392 | + </property> | ||
| 381 | <property name="styleSheet"> | 393 | <property name="styleSheet"> |
| 382 | <string notr="true">border: #000000</string> | 394 | <string notr="true">border: #000000</string> |
| 383 | </property> | 395 | </property> |
| @@ -659,6 +671,9 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -659,6 +671,9 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 659 | <height>290</height> | 671 | <height>290</height> |
| 660 | </rect> | 672 | </rect> |
| 661 | </property> | 673 | </property> |
| 674 | + <property name="focusPolicy"> | ||
| 675 | + <enum>Qt::NoFocus</enum> | ||
| 676 | + </property> | ||
| 662 | <property name="styleSheet"> | 677 | <property name="styleSheet"> |
| 663 | <string notr="true">border: #000000</string> | 678 | <string notr="true">border: #000000</string> |
| 664 | </property> | 679 | </property> |
| @@ -789,6 +804,9 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -789,6 +804,9 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 789 | <height>478</height> | 804 | <height>478</height> |
| 790 | </rect> | 805 | </rect> |
| 791 | </property> | 806 | </property> |
| 807 | + <property name="focusPolicy"> | ||
| 808 | + <enum>Qt::NoFocus</enum> | ||
| 809 | + </property> | ||
| 792 | <property name="text"> | 810 | <property name="text"> |
| 793 | <string/> | 811 | <string/> |
| 794 | </property> | 812 | </property> |
| @@ -814,6 +832,13 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -814,6 +832,13 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 814 | <container>1</container> | 832 | <container>1</container> |
| 815 | </customwidget> | 833 | </customwidget> |
| 816 | </customwidgets> | 834 | </customwidgets> |
| 835 | + <tabstops> | ||
| 836 | + <tabstop>background</tabstop> | ||
| 837 | + <tabstop>infoButton</tabstop> | ||
| 838 | + <tabstop>humidityGaugeButton</tabstop> | ||
| 839 | + <tabstop>selectCookButton_2</tabstop> | ||
| 840 | + <tabstop>heatGaugeButton</tabstop> | ||
| 841 | + </tabstops> | ||
| 817 | <resources> | 842 | <resources> |
| 818 | <include location="resources.qrc"/> | 843 | <include location="resources.qrc"/> |
| 819 | </resources> | 844 | </resources> |
app/gui/oven_control/slider.cpp
| @@ -8,6 +8,7 @@ Slider::Slider(QWidget *parent) : QWidget(parent), | @@ -8,6 +8,7 @@ Slider::Slider(QWidget *parent) : QWidget(parent), | ||
| 8 | isSliderDown_(false), | 8 | isSliderDown_(false), |
| 9 | sliderPosition_(0), value_(0), minimum_(0), maximum_(1), | 9 | sliderPosition_(0), value_(0), minimum_(0), maximum_(1), |
| 10 | subVisible_(true), | 10 | subVisible_(true), |
| 11 | + focused(false), isSliderMoved_(false), | ||
| 11 | tickInterval(0), bigTickInterval(0) | 12 | tickInterval(0), bigTickInterval(0) |
| 12 | { | 13 | { |
| 13 | groove.load(":/images/slider/groove.png"); | 14 | groove.load(":/images/slider/groove.png"); |
| @@ -95,16 +96,76 @@ int Slider::sliderPosition() | @@ -95,16 +96,76 @@ int Slider::sliderPosition() | ||
| 95 | 96 | ||
| 96 | void Slider::setSliderPosition(int value) | 97 | void Slider::setSliderPosition(int value) |
| 97 | { | 98 | { |
| 99 | + value = qBound(minimum_, value, maximum_); | ||
| 100 | + | ||
| 98 | if (sliderPosition_ == value) | 101 | if (sliderPosition_ == value) |
| 99 | return; | 102 | return; |
| 100 | 103 | ||
| 101 | sliderPosition_ = value; | 104 | sliderPosition_ = value; |
| 105 | + if (focused) | ||
| 106 | + isSliderMoved_ = true; | ||
| 102 | 107 | ||
| 103 | emit sliderMoved(value); | 108 | emit sliderMoved(value); |
| 104 | 109 | ||
| 105 | update(); | 110 | update(); |
| 106 | } | 111 | } |
| 107 | 112 | ||
| 113 | +bool Slider::isSliderMoved() | ||
| 114 | +{ | ||
| 115 | + return isSliderMoved_; | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +void Slider::focusInEvent(QFocusEvent */*event*/) | ||
| 119 | +{ | ||
| 120 | + focused = true; | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | +void Slider::focusOutEvent(QFocusEvent *event) | ||
| 124 | +{ | ||
| 125 | + QWidget::focusOutEvent(event); | ||
| 126 | + | ||
| 127 | + focused = false; | ||
| 128 | + | ||
| 129 | + if (isSliderMoved_) | ||
| 130 | + { | ||
| 131 | + isSliderMoved_ = false; | ||
| 132 | + value_ = sliderPosition_; | ||
| 133 | + emit valueChanged(value_); | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +void Slider::keyPressEvent(QKeyEvent *event) | ||
| 138 | +{ | ||
| 139 | + switch (event->key()) | ||
| 140 | + { | ||
| 141 | + case 0x01000030: // Turn left | ||
| 142 | + decrease(); | ||
| 143 | + break; | ||
| 144 | + case 0x01000031: // Push | ||
| 145 | + event->ignore(); | ||
| 146 | + break; | ||
| 147 | + case 0x01000032: // Turn right | ||
| 148 | + increase(); | ||
| 149 | + break; | ||
| 150 | + } | ||
| 151 | +} | ||
| 152 | + | ||
| 153 | +void Slider::keyReleaseEvent(QKeyEvent *event) | ||
| 154 | +{ | ||
| 155 | + switch (event->key()) | ||
| 156 | + { | ||
| 157 | + case 0x01000030: // Turn left | ||
| 158 | + decrease(); | ||
| 159 | + break; | ||
| 160 | + case 0x01000031: // Push | ||
| 161 | + event->ignore(); | ||
| 162 | + break; | ||
| 163 | + case 0x01000032: // Turn right | ||
| 164 | + increase(); | ||
| 165 | + break; | ||
| 166 | + } | ||
| 167 | +} | ||
| 168 | + | ||
| 108 | void Slider::mouseMoveEvent(QMouseEvent *event) | 169 | void Slider::mouseMoveEvent(QMouseEvent *event) |
| 109 | { | 170 | { |
| 110 | if (!isSliderDown_) | 171 | if (!isSliderDown_) |
| @@ -124,12 +185,7 @@ void Slider::mouseReleaseEvent(QMouseEvent */*event*/) | @@ -124,12 +185,7 @@ void Slider::mouseReleaseEvent(QMouseEvent */*event*/) | ||
| 124 | { | 185 | { |
| 125 | isSliderDown_ = false; | 186 | isSliderDown_ = false; |
| 126 | 187 | ||
| 127 | - if (sliderPosition_ == value_) | ||
| 128 | - return; | ||
| 129 | - | ||
| 130 | emit sliderReleased(); | 188 | emit sliderReleased(); |
| 131 | - | ||
| 132 | - setValue(sliderPosition_); | ||
| 133 | } | 189 | } |
| 134 | 190 | ||
| 135 | void Slider::paintEvent(QPaintEvent */*event*/) | 191 | void Slider::paintEvent(QPaintEvent */*event*/) |
| @@ -206,6 +262,7 @@ void Slider::updatePixmapPosition() | @@ -206,6 +262,7 @@ void Slider::updatePixmapPosition() | ||
| 206 | 262 | ||
| 207 | void Slider::setValue(int value) | 263 | void Slider::setValue(int value) |
| 208 | { | 264 | { |
| 265 | + value = qBound(minimum_, value, maximum_); | ||
| 209 | if (value == value_) | 266 | if (value == value_) |
| 210 | return; | 267 | return; |
| 211 | 268 | ||
| @@ -215,3 +272,13 @@ void Slider::setValue(int value) | @@ -215,3 +272,13 @@ void Slider::setValue(int value) | ||
| 215 | 272 | ||
| 216 | emit valueChanged(value); | 273 | emit valueChanged(value); |
| 217 | } | 274 | } |
| 275 | + | ||
| 276 | +void Slider::increase() | ||
| 277 | +{ | ||
| 278 | + setSliderPosition(sliderPosition_ + 1); | ||
| 279 | +} | ||
| 280 | + | ||
| 281 | +void Slider::decrease() | ||
| 282 | +{ | ||
| 283 | + setSliderPosition(sliderPosition_ - 1); | ||
| 284 | +} |
app/gui/oven_control/slider.h
| @@ -25,6 +25,8 @@ class Slider : public QWidget | @@ -25,6 +25,8 @@ class Slider : public QWidget | ||
| 25 | QPoint subPoint; | 25 | QPoint subPoint; |
| 26 | 26 | ||
| 27 | bool subVisible_; | 27 | bool subVisible_; |
| 28 | + bool focused; | ||
| 29 | + bool isSliderMoved_; | ||
| 28 | 30 | ||
| 29 | public: | 31 | public: |
| 30 | explicit Slider(QWidget *parent = 0); | 32 | explicit Slider(QWidget *parent = 0); |
| @@ -44,6 +46,7 @@ public: | @@ -44,6 +46,7 @@ public: | ||
| 44 | bool isSliderDown(); | 46 | bool isSliderDown(); |
| 45 | int sliderPosition(); | 47 | int sliderPosition(); |
| 46 | void setSliderPosition(int value); | 48 | void setSliderPosition(int value); |
| 49 | + bool isSliderMoved(); | ||
| 47 | 50 | ||
| 48 | QList<int> ticks; | 51 | QList<int> ticks; |
| 49 | QList<int> bigTicks; | 52 | QList<int> bigTicks; |
| @@ -52,6 +55,10 @@ public: | @@ -52,6 +55,10 @@ public: | ||
| 52 | int bigTickInterval; | 55 | int bigTickInterval; |
| 53 | 56 | ||
| 54 | protected: | 57 | protected: |
| 58 | + virtual void focusInEvent(QFocusEvent *event); | ||
| 59 | + virtual void focusOutEvent(QFocusEvent *event); | ||
| 60 | + virtual void keyPressEvent(QKeyEvent *event); | ||
| 61 | + virtual void keyReleaseEvent(QKeyEvent *event); | ||
| 55 | virtual void mouseMoveEvent(QMouseEvent *event); | 62 | virtual void mouseMoveEvent(QMouseEvent *event); |
| 56 | virtual void mousePressEvent(QMouseEvent *event); | 63 | virtual void mousePressEvent(QMouseEvent *event); |
| 57 | virtual void mouseReleaseEvent(QMouseEvent *event); | 64 | virtual void mouseReleaseEvent(QMouseEvent *event); |
| @@ -71,7 +78,8 @@ signals: | @@ -71,7 +78,8 @@ signals: | ||
| 71 | 78 | ||
| 72 | public slots: | 79 | public slots: |
| 73 | void setValue(int value); | 80 | void setValue(int value); |
| 74 | - | 81 | + void increase(); |
| 82 | + void decrease(); | ||
| 75 | }; | 83 | }; |
| 76 | 84 | ||
| 77 | #endif // SLIDER_H | 85 | #endif // SLIDER_H |
app/gui/oven_control/washwindow.cpp
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #include "ui_washwindow.h" | 2 | #include "ui_washwindow.h" |
| 3 | 3 | ||
| 4 | #include <QSignalMapper> | 4 | #include <QSignalMapper> |
| 5 | +#include <QKeyEvent> | ||
| 5 | 6 | ||
| 6 | #include "soundplayer.h" | 7 | #include "soundplayer.h" |
| 7 | #include "dirtylevel.h" | 8 | #include "dirtylevel.h" |
| @@ -53,6 +54,8 @@ WashWindow::WashWindow(QWidget *parent) : | @@ -53,6 +54,8 @@ WashWindow::WashWindow(QWidget *parent) : | ||
| 53 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 54 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 54 | 55 | ||
| 55 | updateGauge(); | 56 | updateGauge(); |
| 57 | + | ||
| 58 | + setFocus(); | ||
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | WashWindow::~WashWindow() | 61 | WashWindow::~WashWindow() |
| @@ -60,6 +63,41 @@ WashWindow::~WashWindow() | @@ -60,6 +63,41 @@ WashWindow::~WashWindow() | ||
| 60 | delete ui; | 63 | delete ui; |
| 61 | } | 64 | } |
| 62 | 65 | ||
| 66 | +void WashWindow::keyPressEvent(QKeyEvent *event) | ||
| 67 | +{ | ||
| 68 | + switch (event->key()) | ||
| 69 | + { | ||
| 70 | + case 0x01000030: // Turn left | ||
| 71 | + onEncoderLeft(); | ||
| 72 | + break; | ||
| 73 | + case 0x01000031: // Push | ||
| 74 | + pushed = focusWidget(); | ||
| 75 | + break; | ||
| 76 | + case 0x01000032: // Turn right | ||
| 77 | + onEncoderRight(); | ||
| 78 | + break; | ||
| 79 | + } | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +void WashWindow::keyReleaseEvent(QKeyEvent *event) | ||
| 83 | +{ | ||
| 84 | + switch (event->key()) | ||
| 85 | + { | ||
| 86 | + case 0x01000030: // Turn left | ||
| 87 | + onEncoderLeft(); | ||
| 88 | + break; | ||
| 89 | + case 0x01000031: // Push | ||
| 90 | + if (focusWidget() == pushed) | ||
| 91 | + onEncoderClicked(pushed); | ||
| 92 | + | ||
| 93 | + pushed = NULL; | ||
| 94 | + break; | ||
| 95 | + case 0x01000032: // Turn right | ||
| 96 | + onEncoderRight(); | ||
| 97 | + break; | ||
| 98 | + } | ||
| 99 | +} | ||
| 100 | + | ||
| 63 | void WashWindow::start(int type) | 101 | void WashWindow::start(int type) |
| 64 | { | 102 | { |
| 65 | if (selected) | 103 | if (selected) |
| @@ -273,3 +311,20 @@ void WashWindow::on_helpButton_clicked() | @@ -273,3 +311,20 @@ void WashWindow::on_helpButton_clicked() | ||
| 273 | { | 311 | { |
| 274 | 312 | ||
| 275 | } | 313 | } |
| 314 | + | ||
| 315 | +void WashWindow::onEncoderLeft() | ||
| 316 | +{ | ||
| 317 | + focusPreviousChild(); | ||
| 318 | +} | ||
| 319 | + | ||
| 320 | +void WashWindow::onEncoderRight() | ||
| 321 | +{ | ||
| 322 | + focusNextChild(); | ||
| 323 | +} | ||
| 324 | + | ||
| 325 | +void WashWindow::onEncoderClicked(QWidget *clicked) | ||
| 326 | +{ | ||
| 327 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); | ||
| 328 | + if (b) | ||
| 329 | + b->click(); | ||
| 330 | +} |
app/gui/oven_control/washwindow.h
| @@ -18,16 +18,20 @@ public: | @@ -18,16 +18,20 @@ public: | ||
| 18 | explicit WashWindow(QWidget *parent = 0); | 18 | explicit WashWindow(QWidget *parent = 0); |
| 19 | ~WashWindow(); | 19 | ~WashWindow(); |
| 20 | 20 | ||
| 21 | +protected: | ||
| 22 | + void keyPressEvent(QKeyEvent *event); | ||
| 23 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 24 | + | ||
| 21 | private slots: | 25 | private slots: |
| 22 | void start(int type); | 26 | void start(int type); |
| 23 | void stop(); | 27 | void stop(); |
| 24 | void returnToClock(); | 28 | void returnToClock(); |
| 25 | void updateGauge(); | 29 | void updateGauge(); |
| 30 | + | ||
| 26 | void onChanged(); | 31 | void onChanged(); |
| 27 | - void on_backButton_clicked(); | ||
| 28 | 32 | ||
| 33 | + void on_backButton_clicked(); | ||
| 29 | void on_configButton_clicked(); | 34 | void on_configButton_clicked(); |
| 30 | - | ||
| 31 | void on_helpButton_clicked(); | 35 | void on_helpButton_clicked(); |
| 32 | 36 | ||
| 33 | private: | 37 | private: |
| @@ -42,6 +46,12 @@ private: | @@ -42,6 +46,12 @@ private: | ||
| 42 | int type; | 46 | int type; |
| 43 | 47 | ||
| 44 | QTimer returnToClockTimer; | 48 | QTimer returnToClockTimer; |
| 49 | + | ||
| 50 | + QWidget *pushed = NULL; | ||
| 51 | + | ||
| 52 | + void onEncoderLeft(); | ||
| 53 | + void onEncoderRight(); | ||
| 54 | + void onEncoderClicked(QWidget *clicked); | ||
| 45 | }; | 55 | }; |
| 46 | 56 | ||
| 47 | #endif // WASHWINDOW_H | 57 | #endif // WASHWINDOW_H |
app/gui/oven_control/washwindow.ui
| @@ -482,7 +482,7 @@ border: none; | @@ -482,7 +482,7 @@ border: none; | ||
| 482 | </property> | 482 | </property> |
| 483 | <property name="styleSheet"> | 483 | <property name="styleSheet"> |
| 484 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } | 484 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } |
| 485 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</string> | 485 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> |
| 486 | </property> | 486 | </property> |
| 487 | <property name="text"> | 487 | <property name="text"> |
| 488 | <string/> | 488 | <string/> |
| @@ -505,7 +505,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | @@ -505,7 +505,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | ||
| 505 | </property> | 505 | </property> |
| 506 | <property name="styleSheet"> | 506 | <property name="styleSheet"> |
| 507 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } | 507 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/config.png); } |
| 508 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</string> | 508 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/config_ov.png); }</string> |
| 509 | </property> | 509 | </property> |
| 510 | <property name="text"> | 510 | <property name="text"> |
| 511 | <string/> | 511 | <string/> |
| @@ -528,7 +528,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | @@ -528,7 +528,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | ||
| 528 | </property> | 528 | </property> |
| 529 | <property name="styleSheet"> | 529 | <property name="styleSheet"> |
| 530 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } | 530 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } |
| 531 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</string> | 531 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); }</string> |
| 532 | </property> | 532 | </property> |
| 533 | <property name="text"> | 533 | <property name="text"> |
| 534 | <string/> | 534 | <string/> |
| @@ -545,11 +545,11 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</str | @@ -545,11 +545,11 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</str | ||
| 545 | </rect> | 545 | </rect> |
| 546 | </property> | 546 | </property> |
| 547 | <property name="focusPolicy"> | 547 | <property name="focusPolicy"> |
| 548 | - <enum>Qt::NoFocus</enum> | 548 | + <enum>Qt::StrongFocus</enum> |
| 549 | </property> | 549 | </property> |
| 550 | <property name="styleSheet"> | 550 | <property name="styleSheet"> |
| 551 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_1.png); } | 551 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_1.png); } |
| 552 | -QPushButton::pressed { background-image: url(:/images/wash/button_1_ov.png); }</string> | 552 | +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/wash/button_1_ov.png); }</string> |
| 553 | </property> | 553 | </property> |
| 554 | <property name="text"> | 554 | <property name="text"> |
| 555 | <string>세제 없이 헹굼</string> | 555 | <string>세제 없이 헹굼</string> |
| @@ -568,11 +568,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_1_ov.png); }</ | @@ -568,11 +568,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_1_ov.png); }</ | ||
| 568 | </rect> | 568 | </rect> |
| 569 | </property> | 569 | </property> |
| 570 | <property name="focusPolicy"> | 570 | <property name="focusPolicy"> |
| 571 | - <enum>Qt::NoFocus</enum> | 571 | + <enum>Qt::StrongFocus</enum> |
| 572 | </property> | 572 | </property> |
| 573 | <property name="styleSheet"> | 573 | <property name="styleSheet"> |
| 574 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_2.png); } | 574 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_2.png); } |
| 575 | -QPushButton::pressed { background-image: url(:/images/wash/button_2_ov.png); }</string> | 575 | +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/wash/button_2_ov.png); }</string> |
| 576 | </property> | 576 | </property> |
| 577 | <property name="text"> | 577 | <property name="text"> |
| 578 | <string>간이 세척</string> | 578 | <string>간이 세척</string> |
| @@ -591,11 +591,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_2_ov.png); }</ | @@ -591,11 +591,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_2_ov.png); }</ | ||
| 591 | </rect> | 591 | </rect> |
| 592 | </property> | 592 | </property> |
| 593 | <property name="focusPolicy"> | 593 | <property name="focusPolicy"> |
| 594 | - <enum>Qt::NoFocus</enum> | 594 | + <enum>Qt::StrongFocus</enum> |
| 595 | </property> | 595 | </property> |
| 596 | <property name="styleSheet"> | 596 | <property name="styleSheet"> |
| 597 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_3.png); } | 597 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_3.png); } |
| 598 | -QPushButton::pressed { background-image: url(:/images/wash/button_3_ov.png); }</string> | 598 | +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/wash/button_3_ov.png); }</string> |
| 599 | </property> | 599 | </property> |
| 600 | <property name="text"> | 600 | <property name="text"> |
| 601 | <string>표준 세척</string> | 601 | <string>표준 세척</string> |
| @@ -614,11 +614,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_3_ov.png); }</ | @@ -614,11 +614,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_3_ov.png); }</ | ||
| 614 | </rect> | 614 | </rect> |
| 615 | </property> | 615 | </property> |
| 616 | <property name="focusPolicy"> | 616 | <property name="focusPolicy"> |
| 617 | - <enum>Qt::NoFocus</enum> | 617 | + <enum>Qt::StrongFocus</enum> |
| 618 | </property> | 618 | </property> |
| 619 | <property name="styleSheet"> | 619 | <property name="styleSheet"> |
| 620 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_4.png); } | 620 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_4.png); } |
| 621 | -QPushButton::pressed { background-image: url(:/images/wash/button_4_ov.png); }</string> | 621 | +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/wash/button_4_ov.png); }</string> |
| 622 | </property> | 622 | </property> |
| 623 | <property name="text"> | 623 | <property name="text"> |
| 624 | <string>강 세척</string> | 624 | <string>강 세척</string> |
| @@ -637,11 +637,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_4_ov.png); }</ | @@ -637,11 +637,11 @@ QPushButton::pressed { background-image: url(:/images/wash/button_4_ov.png); }</ | ||
| 637 | </rect> | 637 | </rect> |
| 638 | </property> | 638 | </property> |
| 639 | <property name="focusPolicy"> | 639 | <property name="focusPolicy"> |
| 640 | - <enum>Qt::NoFocus</enum> | 640 | + <enum>Qt::StrongFocus</enum> |
| 641 | </property> | 641 | </property> |
| 642 | <property name="styleSheet"> | 642 | <property name="styleSheet"> |
| 643 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_5.png); } | 643 | <string notr="true">QPushButton { background-image: url(:/images/wash/button_5.png); } |
| 644 | -QPushButton::pressed { background-image: url(:/images/wash/button_5_ov.png); }</string> | 644 | +QPushButton::pressed, QPushButton:focus { background-image: url(:/images/wash/button_5_ov.png); }</string> |
| 645 | </property> | 645 | </property> |
| 646 | <property name="text"> | 646 | <property name="text"> |
| 647 | <string>고속 세척</string> | 647 | <string>고속 세척</string> |
| @@ -721,6 +721,9 @@ QPushButton::pressed { background-image: url(:/images/wash/button_5_ov.png); }</ | @@ -721,6 +721,9 @@ QPushButton::pressed { background-image: url(:/images/wash/button_5_ov.png); }</ | ||
| 721 | <height>140</height> | 721 | <height>140</height> |
| 722 | </rect> | 722 | </rect> |
| 723 | </property> | 723 | </property> |
| 724 | + <property name="focusPolicy"> | ||
| 725 | + <enum>Qt::NoFocus</enum> | ||
| 726 | + </property> | ||
| 724 | <property name="styleSheet"> | 727 | <property name="styleSheet"> |
| 725 | <string notr="true">QPushButton { image: url(:/images/slider_icon/management.png); } | 728 | <string notr="true">QPushButton { image: url(:/images/slider_icon/management.png); } |
| 726 | QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</string> | 729 | QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</string> |
| @@ -870,6 +873,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | @@ -870,6 +873,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | ||
| 870 | <height>33</height> | 873 | <height>33</height> |
| 871 | </rect> | 874 | </rect> |
| 872 | </property> | 875 | </property> |
| 876 | + <property name="focusPolicy"> | ||
| 877 | + <enum>Qt::NoFocus</enum> | ||
| 878 | + </property> | ||
| 873 | <property name="maximum"> | 879 | <property name="maximum"> |
| 874 | <number>5</number> | 880 | <number>5</number> |
| 875 | </property> | 881 | </property> |
| @@ -960,6 +966,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | @@ -960,6 +966,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | ||
| 960 | <height>140</height> | 966 | <height>140</height> |
| 961 | </rect> | 967 | </rect> |
| 962 | </property> | 968 | </property> |
| 969 | + <property name="focusPolicy"> | ||
| 970 | + <enum>Qt::NoFocus</enum> | ||
| 971 | + </property> | ||
| 963 | <property name="styleSheet"> | 972 | <property name="styleSheet"> |
| 964 | <string notr="true">QPushButton { image: url(:/images/slider_icon/clean.png); } | 973 | <string notr="true">QPushButton { image: url(:/images/slider_icon/clean.png); } |
| 965 | QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | 974 | QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> |
| @@ -1109,6 +1118,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -1109,6 +1118,9 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
| 1109 | <height>33</height> | 1118 | <height>33</height> |
| 1110 | </rect> | 1119 | </rect> |
| 1111 | </property> | 1120 | </property> |
| 1121 | + <property name="focusPolicy"> | ||
| 1122 | + <enum>Qt::NoFocus</enum> | ||
| 1123 | + </property> | ||
| 1112 | <property name="maximum"> | 1124 | <property name="maximum"> |
| 1113 | <number>5</number> | 1125 | <number>5</number> |
| 1114 | </property> | 1126 | </property> |
| @@ -1180,6 +1192,16 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -1180,6 +1192,16 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
| 1180 | <container>1</container> | 1192 | <container>1</container> |
| 1181 | </customwidget> | 1193 | </customwidget> |
| 1182 | </customwidgets> | 1194 | </customwidgets> |
| 1195 | + <tabstops> | ||
| 1196 | + <tabstop>washButton_1</tabstop> | ||
| 1197 | + <tabstop>washButton_2</tabstop> | ||
| 1198 | + <tabstop>washButton_3</tabstop> | ||
| 1199 | + <tabstop>washButton_4</tabstop> | ||
| 1200 | + <tabstop>washButton_5</tabstop> | ||
| 1201 | + <tabstop>backButton</tabstop> | ||
| 1202 | + <tabstop>configButton</tabstop> | ||
| 1203 | + <tabstop>helpButton</tabstop> | ||
| 1204 | + </tabstops> | ||
| 1183 | <resources> | 1205 | <resources> |
| 1184 | <include location="resources.qrc"/> | 1206 | <include location="resources.qrc"/> |
| 1185 | </resources> | 1207 | </resources> |