Skip to content

Commit

Permalink
Find tab for binary view on any top level window.
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-carciofini committed Feb 29, 2024
1 parent bbb6598 commit 8c641c7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pate_binja/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ def showExitTraceInfo(self, sourceCfarNode: pate.CFARNode, trace: dict, label: s

def getTabForFilename(context: UIContext, filename: str, loadIfDoesNotExist: bool = True) -> QWidget | None:
"""Find Tab for filename."""
tabs = context.getTabs()
tab = None
for t in tabs:
vf: ViewFrame = context.getViewFrameForTab(t)
if vf:
fc: FileContext = vf.getFileContext()
#print('tab:', t, "ViewFrame", vf, "filename:", fc.getFilename())
if fc.getFilename() == filename:
tab = t
for c in UIContext.allContexts():
for t in c.getTabs():
vf: ViewFrame = context.getViewFrameForTab(t)
if vf:
fc: FileContext = vf.getFileContext()
print('tab:', t, "ViewFrame", vf, "filename:", fc.getFilename())
if fc.getFilename() == filename:
tab = t
if not tab and loadIfDoesNotExist:
# No Tab found for filename, open it in a new tab
file_context = context.openFilename(filename)
Expand Down

0 comments on commit 8c641c7

Please sign in to comment.