From 382d452ec08ca2aee8dca352063954ea62441325 Mon Sep 17 00:00:00 2001 From: torusrxxx Date: Tue, 29 Dec 2020 22:05:46 +0800 Subject: [PATCH] Set the follow in disassembler shortcut in graph to G --- src/gui/Src/Gui/DisassemblerGraphView.cpp | 16 ++++++++++------ src/gui/Src/Gui/DisassemblerGraphView.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/Src/Gui/DisassemblerGraphView.cpp b/src/gui/Src/Gui/DisassemblerGraphView.cpp index 42fed544..68b87451 100644 --- a/src/gui/Src/Gui/DisassemblerGraphView.cpp +++ b/src/gui/Src/Gui/DisassemblerGraphView.cpp @@ -2179,20 +2179,19 @@ void DisassemblerGraphView::setupContextMenu() { return DbgIsDebugging() && this->ready; }); - - mMenuBuilder->addSeparator(); - mCommonActions = new CommonActions(this, getActionHelperFuncs(), [this]() { return zoomActionHelper(); }); - mCommonActions->build(mMenuBuilder, CommonActions::ActionBreakpoint | CommonActions::ActionMemoryMap | CommonActions::ActionBookmark | CommonActions::ActionLabel | - CommonActions::ActionComment | CommonActions::ActionDisasm | CommonActions::ActionNewOrigin | CommonActions::ActionNewThread); - auto zoomActionHelperNonZero = [this](QMenu*) { return zoomActionHelper() != 0; }; + mMenuBuilder->addAction(makeShortcutAction(DIcon(ArchValue("processor32.png", "processor64.png")), tr("Follow in &Disassembler"), SLOT(followDisassemblySlot()), "ActionGraph"), zoomActionHelperNonZero); + mMenuBuilder->addSeparator(); + + mCommonActions->build(mMenuBuilder, CommonActions::ActionBreakpoint | CommonActions::ActionMemoryMap | CommonActions::ActionBookmark | CommonActions::ActionLabel | + CommonActions::ActionComment | CommonActions::ActionNewOrigin | CommonActions::ActionNewThread); mMenuBuilder->addAction(makeShortcutAction(DIcon("xrefs.png"), tr("Xrefs..."), SLOT(xrefSlot()), "ActionXrefs"), zoomActionHelperNonZero); @@ -2523,6 +2522,11 @@ void DisassemblerGraphView::xrefSlot() mXrefDlg->showNormal(); } +void DisassemblerGraphView::followDisassemblySlot() +{ + mCommonActions->followDisassemblySlot(); +} + void DisassemblerGraphView::followActionSlot() { QAction* action = qobject_cast(sender()); diff --git a/src/gui/Src/Gui/DisassemblerGraphView.h b/src/gui/Src/Gui/DisassemblerGraphView.h index 2685cba5..2e2b9f60 100644 --- a/src/gui/Src/Gui/DisassemblerGraphView.h +++ b/src/gui/Src/Gui/DisassemblerGraphView.h @@ -281,6 +281,7 @@ public slots: void gotoNextSlot(); void toggleSyncOriginSlot(); void followActionSlot(); + void followDisassemblySlot(); void refreshSlot(); void saveImageSlot(); void xrefSlot();