configwindow.cpp
3.54 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include "configwindow.h"
#include "ui_configwindow.h"
#include "functiontestwindow.h"
#include "engineermenuwindow.h"
#include "config.h"
ConfigWindow::ConfigWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ConfigWindow)
{
uint32_t idx;
ui->setupUi(this);
ui->clockContainer->setParent(ui->upperStack);
setAttribute(Qt::WA_DeleteOnClose);
ui->scrollAreaMenuLayout->setAlignment(Qt::AlignTop);
Config* cfg = Config::getInstance();
QSetIterator<uint32_t> itr = cfg->getConstBeginFavorite();
while(itr.hasNext()) itr.next();
while(itr.hasPrevious()){
idx = itr.previous();
//configbtn = new ConfigPanelButton(this,idx);
}
m_nCurConfigPos = config_menu_favorite;
reloadUi();
}
ConfigWindow::~ConfigWindow()
{
delete ui;
}
void ConfigWindow::on_pushButton_clicked()
{
}
void ConfigWindow::on_backButton_clicked()
{
close();
}
void ConfigWindow::on_pushButton_3_clicked()
{
EngineerMenuWindow *w = new EngineerMenuWindow(this);
w->setWindowModality(Qt::WindowModal);
w->showFullScreen();
}
void ConfigWindow::on_pushButton_8_clicked() //설정 버튼
{
if(m_nCurConfigPos != config_menu_setting){
m_nCurConfigPos = config_menu_setting;
reloadUi();
}
}
void ConfigWindow::reloadValue(){
Config* cfg = Config::getInstance();
QString strtemp="";
for(int i=0;i<m_vectorMenuList.count();i++){
strtemp = cfg->getValueString(m_arrConfigListInfos[m_nCurConfigPos][i]);
m_vectorMenuList[i]->setValue(strtemp);
}
}
void ConfigWindow::onConfigBtnClicked(uint16_t id){
qDebug() << "config id prsess : " << id;
Config *cfg = Config::getInstance();
cfg->execConfigWindow(this,(Define::ConfigType)id);
reloadValue();
}
void ConfigWindow::onConfigCheckBtnClicked(uint16_t id, bool checked){
}
void ConfigWindow::reloadUi(void){
ConfigPanelButton** pws = m_vectorMenuList.data();
ConfigPanelButton* pw;
ConfigPanelButton *pcb;
Config* cfg = Config::getInstance();
QString strtemp="";
for(int i = 0; i < m_vectorMenuList.count();i++){
pw = pws[i];
ui->scrollAreaMenuLayout->removeWidget(pw);
delete pw;
}
m_vectorMenuList.clear();
if(m_nCurConfigPos != config_menu_favorite){
for(int i=0 ; i < m_arrMaxMenuCount[m_nCurConfigPos] ;i++){
pcb = new ConfigPanelButton(this,m_arrConfigListInfos[m_nCurConfigPos][i]);
qDebug() <<m_arrConfigListInfos[m_nCurConfigPos][i] << cfg->getTitleString(m_arrConfigListInfos[m_nCurConfigPos][i]);
strtemp = cfg->getTitleString(m_arrConfigListInfos[m_nCurConfigPos][i]);
pcb->setText(strtemp);
strtemp = cfg->getValueString(m_arrConfigListInfos[m_nCurConfigPos][i]);
pcb->setValue(strtemp);
pcb->showFavoriteButton();
pcb->setFavoriteCheck(cfg->isFavorite(m_arrConfigListInfos[m_nCurConfigPos][i]));
ui->scrollAreaMenuLayout->addWidget(pcb);
m_vectorMenuList.append(pcb);
connect(pcb ,SIGNAL(clicked(uint16_t)),SLOT(onConfigBtnClicked(uint16_t)));
}
}
ui->scrollAreaMenu->adjustSize(); //Display 전 Contents 사이즈 수정 깜빡임 제거함.
}
void ConfigWindow::on_pushButton_7_clicked() //음향 관리
{
if(m_nCurConfigPos != config_menu_sound){
m_nCurConfigPos = config_menu_sound;
reloadUi();
}
}
void ConfigWindow::on_pushButton_2_clicked()
{
if(m_nCurConfigPos != config_menu_system){
m_nCurConfigPos = config_menu_system;
reloadUi();
}
}