MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / createUI

Method createUI

AdaptixClient/Source/UI/Dialogs/DialogTunnel.cpp:29–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27DialogTunnel::~DialogTunnel() = default;
28
29void 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);

Callers 1

DialogTunnelMethod · 0.95

Calls 15

setWindowTitleMethod · 0.80
setHorizontalSpacingMethod · 0.80
setFixedWidthMethod · 0.80
setFixedHeightMethod · 0.80
setValueMethod · 0.80
resizeMethod · 0.45
setPropertyMethod · 0.45
addItemMethod · 0.45
setContentsMarginsMethod · 0.45
addWidgetMethod · 0.45
setTitleMethod · 0.45
setLayoutMethod · 0.45

Tested by

no test coverage detected