MCPcopy Create free account
hub / github.com/Vector35/debugger / RemoteProcessSettingsDialog

Method RemoteProcessSettingsDialog

ui/remoteprocess.cpp:23–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21using namespace std;
22
23RemoteProcessSettingsDialog::RemoteProcessSettingsDialog(QWidget* parent, DebuggerControllerRef controller) :
24 QDialog(), m_controller(controller)
25{
26 setWindowTitle("Remote Process Settings");
27 setMinimumSize(UIContext::getScaledWindowSize(400, 130));
28 setAttribute(Qt::WA_DeleteOnClose);
29
30 setModal(true);
31 QVBoxLayout* layout = new QVBoxLayout;
32 layout->setSpacing(0);
33
34 QHBoxLayout* titleLayout = new QHBoxLayout;
35 titleLayout->setContentsMargins(0, 0, 0, 0);
36
37 m_pluginEntry = new QComboBox(this);
38 auto pluginsMetadata = m_controller->GetAdapterProperty("process_plugins");
39 if (pluginsMetadata && pluginsMetadata->IsStringList())
40 {
41 auto plugins = pluginsMetadata->GetStringList();
42 for (const auto& plugin : plugins)
43 m_pluginEntry->addItem(QString::fromStdString(plugin));
44 }
45
46 auto currentPluginMetadata = m_controller->GetAdapterProperty("current_process_plugin");
47 if (currentPluginMetadata && currentPluginMetadata->IsString())
48 {
49 const auto currentPlugin = currentPluginMetadata->GetString();
50 m_pluginEntry->setCurrentText(QString::fromStdString(currentPlugin));
51 }
52
53 m_addressEntry = new QLineEdit(this);
54 m_portEntry = new QLineEdit(this);
55
56 QFormLayout* formLayout = new QFormLayout;
57 formLayout->addRow("Plugin", m_pluginEntry);
58 formLayout->addRow("Host", m_addressEntry);
59 formLayout->addRow("Port", m_portEntry);
60
61 QHBoxLayout* buttonLayout = new QHBoxLayout;
62 buttonLayout->setContentsMargins(0, 0, 0, 0);
63
64 QPushButton* cancelButton = new QPushButton("Cancel");
65 connect(cancelButton, &QPushButton::clicked, [&]() { reject(); });
66 QPushButton* acceptButton = new QPushButton("Accept");
67 connect(acceptButton, &QPushButton::clicked, [&]() { apply(); });
68 acceptButton->setDefault(true);
69
70 buttonLayout->addStretch(1);
71 buttonLayout->addWidget(cancelButton);
72 buttonLayout->addWidget(acceptButton);
73
74 layout->addLayout(titleLayout);
75 layout->addSpacing(10);
76 layout->addLayout(formLayout);
77 layout->addStretch(1);
78 layout->addSpacing(10);
79 layout->addLayout(buttonLayout);
80 setLayout(layout);

Callers

nothing calls this directly

Calls 3

GetAdapterPropertyMethod · 0.45
GetRemoteHostMethod · 0.45
GetRemotePortMethod · 0.45

Tested by

no test coverage detected