Commit 51175dd1aa7c3b44e66c4391deb4e645cbb11b22
1 parent
6139c8c790
Exists in
master
and in
2 other branches
엔코더 구현
- 프로그래밍 모드
Showing
16 changed files
with
578 additions
and
103 deletions
Show diff stats
app/gui/oven_control/cookpanelbutton.cpp
| @@ -81,6 +81,11 @@ QPushButton *CookPanelButton::bar() | @@ -81,6 +81,11 @@ QPushButton *CookPanelButton::bar() | ||
| 81 | return ui->pushButton; | 81 | return ui->pushButton; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | +QPushButton *CookPanelButton::infoButton() | ||
| 85 | +{ | ||
| 86 | + return ui->showInfoButton; | ||
| 87 | +} | ||
| 88 | + | ||
| 84 | QPushButton *CookPanelButton::deleteButton() | 89 | QPushButton *CookPanelButton::deleteButton() |
| 85 | { | 90 | { |
| 86 | return ui->deleteButton; | 91 | return ui->deleteButton; |
| @@ -93,40 +98,45 @@ void CookPanelButton::setEnabled(bool enabled) | @@ -93,40 +98,45 @@ void CookPanelButton::setEnabled(bool enabled) | ||
| 93 | ui->deleteButton->setEnabled(enabled); | 98 | ui->deleteButton->setEnabled(enabled); |
| 94 | } | 99 | } |
| 95 | 100 | ||
| 96 | -//void CookPanelButton::keyPressEvent(QKeyEvent *event) | ||
| 97 | -//{ | ||
| 98 | -// switch (event->key()) | ||
| 99 | -// { | ||
| 100 | -// case 0x01000030: // Turn left | ||
| 101 | -// onEncoderLeft(); | ||
| 102 | -// break; | ||
| 103 | -// case 0x01000031: // Push | ||
| 104 | -// pushed = focusWidget(); | ||
| 105 | -// break; | ||
| 106 | -// case 0x01000032: // Turn right | ||
| 107 | -// onEncoderRight(); | ||
| 108 | -// break; | ||
| 109 | -// } | ||
| 110 | -//} | ||
| 111 | - | ||
| 112 | -//void CookPanelButton::keyReleaseEvent(QKeyEvent *event) | ||
| 113 | -//{ | ||
| 114 | -// switch (event->key()) | ||
| 115 | -// { | ||
| 116 | -// case 0x01000030: // Turn left | ||
| 117 | -// onEncoderLeft(); | ||
| 118 | -// break; | ||
| 119 | -// case 0x01000031: // Push | ||
| 120 | -// if (focusWidget() == pushed) | ||
| 121 | -// onEncoderClicked(pushed); | ||
| 122 | - | ||
| 123 | -// pushed = NULL; | ||
| 124 | -// break; | ||
| 125 | -// case 0x01000032: // Turn right | ||
| 126 | -// onEncoderRight(); | ||
| 127 | -// break; | ||
| 128 | -// } | ||
| 129 | -//} | 101 | +void CookPanelButton::keyPressEvent(QKeyEvent *event) |
| 102 | +{ | ||
| 103 | + switch (event->key()) | ||
| 104 | + { | ||
| 105 | + case 0x01000030: // Turn left | ||
| 106 | + event->ignore(); | ||
| 107 | + break; | ||
| 108 | + case 0x01000031: // Push | ||
| 109 | + pushed = focusWidget(); | ||
| 110 | + if (pushed == ui->pushButton) | ||
| 111 | + on_pushButton_pressed(); | ||
| 112 | + break; | ||
| 113 | + case 0x01000032: // Turn right | ||
| 114 | + event->ignore(); | ||
| 115 | + break; | ||
| 116 | + } | ||
| 117 | +} | ||
| 118 | + | ||
| 119 | +void CookPanelButton::keyReleaseEvent(QKeyEvent *event) | ||
| 120 | +{ | ||
| 121 | + switch (event->key()) | ||
| 122 | + { | ||
| 123 | + case 0x01000030: // Turn left | ||
| 124 | + event->ignore(); | ||
| 125 | + break; | ||
| 126 | + case 0x01000031: // Push | ||
| 127 | + if (pushed == ui->pushButton) | ||
| 128 | + on_pushButton_released(); | ||
| 129 | + | ||
| 130 | + if (focusWidget() == pushed) | ||
| 131 | + onEncoderClicked(pushed); | ||
| 132 | + | ||
| 133 | + pushed = NULL; | ||
| 134 | + break; | ||
| 135 | + case 0x01000032: // Turn right | ||
| 136 | + event->ignore(); | ||
| 137 | + break; | ||
| 138 | + } | ||
| 139 | +} | ||
| 130 | 140 | ||
| 131 | void CookPanelButton::emitLongPressed() | 141 | void CookPanelButton::emitLongPressed() |
| 132 | { | 142 | { |
| @@ -165,7 +175,9 @@ void CookPanelButton::onEncoderRight() | @@ -165,7 +175,9 @@ void CookPanelButton::onEncoderRight() | ||
| 165 | 175 | ||
| 166 | void CookPanelButton::onEncoderClicked(QWidget *clicked) | 176 | void CookPanelButton::onEncoderClicked(QWidget *clicked) |
| 167 | { | 177 | { |
| 168 | - | 178 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); |
| 179 | + if (b) | ||
| 180 | + b->click(); | ||
| 169 | } | 181 | } |
| 170 | 182 | ||
| 171 | void CookPanelButton::on_pushButton_pressed() | 183 | void CookPanelButton::on_pushButton_pressed() |
app/gui/oven_control/cookpanelbutton.h
| @@ -39,6 +39,7 @@ public: | @@ -39,6 +39,7 @@ public: | ||
| 39 | void setLongPressEnabled(bool enabled); | 39 | void setLongPressEnabled(bool enabled); |
| 40 | 40 | ||
| 41 | QPushButton *bar(); | 41 | QPushButton *bar(); |
| 42 | + QPushButton *infoButton(); | ||
| 42 | QPushButton *deleteButton(); | 43 | QPushButton *deleteButton(); |
| 43 | 44 | ||
| 44 | CookRecord record; | 45 | CookRecord record; |
| @@ -47,8 +48,8 @@ public slots: | @@ -47,8 +48,8 @@ public slots: | ||
| 47 | void setEnabled(bool enabled = true); | 48 | void setEnabled(bool enabled = true); |
| 48 | 49 | ||
| 49 | protected: | 50 | protected: |
| 50 | -// void keyPressEvent(QKeyEvent *event); | ||
| 51 | -// void keyReleaseEvent(QKeyEvent *event); | 51 | + void keyPressEvent(QKeyEvent *event); |
| 52 | + void keyReleaseEvent(QKeyEvent *event); | ||
| 52 | 53 | ||
| 53 | private slots: | 54 | private slots: |
| 54 | void emitLongPressed(); | 55 | void emitLongPressed(); |
app/gui/oven_control/programmingautoconfigwindow.cpp
| @@ -62,8 +62,19 @@ ProgrammingAutoConfigWindow::ProgrammingAutoConfigWindow(QWidget *parent, Cook c | @@ -62,8 +62,19 @@ ProgrammingAutoConfigWindow::ProgrammingAutoConfigWindow(QWidget *parent, Cook c | ||
| 62 | 62 | ||
| 63 | setupUi(); | 63 | setupUi(); |
| 64 | 64 | ||
| 65 | + afterThreeSecsTimer.setSingleShot(true); | ||
| 66 | + afterThreeSecsTimer.setInterval(3000); | ||
| 67 | + connect(&afterThreeSecsTimer, SIGNAL(timeout()), SLOT(afterThreeSecs())); | ||
| 68 | + | ||
| 65 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 69 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 66 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 70 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 71 | + | ||
| 72 | + foreach (QWidget *w, findChildren<QWidget *>()) | ||
| 73 | + w->installEventFilter(this); | ||
| 74 | + | ||
| 75 | + installEventFilter(this); | ||
| 76 | + | ||
| 77 | + setFocus(); | ||
| 67 | } | 78 | } |
| 68 | 79 | ||
| 69 | ProgrammingAutoConfigWindow::~ProgrammingAutoConfigWindow() | 80 | ProgrammingAutoConfigWindow::~ProgrammingAutoConfigWindow() |
| @@ -71,6 +82,24 @@ ProgrammingAutoConfigWindow::~ProgrammingAutoConfigWindow() | @@ -71,6 +82,24 @@ ProgrammingAutoConfigWindow::~ProgrammingAutoConfigWindow() | ||
| 71 | delete ui; | 82 | delete ui; |
| 72 | } | 83 | } |
| 73 | 84 | ||
| 85 | +bool ProgrammingAutoConfigWindow::eventFilter(QObject */*watched*/, QEvent *event) | ||
| 86 | +{ | ||
| 87 | + switch (event->type()) | ||
| 88 | + { | ||
| 89 | + case QEvent::KeyPress: | ||
| 90 | + case QEvent::KeyRelease: | ||
| 91 | + case QEvent::MouseButtonPress: | ||
| 92 | + case QEvent::MouseButtonRelease: | ||
| 93 | + case QEvent::MouseMove: | ||
| 94 | + afterThreeSecsTimer.start(); | ||
| 95 | + break; | ||
| 96 | + default: | ||
| 97 | + break; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + return false; | ||
| 101 | +} | ||
| 102 | + | ||
| 74 | void ProgrammingAutoConfigWindow::keyPressEvent(QKeyEvent *event) | 103 | void ProgrammingAutoConfigWindow::keyPressEvent(QKeyEvent *event) |
| 75 | { | 104 | { |
| 76 | switch (event->key()) | 105 | switch (event->key()) |
| @@ -108,17 +137,42 @@ void ProgrammingAutoConfigWindow::keyReleaseEvent(QKeyEvent *event) | @@ -108,17 +137,42 @@ void ProgrammingAutoConfigWindow::keyReleaseEvent(QKeyEvent *event) | ||
| 108 | 137 | ||
| 109 | void ProgrammingAutoConfigWindow::onEncoderLeft() | 138 | void ProgrammingAutoConfigWindow::onEncoderLeft() |
| 110 | { | 139 | { |
| 111 | - | 140 | + focusPreviousChild(); |
| 112 | } | 141 | } |
| 113 | 142 | ||
| 114 | void ProgrammingAutoConfigWindow::onEncoderRight() | 143 | void ProgrammingAutoConfigWindow::onEncoderRight() |
| 115 | { | 144 | { |
| 116 | - | 145 | + focusNextChild(); |
| 117 | } | 146 | } |
| 118 | 147 | ||
| 119 | void ProgrammingAutoConfigWindow::onEncoderClicked(QWidget *clicked) | 148 | void ProgrammingAutoConfigWindow::onEncoderClicked(QWidget *clicked) |
| 120 | { | 149 | { |
| 150 | + if (clicked == NULL) | ||
| 151 | + return; | ||
| 121 | 152 | ||
| 153 | + if (clicked->inherits("QPushButton")) | ||
| 154 | + { | ||
| 155 | + QPushButton *pb = qobject_cast<QPushButton *>(clicked); | ||
| 156 | + if (pb) | ||
| 157 | + pb->click(); | ||
| 158 | + } | ||
| 159 | + else if (clicked->inherits("Slider")) | ||
| 160 | + { | ||
| 161 | + Slider *slider = qobject_cast<Slider *>(clicked); | ||
| 162 | + if (slider) | ||
| 163 | + { | ||
| 164 | + if (slider == ui->configSlider_1) | ||
| 165 | + ui->configButton_1->setFocus(); | ||
| 166 | + else if (slider == ui->configSlider_2) | ||
| 167 | + ui->configButton_2->setFocus(); | ||
| 168 | + else if (slider == ui->configSlider_3) | ||
| 169 | + ui->configButton_3->setFocus(); | ||
| 170 | + else if (slider == ui->configSlider_4) | ||
| 171 | + ui->configButton_4->setFocus(); | ||
| 172 | + else if (slider == ui->configSlider_5) | ||
| 173 | + ui->configButton_5->setFocus(); | ||
| 174 | + } | ||
| 175 | + } | ||
| 122 | } | 176 | } |
| 123 | 177 | ||
| 124 | void ProgrammingAutoConfigWindow::setupUi() | 178 | void ProgrammingAutoConfigWindow::setupUi() |
| @@ -144,7 +198,7 @@ void ProgrammingAutoConfigWindow::setupUi() | @@ -144,7 +198,7 @@ void ProgrammingAutoConfigWindow::setupUi() | ||
| 144 | cw.button->setStyleSheet( | 198 | cw.button->setStyleSheet( |
| 145 | "QPushButton { image: url(" | 199 | "QPushButton { image: url(" |
| 146 | + Define::icon(config.type) | 200 | + Define::icon(config.type) |
| 147 | - + ") } QPushButton::pressed { image: url(" | 201 | + + ") } QPushButton::pressed, QPushButton:focus { image: url(" |
| 148 | + Define::iconOverlay(config.type) | 202 | + Define::iconOverlay(config.type) |
| 149 | + ") }"); | 203 | + ") }"); |
| 150 | 204 | ||
| @@ -220,6 +274,24 @@ void ProgrammingAutoConfigWindow::updateConfig() | @@ -220,6 +274,24 @@ void ProgrammingAutoConfigWindow::updateConfig() | ||
| 220 | updateView(); | 274 | updateView(); |
| 221 | } | 275 | } |
| 222 | 276 | ||
| 277 | +void ProgrammingAutoConfigWindow::afterThreeSecs() | ||
| 278 | +{ | ||
| 279 | + Slider *slider = qobject_cast<Slider *>(focusWidget()); | ||
| 280 | + if (slider) | ||
| 281 | + { | ||
| 282 | + if (slider == ui->configSlider_1) | ||
| 283 | + ui->configButton_1->setFocus(); | ||
| 284 | + else if (slider == ui->configSlider_2) | ||
| 285 | + ui->configButton_2->setFocus(); | ||
| 286 | + else if (slider == ui->configSlider_3) | ||
| 287 | + ui->configButton_3->setFocus(); | ||
| 288 | + else if (slider == ui->configSlider_4) | ||
| 289 | + ui->configButton_4->setFocus(); | ||
| 290 | + else if (slider == ui->configSlider_5) | ||
| 291 | + ui->configButton_5->setFocus(); | ||
| 292 | + } | ||
| 293 | +} | ||
| 294 | + | ||
| 223 | void ProgrammingAutoConfigWindow::on_backButton_clicked() | 295 | void ProgrammingAutoConfigWindow::on_backButton_clicked() |
| 224 | { | 296 | { |
| 225 | close(); | 297 | close(); |
| @@ -257,3 +329,28 @@ void ProgrammingAutoConfigWindow::on_okButton_clicked() | @@ -257,3 +329,28 @@ void ProgrammingAutoConfigWindow::on_okButton_clicked() | ||
| 257 | emit added(); | 329 | emit added(); |
| 258 | close(); | 330 | close(); |
| 259 | } | 331 | } |
| 332 | + | ||
| 333 | +void ProgrammingAutoConfigWindow::on_configButton_1_clicked() | ||
| 334 | +{ | ||
| 335 | + ui->configSlider_1->setFocus(); | ||
| 336 | +} | ||
| 337 | + | ||
| 338 | +void ProgrammingAutoConfigWindow::on_configButton_2_clicked() | ||
| 339 | +{ | ||
| 340 | + ui->configSlider_2->setFocus(); | ||
| 341 | +} | ||
| 342 | + | ||
| 343 | +void ProgrammingAutoConfigWindow::on_configButton_3_clicked() | ||
| 344 | +{ | ||
| 345 | + ui->configSlider_3->setFocus(); | ||
| 346 | +} | ||
| 347 | + | ||
| 348 | +void ProgrammingAutoConfigWindow::on_configButton_4_clicked() | ||
| 349 | +{ | ||
| 350 | + ui->configSlider_4->setFocus(); | ||
| 351 | +} | ||
| 352 | + | ||
| 353 | +void ProgrammingAutoConfigWindow::on_configButton_5_clicked() | ||
| 354 | +{ | ||
| 355 | + ui->configSlider_5->setFocus(); | ||
| 356 | +} |
app/gui/oven_control/programmingautoconfigwindow.h
| @@ -21,6 +21,8 @@ public: | @@ -21,6 +21,8 @@ public: | ||
| 21 | explicit ProgrammingAutoConfigWindow(QWidget *parent, Cook cook); | 21 | explicit ProgrammingAutoConfigWindow(QWidget *parent, Cook cook); |
| 22 | ~ProgrammingAutoConfigWindow(); | 22 | ~ProgrammingAutoConfigWindow(); |
| 23 | 23 | ||
| 24 | + bool eventFilter(QObject *watched, QEvent *event); | ||
| 25 | + | ||
| 24 | protected: | 26 | protected: |
| 25 | void keyPressEvent(QKeyEvent *event); | 27 | void keyPressEvent(QKeyEvent *event); |
| 26 | void keyReleaseEvent(QKeyEvent *event); | 28 | void keyReleaseEvent(QKeyEvent *event); |
| @@ -45,10 +47,13 @@ private: | @@ -45,10 +47,13 @@ private: | ||
| 45 | void onEncoderRight(); | 47 | void onEncoderRight(); |
| 46 | void onEncoderClicked(QWidget *clicked); | 48 | void onEncoderClicked(QWidget *clicked); |
| 47 | 49 | ||
| 50 | + QTimer afterThreeSecsTimer; | ||
| 51 | + | ||
| 48 | private slots: | 52 | private slots: |
| 49 | void setupUi(); | 53 | void setupUi(); |
| 50 | void updateView(); | 54 | void updateView(); |
| 51 | void updateConfig(); | 55 | void updateConfig(); |
| 56 | + void afterThreeSecs(); | ||
| 52 | 57 | ||
| 53 | void on_backButton_clicked(); | 58 | void on_backButton_clicked(); |
| 54 | 59 | ||
| @@ -58,6 +63,16 @@ private slots: | @@ -58,6 +63,16 @@ private slots: | ||
| 58 | 63 | ||
| 59 | void on_okButton_clicked(); | 64 | void on_okButton_clicked(); |
| 60 | 65 | ||
| 66 | + void on_configButton_1_clicked(); | ||
| 67 | + | ||
| 68 | + void on_configButton_2_clicked(); | ||
| 69 | + | ||
| 70 | + void on_configButton_3_clicked(); | ||
| 71 | + | ||
| 72 | + void on_configButton_4_clicked(); | ||
| 73 | + | ||
| 74 | + void on_configButton_5_clicked(); | ||
| 75 | + | ||
| 61 | signals: | 76 | signals: |
| 62 | void added(); | 77 | void added(); |
| 63 | }; | 78 | }; |
app/gui/oven_control/programmingautoconfigwindow.ui
| @@ -1308,6 +1308,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1308,6 +1308,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1308 | <height>140</height> | 1308 | <height>140</height> |
| 1309 | </rect> | 1309 | </rect> |
| 1310 | </property> | 1310 | </property> |
| 1311 | + <property name="focusPolicy"> | ||
| 1312 | + <enum>Qt::ClickFocus</enum> | ||
| 1313 | + </property> | ||
| 1311 | </widget> | 1314 | </widget> |
| 1312 | <widget class="Slider" name="configSlider_3" native="true"> | 1315 | <widget class="Slider" name="configSlider_3" native="true"> |
| 1313 | <property name="geometry"> | 1316 | <property name="geometry"> |
| @@ -1318,6 +1321,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1318,6 +1321,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1318 | <height>140</height> | 1321 | <height>140</height> |
| 1319 | </rect> | 1322 | </rect> |
| 1320 | </property> | 1323 | </property> |
| 1324 | + <property name="focusPolicy"> | ||
| 1325 | + <enum>Qt::ClickFocus</enum> | ||
| 1326 | + </property> | ||
| 1321 | </widget> | 1327 | </widget> |
| 1322 | <widget class="Slider" name="configSlider_2" native="true"> | 1328 | <widget class="Slider" name="configSlider_2" native="true"> |
| 1323 | <property name="geometry"> | 1329 | <property name="geometry"> |
| @@ -1328,6 +1334,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1328,6 +1334,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1328 | <height>140</height> | 1334 | <height>140</height> |
| 1329 | </rect> | 1335 | </rect> |
| 1330 | </property> | 1336 | </property> |
| 1337 | + <property name="focusPolicy"> | ||
| 1338 | + <enum>Qt::ClickFocus</enum> | ||
| 1339 | + </property> | ||
| 1331 | </widget> | 1340 | </widget> |
| 1332 | <widget class="Slider" name="configSlider_5" native="true"> | 1341 | <widget class="Slider" name="configSlider_5" native="true"> |
| 1333 | <property name="geometry"> | 1342 | <property name="geometry"> |
| @@ -1338,6 +1347,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1338,6 +1347,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1338 | <height>140</height> | 1347 | <height>140</height> |
| 1339 | </rect> | 1348 | </rect> |
| 1340 | </property> | 1349 | </property> |
| 1350 | + <property name="focusPolicy"> | ||
| 1351 | + <enum>Qt::ClickFocus</enum> | ||
| 1352 | + </property> | ||
| 1341 | </widget> | 1353 | </widget> |
| 1342 | <widget class="Slider" name="configSlider_1" native="true"> | 1354 | <widget class="Slider" name="configSlider_1" native="true"> |
| 1343 | <property name="geometry"> | 1355 | <property name="geometry"> |
| @@ -1348,6 +1360,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1348,6 +1360,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1348 | <height>140</height> | 1360 | <height>140</height> |
| 1349 | </rect> | 1361 | </rect> |
| 1350 | </property> | 1362 | </property> |
| 1363 | + <property name="focusPolicy"> | ||
| 1364 | + <enum>Qt::ClickFocus</enum> | ||
| 1365 | + </property> | ||
| 1351 | </widget> | 1366 | </widget> |
| 1352 | </widget> | 1367 | </widget> |
| 1353 | </widget> | 1368 | </widget> |
| @@ -1370,6 +1385,19 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | @@ -1370,6 +1385,19 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/c | ||
| 1370 | <container>1</container> | 1385 | <container>1</container> |
| 1371 | </customwidget> | 1386 | </customwidget> |
| 1372 | </customwidgets> | 1387 | </customwidgets> |
| 1388 | + <tabstops> | ||
| 1389 | + <tabstop>selectCookButton</tabstop> | ||
| 1390 | + <tabstop>pushButton_4</tabstop> | ||
| 1391 | + <tabstop>configButton_1</tabstop> | ||
| 1392 | + <tabstop>configButton_2</tabstop> | ||
| 1393 | + <tabstop>configButton_3</tabstop> | ||
| 1394 | + <tabstop>configButton_4</tabstop> | ||
| 1395 | + <tabstop>configButton_5</tabstop> | ||
| 1396 | + <tabstop>backButton</tabstop> | ||
| 1397 | + <tabstop>configButton</tabstop> | ||
| 1398 | + <tabstop>helpButton</tabstop> | ||
| 1399 | + <tabstop>okButton</tabstop> | ||
| 1400 | + </tabstops> | ||
| 1373 | <resources> | 1401 | <resources> |
| 1374 | <include location="resources.qrc"/> | 1402 | <include location="resources.qrc"/> |
| 1375 | </resources> | 1403 | </resources> |
app/gui/oven_control/programmingautoselectionwindow.cpp
| @@ -36,10 +36,11 @@ ProgrammingAutoSelectionWindow::ProgrammingAutoSelectionWindow(QWidget *parent, | @@ -36,10 +36,11 @@ ProgrammingAutoSelectionWindow::ProgrammingAutoSelectionWindow(QWidget *parent, | ||
| 36 | QPushButton {\ | 36 | QPushButton {\ |
| 37 | border-image: url(:/images/button/288.png);\ | 37 | border-image: url(:/images/button/288.png);\ |
| 38 | }\ | 38 | }\ |
| 39 | -QPushButton:pressed {\ | 39 | +QPushButton:pressed, QPushButton:focus {\ |
| 40 | border-image: url(:/images/button/288_ov.png);\ | 40 | border-image: url(:/images/button/288_ov.png);\ |
| 41 | }"); | 41 | }"); |
| 42 | 42 | ||
| 43 | + QWidget *last = this; | ||
| 43 | for (int idx = 0; idx < book.list.size(); idx++) | 44 | for (int idx = 0; idx < book.list.size(); idx++) |
| 44 | { | 45 | { |
| 45 | int x = 12 + (idx % 3) * 294; | 46 | int x = 12 + (idx % 3) * 294; |
| @@ -53,10 +54,21 @@ QPushButton:pressed {\ | @@ -53,10 +54,21 @@ QPushButton:pressed {\ | ||
| 53 | 54 | ||
| 54 | sm->setMapping(pb, idx); | 55 | sm->setMapping(pb, idx); |
| 55 | connect(pb, SIGNAL(clicked()), sm, SLOT(map())); | 56 | connect(pb, SIGNAL(clicked()), sm, SLOT(map())); |
| 57 | + | ||
| 58 | + setTabOrder(last, pb); | ||
| 59 | + | ||
| 60 | + last = pb; | ||
| 56 | } | 61 | } |
| 57 | 62 | ||
| 63 | + setTabOrder(last, ui->backButton); | ||
| 64 | + setTabOrder(ui->backButton, ui->configButton); | ||
| 65 | + setTabOrder(ui->configButton, ui->helpButton); | ||
| 66 | + setTabOrder(ui->helpButton, ui->okButton); | ||
| 67 | + | ||
| 58 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 68 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 59 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 69 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 70 | + | ||
| 71 | + setFocus(); | ||
| 60 | } | 72 | } |
| 61 | 73 | ||
| 62 | ProgrammingAutoSelectionWindow::~ProgrammingAutoSelectionWindow() | 74 | ProgrammingAutoSelectionWindow::~ProgrammingAutoSelectionWindow() |
| @@ -101,17 +113,19 @@ void ProgrammingAutoSelectionWindow::keyReleaseEvent(QKeyEvent *event) | @@ -101,17 +113,19 @@ void ProgrammingAutoSelectionWindow::keyReleaseEvent(QKeyEvent *event) | ||
| 101 | 113 | ||
| 102 | void ProgrammingAutoSelectionWindow::onEncoderLeft() | 114 | void ProgrammingAutoSelectionWindow::onEncoderLeft() |
| 103 | { | 115 | { |
| 104 | - | 116 | + focusPreviousChild(); |
| 105 | } | 117 | } |
| 106 | 118 | ||
| 107 | void ProgrammingAutoSelectionWindow::onEncoderRight() | 119 | void ProgrammingAutoSelectionWindow::onEncoderRight() |
| 108 | { | 120 | { |
| 109 | - | 121 | + focusNextChild(); |
| 110 | } | 122 | } |
| 111 | 123 | ||
| 112 | void ProgrammingAutoSelectionWindow::onEncoderClicked(QWidget *clicked) | 124 | void ProgrammingAutoSelectionWindow::onEncoderClicked(QWidget *clicked) |
| 113 | { | 125 | { |
| 114 | - | 126 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); |
| 127 | + if (b) | ||
| 128 | + b->click(); | ||
| 115 | } | 129 | } |
| 116 | 130 | ||
| 117 | void ProgrammingAutoSelectionWindow::onCookSelected(int idx) | 131 | void ProgrammingAutoSelectionWindow::onCookSelected(int idx) |
app/gui/oven_control/programmingmanualcoretemppopup.cpp
| @@ -35,8 +35,19 @@ ProgrammingManualCoreTempPopup::ProgrammingManualCoreTempPopup(QWidget *parent) | @@ -35,8 +35,19 @@ ProgrammingManualCoreTempPopup::ProgrammingManualCoreTempPopup(QWidget *parent) | ||
| 35 | 35 | ||
| 36 | updateCoreTempLabel(); | 36 | updateCoreTempLabel(); |
| 37 | 37 | ||
| 38 | + afterThreeSecsTimer.setSingleShot(true); | ||
| 39 | + afterThreeSecsTimer.setInterval(3000); | ||
| 40 | + connect(&afterThreeSecsTimer, SIGNAL(timeout()), SLOT(afterThreeSecs())); | ||
| 41 | + | ||
| 38 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 42 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 39 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 43 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 44 | + | ||
| 45 | + foreach (QWidget *w, findChildren<QWidget *>()) | ||
| 46 | + w->installEventFilter(this); | ||
| 47 | + | ||
| 48 | + installEventFilter(this); | ||
| 49 | + | ||
| 50 | + ui->background->setFocus(); | ||
| 40 | } | 51 | } |
| 41 | 52 | ||
| 42 | ProgrammingManualCoreTempPopup::~ProgrammingManualCoreTempPopup() | 53 | ProgrammingManualCoreTempPopup::~ProgrammingManualCoreTempPopup() |
| @@ -44,6 +55,24 @@ ProgrammingManualCoreTempPopup::~ProgrammingManualCoreTempPopup() | @@ -44,6 +55,24 @@ ProgrammingManualCoreTempPopup::~ProgrammingManualCoreTempPopup() | ||
| 44 | delete ui; | 55 | delete ui; |
| 45 | } | 56 | } |
| 46 | 57 | ||
| 58 | +bool ProgrammingManualCoreTempPopup::eventFilter(QObject */*watched*/, QEvent *event) | ||
| 59 | +{ | ||
| 60 | + switch (event->type()) | ||
| 61 | + { | ||
| 62 | + case QEvent::KeyPress: | ||
| 63 | + case QEvent::KeyRelease: | ||
| 64 | + case QEvent::MouseButtonPress: | ||
| 65 | + case QEvent::MouseButtonRelease: | ||
| 66 | + case QEvent::MouseMove: | ||
| 67 | + afterThreeSecsTimer.start(); | ||
| 68 | + break; | ||
| 69 | + default: | ||
| 70 | + break; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + return false; | ||
| 74 | +} | ||
| 75 | + | ||
| 47 | void ProgrammingManualCoreTempPopup::keyPressEvent(QKeyEvent *event) | 76 | void ProgrammingManualCoreTempPopup::keyPressEvent(QKeyEvent *event) |
| 48 | { | 77 | { |
| 49 | switch (event->key()) | 78 | switch (event->key()) |
| @@ -84,9 +113,19 @@ void ProgrammingManualCoreTempPopup::updateCoreTempLabel() | @@ -84,9 +113,19 @@ void ProgrammingManualCoreTempPopup::updateCoreTempLabel() | ||
| 84 | ui->coreTempLabel->setText(Stringer::temperature(ui->coreTempSlider->sliderPosition(), Stringer::fontSize14)); | 113 | ui->coreTempLabel->setText(Stringer::temperature(ui->coreTempSlider->sliderPosition(), Stringer::fontSize14)); |
| 85 | } | 114 | } |
| 86 | 115 | ||
| 87 | -void ProgrammingManualCoreTempPopup::on_coreTempButton_clicked() | 116 | +void ProgrammingManualCoreTempPopup::afterThreeSecs() |
| 88 | { | 117 | { |
| 118 | + Slider *slider = qobject_cast<Slider *>(focusWidget()); | ||
| 119 | + if (slider) | ||
| 120 | + { | ||
| 121 | + if (slider == ui->coreTempSlider) | ||
| 122 | + ui->coreTempButton->setFocus(); | ||
| 123 | + } | ||
| 124 | +} | ||
| 89 | 125 | ||
| 126 | +void ProgrammingManualCoreTempPopup::on_coreTempButton_clicked() | ||
| 127 | +{ | ||
| 128 | + ui->coreTempSlider->setFocus(); | ||
| 90 | } | 129 | } |
| 91 | 130 | ||
| 92 | void ProgrammingManualCoreTempPopup::on_cancelButton_clicked() | 131 | void ProgrammingManualCoreTempPopup::on_cancelButton_clicked() |
| @@ -96,22 +135,47 @@ void ProgrammingManualCoreTempPopup::on_cancelButton_clicked() | @@ -96,22 +135,47 @@ void ProgrammingManualCoreTempPopup::on_cancelButton_clicked() | ||
| 96 | 135 | ||
| 97 | void ProgrammingManualCoreTempPopup::on_applyButton_clicked() | 136 | void ProgrammingManualCoreTempPopup::on_applyButton_clicked() |
| 98 | { | 137 | { |
| 99 | - emit coreTempEnabled(ui->coreTempSlider->value()); | 138 | + emit coreTempEnabled(ui->coreTempSlider->sliderPosition()); |
| 100 | 139 | ||
| 101 | close(); | 140 | close(); |
| 102 | } | 141 | } |
| 103 | 142 | ||
| 104 | void ProgrammingManualCoreTempPopup::onEncoderLeft() | 143 | void ProgrammingManualCoreTempPopup::onEncoderLeft() |
| 105 | { | 144 | { |
| 106 | - | 145 | + QWidget *focused = focusWidget(); |
| 146 | + if (focused == ui->background) | ||
| 147 | + ui->applyButton->setFocus(); | ||
| 148 | + else | ||
| 149 | + focusPreviousChild(); | ||
| 107 | } | 150 | } |
| 108 | 151 | ||
| 109 | void ProgrammingManualCoreTempPopup::onEncoderRight() | 152 | void ProgrammingManualCoreTempPopup::onEncoderRight() |
| 110 | { | 153 | { |
| 111 | - | 154 | + QWidget *focused = focusWidget(); |
| 155 | + if (focused == ui->applyButton) | ||
| 156 | + ui->background->setFocus(); | ||
| 157 | + else | ||
| 158 | + focusNextChild(); | ||
| 112 | } | 159 | } |
| 113 | 160 | ||
| 114 | void ProgrammingManualCoreTempPopup::onEncoderClicked(QWidget *clicked) | 161 | void ProgrammingManualCoreTempPopup::onEncoderClicked(QWidget *clicked) |
| 115 | { | 162 | { |
| 116 | - | 163 | + QWidget *focused = clicked; |
| 164 | + if (focused == ui->background) | ||
| 165 | + close(); | ||
| 166 | + else if (focused->inherits("QPushButton")) | ||
| 167 | + { | ||
| 168 | + QPushButton *pb = qobject_cast<QPushButton *>(focused); | ||
| 169 | + if (pb) | ||
| 170 | + pb->click(); | ||
| 171 | + } | ||
| 172 | + else if (focused->inherits("Slider")) | ||
| 173 | + { | ||
| 174 | + Slider *slider = qobject_cast<Slider *>(focused); | ||
| 175 | + if (slider) | ||
| 176 | + { | ||
| 177 | + if (slider == ui->coreTempSlider) | ||
| 178 | + ui->coreTempButton->setFocus(); | ||
| 179 | + } | ||
| 180 | + } | ||
| 117 | } | 181 | } |
app/gui/oven_control/programmingmanualcoretemppopup.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define PROGRAMMINGMANUALCORETEMPPOPUP_H | 2 | #define PROGRAMMINGMANUALCORETEMPPOPUP_H |
| 3 | 3 | ||
| 4 | #include <QWidget> | 4 | #include <QWidget> |
| 5 | +#include <QTimer> | ||
| 5 | 6 | ||
| 6 | namespace Ui { | 7 | namespace Ui { |
| 7 | class ProgrammingManualCoreTempPopup; | 8 | class ProgrammingManualCoreTempPopup; |
| @@ -15,12 +16,15 @@ public: | @@ -15,12 +16,15 @@ public: | ||
| 15 | explicit ProgrammingManualCoreTempPopup(QWidget *parent = 0); | 16 | explicit ProgrammingManualCoreTempPopup(QWidget *parent = 0); |
| 16 | ~ProgrammingManualCoreTempPopup(); | 17 | ~ProgrammingManualCoreTempPopup(); |
| 17 | 18 | ||
| 19 | + bool eventFilter(QObject *watched, QEvent *event); | ||
| 20 | + | ||
| 18 | protected: | 21 | protected: |
| 19 | void keyPressEvent(QKeyEvent *event); | 22 | void keyPressEvent(QKeyEvent *event); |
| 20 | void keyReleaseEvent(QKeyEvent *event); | 23 | void keyReleaseEvent(QKeyEvent *event); |
| 21 | 24 | ||
| 22 | private slots: | 25 | private slots: |
| 23 | void updateCoreTempLabel(); | 26 | void updateCoreTempLabel(); |
| 27 | + void afterThreeSecs(); | ||
| 24 | 28 | ||
| 25 | void on_coreTempButton_clicked(); | 29 | void on_coreTempButton_clicked(); |
| 26 | void on_cancelButton_clicked(); | 30 | void on_cancelButton_clicked(); |
| @@ -35,6 +39,8 @@ private: | @@ -35,6 +39,8 @@ private: | ||
| 35 | void onEncoderRight(); | 39 | void onEncoderRight(); |
| 36 | void onEncoderClicked(QWidget *clicked); | 40 | void onEncoderClicked(QWidget *clicked); |
| 37 | 41 | ||
| 42 | + QTimer afterThreeSecsTimer; | ||
| 43 | + | ||
| 38 | signals: | 44 | signals: |
| 39 | void coreTempEnabled(int); | 45 | void coreTempEnabled(int); |
| 40 | }; | 46 | }; |
app/gui/oven_control/programmingmanualcoretemppopup.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; |
| @@ -118,6 +124,9 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_b | @@ -118,6 +124,9 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_b | ||
| 118 | <height>730</height> | 124 | <height>730</height> |
| 119 | </rect> | 125 | </rect> |
| 120 | </property> | 126 | </property> |
| 127 | + <property name="focusPolicy"> | ||
| 128 | + <enum>Qt::TabFocus</enum> | ||
| 129 | + </property> | ||
| 121 | </widget> | 130 | </widget> |
| 122 | <widget class="QLabel" name="coreTempLabel"> | 131 | <widget class="QLabel" name="coreTempLabel"> |
| 123 | <property name="enabled"> | 132 | <property name="enabled"> |
| @@ -208,6 +217,12 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_b | @@ -208,6 +217,12 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/manual_b | ||
| 208 | <container>1</container> | 217 | <container>1</container> |
| 209 | </customwidget> | 218 | </customwidget> |
| 210 | </customwidgets> | 219 | </customwidgets> |
| 220 | + <tabstops> | ||
| 221 | + <tabstop>background</tabstop> | ||
| 222 | + <tabstop>coreTempButton</tabstop> | ||
| 223 | + <tabstop>cancelButton</tabstop> | ||
| 224 | + <tabstop>applyButton</tabstop> | ||
| 225 | + </tabstops> | ||
| 211 | <resources/> | 226 | <resources/> |
| 212 | <connections/> | 227 | <connections/> |
| 213 | </ui> | 228 | </ui> |
app/gui/oven_control/programmingmanualwindow.cpp
| @@ -66,6 +66,19 @@ ProgrammingManualWindow::ProgrammingManualWindow(QWidget *parent, Define::Mode m | @@ -66,6 +66,19 @@ ProgrammingManualWindow::ProgrammingManualWindow(QWidget *parent, Define::Mode m | ||
| 66 | 66 | ||
| 67 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 67 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 68 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 68 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 69 | + | ||
| 70 | + setFocus(); | ||
| 71 | + | ||
| 72 | + afterThreeSecsTimer.setSingleShot(true); | ||
| 73 | + afterThreeSecsTimer.setInterval(3000); | ||
| 74 | + connect(&afterThreeSecsTimer, SIGNAL(timeout()), SLOT(afterThreeSecs())); | ||
| 75 | + | ||
| 76 | + foreach (QWidget *w, findChildren<QWidget *>()) | ||
| 77 | + w->installEventFilter(this); | ||
| 78 | + | ||
| 79 | + installEventFilter(this); | ||
| 80 | + | ||
| 81 | + afterThreeSecsTimer.start(); | ||
| 69 | } | 82 | } |
| 70 | 83 | ||
| 71 | ProgrammingManualWindow::~ProgrammingManualWindow() | 84 | ProgrammingManualWindow::~ProgrammingManualWindow() |
| @@ -73,6 +86,24 @@ ProgrammingManualWindow::~ProgrammingManualWindow() | @@ -73,6 +86,24 @@ ProgrammingManualWindow::~ProgrammingManualWindow() | ||
| 73 | delete ui; | 86 | delete ui; |
| 74 | } | 87 | } |
| 75 | 88 | ||
| 89 | +bool ProgrammingManualWindow::eventFilter(QObject */*watched*/, QEvent *event) | ||
| 90 | +{ | ||
| 91 | + switch (event->type()) | ||
| 92 | + { | ||
| 93 | + case QEvent::KeyPress: | ||
| 94 | + case QEvent::KeyRelease: | ||
| 95 | + case QEvent::MouseButtonPress: | ||
| 96 | + case QEvent::MouseButtonRelease: | ||
| 97 | + case QEvent::MouseMove: | ||
| 98 | + afterThreeSecsTimer.start(); | ||
| 99 | + break; | ||
| 100 | + default: | ||
| 101 | + break; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + return false; | ||
| 105 | +} | ||
| 106 | + | ||
| 76 | void ProgrammingManualWindow::keyPressEvent(QKeyEvent *event) | 107 | void ProgrammingManualWindow::keyPressEvent(QKeyEvent *event) |
| 77 | { | 108 | { |
| 78 | switch (event->key()) | 109 | switch (event->key()) |
| @@ -128,17 +159,92 @@ int ProgrammingManualWindow::timeToSlider(int secs) | @@ -128,17 +159,92 @@ int ProgrammingManualWindow::timeToSlider(int secs) | ||
| 128 | 159 | ||
| 129 | void ProgrammingManualWindow::onEncoderLeft() | 160 | void ProgrammingManualWindow::onEncoderLeft() |
| 130 | { | 161 | { |
| 162 | + focusPreviousChild(); | ||
| 131 | 163 | ||
| 164 | + QWidget *focused = focusWidget(); | ||
| 165 | + if (focused == ui->steamButton) | ||
| 166 | + { | ||
| 167 | + if (ui->steamButton->isChecked()) | ||
| 168 | + focusPreviousChild(); | ||
| 169 | + } | ||
| 170 | + else if (focused == ui->combiButton) | ||
| 171 | + { | ||
| 172 | + if (ui->combiButton->isChecked()) | ||
| 173 | + focusPreviousChild(); | ||
| 174 | + } | ||
| 175 | + else if (focused == ui->dryheatButton) | ||
| 176 | + { | ||
| 177 | + if (ui->dryheatButton->isChecked()) | ||
| 178 | + focusPreviousChild(); | ||
| 179 | + } | ||
| 132 | } | 180 | } |
| 133 | 181 | ||
| 134 | void ProgrammingManualWindow::onEncoderRight() | 182 | void ProgrammingManualWindow::onEncoderRight() |
| 135 | { | 183 | { |
| 136 | - | 184 | + QWidget *focused = focusWidget(); |
| 185 | + if (focused == NULL || focused == this) | ||
| 186 | + { | ||
| 187 | + if (ui->steamButton->isChecked() || ui->dryheatButton->isChecked()) | ||
| 188 | + ui->tempButton->setFocus(); | ||
| 189 | + else if (ui->combiButton->isChecked()) | ||
| 190 | + ui->humidityButton->setFocus(); | ||
| 191 | + } | ||
| 192 | + else | ||
| 193 | + { | ||
| 194 | + focusNextChild(); | ||
| 195 | + | ||
| 196 | + focused = focusWidget(); | ||
| 197 | + if (focused == ui->steamButton) | ||
| 198 | + { | ||
| 199 | + if (ui->steamButton->isChecked()) | ||
| 200 | + focusNextChild(); | ||
| 201 | + } | ||
| 202 | + else if (focused == ui->combiButton) | ||
| 203 | + { | ||
| 204 | + if (ui->combiButton->isChecked()) | ||
| 205 | + focusNextChild(); | ||
| 206 | + } | ||
| 207 | + else if (focused == ui->dryheatButton) | ||
| 208 | + { | ||
| 209 | + if (ui->dryheatButton->isChecked()) | ||
| 210 | + focusNextChild(); | ||
| 211 | + } | ||
| 212 | + } | ||
| 137 | } | 213 | } |
| 138 | 214 | ||
| 139 | void ProgrammingManualWindow::onEncoderClicked(QWidget *clicked) | 215 | void ProgrammingManualWindow::onEncoderClicked(QWidget *clicked) |
| 140 | { | 216 | { |
| 217 | + if (clicked == NULL) | ||
| 218 | + return; | ||
| 141 | 219 | ||
| 220 | + if (clicked->inherits("QPushButton")) | ||
| 221 | + { | ||
| 222 | + QPushButton *b = qobject_cast<QPushButton *>(clicked); | ||
| 223 | + if (b) | ||
| 224 | + { | ||
| 225 | + b->click(); | ||
| 226 | + | ||
| 227 | + if (b == ui->steamButton || b == ui->dryheatButton) | ||
| 228 | + ui->tempButton->setFocus(); | ||
| 229 | + else if (b == ui->combiButton) | ||
| 230 | + ui->humidityButton->setFocus(); | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + else if (clicked->inherits("Slider")) | ||
| 234 | + { | ||
| 235 | + Slider *slider = qobject_cast<Slider *>(clicked); | ||
| 236 | + if (slider) | ||
| 237 | + { | ||
| 238 | + if (slider == ui->humiditySlider) | ||
| 239 | + ui->humidityButton->setFocus(); | ||
| 240 | + else if (slider == ui->tempSlider) | ||
| 241 | + ui->tempButton->setFocus(); | ||
| 242 | + else if (slider == ui->timeSlider) | ||
| 243 | + ui->timeButton->setFocus(); | ||
| 244 | + else if (slider == ui->interTempSlider) | ||
| 245 | + ui->interTempButton->setFocus(); | ||
| 246 | + } | ||
| 247 | + } | ||
| 142 | } | 248 | } |
| 143 | 249 | ||
| 144 | void ProgrammingManualWindow::setDefault(Define::Mode mode) | 250 | void ProgrammingManualWindow::setDefault(Define::Mode mode) |
| @@ -147,6 +253,8 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | @@ -147,6 +253,8 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | ||
| 147 | { | 253 | { |
| 148 | case Define::SteamMode: | 254 | case Define::SteamMode: |
| 149 | ui->steamButton->setChecked(true); | 255 | ui->steamButton->setChecked(true); |
| 256 | + ui->combiButton->setChecked(false); | ||
| 257 | + ui->dryheatButton->setChecked(false); | ||
| 150 | ui->humiditySlider->setEnabled(false); | 258 | ui->humiditySlider->setEnabled(false); |
| 151 | ui->humiditySlider->setValue(100); | 259 | ui->humiditySlider->setValue(100); |
| 152 | ui->tempSlider->setRange(30, 130); | 260 | ui->tempSlider->setRange(30, 130); |
| @@ -161,7 +269,9 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | @@ -161,7 +269,9 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | ||
| 161 | this->mode = mode; | 269 | this->mode = mode; |
| 162 | break; | 270 | break; |
| 163 | case Define::CombiMode: | 271 | case Define::CombiMode: |
| 272 | + ui->steamButton->setChecked(false); | ||
| 164 | ui->combiButton->setChecked(true); | 273 | ui->combiButton->setChecked(true); |
| 274 | + ui->dryheatButton->setChecked(false); | ||
| 165 | ui->humiditySlider->setEnabled(true); | 275 | ui->humiditySlider->setEnabled(true); |
| 166 | ui->humiditySlider->setValue(50); | 276 | ui->humiditySlider->setValue(50); |
| 167 | ui->tempSlider->setRange(30, 300); | 277 | ui->tempSlider->setRange(30, 300); |
| @@ -176,6 +286,8 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | @@ -176,6 +286,8 @@ void ProgrammingManualWindow::setDefault(Define::Mode mode) | ||
| 176 | this->mode = mode; | 286 | this->mode = mode; |
| 177 | break; | 287 | break; |
| 178 | case Define::DryMode: | 288 | case Define::DryMode: |
| 289 | + ui->steamButton->setChecked(false); | ||
| 290 | + ui->combiButton->setChecked(false); | ||
| 179 | ui->dryheatButton->setChecked(true); | 291 | ui->dryheatButton->setChecked(true); |
| 180 | ui->humiditySlider->setEnabled(false); | 292 | ui->humiditySlider->setEnabled(false); |
| 181 | ui->humiditySlider->setValue(0); | 293 | ui->humiditySlider->setValue(0); |
| @@ -219,22 +331,7 @@ void ProgrammingManualWindow::updateTimeLabel() | @@ -219,22 +331,7 @@ void ProgrammingManualWindow::updateTimeLabel() | ||
| 219 | 331 | ||
| 220 | void ProgrammingManualWindow::updateCoreTempButton() | 332 | void ProgrammingManualWindow::updateCoreTempButton() |
| 221 | { | 333 | { |
| 222 | - if (ui->interTempSlider->isEnabled()) | ||
| 223 | - ui->interTempButton->setStyleSheet("\ | ||
| 224 | -QPushButton {\ | ||
| 225 | - image: url(:/images/slider_icon/core_temp_enabled.png);\ | ||
| 226 | -}\ | ||
| 227 | -QPushButton:pressed {\ | ||
| 228 | - image: url(:/images/slider_icon/core_temp_ov.png);\ | ||
| 229 | -}"); | ||
| 230 | - else | ||
| 231 | - ui->interTempButton->setStyleSheet("\ | ||
| 232 | -QPushButton {\ | ||
| 233 | - image: url(:/images/slider_icon/core_temp.png);\ | ||
| 234 | -}\ | ||
| 235 | -QPushButton:pressed {\ | ||
| 236 | - image: url(:/images/slider_icon/core_temp_ov.png);\ | ||
| 237 | -}"); | 334 | + ui->interTempButton->setChecked(ui->interTempSlider->isEnabled()); |
| 238 | } | 335 | } |
| 239 | 336 | ||
| 240 | void ProgrammingManualWindow::updateCoreTempLabel() | 337 | void ProgrammingManualWindow::updateCoreTempLabel() |
| @@ -276,6 +373,24 @@ void ProgrammingManualWindow::updateFanButton() | @@ -276,6 +373,24 @@ void ProgrammingManualWindow::updateFanButton() | ||
| 276 | } | 373 | } |
| 277 | } | 374 | } |
| 278 | 375 | ||
| 376 | +void ProgrammingManualWindow::afterThreeSecs() | ||
| 377 | +{ | ||
| 378 | + Slider *slider = qobject_cast<Slider *>(focusWidget()); | ||
| 379 | + if (slider) | ||
| 380 | + { | ||
| 381 | + if (slider == ui->humiditySlider) | ||
| 382 | + ui->humidityButton->setFocus(); | ||
| 383 | + else if (slider == ui->tempSlider) | ||
| 384 | + ui->tempButton->setFocus(); | ||
| 385 | + else if (slider == ui->timeSlider) | ||
| 386 | + ui->timeButton->setFocus(); | ||
| 387 | + else if (slider == ui->interTempSlider) | ||
| 388 | + ui->interTempButton->setFocus(); | ||
| 389 | + | ||
| 390 | + afterThreeSecsTimer.start(); | ||
| 391 | + } | ||
| 392 | +} | ||
| 393 | + | ||
| 279 | void ProgrammingManualWindow::onCoreTempEnabled(int celsius) | 394 | void ProgrammingManualWindow::onCoreTempEnabled(int celsius) |
| 280 | { | 395 | { |
| 281 | ui->interTempSlider->setEnabled(true); | 396 | ui->interTempSlider->setEnabled(true); |
| @@ -300,6 +415,21 @@ void ProgrammingManualWindow::on_dryheatButton_clicked() | @@ -300,6 +415,21 @@ void ProgrammingManualWindow::on_dryheatButton_clicked() | ||
| 300 | setDefault(Define::DryMode); | 415 | setDefault(Define::DryMode); |
| 301 | } | 416 | } |
| 302 | 417 | ||
| 418 | +void ProgrammingManualWindow::on_humidityButton_clicked() | ||
| 419 | +{ | ||
| 420 | + ui->humiditySlider->setFocus(); | ||
| 421 | +} | ||
| 422 | + | ||
| 423 | +void ProgrammingManualWindow::on_tempButton_clicked() | ||
| 424 | +{ | ||
| 425 | + ui->tempSlider->setFocus(); | ||
| 426 | +} | ||
| 427 | + | ||
| 428 | +void ProgrammingManualWindow::on_timeButton_clicked() | ||
| 429 | +{ | ||
| 430 | + ui->timeSlider->setFocus(); | ||
| 431 | +} | ||
| 432 | + | ||
| 303 | void ProgrammingManualWindow::on_interTempButton_clicked() | 433 | void ProgrammingManualWindow::on_interTempButton_clicked() |
| 304 | { | 434 | { |
| 305 | if (ui->interTempSlider->isEnabled()) | 435 | if (ui->interTempSlider->isEnabled()) |
| @@ -313,6 +443,8 @@ void ProgrammingManualWindow::on_interTempButton_clicked() | @@ -313,6 +443,8 @@ void ProgrammingManualWindow::on_interTempButton_clicked() | ||
| 313 | { | 443 | { |
| 314 | ProgrammingManualCoreTempPopup *p = new ProgrammingManualCoreTempPopup(this); | 444 | ProgrammingManualCoreTempPopup *p = new ProgrammingManualCoreTempPopup(this); |
| 315 | connect(p, SIGNAL(coreTempEnabled(int)), SLOT(onCoreTempEnabled(int))); | 445 | connect(p, SIGNAL(coreTempEnabled(int)), SLOT(onCoreTempEnabled(int))); |
| 446 | + connect(p, SIGNAL(destroyed(QObject*)), SLOT(updateCoreTempButton())); | ||
| 447 | + connect(p, SIGNAL(destroyed(QObject*)), ui->interTempButton, SLOT(setFocus())); | ||
| 316 | p->showFullScreen(); | 448 | p->showFullScreen(); |
| 317 | } | 449 | } |
| 318 | } | 450 | } |
app/gui/oven_control/programmingmanualwindow.h
| @@ -17,6 +17,8 @@ public: | @@ -17,6 +17,8 @@ public: | ||
| 17 | explicit ProgrammingManualWindow(QWidget *parent, Define::Mode mode); | 17 | explicit ProgrammingManualWindow(QWidget *parent, Define::Mode mode); |
| 18 | ~ProgrammingManualWindow(); | 18 | ~ProgrammingManualWindow(); |
| 19 | 19 | ||
| 20 | + bool eventFilter(QObject *watched, QEvent *event); | ||
| 21 | + | ||
| 20 | protected: | 22 | protected: |
| 21 | void keyPressEvent(QKeyEvent *event); | 23 | void keyPressEvent(QKeyEvent *event); |
| 22 | void keyReleaseEvent(QKeyEvent *event); | 24 | void keyReleaseEvent(QKeyEvent *event); |
| @@ -36,6 +38,8 @@ private: | @@ -36,6 +38,8 @@ private: | ||
| 36 | void onEncoderRight(); | 38 | void onEncoderRight(); |
| 37 | void onEncoderClicked(QWidget *clicked); | 39 | void onEncoderClicked(QWidget *clicked); |
| 38 | 40 | ||
| 41 | + QTimer afterThreeSecsTimer; | ||
| 42 | + | ||
| 39 | private slots: | 43 | private slots: |
| 40 | void setDefault(Define::Mode mode); | 44 | void setDefault(Define::Mode mode); |
| 41 | void setFan(int level); | 45 | void setFan(int level); |
| @@ -45,6 +49,7 @@ private slots: | @@ -45,6 +49,7 @@ private slots: | ||
| 45 | void updateCoreTempButton(); | 49 | void updateCoreTempButton(); |
| 46 | void updateCoreTempLabel(); | 50 | void updateCoreTempLabel(); |
| 47 | void updateFanButton(); | 51 | void updateFanButton(); |
| 52 | + void afterThreeSecs(); | ||
| 48 | 53 | ||
| 49 | void onCoreTempEnabled(int celsius); | 54 | void onCoreTempEnabled(int celsius); |
| 50 | 55 | ||
| @@ -58,6 +63,12 @@ private slots: | @@ -58,6 +63,12 @@ private slots: | ||
| 58 | void on_helpButton_clicked(); | 63 | void on_helpButton_clicked(); |
| 59 | void on_okButton_clicked(); | 64 | void on_okButton_clicked(); |
| 60 | 65 | ||
| 66 | + void on_humidityButton_clicked(); | ||
| 67 | + | ||
| 68 | + void on_tempButton_clicked(); | ||
| 69 | + | ||
| 70 | + void on_timeButton_clicked(); | ||
| 71 | + | ||
| 61 | signals: | 72 | signals: |
| 62 | void added(); | 73 | void added(); |
| 63 | }; | 74 | }; |
app/gui/oven_control/programmingmanualwindow.ui
| @@ -207,9 +207,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | @@ -207,9 +207,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_dryheat.png); | ||
| 207 | <property name="checkable"> | 207 | <property name="checkable"> |
| 208 | <bool>true</bool> | 208 | <bool>true</bool> |
| 209 | </property> | 209 | </property> |
| 210 | - <property name="autoExclusive"> | ||
| 211 | - <bool>true</bool> | ||
| 212 | - </property> | ||
| 213 | <property name="style" stdset="0"> | 210 | <property name="style" stdset="0"> |
| 214 | <string notr="true">mode</string> | 211 | <string notr="true">mode</string> |
| 215 | </property> | 212 | </property> |
| @@ -596,9 +593,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | @@ -596,9 +593,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_steam.png); } | ||
| 596 | <property name="checkable"> | 593 | <property name="checkable"> |
| 597 | <bool>true</bool> | 594 | <bool>true</bool> |
| 598 | </property> | 595 | </property> |
| 599 | - <property name="autoExclusive"> | ||
| 600 | - <bool>true</bool> | ||
| 601 | - </property> | ||
| 602 | <property name="style" stdset="0"> | 596 | <property name="style" stdset="0"> |
| 603 | <string notr="true">mode</string> | 597 | <string notr="true">mode</string> |
| 604 | </property> | 598 | </property> |
| @@ -757,8 +751,12 @@ QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/humidit | @@ -757,8 +751,12 @@ QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/humidit | ||
| 757 | </property> | 751 | </property> |
| 758 | <property name="styleSheet"> | 752 | <property name="styleSheet"> |
| 759 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp.png); } | 753 | <string notr="true">QPushButton { image: url(:/images/slider_icon/core_temp.png); } |
| 754 | +QPushButton:checked { image: url(:/images/slider_icon/core_temp_enabled.png); } | ||
| 760 | QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/core_temp_ov.png); }</string> | 755 | QPushButton:pressed, QPushButton:focus { image: url(:/images/slider_icon/core_temp_ov.png); }</string> |
| 761 | </property> | 756 | </property> |
| 757 | + <property name="checkable"> | ||
| 758 | + <bool>true</bool> | ||
| 759 | + </property> | ||
| 762 | <property name="style" stdset="0"> | 760 | <property name="style" stdset="0"> |
| 763 | <string notr="true">icon</string> | 761 | <string notr="true">icon</string> |
| 764 | </property> | 762 | </property> |
| @@ -783,9 +781,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | @@ -783,9 +781,6 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | ||
| 783 | <property name="checkable"> | 781 | <property name="checkable"> |
| 784 | <bool>true</bool> | 782 | <bool>true</bool> |
| 785 | </property> | 783 | </property> |
| 786 | - <property name="autoExclusive"> | ||
| 787 | - <bool>true</bool> | ||
| 788 | - </property> | ||
| 789 | <property name="style" stdset="0"> | 784 | <property name="style" stdset="0"> |
| 790 | <string notr="true">mode</string> | 785 | <string notr="true">mode</string> |
| 791 | </property> | 786 | </property> |
| @@ -871,41 +866,53 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | @@ -871,41 +866,53 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | ||
| 871 | <property name="geometry"> | 866 | <property name="geometry"> |
| 872 | <rect> | 867 | <rect> |
| 873 | <x>185</x> | 868 | <x>185</x> |
| 874 | - <y>875</y> | 869 | + <y>915</y> |
| 875 | <width>666</width> | 870 | <width>666</width> |
| 876 | - <height>140</height> | 871 | + <height>60</height> |
| 877 | </rect> | 872 | </rect> |
| 878 | </property> | 873 | </property> |
| 874 | + <property name="focusPolicy"> | ||
| 875 | + <enum>Qt::ClickFocus</enum> | ||
| 876 | + </property> | ||
| 879 | </widget> | 877 | </widget> |
| 880 | <widget class="Slider" name="interTempSlider" native="true"> | 878 | <widget class="Slider" name="interTempSlider" native="true"> |
| 881 | <property name="geometry"> | 879 | <property name="geometry"> |
| 882 | <rect> | 880 | <rect> |
| 883 | <x>185</x> | 881 | <x>185</x> |
| 884 | - <y>1175</y> | 882 | + <y>1215</y> |
| 885 | <width>666</width> | 883 | <width>666</width> |
| 886 | - <height>140</height> | 884 | + <height>60</height> |
| 887 | </rect> | 885 | </rect> |
| 888 | </property> | 886 | </property> |
| 887 | + <property name="focusPolicy"> | ||
| 888 | + <enum>Qt::ClickFocus</enum> | ||
| 889 | + </property> | ||
| 889 | </widget> | 890 | </widget> |
| 890 | <widget class="Slider" name="timeSlider" native="true"> | 891 | <widget class="Slider" name="timeSlider" native="true"> |
| 891 | <property name="geometry"> | 892 | <property name="geometry"> |
| 892 | <rect> | 893 | <rect> |
| 893 | <x>185</x> | 894 | <x>185</x> |
| 894 | - <y>1025</y> | 895 | + <y>1065</y> |
| 895 | <width>666</width> | 896 | <width>666</width> |
| 896 | - <height>140</height> | 897 | + <height>60</height> |
| 897 | </rect> | 898 | </rect> |
| 898 | </property> | 899 | </property> |
| 900 | + <property name="focusPolicy"> | ||
| 901 | + <enum>Qt::ClickFocus</enum> | ||
| 902 | + </property> | ||
| 899 | </widget> | 903 | </widget> |
| 900 | <widget class="Slider" name="humiditySlider" native="true"> | 904 | <widget class="Slider" name="humiditySlider" native="true"> |
| 901 | <property name="geometry"> | 905 | <property name="geometry"> |
| 902 | <rect> | 906 | <rect> |
| 903 | <x>185</x> | 907 | <x>185</x> |
| 904 | - <y>725</y> | 908 | + <y>765</y> |
| 905 | <width>666</width> | 909 | <width>666</width> |
| 906 | - <height>140</height> | 910 | + <height>60</height> |
| 907 | </rect> | 911 | </rect> |
| 908 | </property> | 912 | </property> |
| 913 | + <property name="focusPolicy"> | ||
| 914 | + <enum>Qt::ClickFocus</enum> | ||
| 915 | + </property> | ||
| 909 | </widget> | 916 | </widget> |
| 910 | </widget> | 917 | </widget> |
| 911 | </widget> | 918 | </widget> |
| @@ -933,6 +940,20 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | @@ -933,6 +940,20 @@ QPushButton:checked { background-image: url(:/images/cook_mode/big_combi.png); } | ||
| 933 | <container>1</container> | 940 | <container>1</container> |
| 934 | </customwidget> | 941 | </customwidget> |
| 935 | </customwidgets> | 942 | </customwidgets> |
| 943 | + <tabstops> | ||
| 944 | + <tabstop>steamButton</tabstop> | ||
| 945 | + <tabstop>combiButton</tabstop> | ||
| 946 | + <tabstop>dryheatButton</tabstop> | ||
| 947 | + <tabstop>humidityButton</tabstop> | ||
| 948 | + <tabstop>tempButton</tabstop> | ||
| 949 | + <tabstop>timeButton</tabstop> | ||
| 950 | + <tabstop>interTempButton</tabstop> | ||
| 951 | + <tabstop>fanButton</tabstop> | ||
| 952 | + <tabstop>backButton</tabstop> | ||
| 953 | + <tabstop>configButton</tabstop> | ||
| 954 | + <tabstop>helpButton</tabstop> | ||
| 955 | + <tabstop>okButton</tabstop> | ||
| 956 | + </tabstops> | ||
| 936 | <resources> | 957 | <resources> |
| 937 | <include location="resources.qrc"/> | 958 | <include location="resources.qrc"/> |
| 938 | </resources> | 959 | </resources> |
app/gui/oven_control/programmingselectionwindow.cpp
| @@ -101,6 +101,8 @@ void ProgrammingSelectionWindow::onEncoderClicked(QWidget *clicked) | @@ -101,6 +101,8 @@ void ProgrammingSelectionWindow::onEncoderClicked(QWidget *clicked) | ||
| 101 | 101 | ||
| 102 | void ProgrammingSelectionWindow::onModeClicked(Define::Mode mode) | 102 | void ProgrammingSelectionWindow::onModeClicked(Define::Mode mode) |
| 103 | { | 103 | { |
| 104 | + setFocus(); | ||
| 105 | + | ||
| 104 | ProgrammingManualWindow *w = new ProgrammingManualWindow(this, mode); | 106 | ProgrammingManualWindow *w = new ProgrammingManualWindow(this, mode); |
| 105 | connect(w, SIGNAL(added()), SIGNAL(added())); | 107 | connect(w, SIGNAL(added()), SIGNAL(added())); |
| 106 | connect(w, SIGNAL(added()), SLOT(hide())); | 108 | connect(w, SIGNAL(added()), SLOT(hide())); |
| @@ -112,6 +114,8 @@ void ProgrammingSelectionWindow::onModeClicked(Define::Mode mode) | @@ -112,6 +114,8 @@ void ProgrammingSelectionWindow::onModeClicked(Define::Mode mode) | ||
| 112 | 114 | ||
| 113 | void ProgrammingSelectionWindow::onCookTypeClicked(Define::CookType type) | 115 | void ProgrammingSelectionWindow::onCookTypeClicked(Define::CookType type) |
| 114 | { | 116 | { |
| 117 | + setFocus(); | ||
| 118 | + | ||
| 115 | ProgrammingAutoSelectionWindow *w = new ProgrammingAutoSelectionWindow(this, type); | 119 | ProgrammingAutoSelectionWindow *w = new ProgrammingAutoSelectionWindow(this, type); |
| 116 | connect(w, SIGNAL(added()), SIGNAL(added())); | 120 | connect(w, SIGNAL(added()), SIGNAL(added())); |
| 117 | connect(w, SIGNAL(added()), SLOT(hide())); | 121 | connect(w, SIGNAL(added()), SLOT(hide())); |
app/gui/oven_control/programmingselectionwindow.ui
| @@ -161,6 +161,9 @@ QPushButton:disabled { background-image: url(:/images/cook_type/fish_hide.png); | @@ -161,6 +161,9 @@ QPushButton:disabled { background-image: url(:/images/cook_type/fish_hide.png); | ||
| 161 | <verstretch>0</verstretch> | 161 | <verstretch>0</verstretch> |
| 162 | </sizepolicy> | 162 | </sizepolicy> |
| 163 | </property> | 163 | </property> |
| 164 | + <property name="focusPolicy"> | ||
| 165 | + <enum>Qt::NoFocus</enum> | ||
| 166 | + </property> | ||
| 164 | <property name="styleSheet"> | 167 | <property name="styleSheet"> |
| 165 | <string notr="true">QPushButton { background-image: url(:/images/main_button/multi.png); } | 168 | <string notr="true">QPushButton { background-image: url(:/images/main_button/multi.png); } |
| 166 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/multi_ov.png); } | 169 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/multi_ov.png); } |
| @@ -445,6 +448,9 @@ QPushButton:disabled { background-image: url(:/images/cook_type/etc_hide.png); } | @@ -445,6 +448,9 @@ QPushButton:disabled { background-image: url(:/images/cook_type/etc_hide.png); } | ||
| 445 | <verstretch>0</verstretch> | 448 | <verstretch>0</verstretch> |
| 446 | </sizepolicy> | 449 | </sizepolicy> |
| 447 | </property> | 450 | </property> |
| 451 | + <property name="focusPolicy"> | ||
| 452 | + <enum>Qt::NoFocus</enum> | ||
| 453 | + </property> | ||
| 448 | <property name="styleSheet"> | 454 | <property name="styleSheet"> |
| 449 | <string notr="true">QPushButton { background-image: url(:/images/main_button/wash.png); } | 455 | <string notr="true">QPushButton { background-image: url(:/images/main_button/wash.png); } |
| 450 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/wash_ov.png); } | 456 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/wash_ov.png); } |
| @@ -475,6 +481,9 @@ QPushButton:disabled { background-image: url(:/images/main_button/wash_hide.png) | @@ -475,6 +481,9 @@ QPushButton:disabled { background-image: url(:/images/main_button/wash_hide.png) | ||
| 475 | <verstretch>0</verstretch> | 481 | <verstretch>0</verstretch> |
| 476 | </sizepolicy> | 482 | </sizepolicy> |
| 477 | </property> | 483 | </property> |
| 484 | + <property name="focusPolicy"> | ||
| 485 | + <enum>Qt::NoFocus</enum> | ||
| 486 | + </property> | ||
| 478 | <property name="styleSheet"> | 487 | <property name="styleSheet"> |
| 479 | <string notr="true">QPushButton { background-image: url(:/images/main_button/custom.png); } | 488 | <string notr="true">QPushButton { background-image: url(:/images/main_button/custom.png); } |
| 480 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/custom_ov.png); } | 489 | QPushButton:pressed, QPushButton:focus { background-image: url(:/images/main_button/custom_ov.png); } |
| @@ -724,11 +733,13 @@ QPushButton:disabled { background-image: url(:/images/cook_type/bread_hide.png); | @@ -724,11 +733,13 @@ QPushButton:disabled { background-image: url(:/images/cook_type/bread_hide.png); | ||
| 724 | <tabstop>breadButton</tabstop> | 733 | <tabstop>breadButton</tabstop> |
| 725 | <tabstop>etcButton</tabstop> | 734 | <tabstop>etcButton</tabstop> |
| 726 | <tabstop>primeButton</tabstop> | 735 | <tabstop>primeButton</tabstop> |
| 727 | - <tabstop>multiButton</tabstop> | ||
| 728 | - <tabstop>programmingButton</tabstop> | ||
| 729 | - <tabstop>washButton</tabstop> | 736 | + <tabstop>backButton</tabstop> |
| 730 | <tabstop>configButton</tabstop> | 737 | <tabstop>configButton</tabstop> |
| 731 | <tabstop>helpButton</tabstop> | 738 | <tabstop>helpButton</tabstop> |
| 739 | + <tabstop>okButton</tabstop> | ||
| 740 | + <tabstop>washButton</tabstop> | ||
| 741 | + <tabstop>multiButton</tabstop> | ||
| 742 | + <tabstop>programmingButton</tabstop> | ||
| 732 | </tabstops> | 743 | </tabstops> |
| 733 | <resources/> | 744 | <resources/> |
| 734 | <connections/> | 745 | <connections/> |
app/gui/oven_control/programmingwindow.cpp
| @@ -25,6 +25,8 @@ ProgrammingWindow::ProgrammingWindow(QWidget *parent) : | @@ -25,6 +25,8 @@ ProgrammingWindow::ProgrammingWindow(QWidget *parent) : | ||
| 25 | 25 | ||
| 26 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 26 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 27 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 27 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 28 | + | ||
| 29 | + setFocus(); | ||
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | ProgrammingWindow::~ProgrammingWindow() | 32 | ProgrammingWindow::~ProgrammingWindow() |
| @@ -42,6 +44,9 @@ void ProgrammingWindow::listAuto() | @@ -42,6 +44,9 @@ void ProgrammingWindow::listAuto() | ||
| 42 | ui->autoButton->blockSignals(false); | 44 | ui->autoButton->blockSignals(false); |
| 43 | } | 45 | } |
| 44 | 46 | ||
| 47 | + if (ui->manualButton->isChecked()) | ||
| 48 | + ui->manualButton->setChecked(false); | ||
| 49 | + | ||
| 45 | listButtons(CookProgram::listAuto()); | 50 | listButtons(CookProgram::listAuto()); |
| 46 | } | 51 | } |
| 47 | 52 | ||
| @@ -54,6 +59,9 @@ void ProgrammingWindow::listManual() | @@ -54,6 +59,9 @@ void ProgrammingWindow::listManual() | ||
| 54 | ui->manualButton->blockSignals(false); | 59 | ui->manualButton->blockSignals(false); |
| 55 | } | 60 | } |
| 56 | 61 | ||
| 62 | + if (ui->autoButton->isChecked()) | ||
| 63 | + ui->autoButton->setChecked(false); | ||
| 64 | + | ||
| 57 | listButtons(CookProgram::listManual()); | 65 | listButtons(CookProgram::listManual()); |
| 58 | } | 66 | } |
| 59 | 67 | ||
| @@ -134,8 +142,23 @@ void ProgrammingWindow::listButtons(QList<CookRecord> record) | @@ -134,8 +142,23 @@ void ProgrammingWindow::listButtons(QList<CookRecord> record) | ||
| 134 | 142 | ||
| 135 | ui->addButton->show(); | 143 | ui->addButton->show(); |
| 136 | 144 | ||
| 145 | + setTabOrder(this, ui->autoButton); | ||
| 146 | + setTabOrder(ui->autoButton, ui->manualButton); | ||
| 147 | + setTabOrder(ui->manualButton, ui->addButton); | ||
| 148 | + | ||
| 149 | + QWidget *last = ui->addButton; | ||
| 137 | foreach (CookRecord r, record) | 150 | foreach (CookRecord r, record) |
| 138 | - newButton(r); | 151 | + { |
| 152 | + CookPanelButton *b = newButton(r); | ||
| 153 | + setTabOrder(last, b->bar()); | ||
| 154 | + setTabOrder(b->bar(), b->infoButton()); | ||
| 155 | + setTabOrder(b->infoButton(), b->deleteButton()); | ||
| 156 | + last = b->deleteButton(); | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + setTabOrder(last, ui->backButton); | ||
| 160 | + setTabOrder(ui->backButton, ui->saveButton); | ||
| 161 | + setTabOrder(ui->saveButton, ui->helpButton); | ||
| 139 | 162 | ||
| 140 | ui->scrollAreaWidgetContents->adjustSize(); | 163 | ui->scrollAreaWidgetContents->adjustSize(); |
| 141 | } | 164 | } |
| @@ -243,18 +266,32 @@ void ProgrammingWindow::on_addButton_clicked() | @@ -243,18 +266,32 @@ void ProgrammingWindow::on_addButton_clicked() | ||
| 243 | 266 | ||
| 244 | void ProgrammingWindow::on_autoButton_toggled(bool checked) | 267 | void ProgrammingWindow::on_autoButton_toggled(bool checked) |
| 245 | { | 268 | { |
| 246 | - if (!checked) | ||
| 247 | - return; | ||
| 248 | - | ||
| 249 | - listAuto(); | 269 | + if (checked) |
| 270 | + listAuto(); | ||
| 271 | + else | ||
| 272 | + { | ||
| 273 | + if (!ui->manualButton->isChecked()) | ||
| 274 | + { | ||
| 275 | + ui->autoButton->blockSignals(true); | ||
| 276 | + ui->autoButton->setChecked(true); | ||
| 277 | + ui->autoButton->blockSignals(false); | ||
| 278 | + } | ||
| 279 | + } | ||
| 250 | } | 280 | } |
| 251 | 281 | ||
| 252 | void ProgrammingWindow::on_manualButton_toggled(bool checked) | 282 | void ProgrammingWindow::on_manualButton_toggled(bool checked) |
| 253 | { | 283 | { |
| 254 | - if (!checked) | ||
| 255 | - return; | ||
| 256 | - | ||
| 257 | - listManual(); | 284 | + if (checked) |
| 285 | + listManual(); | ||
| 286 | + else | ||
| 287 | + { | ||
| 288 | + if (!ui->autoButton->isChecked()) | ||
| 289 | + { | ||
| 290 | + ui->manualButton->blockSignals(true); | ||
| 291 | + ui->manualButton->setChecked(true); | ||
| 292 | + ui->manualButton->blockSignals(false); | ||
| 293 | + } | ||
| 294 | + } | ||
| 258 | } | 295 | } |
| 259 | 296 | ||
| 260 | void ProgrammingWindow::on_backButton_clicked() | 297 | void ProgrammingWindow::on_backButton_clicked() |
| @@ -284,11 +321,13 @@ void ProgrammingWindow::on_helpButton_clicked() | @@ -284,11 +321,13 @@ void ProgrammingWindow::on_helpButton_clicked() | ||
| 284 | void ProgrammingWindow::onEncoderLeft() | 321 | void ProgrammingWindow::onEncoderLeft() |
| 285 | { | 322 | { |
| 286 | focusPreviousChild(); | 323 | focusPreviousChild(); |
| 324 | + ui->scrollArea->ensureWidgetVisible(focusWidget()); | ||
| 287 | } | 325 | } |
| 288 | 326 | ||
| 289 | void ProgrammingWindow::onEncoderRight() | 327 | void ProgrammingWindow::onEncoderRight() |
| 290 | { | 328 | { |
| 291 | focusNextChild(); | 329 | focusNextChild(); |
| 330 | + ui->scrollArea->ensureWidgetVisible(focusWidget()); | ||
| 292 | } | 331 | } |
| 293 | 332 | ||
| 294 | void ProgrammingWindow::onEncoderClicked(QWidget *clicked) | 333 | void ProgrammingWindow::onEncoderClicked(QWidget *clicked) |
app/gui/oven_control/programmingwindow.ui
| @@ -187,11 +187,8 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | @@ -187,11 +187,8 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | ||
| 187 | <property name="checkable"> | 187 | <property name="checkable"> |
| 188 | <bool>true</bool> | 188 | <bool>true</bool> |
| 189 | </property> | 189 | </property> |
| 190 | - <property name="autoExclusive"> | ||
| 191 | - <bool>true</bool> | ||
| 192 | - </property> | ||
| 193 | <property name="style" stdset="0"> | 190 | <property name="style" stdset="0"> |
| 194 | - <string>mode</string> | 191 | + <string notr="true">mode</string> |
| 195 | </property> | 192 | </property> |
| 196 | </widget> | 193 | </widget> |
| 197 | </item> | 194 | </item> |
| @@ -213,11 +210,8 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | @@ -213,11 +210,8 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | ||
| 213 | <property name="checkable"> | 210 | <property name="checkable"> |
| 214 | <bool>true</bool> | 211 | <bool>true</bool> |
| 215 | </property> | 212 | </property> |
| 216 | - <property name="autoExclusive"> | ||
| 217 | - <bool>true</bool> | ||
| 218 | - </property> | ||
| 219 | <property name="style" stdset="0"> | 213 | <property name="style" stdset="0"> |
| 220 | - <string>mode</string> | 214 | + <string notr="true">mode</string> |
| 221 | </property> | 215 | </property> |
| 222 | </widget> | 216 | </widget> |
| 223 | </item> | 217 | </item> |
| @@ -232,6 +226,9 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | @@ -232,6 +226,9 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/main | ||
| 232 | <height>803</height> | 226 | <height>803</height> |
| 233 | </rect> | 227 | </rect> |
| 234 | </property> | 228 | </property> |
| 229 | + <property name="focusPolicy"> | ||
| 230 | + <enum>Qt::NoFocus</enum> | ||
| 231 | + </property> | ||
| 235 | <property name="widgetResizable"> | 232 | <property name="widgetResizable"> |
| 236 | <bool>true</bool> | 233 | <bool>true</bool> |
| 237 | </property> | 234 | </property> |
| @@ -295,6 +292,14 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/bar_ | @@ -295,6 +292,14 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/etc/bar_ | ||
| 295 | <header>washwarnicon.h</header> | 292 | <header>washwarnicon.h</header> |
| 296 | </customwidget> | 293 | </customwidget> |
| 297 | </customwidgets> | 294 | </customwidgets> |
| 295 | + <tabstops> | ||
| 296 | + <tabstop>autoButton</tabstop> | ||
| 297 | + <tabstop>manualButton</tabstop> | ||
| 298 | + <tabstop>addButton</tabstop> | ||
| 299 | + <tabstop>backButton</tabstop> | ||
| 300 | + <tabstop>saveButton</tabstop> | ||
| 301 | + <tabstop>helpButton</tabstop> | ||
| 302 | + </tabstops> | ||
| 298 | <resources/> | 303 | <resources/> |
| 299 | <connections/> | 304 | <connections/> |
| 300 | </ui> | 305 | </ui> |