1
0
Fork 0

GUI: Add "Copy RVA" shortcut (#1232)

* Add Copy RVA shortcut

* Fix Copy RVA shortcut for hex dump
This commit is contained in:
ecx86 2016-11-08 02:57:27 -05:00 committed by Duncan Ogilvie
parent afabd01f77
commit 83631db154
3 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,7 @@ void HexDump::updateShortcuts()
{
AbstractTableView::updateShortcuts();
mCopyAddress->setShortcut(ConfigShortcut("ActionCopyAddress"));
mCopyRva->setShortcut(ConfigShortcut("ActionCopyRva"));
mCopySelection->setShortcut(ConfigShortcut("ActionCopy"));
}
@ -293,6 +294,8 @@ void HexDump::setupCopyMenu()
// Copy -> RVA
mCopyRva = new QAction(DIcon("copy_address.png"), "&RVA", this);
connect(mCopyRva, SIGNAL(triggered()), this, SLOT(copyRvaSlot()));
mCopyRva->setShortcutContext(Qt::WidgetShortcut);
addAction(mCopyRva);
}
void HexDump::copyAddressSlot()

View File

@ -52,7 +52,10 @@ void CPUDisassembly::mousePressEvent(QMouseEvent* event)
if(!DbgIsDebugging())
return;
MessageBeep(MB_OK);
copyAddressSlot();
if(event->modifiers() & Qt::ShiftModifier)
copyRvaSlot();
else
copyAddressSlot();
}
else
{
@ -241,7 +244,7 @@ void CPUDisassembly::setupRightClickContextMenu()
copyMenu->addAction(makeAction(DIcon("copy_selection_no_bytes.png"), tr("Selection (&No Bytes)"), SLOT(copySelectionNoBytesSlot())));
copyMenu->addAction(makeAction(DIcon("copy_selection_no_bytes.png"), tr("Selection to File (No Bytes)"), SLOT(copySelectionToFileNoBytesSlot())));
copyMenu->addAction(makeShortcutAction(DIcon("copy_address.png"), tr("&Address"), SLOT(copyAddressSlot()), "ActionCopyAddress"));
copyMenu->addAction(makeAction(DIcon("copy_address.png"), tr("&RVA"), SLOT(copyRvaSlot())));
copyMenu->addAction(makeShortcutAction(DIcon("copy_address.png"), tr("&RVA"), SLOT(copyRvaSlot()), "ActionCopyRva"));
copyMenu->addAction(makeAction(DIcon("copy_disassembly.png"), tr("Disassembly"), SLOT(copyDisassemblySlot())));
copyMenu->addAction(makeAction(DIcon("data-copy.png"), tr("&Data..."), SLOT(copyDataSlot())));

View File

@ -471,6 +471,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultShortcuts.insert("ActionToggleRegisterValue", Shortcut(tr("Actions -> Toggle Register Value"), "Space"));
defaultShortcuts.insert("ActionCopy", Shortcut(tr("Actions -> Copy"), "Ctrl+C"));
defaultShortcuts.insert("ActionCopyAddress", Shortcut(tr("Actions -> Copy Address"), "Alt+INS"));
defaultShortcuts.insert("ActionCopyRva", Shortcut(tr("Actions -> Copy RVA"), ""));
defaultShortcuts.insert("ActionCopySymbol", Shortcut(tr("Actions -> Copy Symbol"), "Ctrl+S"));
defaultShortcuts.insert("ActionLoadScript", Shortcut(tr("Actions -> Load Script"), "Ctrl+O"));
defaultShortcuts.insert("ActionReloadScript", Shortcut(tr("Actions -> Reload Script"), "Ctrl+R"));