From d764dd9cf598f0ee5c80d2b6437a42cf0fdeb507 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 3 Oct 2017 10:50:07 +0200 Subject: [PATCH] Add "Disasm Options" context menu in the Memory Widget --- src/MainWindow.ui | 5 +++++ src/widgets/MemoryWidget.cpp | 9 +++++++++ src/widgets/MemoryWidget.h | 2 ++ src/widgets/MemoryWidget.ui | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 40f19508..708de1e5 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -761,6 +761,11 @@ QToolButton .svg-icon path { Copy Disasm + + + Copy Disasm + + true diff --git a/src/widgets/MemoryWidget.cpp b/src/widgets/MemoryWidget.cpp index 4d6e5201..d0f3e958 100644 --- a/src/widgets/MemoryWidget.cpp +++ b/src/widgets/MemoryWidget.cpp @@ -7,6 +7,7 @@ #include "dialogs/XrefsDialog.h" #include "dialogs/RenameDialog.h" #include "dialogs/CommentsDialog.h" +#include "dialogs/AsmOptionsDialog.h" #include "dialogs/FlagDialog.h" #include @@ -988,6 +989,12 @@ void MemoryWidget::showHexASCIIContextMenu(const QPoint &pt) delete menu; } +void MemoryWidget::on_actionDisplayOptions_triggered() +{ + auto dialog = new AsmOptionsDialog(main->core, this); + dialog->show(); +} + void MemoryWidget::showDisasContextMenu(const QPoint &pt) { // Set Disas popup menu @@ -1018,6 +1025,8 @@ void MemoryWidget::showDisasContextMenu(const QPoint &pt) menu->addAction(ui->actionDisasCopy_All); menu->addAction(ui->actionDisasCopy_Bytes); menu->addAction(ui->actionDisasCopy_Disasm); + menu->addSeparator(); + menu->addAction(ui->actionDisplayOptions); ui->disasTextEdit_2->setContextMenuPolicy(Qt::CustomContextMenu); } diff --git a/src/widgets/MemoryWidget.h b/src/widgets/MemoryWidget.h index 3f44f9f4..b5e1e951 100644 --- a/src/widgets/MemoryWidget.h +++ b/src/widgets/MemoryWidget.h @@ -134,6 +134,8 @@ private slots: void on_actionHideDisasm_side_panel_triggered(); void on_actionHideHexdump_side_panel_triggered(); void on_actionHideGraph_side_panel_triggered(); + void on_actionDisplayOptions_triggered(); + void on_disasButton_clicked(); void on_graphButton_clicked(); void on_hexButton_clicked(); diff --git a/src/widgets/MemoryWidget.ui b/src/widgets/MemoryWidget.ui index 27c79f2b..40ab567f 100644 --- a/src/widgets/MemoryWidget.ui +++ b/src/widgets/MemoryWidget.ui @@ -2823,6 +2823,11 @@ QToolTip { Copy bytes + + + Display Options + + Copy disasm