summaryrefslogtreecommitdiff
path: root/plugins/warp/ui/matches.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-10-12 22:46:54 -0400
committerMason Reed <mason@vector35.com>2025-10-12 22:50:20 -0400
commit40f7d40e394657575001a8146d8233f1fc4356fd (patch)
treea1dfac7f90bbd284119d0a3e10e205fe2e0303c1 /plugins/warp/ui/matches.cpp
parent49558b88ed5dacaac0bdf1946291bc37a4a88cb9 (diff)
[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
Diffstat (limited to 'plugins/warp/ui/matches.cpp')
-rw-r--r--plugins/warp/ui/matches.cpp19
1 files changed, 18 insertions, 1 deletions
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<uint64_t>) {
+ WarpRemoveMatchDialog dlg(this, m_current);
+ if (dlg.execute())
+ m_tableWidget->GetModel()->SetMatchedFunction(nullptr);
+ },
+ [this](WarpFunctionItem* item, std::optional<uint64_t>) {
+ if (item == nullptr)
+ return false;
+ Warp::Ref<Warp::Function> selectedFunction = item->GetFunction();
+ if (!selectedFunction)
+ return false;
+ Warp::Ref<Warp::Function> 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<uint64_t>) {
// 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;