Set the follow in disassembler shortcut in graph to G

This commit is contained in:
torusrxxx 2020-12-29 22:05:46 +08:00
parent 9fe6a9c164
commit 382d452ec0
No known key found for this signature in database
GPG Key ID: A795C73A0F1CFADD
2 changed files with 11 additions and 6 deletions

View File

@ -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<QAction*>(sender());

View File

@ -281,6 +281,7 @@ public slots:
void gotoNextSlot();
void toggleSyncOriginSlot();
void followActionSlot();
void followDisassemblySlot();
void refreshSlot();
void saveImageSlot();
void xrefSlot();