| 27 | DialogTunnel::~DialogTunnel() = default; |
| 28 | |
| 29 | void DialogTunnel::createUI() |
| 30 | { |
| 31 | this->resize(400, 350); |
| 32 | this->setWindowTitle( "Create Tunnel" ); |
| 33 | this->setProperty("Main", "base"); |
| 34 | |
| 35 | tunnelTypeLabel = new QLabel("Tunnel type:", this); |
| 36 | tunnelTypeCombo = new QComboBox(this); |
| 37 | |
| 38 | tunnelEndpointLabel = new QLabel("Tunnel endpoint:", this); |
| 39 | tunnelEndpointCombo = new QComboBox(this); |
| 40 | tunnelEndpointCombo->addItem("Teamserver"); |
| 41 | tunnelEndpointCombo->addItem("Client"); |
| 42 | |
| 43 | tunnelDescLabel = new QLabel("Description: ",this); |
| 44 | tunnelDescInput = new QLineEdit(this); |
| 45 | |
| 46 | tunnelStackWidget = new QStackedWidget(this ); |
| 47 | |
| 48 | stackGridLayout = new QGridLayout(this ); |
| 49 | stackGridLayout->setHorizontalSpacing(0); |
| 50 | stackGridLayout->setContentsMargins(0, 0, 0, 0 ); |
| 51 | stackGridLayout->addWidget(tunnelStackWidget, 0, 0, 1, 1 ); |
| 52 | |
| 53 | tunnelConfigGroupbox = new QGroupBox(this); |
| 54 | tunnelConfigGroupbox->setTitle("Settings"); |
| 55 | tunnelConfigGroupbox->setLayout(stackGridLayout); |
| 56 | |
| 57 | buttonCreate = new QPushButton(this); |
| 58 | buttonCreate->setText("Create"); |
| 59 | buttonCreate->setDefault(true); |
| 60 | |
| 61 | buttonCancel = new QPushButton(this); |
| 62 | buttonCancel->setText("Cancel"); |
| 63 | |
| 64 | horizontalSpacer_1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); |
| 65 | horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); |
| 66 | |
| 67 | hLayoutBottom = new QHBoxLayout(); |
| 68 | hLayoutBottom->addItem(horizontalSpacer_1); |
| 69 | hLayoutBottom->addWidget(buttonCreate); |
| 70 | hLayoutBottom->addWidget(buttonCancel); |
| 71 | hLayoutBottom->addItem(horizontalSpacer_2); |
| 72 | |
| 73 | mainGridLayout = new QGridLayout( this ); |
| 74 | mainGridLayout->addWidget( tunnelTypeLabel, 0, 0, 1, 1); |
| 75 | mainGridLayout->addWidget( tunnelTypeCombo, 0, 1, 1, 1); |
| 76 | mainGridLayout->addWidget( tunnelEndpointLabel, 1, 0, 1, 1); |
| 77 | mainGridLayout->addWidget( tunnelEndpointCombo, 1, 1, 1, 1); |
| 78 | mainGridLayout->addWidget( tunnelDescLabel, 2, 0, 1, 1); |
| 79 | mainGridLayout->addWidget( tunnelDescInput, 2, 1, 1, 1); |
| 80 | mainGridLayout->addWidget( tunnelConfigGroupbox, 3, 0, 1, 2); |
| 81 | mainGridLayout->addLayout( hLayoutBottom, 4, 0, 1, 2); |
| 82 | |
| 83 | this->setLayout(mainGridLayout); |
| 84 | |
| 85 | int buttonWidth = buttonCancel->width(); |
| 86 | buttonCreate->setFixedWidth(buttonWidth); |
no test coverage detected