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