GUI: mnemonic help and mnemonic brief implemented
This commit is contained in:
parent
dd96e7aae0
commit
4752f96219
|
@ -431,6 +431,7 @@ void AppearanceDialog::colorInfoListInit()
|
|||
colorInfoListAppend("Bookmarks", "DisassemblyBookmarkColor", "DisassemblyBookmarkBackgroundColor");
|
||||
colorInfoListAppend("Comments", "DisassemblyCommentColor", "DisassemblyCommentBackgroundColor");
|
||||
colorInfoListAppend("Automatic Comments", "DisassemblyAutoCommentColor", "DisassemblyAutoCommentBackgroundColor");
|
||||
colorInfoListAppend("Mnemonic Brief Comments", "DisassemblyMnemonicBriefColor", "DisassemblyMnemonicBriefBackgroundColor");
|
||||
colorInfoListAppend("Labels", "DisassemblyLabelColor", "DisassemblyLabelBackgroundColor");
|
||||
colorInfoListAppend("Addresses", "DisassemblyAddressColor", "DisassemblyAddressBackgroundColor");
|
||||
colorInfoListAppend("Selected Addresses", "DisassemblySelectedAddressColor", "DisassemblySelectedAddressBackgroundColor");
|
||||
|
|
|
@ -329,7 +329,7 @@ void CPUDisassembly::setupRightClickContextMenu()
|
|||
|
||||
mMenuBuilder->addMenu(makeMenu(QIcon(":/icons/images/snowman.png"), tr("Decompile")), decompileMenu);
|
||||
|
||||
mMenuBuilder->addMenu(makeMenu(QIcon(":icons/images/help.png"), tr("Help on Symbolic Name")), [this](QMenu * menu)
|
||||
mMenuBuilder->addMenu(makeMenu(QIcon(":/icons/images/help.png"), tr("Help on Symbolic Name")), [this](QMenu * menu)
|
||||
{
|
||||
QSet<QString> labels;
|
||||
if(!getLabelsFromInstruction(rvaToVa(getInitialSelection()), labels))
|
||||
|
@ -338,6 +338,14 @@ void CPUDisassembly::setupRightClickContextMenu()
|
|||
menu->addAction(makeAction(label, SLOT(labelHelpSlot())));
|
||||
return true;
|
||||
});
|
||||
mMenuBuilder->addAction(makeShortcutAction(QIcon(":/icons/images/helpmnemonic.png"), tr("Help on mnemonic"), SLOT(mnemonicHelpSlot()), "ActionHelpOnMnemonic"));
|
||||
QAction* mnemonicBrief = makeShortcutAction(QIcon(":/icons/images/helpbrief.png"), tr("Show mnemonic brief"), SLOT(mnemonicBriefSlot()), "ActionToggleMnemonicBrief");
|
||||
mMenuBuilder->addAction(mnemonicBrief, [this, mnemonicBrief](QMenu*)
|
||||
{
|
||||
if(mShowMnemonicBrief)
|
||||
mnemonicBrief->setText(tr("Hide mnemonic brief"));
|
||||
return true;
|
||||
});
|
||||
|
||||
mMenuBuilder->addAction(makeShortcutAction(QIcon(":/icons/images/highlight.png"), tr("&Highlighting mode"), SLOT(enableHighlightingModeSlot()), "ActionHighlightingMode"));
|
||||
mMenuBuilder->addSeparator();
|
||||
|
@ -359,7 +367,7 @@ void CPUDisassembly::setupRightClickContextMenu()
|
|||
else
|
||||
return false;
|
||||
|
||||
labelAddress->setText("Label " + ToPtrString(addr));
|
||||
labelAddress->setText(tr("Label") + " " + ToPtrString(addr));
|
||||
|
||||
return DbgMemIsValidReadPtr(addr);
|
||||
});
|
||||
|
@ -1364,3 +1372,22 @@ void CPUDisassembly::editSoftBpActionSlot()
|
|||
{
|
||||
Breakpoints::editBP(bp_normal, ToHexString(rvaToVa(getInitialSelection())), this);
|
||||
}
|
||||
|
||||
void CPUDisassembly::mnemonicHelpSlot()
|
||||
{
|
||||
BASIC_INSTRUCTION_INFO disasm;
|
||||
DbgDisasmFastAt(rvaToVa(getInitialSelection()), &disasm);
|
||||
if(!*disasm.instruction)
|
||||
return;
|
||||
char* space = strstr(disasm.instruction, " ");
|
||||
if(space)
|
||||
*space = '\0';
|
||||
DbgCmdExecDirect(QString("mnemonichelp %1").arg(disasm.instruction).toUtf8().constData());
|
||||
emit displayLogWidget();
|
||||
}
|
||||
|
||||
void CPUDisassembly::mnemonicBriefSlot()
|
||||
{
|
||||
mShowMnemonicBrief = !mShowMnemonicBrief;
|
||||
reloadData();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ signals:
|
|||
void showPatches();
|
||||
void decompileAt(dsint start, dsint end);
|
||||
void displaySnowmanWidget();
|
||||
void displayLogWidget();
|
||||
|
||||
public slots:
|
||||
void toggleInt3BPActionSlot();
|
||||
|
@ -86,6 +87,8 @@ public slots:
|
|||
void displayWarningSlot(QString title, QString text);
|
||||
void labelHelpSlot();
|
||||
void editSoftBpActionSlot();
|
||||
void mnemonicHelpSlot();
|
||||
void mnemonicBriefSlot();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
|
|
@ -263,6 +263,8 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
|
||||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(displaySourceManagerWidget()), this, SLOT(displaySourceViewWidget()));
|
||||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(displaySnowmanWidget()), this, SLOT(displaySnowmanWidget()));
|
||||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(displayLogWidget()), this, SLOT(displayLogWidget()));
|
||||
|
||||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(showPatches()), this, SLOT(patchWindow()));
|
||||
connect(mCpuWidget->getDisasmWidget(), SIGNAL(decompileAt(dsint, dsint)), this, SLOT(decompileAt(dsint, dsint)));
|
||||
connect(mCpuWidget->getDumpWidget(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
|
||||
|
|
|
@ -42,6 +42,8 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultColors.insert("DisassemblyCommentBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyAutoCommentColor", QColor("#808080"));
|
||||
defaultColors.insert("DisassemblyAutoCommentBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyMnemonicBriefColor", QColor("#717171"));
|
||||
defaultColors.insert("DisassemblyMnemonicBriefBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyFunctionColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyLoopColor", QColor("#000000"));
|
||||
|
||||
|
@ -297,6 +299,8 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultShortcuts.insert("ActionFindReferencesToSelectedAddress", Shortcut(tr("Actions -> Find References to Selected Address"), "Ctrl+R"));
|
||||
defaultShortcuts.insert("ActionFindPattern", Shortcut(tr("Actions -> Find Pattern"), "Ctrl+B"));
|
||||
defaultShortcuts.insert("ActionFindReferences", Shortcut(tr("Actions -> Find References"), "Ctrl+R"));
|
||||
defaultShortcuts.insert("ActionHelpOnMnemonic", Shortcut(tr("Actions -> Help on Mnemonic"), "Ctrl+F1"));
|
||||
defaultShortcuts.insert("ActionToggleMnemonicBrief", Shortcut(tr("Actions -> Toggle Mnemonic Brief"), "Ctrl+Shift+F1"));
|
||||
defaultShortcuts.insert("ActionHighlightingMode", Shortcut(tr("Actions -> Highlighting Mode"), "Ctrl+H"));
|
||||
defaultShortcuts.insert("ActionFind", Shortcut(tr("Actions -> Find"), "Ctrl+F"));
|
||||
defaultShortcuts.insert("ActionDecompileFunction", Shortcut(tr("Actions -> Decompile Function"), "F5"));
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 582 B |
|
@ -92,5 +92,7 @@
|
|||
<file>images/bottom.png</file>
|
||||
<file>images/top.png</file>
|
||||
<file>images/fileoffset.png</file>
|
||||
<file>images/helpbrief.png</file>
|
||||
<file>images/helpmnemonic.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in New Issue