Commit bbd7d8f297255954573757ad4b8058939c26a262

Authored by 김태훈
1 parent 0bceaf0069
Exists in master and in 2 other branches fhd, fhd-demo

버튼 음향 추가

app/gui/oven_control/autocookconfigwindow.cpp
... ... @@ -5,6 +5,7 @@
5 5 #include "confirmpopup.h"
6 6 #include "stringer.h"
7 7 #include "favoritenamepopup.h"
  8 +#include "soundplayer.h"
8 9  
9 10 AutoCookConfigWindow::AutoCookConfigWindow(QWidget *parent, Cook cook) :
10 11 QMainWindow(parent),
... ... @@ -71,6 +72,11 @@ AutoCookConfigWindow::AutoCookConfigWindow(QWidget *parent, Cook cook) :
71 72  
72 73 setupUi();
73 74  
  75 + foreach (QPushButton *button, findChildren<QPushButton *>())
  76 + {
  77 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
  78 + }
  79 +
74 80 startTimer();
75 81 }
76 82  
... ...
app/gui/oven_control/autocookselectionwindow.cpp
... ... @@ -5,7 +5,7 @@
5 5 #include <QtDebug>
6 6  
7 7 #include "autocookconfigwindow.h"
8   -//#include "autocookwindow.h"
  8 +#include "soundplayer.h"
9 9  
10 10 AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookType type) :
11 11 QMainWindow(parent),
... ... @@ -51,6 +51,9 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy
51 51 sm->setMapping(pb, idx);
52 52 connect(pb, SIGNAL(clicked()), sm, SLOT(map()));
53 53 }
  54 +
  55 + foreach (QPushButton *button, findChildren<QPushButton *>())
  56 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
54 57 }
55 58  
56 59 AutoCookSelectionWindow::~AutoCookSelectionWindow()
... ...
app/gui/oven_control/autocookwindow.cpp
... ... @@ -6,6 +6,7 @@
6 6 #include "confirmpopup.h"
7 7 #include "favoritenamepopup.h"
8 8 #include "stringer.h"
  9 +#include "soundplayer.h"
9 10  
10 11 AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) :
11 12 QMainWindow(parent),
... ... @@ -55,6 +56,9 @@ AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) :
55 56  
56 57 CookHistory::record(setting);
57 58  
  59 + foreach (QPushButton *button, findChildren<QPushButton *>())
  60 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
  61 +
58 62 connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView()));
59 63 updateViewTimer.start(100);
60 64 }
... ...
app/gui/oven_control/configmastervolumedlg.cpp
... ... @@ -2,6 +2,8 @@
2 2 #include "configmastervolumedlg.h"
3 3 #include "ui_configmastervolumedlg.h"
4 4  
  5 +#include "soundplayer.h"
  6 +
5 7 using namespace Define;
6 8  
7 9 #define MAX_MASTER_VOL 7
... ... @@ -48,6 +50,8 @@ void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked()
48 50 item.d32 = m_nCurMasterVol;
49 51 cfg->setConfigValue(config_marster_vol,item);
50 52 ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  53 +
  54 + SoundPlayer::playClick();
51 55 }
52 56  
53 57 void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked()
... ... @@ -58,4 +62,6 @@ void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked()
58 62 item.d32 = m_nCurMasterVol;
59 63 cfg->setConfigValue(config_marster_vol,item);
60 64 ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  65 +
  66 + SoundPlayer::playClick();
61 67 }
... ...
app/gui/oven_control/confirmpopup.cpp
1 1 #include "confirmpopup.h"
2 2 #include "ui_confirmpopup.h"
3 3  
  4 +#include "soundplayer.h"
  5 +
4 6 ConfirmPopup::ConfirmPopup(QWidget *parent, QString text) :
5 7 QWidget(parent),
6 8 ui(new Ui::ConfirmPopup)
7 9 {
8 10 ui->setupUi(this);
9 11 ui->text->setText(text);
  12 +
  13 + foreach (QPushButton *button, findChildren<QPushButton *>())
  14 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
10 15 }
11 16  
12 17 ConfirmPopup::~ConfirmPopup()
... ...
app/gui/oven_control/cookpanelbutton.cpp
1 1 #include "cookpanelbutton.h"
2 2 #include "ui_cookpanelbutton.h"
3 3  
  4 +#include "soundplayer.h"
4 5 #include "manualcooksettingwidget.h"
5 6  
6 7 CookPanelButton::CookPanelButton(CookRecord record, QWidget *parent) :
... ... @@ -12,6 +13,9 @@ CookPanelButton::CookPanelButton(CookRecord record, QWidget *parent) :
12 13 ui->setupUi(this);
13 14  
14 15 setText(record.name);
  16 +
  17 + foreach (QPushButton *button, findChildren<QPushButton *>())
  18 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
