mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Remove unneeded menu (#720)
This commit is contained in:
parent
96bf32b86a
commit
ce54e4ea8f
@ -47,10 +47,13 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent)
|
||||
initAction(&actionDeleteFlag, tr("Delete flag"), SLOT(on_actionDeleteFlag_triggered()));
|
||||
addAction(&actionDeleteFlag);
|
||||
|
||||
initAction(&actionDeleteFunction, tr("Undefine function"), SLOT(on_actionDeleteFunction_triggered()));
|
||||
initAction(&actionDeleteFunction, tr("Undefine function"),
|
||||
SLOT(on_actionDeleteFunction_triggered()));
|
||||
addAction(&actionDeleteFunction);
|
||||
|
||||
addAnalyzeMenu();
|
||||
initAction(&actionAnalyzeFunction, tr("Define function here..."),
|
||||
SLOT(on_actionAnalyzeFunction_triggered()));
|
||||
addAction(&actionAnalyzeFunction);
|
||||
|
||||
addSetBaseMenu();
|
||||
|
||||
@ -90,16 +93,6 @@ DisassemblyContextMenu::~DisassemblyContextMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::addAnalyzeMenu()
|
||||
{
|
||||
analyzeMenu = addMenu(tr("Analyze..."));
|
||||
|
||||
initAction(&actionAnalyzeFunction, tr("Create Function"));
|
||||
analyzeMenu->addAction(&actionAnalyzeFunction);
|
||||
connect(&actionAnalyzeFunction, &QAction::triggered, this,
|
||||
&DisassemblyContextMenu::on_actionAnalyzeFunction_triggered);
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::addSetBaseMenu()
|
||||
{
|
||||
setBaseMenu = addMenu(tr("Set Immediate Base to..."));
|
||||
@ -363,8 +356,7 @@ void DisassemblyContextMenu::on_actionEditInstruction_triggered()
|
||||
|
||||
e->setInstruction(oldInstructionOpcode);
|
||||
|
||||
if (e->exec())
|
||||
{
|
||||
if (e->exec()) {
|
||||
QString userInstructionOpcode = e->getInstruction();
|
||||
if (userInstructionOpcode != oldInstructionOpcode) {
|
||||
Core()->editInstruction(offset, userInstructionOpcode);
|
||||
@ -427,8 +419,7 @@ void DisassemblyContextMenu::on_actionEditBytes_triggered()
|
||||
QString oldBytes = Core()->getInstructionBytes(offset);
|
||||
e->setInstruction(oldBytes);
|
||||
|
||||
if (e->exec())
|
||||
{
|
||||
if (e->exec()) {
|
||||
QString bytes = e->getInstruction();
|
||||
if (bytes != oldBytes) {
|
||||
Core()->editBytes(offset, bytes);
|
||||
@ -448,12 +439,13 @@ void DisassemblyContextMenu::writeFailed()
|
||||
msgBox.setWindowTitle(tr("Write error"));
|
||||
msgBox.setText(tr("Unable to complete write operation. Consider opening in write mode."));
|
||||
msgBox.addButton(tr("OK"), QMessageBox::NoRole);
|
||||
QAbstractButton* reopenButton = msgBox.addButton(tr("Reopen in write mode"), QMessageBox::YesRole);
|
||||
QAbstractButton *reopenButton = msgBox.addButton(tr("Reopen in write mode"), QMessageBox::YesRole);
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
if (msgBox.clickedButton() == reopenButton) {
|
||||
QMessageBox::warning(this, "File reopened in write mode", "WARNING: Any chages will now be commited to disk");
|
||||
QMessageBox::warning(this, "File reopened in write mode",
|
||||
"WARNING: Any chages will now be commited to disk");
|
||||
Core()->cmd("oo+");
|
||||
}
|
||||
}
|
||||
@ -513,7 +505,7 @@ void DisassemblyContextMenu::on_actionAnalyzeFunction_triggered()
|
||||
{
|
||||
RenameDialog *dialog = new RenameDialog(this);
|
||||
dialog->setWindowTitle(tr("Analyze function at %1").arg(RAddressString(offset)));
|
||||
dialog->setPlaceholderText(tr("Auto"));
|
||||
dialog->setPlaceholderText(tr("Function name"));
|
||||
if (dialog->exec()) {
|
||||
QString function_name = dialog->getName();
|
||||
Core()->createFunctionAt(offset, function_name);
|
||||
|
@ -83,7 +83,6 @@ private:
|
||||
|
||||
QAction actionAddComment;
|
||||
QAction actionAddFlag;
|
||||
QMenu *analyzeMenu;
|
||||
QAction actionAnalyzeFunction;
|
||||
QAction actionRename;
|
||||
QAction actionRenameUsedHere;
|
||||
@ -134,7 +133,6 @@ private:
|
||||
void setToData(int size, int repeat = 1);
|
||||
void setBits(int bits);
|
||||
|
||||
void addAnalyzeMenu();
|
||||
void addSetBaseMenu();
|
||||
void addSetBitsMenu();
|
||||
void addSetToDataMenu();
|
||||
|
Loading…
Reference in New Issue
Block a user