Blame view

app/gui/oven_control/configmastervolumedlg.cpp 1.33 KB
92fef6124   고영탁   환경 설정 - 설정 UI 완료
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  #include "config.h"
  #include "configmastervolumedlg.h"
  #include "ui_configmastervolumedlg.h"
  
  using namespace Define;
  
  #define MAX_MASTER_VOL  7
  
  ConfigMasterVolumeDlg::ConfigMasterVolumeDlg(QWidget *parent) :
      QDialog(parent),
      ui(new Ui::ConfigMasterVolumeDlg)
  {
      Config* cfg = Config::getInstance();
      config_item item;
      ui->setupUi(this);
      this->setWindowFlags( Qt::FramelessWindowHint);
      this->setAttribute( Qt::WA_DeleteOnClose);
  
      item = cfg->getConfigValue(config_marster_vol);
      m_nCurMasterVol = item.d32;
      ui->ctrProgressLight->setMaxProgress(m_nCurMasterVol,MAX_MASTER_VOL);
  }
  
  ConfigMasterVolumeDlg::~ConfigMasterVolumeDlg()
  {
      delete ui;
  }
  
  void ConfigMasterVolumeDlg::on_ctrBtnOk_clicked()
  {
      Config* cfg = Config::getInstance();
      config_item item;
      item.d32 = m_nCurMasterVol;
      cfg->setConfigValue(config_marster_vol,item);
      accept();
  }
  
  void ConfigMasterVolumeDlg::on_ctrBtnCancel_clicked()
  {
      reject();
  }
  
  void ConfigMasterVolumeDlg::on_ctrBtnMinus_clicked()
  {
      m_nCurMasterVol = m_nCurMasterVol > 0?m_nCurMasterVol-1:0;
      ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  }
  
  void ConfigMasterVolumeDlg::on_ctrBtnPlus_clicked()
  {
      m_nCurMasterVol = m_nCurMasterVol<MAX_MASTER_VOL?m_nCurMasterVol+1:MAX_MASTER_VOL;
      ui->ctrProgressLight->setCurrentProgress(m_nCurMasterVol);
  }