FunctionsWidget: Add undefine function action. (#217)

This commit is contained in:
Thomas (nezza-_-) Roth 2017-12-14 22:54:57 +01:00 committed by Maijin
parent ce2557ccbe
commit 7b3c2fe7b1
4 changed files with 12 additions and 2 deletions

View File

@ -41,7 +41,7 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent)
createAction(&actionDeleteComment, tr("Delete comment"), {}, SLOT(on_actionDeleteComment_triggered()));
createAction(&actionDeleteFlag, tr("Delete flag"), {}, SLOT(on_actionDeleteFlag_triggered()));
createAction(&actionDeleteFunction, tr("Delete function"), {}, SLOT(on_actionDeleteFunction_triggered()));
createAction(&actionDeleteFunction, tr("Undefine function"), {}, SLOT(on_actionDeleteFunction_triggered()));
setBaseMenu = new QMenu(tr("Set Immediate Base to..."), this);
setBaseMenuAction = addMenu(setBaseMenu);

View File

@ -25,6 +25,7 @@ DisassemblerGraphView::DisassemblerGraphView(QWidget *parent)
connect(Core(), SIGNAL(flagsChanged()), this, SLOT(refreshView()));
connect(Core(), SIGNAL(varsChanged()), this, SLOT(refreshView()));
connect(Core(), SIGNAL(instructionChanged(RVA)), this, SLOT(refreshView()));
connect(Core(), SIGNAL(functionsChanged()), this, SLOT(refreshView()));
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(colorsUpdatedSlot()));
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(fontsUpdatedSlot()));
@ -597,6 +598,7 @@ void DisassemblerGraphView::blockClicked(GraphView::GraphBlock &block, QMouseEve
void DisassemblerGraphView::blockDoubleClicked(GraphView::GraphBlock &block, QMouseEvent *event, QPoint pos)
{
Q_UNUSED(event);
RVA instr = getInstrForMouseEvent(block, &pos);
if(instr == RVA_INVALID)
{

View File

@ -430,7 +430,7 @@ void FunctionsWidget::showFunctionsContextMenu(const QPoint &pt)
menu->clear();
menu->addAction(ui->actionDisasAdd_comment);
menu->addAction(ui->actionFunctionsRename);
//menu->addAction(ui->actionFunctionsUndefine);
menu->addAction(ui->actionFunctionsUndefine);
menu->addSeparator();
menu->addAction(ui->action_References);
@ -492,6 +492,13 @@ void FunctionsWidget::on_actionFunctionsRename_triggered()
}
}
void FunctionsWidget::on_actionFunctionsUndefine_triggered()
{
QTreeView *treeView = getCurrentTreeView();
FunctionDescription function = treeView->selectionModel()->currentIndex().data(FunctionModel::FunctionDescriptionRole).value<FunctionDescription>();
Core()->delFunction(function.offset);
}
void FunctionsWidget::on_action_References_triggered()
{
// Get selected item in functions tree view

View File

@ -95,6 +95,7 @@ private slots:
void on_actionDisasAdd_comment_triggered();
void on_actionFunctionsRename_triggered();
void on_action_References_triggered();
void on_actionFunctionsUndefine_triggered();
void on_actionHorizontal_triggered();
void on_actionVertical_triggered();