summaryrefslogtreecommitdiff
path: root/plugins/warp/ui/matches.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-03-13 12:24:18 -0700
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-03-24 18:46:48 -0700
commit3c88b11e5df33116580ac008e36092775df66135 (patch)
treecd64fbe149f05683ddabcccd0db7b87356f1f8cf /plugins/warp/ui/matches.cpp
parentf325aa7b6026a1daef84931baeb1f50d7da10c10 (diff)
[WARP] Improved UX and API
- Exposes WARP type objects directly - Adds processor API (for generating warp files directly) - Adds file and chunk API - Misc cleanup - Simplified the amount of commands - Replaced the "Create" commands with a purpose built processor dialog - Added a native QT viewer for WARP files - Simplified committing to a remote with a purpose built commit dialog
Diffstat (limited to 'plugins/warp/ui/matches.cpp')
-rw-r--r--plugins/warp/ui/matches.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/plugins/warp/ui/matches.cpp b/plugins/warp/ui/matches.cpp
index cede06ab..918312fd 100644
--- a/plugins/warp/ui/matches.cpp
+++ b/plugins/warp/ui/matches.cpp
@@ -1,15 +1,13 @@
-#include <QGridLayout>
-#include <QHeaderView>
-
#include "matches.h"
+#include "theme.h"
+#include "warp.h"
+#include "shared/misc.h"
#include <QClipboard>
#include <QFormLayout>
#include <thread>
-
-#include "theme.h"
-#include "warp.h"
-#include "shared/misc.h"
+#include <QGridLayout>
+#include <QHeaderView>
WarpCurrentFunctionWidget::WarpCurrentFunctionWidget(QWidget* parent) : QWidget(parent)
{
@@ -74,23 +72,24 @@ WarpCurrentFunctionWidget::WarpCurrentFunctionWidget(QWidget* parent) : QWidget(
m_tableWidget->GetModel()->SetMatchedFunction(selectedFunction);
});
// If the selected function is the current match, let the user remove the match.
- m_tableWidget->RegisterContextMenuAction("Remove 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);
- });
+ 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.