| 11 | DialogTarget::~DialogTarget() = default; |
| 12 | |
| 13 | void DialogTarget::createUI() |
| 14 | { |
| 15 | this->resize(500, 250); |
| 16 | this->setWindowTitle( "Add target" ); |
| 17 | this->setProperty("Main", "base"); |
| 18 | |
| 19 | computerLabel = new QLabel("Computer:", this); |
| 20 | computerInput = new QLineEdit(this); |
| 21 | |
| 22 | domainLabel = new QLabel("Domain:", this); |
| 23 | domainInput = new QLineEdit(this); |
| 24 | |
| 25 | addressLabel = new QLabel("Address:", this); |
| 26 | addressInput = new QLineEdit(this); |
| 27 | |
| 28 | aliveCheck = new QCheckBox("alive", this); |
| 29 | |
| 30 | osLabel = new QLabel("OS type:", this); |
| 31 | osCombo = new QComboBox(this); |
| 32 | osCombo->addItems(QStringList() << "unknown" << "windows" << "linux" << "macos"); |
| 33 | |
| 34 | osDescLabel = new QLabel("OS description:", this); |
| 35 | osDescInput = new QLineEdit(this); |
| 36 | |
| 37 | tagLabel = new QLabel("Tag:", this); |
| 38 | tagInput = new QLineEdit(this); |
| 39 | |
| 40 | infoLabel = new QLabel("Info:", this); |
| 41 | infoInput = new QLineEdit(this); |
| 42 | |
| 43 | spacer_1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); |
| 44 | spacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); |
| 45 | |
| 46 | createButton = new QPushButton("Save", this); |
| 47 | createButton->setDefault(true); |
| 48 | cancelButton = new QPushButton("Cancel", this); |
| 49 | |
| 50 | hLayoutBottom = new QHBoxLayout(); |
| 51 | hLayoutBottom->addItem(spacer_1); |
| 52 | hLayoutBottom->addWidget(createButton); |
| 53 | hLayoutBottom->addWidget(cancelButton); |
| 54 | hLayoutBottom->addItem(spacer_2); |
| 55 | |
| 56 | mainGridLayout = new QGridLayout(this); |
| 57 | mainGridLayout->setContentsMargins(4, 4, 4, 4 ); |
| 58 | mainGridLayout->addWidget(computerLabel, 0, 0, 1, 1); |
| 59 | mainGridLayout->addWidget(computerInput, 0, 1, 1, 1); |
| 60 | mainGridLayout->addWidget(domainLabel, 1, 0, 1, 1); |
| 61 | mainGridLayout->addWidget(domainInput, 1, 1, 1, 1); |
| 62 | mainGridLayout->addWidget(addressLabel, 2, 0, 1, 1); |
| 63 | mainGridLayout->addWidget(addressInput, 2, 1, 1, 1); |
| 64 | mainGridLayout->addWidget(aliveCheck, 3, 1, 1, 1); |
| 65 | mainGridLayout->addWidget(osLabel, 4, 0, 1, 1); |
| 66 | mainGridLayout->addWidget(osCombo, 4, 1, 1, 1); |
| 67 | mainGridLayout->addWidget(osDescLabel, 5, 0, 1, 1); |
| 68 | mainGridLayout->addWidget(osDescInput, 5, 1, 1, 1); |
| 69 | mainGridLayout->addWidget(tagLabel, 6, 0, 1, 1); |
| 70 | mainGridLayout->addWidget(tagInput, 6, 1, 1, 1); |
no test coverage detected