mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 04:16:12 +00:00
FunctionsWidget: Add undefine function action. (#217)
This commit is contained in:
parent
ce2557ccbe
commit
7b3c2fe7b1
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user