MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / openAutomaticMappingMenu

Method openAutomaticMappingMenu

pcsx2-qt/SetupWizardDialog.cpp:502–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502void SetupWizardDialog::openAutomaticMappingMenu(u32 port, QLabel* update_label)
503{
504 QMenu menu(this);
505 bool added = false;
506
507 for (const QPair<QString, QString>& dev : m_device_list)
508 {
509 // we set it as data, because the device list could get invalidated while the menu is up
510 QAction* action = menu.addAction(QStringLiteral("%1 (%2)").arg(dev.first).arg(dev.second));
511 action->setData(dev.first);
512 connect(action, &QAction::triggered, this, [this, port, update_label, action]() {
513 doDeviceAutomaticBinding(port, update_label, action->data().toString());
514 });
515 added = true;
516 }
517
518 if (!added)
519 {
520 QAction* action = menu.addAction(tr("No devices available"));
521 action->setEnabled(false);
522 }
523
524 menu.exec(QCursor::pos());
525}
526
527void SetupWizardDialog::doDeviceAutomaticBinding(u32 port, QLabel* update_label, const QString& device)
528{

Callers

nothing calls this directly

Calls 4

argMethod · 0.80
setDataMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected