Commit 9290e89caf053f82cc122ee35fd1f2cb8e288b9d

Authored by 고영탁
1 parent 7a3fdac0e0
Exists in master and in 2 other branches fhd, fhd-demo

설정 음향 조정

- 키패드 볼륨 조정 수정
app/gui/oven_control/config.cpp
... ... @@ -352,10 +352,12 @@ void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){
352 352 dlg = new configResttimeFormatDlg(parent);
353 353 break;
354 354 case config_marster_vol:
355   - dlg = new ConfigMasterVolumeDlg(parent);
  355 + dlg = new ConfigVolumeDlg(parent, idx);
356 356 break;
357   - case config_keypad_sound1:
358 357 case config_keypad_sound2:
  358 + dlg = new ConfigVolumeDlg(parent, idx);
  359 + break;
  360 + case config_keypad_sound1:
359 361 case config_request_loadexec:
360 362 case config_programstep_finish:
361 363 case config_cooktime_finish:
... ...
app/gui/oven_control/config.h
... ... @@ -349,7 +349,7 @@ class Config : public QObject
349 349 "잔여시간 포맷", //12
350 350 "마스터 볼륨", //13
351 351 "키패드 소리 - 1",
352   - "키패드 소리 - 2 ", //15
  352 + "키패드 볼륨 ", //15
353 353 "적재/실행 요청",
354 354 "프로그램 단계 종료",
355 355 "조리시간 종료",
... ...
app/gui/oven_control/configmastervolumedlg.cpp
1   -#include "config.h"
2 1 #include "configmastervolumedlg.h"
3 2 #include "ui_configmastervolumedlg.h"
4 3  
... ... @@ -6,9 +5,9 @@
6 5  
7 6 using namespace Define;
8 7  
9   -#define MAX_MASTER_VOL 7
  8 +#define MAX_VOL 7
10 9  
11   -ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) :
  10 +ConfigVolumeDlg::ConfigVolumeDlg(QWidget *parent, ConfigType type) :
12 11 QDialog(parent),
13 12 ui(new Ui::ConfigMasterVolumeDlg)
14 13 {
... ... @@ -18,50 +17,56 @@ ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) :
18 17 this->setWindowFlags( Qt::FramelessWindowHint);
19 18 this->setAttribute( Qt::WA_DeleteOnClose);
20 19  
21   - item = cfg->getConfigValue(config_marster_vol);
22   - m_nPrevMasterVol = m_nCurMasterVol = item.d32;
23   - ui->ctrProgressLight->setMaxProgress(m_nCurMasterVol,MAX_MASTER_VOL);
  20 + if(type == config_keypad_sound2){
  21 + ui->ctrLbTitle->setText(tr("키패드 볼륨"));
  22 + }
  23 +
  24 + m_cfgType = type;
  25 +
  26 + item = cfg->getConfigValue(m_cfgType);
  27 + m_nPrevVol = m_nCurVol = item.d32;
  28 + ui->ctrProgressLight->setMaxProgress(m_nCurVol,MAX_VOL);
24 29 }
25 30  
26   -ConfigMasterVolumeDlg::~ConfigMasterVolumeDlg()
  31 +ConfigVolumeDlg::~ConfigVolumeDlg()
27 32 {
28 33 delete ui;
29 34 }
30 35  
31   -void ConfigMasterVolumeDlg::on_ctrBtnOk_clicked()
  36 +void ConfigVolumeDlg::on_ctrBtnOk_clicked()
32 37 {
33 38 accept();
34 39 }
35 40  
36   -void ConfigMasterVolumeDlg::on_ctrBtnCancel_clicked()
  41 +void ConfigVolumeDlg::on_ctrBtnCancel_clicked()
37 42 {
38 43 Config* cfg = Config::getInstance();
39 44 config_item item;
40   - item.d32 = m_nPrevMasterVol;
41   - cfg->setConfigValue(config_marster_vol,item);
  45 + item.d32 = m_nPrevVol;
  46 + cfg->setConfigValue(m_cfgType,item);
42 47 reject();
43 48 }
44 49  
45   -void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked()
  50 +void ConfigVolumeDlg::on_ctrBtnMinus_clicked()
46 51 {
47 52 Config* cfg = Config::getInstance();
48 53 config_item item;
49   - m_nCurMasterVol = m_nCurMasterVol > 0?m_nCurMasterVol-1:0;
50   - item.d32 = m_nCurMasterVol;
51   - cfg->setConfigValue(config_marster_vol,item);
52   - ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  54 + m_nCurVol = m_nCurVol > 0?m_nCurVol-1:0;
  55 + item.d32 = m_nCurVol;
  56 + cfg->setConfigValue(m_cfgType,item);
  57 + ui->ctrProgressLight->setCurrentProgress(m_nCurVol);
53 58  
54 59 SoundPlayer::playClick();
55 60 }
56 61  
57   -void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked()
  62 +void ConfigVolumeDlg::on_ctrBtnPlus_clicked()
58 63 {
59 64 Config* cfg = Config::getInstance();
60 65 config_item item;
61   - m_nCurMasterVol = m_nCurMasterVol<MAX_MASTER_VOL?m_nCurMasterVol+1:MAX_MASTER_VOL;
62   - item.d32 = m_nCurMasterVol;
63   - cfg->setConfigValue(config_marster_vol,item);
64   - ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  66 + m_nCurVol = m_nCurVol<MAX_VOL?m_nCurVol+1:MAX_VOL;
  67 + item.d32 = m_nCurVol;
  68 + cfg->setConfigValue(m_cfgType,item);
  69 + ui->ctrProgressLight->setCurrentProgress(m_nCurVol);
65 70  
66 71 SoundPlayer::playClick();
67 72 }
... ...
app/gui/oven_control/configmastervolumedlg.h
... ... @@ -2,18 +2,21 @@
2 2 #define CONFIGMASTERVOLUMEDLG_H
3 3  
4 4 #include <QDialog>
  5 +#include "config.h"
  6 +
  7 +using namespace Define;
5 8  
6 9 namespace Ui {
7 10 class ConfigMasterVolumeDlg;
8 11 }
9 12  
10   -class ConfigMasterVolumeDlg : public QDialog
  13 +class ConfigVolumeDlg : public QDialog
11 14 {
12 15 Q_OBJECT
13 16  
14 17 public:
15   - explicit ConfigMasterVolumeDlg(QWidget *parent = 0);
16   - ~ConfigMasterVolumeDlg();
  18 + explicit ConfigVolumeDlg(QWidget *parent = 0, ConfigType type=config_invalid);
  19 + ~ConfigVolumeDlg();
17 20  
18 21 private slots:
19 22 void on_ctrBtnOk_clicked();
... ... @@ -26,8 +29,9 @@ private slots:
26 29  
27 30 private:
28 31 Ui::ConfigMasterVolumeDlg *ui;
29   - int m_nCurMasterVol;
30   - int m_nPrevMasterVol;
  32 + int m_nCurVol;
  33 + int m_nPrevVol;
  34 + ConfigType m_cfgType;
31 35 };
32 36  
33 37 #endif // CONFIGMASTERVOLUMEDLG_H
... ...
app/gui/oven_control/configmastervolumedlg.ui
... ... @@ -65,7 +65,7 @@ QPushButton::pressed, QPushButton::focus{
65 65 <number>0</number>
66 66 </property>
67 67 <item>
68   - <widget class="QLabel" name="label">
  68 + <widget class="QLabel" name="ctrLbTitle">
69 69 <property name="font">
70 70 <font>
71 71 <pointsize>18</pointsize>
... ...