From 40f7d40e394657575001a8146d8233f1fc4356fd Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 12 Oct 2025 22:46:54 -0400 Subject: [WARP] Improve UX surrounding removal of matched functions - Adds Python API to remove matched function - Adds command + UI actions to remove matched function - Adds command + UI actions to ignore function in subsequent matches --- plugins/warp/ui/matches.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'plugins/warp/ui/matches.cpp') diff --git a/plugins/warp/ui/matches.cpp b/plugins/warp/ui/matches.cpp index 5ec3da1a..4b8f0495 100644 --- a/plugins/warp/ui/matches.cpp +++ b/plugins/warp/ui/matches.cpp @@ -56,6 +56,24 @@ WarpCurrentFunctionWidget::WarpCurrentFunctionWidget() // So it shows visually as selected. m_tableWidget->GetModel()->SetMatchedFunction(selectedFunction); }); + // If the selected function is the current match, let the user remove the match. + m_tableWidget->RegisterContextMenuAction("Remove Match", + [this](WarpFunctionItem*, std::optional) { + WarpRemoveMatchDialog dlg(this, m_current); + if (dlg.execute()) + m_tableWidget->GetModel()->SetMatchedFunction(nullptr); + }, + [this](WarpFunctionItem* item, std::optional) { + if (item == nullptr) + return false; + Warp::Ref selectedFunction = item->GetFunction(); + if (!selectedFunction) + return false; + Warp::Ref matchedFunction = m_tableWidget->GetModel()->GetMatchedFunction(); + if (!matchedFunction) + return false; + return BNWARPFunctionsEqual(selectedFunction->m_object, matchedFunction->m_object); + }); m_tableWidget->RegisterContextMenuAction( "Search for Source", [this](WarpFunctionItem* item, std::optional) { // Apply the source as the filter. @@ -79,7 +97,6 @@ WarpCurrentFunctionWidget::WarpCurrentFunctionWidget() m_infoWidget->UpdateInfo(); }); - connect(m_tableWidget->GetTableView(), &QTableView::doubleClicked, this, [=, this](const QModelIndex& index) { if (m_current == nullptr) return; -- cgit v1.3.1