summaryrefslogtreecommitdiff
path: root/python/examples/triage/exports.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2019-03-27 22:57:58 -0400
committerRusty Wagner <rusty@vector35.com>2019-03-27 23:02:34 -0400
commitc6604a881d3febdf691d77561c62057bb09dac71 (patch)
tree8aeb83804f5096d0c18877be9cc60547c7ca4978 /python/examples/triage/exports.py
parent962efd7abd475c1c40ae2892a89ac5b2c56e24a7 (diff)
Fix an issue with keyboard shortcuts when imports/exports list is active
Diffstat (limited to 'python/examples/triage/exports.py')
-rw-r--r--python/examples/triage/exports.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/examples/triage/exports.py b/python/examples/triage/exports.py
index 14b23969..c72baa19 100644
--- a/python/examples/triage/exports.py
+++ b/python/examples/triage/exports.py
@@ -2,7 +2,7 @@ from PySide2.QtWidgets import QTreeView, QVBoxLayout, QWidget
from PySide2.QtCore import Qt, QAbstractItemModel, QModelIndex, QSize
from binaryninja.enums import SymbolType, SymbolBinding
import binaryninjaui
-from binaryninjaui import ViewFrame, FilterTarget, FilteredView, UIContext
+from binaryninjaui import ViewFrame, FilterTarget, FilteredView, UIContext, UIActionHandler
class GenericExportsModel(QAbstractItemModel):
@@ -112,6 +112,11 @@ class ExportsTreeView(QTreeView, FilterTarget):
self.parent = parent
self.view = view
+ # Allow view-specific shortcuts when exports are focused
+ self.actionHandler = UIActionHandler()
+ self.actionHandler.setupActionHandler(self)
+ self.actionHandler.setActionContext(lambda: self.view.actionContext())
+
self.model = GenericExportsModel(self.data)
self.setModel(self.model)
self.setRootIsDecorated(False)