15 19 }
16 20  
17 21 CookPanelButton::~CookPanelButton()
... ...
app/gui/oven_control/cooldownpopup.cpp
1 1 #include "cooldownpopup.h"
2 2 #include "ui_cooldownpopup.h"
3 3  
  4 +#include "soundplayer.h"
4 5 #include "stringer.h"
5 6  
6 7 CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) :
... ... @@ -50,6 +51,9 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) :
50 51 updateView();
51 52  
52 53 cooldownStartTimer.start();
  54 +
  55 + foreach (QPushButton *button, findChildren<QPushButton *>())
  56 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
53 57 }
54 58  
55 59 CooldownPopup::~CooldownPopup()
... ...
app/gui/oven_control/favoritenamepopup.cpp
1 1 #include "favoritenamepopup.h"
2 2 #include "ui_favoritenamepopup.h"
3 3  
  4 +#include "soundplayer.h"
4 5 #include "primewindow.h"
5 6  
6 7 FavoriteNamePopup::FavoriteNamePopup(QWidget *parent) :
... ... @@ -11,6 +12,9 @@ FavoriteNamePopup::FavoriteNamePopup(QWidget *parent) :
11 12  
12 13 ui->lineEdit->setFocus();
13 14 ui->lineEdit->selectAll();
  15 +
  16 + connect(ui->okButton, &QPushButton::pressed, SoundPlayer::playClick);
  17 + connect(ui->cancelButton, &QPushButton::pressed, SoundPlayer::playClick);
14 18 }
15 19  
16 20 FavoriteNamePopup::FavoriteNamePopup(QWidget *parent, ManualCookSetting setting) : FavoriteNamePopup(parent)
... ...
app/gui/oven_control/manualcookwindow.cpp
... ... @@ -109,6 +109,11 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) :
109 109 ui->steamLabel_12->hide();
110 110 ui->steamLabel_13->hide();
111 111 }
  112 +
  113 + foreach (QPushButton *button, findChildren<QPushButton *>())
  114 + {
  115 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
  116 + }
112 117 }
113 118  
114 119 ManualCookWindow::ManualCookWindow(QWidget *parent, ManualCookSetting setting)
... ... @@ -377,6 +382,9 @@ void ManualCookWindow::setOvenDefault(Define::Mode mode)
377 382  
378 383 void ManualCookWindow::start()
379 384 {
  385 + if (oven->cooking())
  386 + return;
  387 +
380 388 SoundPlayer::playStart();
381 389  
382 390 if (oven->time() > 0)
... ...
app/gui/oven_control/primewindow.cpp
... ... @@ -7,6 +7,7 @@
7 7  
8 8 #include "manualcooksettingwidget.h"
9 9 #include "cookhistory.h"
  10 +#include "soundplayer.h"
10 11  
11 12 PrimeWindow::PrimeWindow(QWidget *parent) :
12 13 QMainWindow(parent),
... ... @@ -20,6 +21,9 @@ PrimeWindow::PrimeWindow(QWidget *parent) :
20 21 ui->verticalScrollLayout->setAlignment(Qt::AlignTop);
21 22  
22 23 lastInfoDisplayed = NULL;
  24 +
  25 + foreach (QPushButton *button, findChildren<QPushButton *>())
  26 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
23 27 }
24 28  
25 29 PrimeWindow::~PrimeWindow()
... ...
app/gui/oven_control/washwindow.cpp
... ... @@ -45,6 +45,9 @@ WashWindow::WashWindow(QWidget *parent) :
45 45 returnToClockTimer.setSingleShot(true);
46 46 returnToClockTimer.setInterval(10 * 1000);
47 47 connect(&returnToClockTimer, SIGNAL(timeout()), SLOT(returnToClock()));
  48 +
  49 + foreach (QPushButton *button, findChildren<QPushButton *>())
  50 + connect(button, &QPushButton::pressed, SoundPlayer::playClick);
48 51 }
49 52  
50 53 WashWindow::~WashWindow()
... ... @@ -54,8 +57,6 @@ WashWindow::~WashWindow()
54 57  
55 58 void WashWindow::start(int type)
56 59 {
57   - SoundPlayer::playClick();
58   -
59 60 if (selected)
60 61 return;
61 62  
... ... @@ -233,8 +234,6 @@ void WashWindow::onChanged()
233 234  
234 235 void WashWindow::on_backButton_clicked()
235 236 {
236   - SoundPlayer::playClick();
237   -
238 237 if (started)
239 238 stop();
240 239 else
... ... @@ -243,14 +242,10 @@ void WashWindow::on_backButton_clicked()
243 242  
244 243 void WashWindow::on_configButton_clicked()
245 244 {
246   - SoundPlayer::playClick();
247   -
248 245  
249 246 }
250 247  
251 248 void WashWindow::on_helpButton_clicked()
252 249 {
253   - SoundPlayer::playClick();
254   -
255 250  
256 251 }
... ...