| 340 | |
| 341 | |
| 342 | AttachProcessDialog::AttachProcessDialog(QWidget* parent, DbgRef<DebuggerController> controller) : QDialog(parent) |
| 343 | { |
| 344 | setWindowTitle("Attach to process"); |
| 345 | setMinimumSize(UIContext::getScaledWindowSize(450, 600)); |
| 346 | setSizeGripEnabled(true); |
| 347 | setModal(true); |
| 348 | |
| 349 | m_processListWidget = new ProcessListWidget(this, controller); |
| 350 | m_separateEdit = new FilterEdit(m_processListWidget); |
| 351 | m_filter = new FilteredView(this, m_processListWidget, m_processListWidget, m_separateEdit); |
| 352 | m_filter->setFilterPlaceholderText("Search process"); |
| 353 | |
| 354 | auto headerLayout = new QHBoxLayout(); |
| 355 | headerLayout->addWidget(m_separateEdit, 1); |
| 356 | |
| 357 | auto filterLayout = new QVBoxLayout(); |
| 358 | filterLayout->setContentsMargins(0, 0, 0, 0); |
| 359 | filterLayout->addLayout(headerLayout); |
| 360 | filterLayout->addWidget(m_filter, 1); |
| 361 | |
| 362 | QVBoxLayout* layout = new QVBoxLayout(); |
| 363 | layout->addLayout(filterLayout); |
| 364 | |
| 365 | QHBoxLayout* buttonLayout = new QHBoxLayout(); |
| 366 | buttonLayout->setContentsMargins(0, 0, 0, 0); |
| 367 | |
| 368 | QPushButton* cancelButton = new QPushButton("Cancel"); |
| 369 | connect(cancelButton, &QPushButton::clicked, [&]() { reject(); }); |
| 370 | |
| 371 | QPushButton* acceptButton = new QPushButton("Attach"); |
| 372 | connect(acceptButton, &QPushButton::clicked, [&]() { apply(); }); |
| 373 | acceptButton->setDefault(true); |
| 374 | |
| 375 | connect(m_processListWidget, &QTableView::doubleClicked, [&]() { apply(); }); |
| 376 | |
| 377 | buttonLayout->addStretch(1); |
| 378 | buttonLayout->addWidget(cancelButton); |
| 379 | buttonLayout->addWidget(acceptButton); |
| 380 | |
| 381 | layout->addSpacing(10); |
| 382 | layout->addLayout(buttonLayout); |
| 383 | |
| 384 | setLayout(layout); |
| 385 | } |
| 386 | |
| 387 | uint32_t AttachProcessDialog::GetSelectedPid() |
| 388 | { |
nothing calls this directly
no outgoing calls
no test coverage detected