diff options
Diffstat (limited to 'plugins/warp/ui/matches.cpp')
| -rw-r--r-- | plugins/warp/ui/matches.cpp | 19 |
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; |
