1
0
Fork 0

GUI: hide the "Disable Branch Destination Preview" menu + symbol menu in system modules only

This commit is contained in:
Duncan Ogilvie 2017-12-18 02:14:50 +01:00
parent ed1dd3c6c1
commit bdde5d3cce
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 4 additions and 5 deletions

View File

@ -358,7 +358,7 @@ void CPUDisassembly::setupRightClickContextMenu()
mMenuBuilder->addAction(togglePreview, [this, togglePreview](QMenu*)
{
togglePreview->setText(mPopupEnabled ? tr("Disable Branch Destination Preview") : tr("Enable Branch Destination Preview"));
return true;
return false; //hide this menu from the user, but keep the shortcut working
});
MenuBuilder* labelMenu = new MenuBuilder(this);
@ -504,12 +504,11 @@ void CPUDisassembly::setupRightClickContextMenu()
mMenuBuilder->addMenu(makeMenu(DIcon("analysis.png"), tr("Analysis")), analysisMenu);
mMenuBuilder->addAction(makeShortcutAction(DIcon("pdb.png"), tr("Download Symbols for This Module"), SLOT(downloadCurrentSymbolsSlot()), "ActionDownloadSymbol"), [this](QMenu*)
{
char module[MAX_MODULE_SIZE] = "";
return DbgGetModuleAt(rvaToVa(getInitialSelection()), module);
//only show this action in system modules (generally user modules don't have downloadable symbols)
return DbgFunctions()->ModGetParty(rvaToVa(getInitialSelection())) == 1;
});
mMenuBuilder->addSeparator();
mMenuBuilder->addAction(makeShortcutAction(DIcon("compile.png"), tr("Assemble"), SLOT(assembleSlot()), "ActionAssemble"));
removeAction(mMenuBuilder->addAction(makeShortcutAction(DIcon("patch.png"), tr("Patches"), SLOT(showPatchesSlot()), "ViewPatches"))); //prevent conflicting shortcut with the MainWindow
mMenuBuilder->addAction(makeShortcutAction(DIcon("yara.png"), tr("&Yara..."), SLOT(yaraSlot()), "ActionYara"));

View File

@ -6,7 +6,7 @@
#include <functional>
/**
* @brief The MenuBuilder class implements the dynamical context menu system for many views.
* @brief The MenuBuilder class implements the dynamic context menu system for many views.
*/
class MenuBuilder : public QObject
{