CheatSearchWidget: "Add to watch" to all selected items

Instead of just the right-clicked item.
This commit is contained in:
Martino Fontana 2025-05-25 19:11:36 +02:00
parent 3a17149b34
commit 1dff6f27d1
1 changed files with 7 additions and 3 deletions

View File

@ -500,9 +500,13 @@ void CheatSearchWidget::OnAddressTableContextMenu()
menu->setAttribute(Qt::WA_DeleteOnClose, true);
menu->addAction(tr("Show in memory"), [this, address] { emit ShowMemory(address); });
menu->addAction(tr("Add to watch"), this, [this, address] {
const QString name = QStringLiteral("mem_%1").arg(address, 8, 16, QLatin1Char('0'));
emit RequestWatch(name, address);
menu->addAction(tr("Add to watch"), this, [this] {
for (auto* const item : m_address_table->selectedItems())
{
const u32 address = item->data(ADDRESS_TABLE_ADDRESS_ROLE).toUInt();
const QString name = QStringLiteral("mem_%1").arg(address, 8, 16, QLatin1Char('0'));
emit RequestWatch(name, address);
}
});
menu->addAction(tr("Generate Action Replay Code(s)"), this, &CheatSearchWidget::GenerateARCodes);