Skip to content

Commit d32a550

Browse files
committed
Add additional helpers for right-click menu cleanup
1 parent 7eedbd5 commit d32a550

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ui/action.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ class BINARYNINJAUIAPI UIActionHandler
252252
ActionPriority getPriority(const QString& name);
253253

254254
void bindCopyAsActions(const UITransformAction& action);
255+
void bindCopyAsActions(const UITransformAction& action, const std::function<bool()>& shouldShow);
255256
void bindPasteFromActions(const UITransformAction& action);
256257
void bindTransformActions(const UITransformAction& encode, const UITransformAction& decode);
258+
void bindTransformActions(const UITransformAction& encode, const UITransformAction& decode, const std::function<bool()>& shouldShow);
257259
void unbindCopyAsActions();
258260
void unbindPasteFromActions();
259261
void unbindTransformActions();

ui/linearview.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,11 @@ private Q_SLOTS:
511511
virtual void followPointer();
512512

513513
virtual bool canCopyWithTransform() override;
514+
virtual bool canCut() override;
514515
virtual void cut() override;
515516
virtual void copy(TransformRef xform = nullptr) override;
516517
virtual void paste(TransformRef xform = nullptr) override;
518+
virtual bool canPaste() override;
517519
virtual void copyAddress() override;
518520

519521
virtual HighlightTokenState getHighlightTokenState() override { return m_highlight; }
@@ -594,6 +596,9 @@ private Q_SLOTS:
594596
bool canExtendSelectionToEndOfSegment();
595597
bool canExtendSelectionToStartOfDataVariable();
596598
bool canExtendSelectionToEndOfDataVariable();
599+
600+
virtual bool shouldShowCopyAsActions();
601+
virtual bool shouldShowTransformActions();
597602
};
598603

599604
/*!

0 commit comments

Comments
 (0)