-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmlconfigwindow.cpp
More file actions
executable file
·63 lines (44 loc) · 1.92 KB
/
xmlconfigwindow.cpp
File metadata and controls
executable file
·63 lines (44 loc) · 1.92 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
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QCheckBox>
#include <QLabel>
#include <QStyle>
#include <QLineEdit>
#include <QDebug>
#include "xmlconfigwindow.h"
#include "contentview.h"
XMLConfigWindow::XMLConfigWindow(ContentView* parent) :
QMainWindow(parent)
{
this->contentView = parent;
this->setWindowTitle("Devices XML config");
QWidget* dummyWidget = new QWidget(this);
QVBoxLayout* mainVStack = new QVBoxLayout(dummyWidget);
mainVStack->setSpacing(0);
QLabel* fileLabel = new QLabel("Devices XML file path:", this);
fileLabel->setContentsMargins(0,0,0,0);
mainVStack->addWidget(fileLabel);
QHBoxLayout* fileHStack = new QHBoxLayout();
fileHStack->setContentsMargins(0,0,0,0);
fileDisplay = new QLineEdit(this->contentView->xmlFile, this);
fileDisplay->setDisabled(true);
fileHStack->addWidget(fileDisplay);
QPushButton* fileButton = new QPushButton(this->style()->standardIcon(QStyle::SP_DirOpenIcon), "", this);
fileButton->setToolTip("Select an .XML file");
fileHStack->addWidget(fileButton);
mainVStack->addLayout(fileHStack);
mainVStack->addStretch();
QCheckBox* useXMLCheckBox = new QCheckBox("Use an AIXACT Software .XML file for inferring device names", this);
mainVStack->addWidget(useXMLCheckBox);
this->setCentralWidget(dummyWidget);
this->hide();
useXMLCheckBox->setChecked(contentView->doesUseXMLFile);
connect(useXMLCheckBox, SIGNAL(toggled(bool)), this, SLOT(checkboxAction(bool)));
connect(fileButton, SIGNAL(released()), this->contentView, SLOT(obtainXMLFile()));
connect(this->contentView, SIGNAL(xmlFileObtained(QString)), this->fileDisplay, SLOT(setText(QString)));
}
void XMLConfigWindow::checkboxAction(bool isChecked) {
this->contentView->doesUseXMLFile = isChecked;
this->contentView->saveXMLConfig();
}