Commit 0bceaf0069b0de1b76ed3a4a1180078d25486ea3
1 parent
d0ee3ccc85
Exists in
master
and in
2 other branches
볼륨 조정 수정
- 볼륨 조정시 설정에 즉시 적용 - 최종 확인 취소시 저장안함은 유지
Showing
2 changed files
with
14 additions
and
5 deletions
Show diff stats
app/gui/oven_control/configmastervolumedlg.cpp
| @@ -17,7 +17,7 @@ ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) : | @@ -17,7 +17,7 @@ ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) : | ||
| 17 | this->setAttribute( Qt::WA_DeleteOnClose); | 17 | this->setAttribute( Qt::WA_DeleteOnClose); |
| 18 | 18 | ||
| 19 | item = cfg->getConfigValue(config_marster_vol); | 19 | item = cfg->getConfigValue(config_marster_vol); |
| 20 | - m_nCurMasterVol = item.d32; | 20 | + m_nPrevMasterVol = m_nCurMasterVol = item.d32; |
| 21 | ui->ctrProgressLight->setMaxProgress(m_nCurMasterVol,MAX_MASTER_VOL); | 21 | ui->ctrProgressLight->setMaxProgress(m_nCurMasterVol,MAX_MASTER_VOL); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -28,26 +28,34 @@ ConfigMasterVolumeDlg::~ConfigMasterVolumeDlg() | @@ -28,26 +28,34 @@ ConfigMasterVolumeDlg::~ConfigMasterVolumeDlg() | ||
| 28 | 28 | ||
| 29 | void ConfigMasterVolumeDlg::on_ctrBtnOk_clicked() | 29 | void ConfigMasterVolumeDlg::on_ctrBtnOk_clicked() |
| 30 | { | 30 | { |
| 31 | - Config* cfg = Config::getInstance(); | ||
| 32 | - config_item item; | ||
| 33 | - item.d32 = m_nCurMasterVol; | ||
| 34 | - cfg->setConfigValue(config_marster_vol,item); | ||
| 35 | accept(); | 31 | accept(); |
| 36 | } | 32 | } |
| 37 | 33 | ||
| 38 | void ConfigMasterVolumeDlg::on_ctrBtnCancel_clicked() | 34 | void ConfigMasterVolumeDlg::on_ctrBtnCancel_clicked() |
| 39 | { | 35 | { |
| 36 | + Config* cfg = Config::getInstance(); | ||
| 37 | + config_item item; | ||
| 38 | + item.d32 = m_nPrevMasterVol; | ||
| 39 | + cfg->setConfigValue(config_marster_vol,item); | ||
| 40 | reject(); | 40 | reject(); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked() | 43 | void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked() |
| 44 | { | 44 | { |
| 45 | + Config* cfg = Config::getInstance(); | ||
| 46 | + config_item item; | ||
| 45 | m_nCurMasterVol = m_nCurMasterVol > 0?m_nCurMasterVol-1:0; | 47 | m_nCurMasterVol = m_nCurMasterVol > 0?m_nCurMasterVol-1:0; |
| 48 | + item.d32 = m_nCurMasterVol; | ||
| 49 | + cfg->setConfigValue(config_marster_vol,item); | ||
| 46 | ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); | 50 | ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); |
| 47 | } | 51 | } |
| 48 | 52 | ||
| 49 | void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked() | 53 | void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked() |
| 50 | { | 54 | { |
| 55 | + Config* cfg = Config::getInstance(); | ||
| 56 | + config_item item; | ||
| 51 | m_nCurMasterVol = m_nCurMasterVol<MAX_MASTER_VOL?m_nCurMasterVol+1:MAX_MASTER_VOL; | 57 | m_nCurMasterVol = m_nCurMasterVol<MAX_MASTER_VOL?m_nCurMasterVol+1:MAX_MASTER_VOL; |
| 58 | + item.d32 = m_nCurMasterVol; | ||
| 59 | + cfg->setConfigValue(config_marster_vol,item); | ||
| 52 | ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); | 60 | ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol); |
| 53 | } | 61 | } |
app/gui/oven_control/configmastervolumedlg.h
| @@ -27,6 +27,7 @@ private slots: | @@ -27,6 +27,7 @@ private slots: | ||
| 27 | private: | 27 | private: |
| 28 | Ui::ConfigMasterVolumeDlg *ui; | 28 | Ui::ConfigMasterVolumeDlg *ui; |
| 29 | int m_nCurMasterVol; | 29 | int m_nCurMasterVol; |
| 30 | + int m_nPrevMasterVol; | ||
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| 32 | #endif // CONFIGMASTERVOLUMEDLG_H | 33 | #endif // CONFIGMASTERVOLUMEDLG_H |