From 9290e89caf053f82cc122ee35fd1f2cb8e288b9d Mon Sep 17 00:00:00 2001 From: byloveletter Date: Fri, 26 May 2017 19:11:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=9D=8C=ED=96=A5=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 키패드 볼륨 조정 수정 --- app/gui/oven_control/config.cpp | 6 ++-- app/gui/oven_control/config.h | 2 +- app/gui/oven_control/configmastervolumedlg.cpp | 47 ++++++++++++++------------ app/gui/oven_control/configmastervolumedlg.h | 14 +++++--- app/gui/oven_control/configmastervolumedlg.ui | 2 +- 5 files changed, 41 insertions(+), 30 deletions(-) diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index eabf7bf..00ade21 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -352,10 +352,12 @@ void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ dlg = new configResttimeFormatDlg(parent); break; case config_marster_vol: - dlg = new ConfigMasterVolumeDlg(parent); + dlg = new ConfigVolumeDlg(parent, idx); break; - case config_keypad_sound1: case config_keypad_sound2: + dlg = new ConfigVolumeDlg(parent, idx); + break; + case config_keypad_sound1: case config_request_loadexec: case config_programstep_finish: case config_cooktime_finish: diff --git a/app/gui/oven_control/config.h b/app/gui/oven_control/config.h index bcf00bd..c627468 100644 --- a/app/gui/oven_control/config.h +++ b/app/gui/oven_control/config.h @@ -349,7 +349,7 @@ class Config : public QObject "잔여시간 포맷", //12 "마스터 볼륨", //13 "키패드 소리 - 1", - "키패드 소리 - 2 ", //15 + "키패드 볼륨 ", //15 "적재/실행 요청", "프로그램 단계 종료", "조리시간 종료", diff --git a/app/gui/oven_control/configmastervolumedlg.cpp b/app/gui/oven_control/configmastervolumedlg.cpp index 2fd0cde..41860cc 100644 --- a/app/gui/oven_control/configmastervolumedlg.cpp +++ b/app/gui/oven_control/configmastervolumedlg.cpp @@ -1,4 +1,3 @@ -#include "config.h" #include "configmastervolumedlg.h" #include "ui_configmastervolumedlg.h" @@ -6,9 +5,9 @@ using namespace Define; -#define MAX_MASTER_VOL 7 +#define MAX_VOL 7 -ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) : +ConfigVolumeDlg::ConfigVolumeDlg(QWidget *parent, ConfigType type) : QDialog(parent), ui(new Ui::ConfigMasterVolumeDlg) { @@ -18,50 +17,56 @@ ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) : this->setWindowFlags( Qt::FramelessWindowHint); this->setAttribute( Qt::WA_DeleteOnClose); - item = cfg->getConfigValue(config_marster_vol); - m_nPrevMasterVol = m_nCurMasterVol = item.d32; - ui->ctrProgressLight->setMaxProgress(m_nCurMasterVol,MAX_MASTER_VOL); + if(type == config_keypad_sound2){ + ui->ctrLbTitle->setText(tr("키패드 볼륨")); + } + + m_cfgType = type; + + item = cfg->getConfigValue(m_cfgType); + m_nPrevVol = m_nCurVol = item.d32; + ui->ctrProgressLight->setMaxProgress(m_nCurVol,MAX_VOL); } -ConfigMasterVolumeDlg::~ConfigMasterVolumeDlg() +ConfigVolumeDlg::~ConfigVolumeDlg() { delete ui; } -void ConfigMasterVolumeDlg::on_ctrBtnOk_clicked() +void ConfigVolumeDlg::on_ctrBtnOk_clicked() { accept(); } -void ConfigMasterVolumeDlg::on_ctrBtnCancel_clicked() +void ConfigVolumeDlg::on_ctrBtnCancel_clicked() { Config* cfg = Config::getInstance(); config_item item; - item.d32 = m_nPrevMasterVol; - cfg->setConfigValue(config_marster_vol,item); + item.d32 = m_nPrevVol; + cfg->setConfigValue(m_cfgType,item); reject(); } -void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked() +void ConfigVolumeDlg::on_ctrBtnMinus_clicked() { Config* cfg = Config::getInstance(); config_item item; - m_nCurMasterVol = m_nCurMasterVol > 0?m_nCurMasterVol-1:0; - item.d32 = m_nCurMasterVol; - cfg->setConfigValue(config_marster_vol,item); - ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); + m_nCurVol = m_nCurVol > 0?m_nCurVol-1:0; + item.d32 = m_nCurVol; + cfg->setConfigValue(m_cfgType,item); + ui->ctrProgressLight->setCurrentProgress(m_nCurVol); SoundPlayer::playClick(); } -void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked() +void ConfigVolumeDlg::on_ctrBtnPlus_clicked() { Config* cfg = Config::getInstance(); config_item item; - m_nCurMasterVol = m_nCurMasterVolsetConfigValue(config_marster_vol,item); - ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); + m_nCurVol = m_nCurVolsetConfigValue(m_cfgType,item); + ui->ctrProgressLight->setCurrentProgress(m_nCurVol); SoundPlayer::playClick(); } diff --git a/app/gui/oven_control/configmastervolumedlg.h b/app/gui/oven_control/configmastervolumedlg.h index 29959b0..e847d71 100644 --- a/app/gui/oven_control/configmastervolumedlg.h +++ b/app/gui/oven_control/configmastervolumedlg.h @@ -2,18 +2,21 @@ #define CONFIGMASTERVOLUMEDLG_H #include +#include "config.h" + +using namespace Define; namespace Ui { class ConfigMasterVolumeDlg; } -class ConfigMasterVolumeDlg : public QDialog +class ConfigVolumeDlg : public QDialog { Q_OBJECT public: - explicit ConfigMasterVolumeDlg(QWidget *parent = 0); - ~ConfigMasterVolumeDlg(); + explicit ConfigVolumeDlg(QWidget *parent = 0, ConfigType type=config_invalid); + ~ConfigVolumeDlg(); private slots: void on_ctrBtnOk_clicked(); @@ -26,8 +29,9 @@ private slots: private: Ui::ConfigMasterVolumeDlg *ui; - int m_nCurMasterVol; - int m_nPrevMasterVol; + int m_nCurVol; + int m_nPrevVol; + ConfigType m_cfgType; }; #endif // CONFIGMASTERVOLUMEDLG_H diff --git a/app/gui/oven_control/configmastervolumedlg.ui b/app/gui/oven_control/configmastervolumedlg.ui index 26c1a32..8fa3238 100644 --- a/app/gui/oven_control/configmastervolumedlg.ui +++ b/app/gui/oven_control/configmastervolumedlg.ui @@ -65,7 +65,7 @@ QPushButton::pressed, QPushButton::focus{ 0 - + 18 -- 2.1.4