Add "Disasm Options" context menu in the Memory Widget

This commit is contained in:
pancake 2017-10-03 10:50:07 +02:00
parent c0079c77be
commit d764dd9cf5
4 changed files with 21 additions and 0 deletions

View File

@ -761,6 +761,11 @@ QToolButton .svg-icon path {
<string>Copy Disasm</string> <string>Copy Disasm</string>
</property> </property>
</action> </action>
<action name="actionDisplayOptions">
<property name="text">
<string>Copy Disasm</string>
</property>
</action>
<action name="actionStart_Web_Server"> <action name="actionStart_Web_Server">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>

View File

@ -7,6 +7,7 @@
#include "dialogs/XrefsDialog.h" #include "dialogs/XrefsDialog.h"
#include "dialogs/RenameDialog.h" #include "dialogs/RenameDialog.h"
#include "dialogs/CommentsDialog.h" #include "dialogs/CommentsDialog.h"
#include "dialogs/AsmOptionsDialog.h"
#include "dialogs/FlagDialog.h" #include "dialogs/FlagDialog.h"
#include <QTemporaryFile> #include <QTemporaryFile>
@ -988,6 +989,12 @@ void MemoryWidget::showHexASCIIContextMenu(const QPoint &pt)
delete menu; delete menu;
} }
void MemoryWidget::on_actionDisplayOptions_triggered()
{
auto dialog = new AsmOptionsDialog(main->core, this);
dialog->show();
}
void MemoryWidget::showDisasContextMenu(const QPoint &pt) void MemoryWidget::showDisasContextMenu(const QPoint &pt)
{ {
// Set Disas popup menu // Set Disas popup menu
@ -1018,6 +1025,8 @@ void MemoryWidget::showDisasContextMenu(const QPoint &pt)
menu->addAction(ui->actionDisasCopy_All); menu->addAction(ui->actionDisasCopy_All);
menu->addAction(ui->actionDisasCopy_Bytes); menu->addAction(ui->actionDisasCopy_Bytes);
menu->addAction(ui->actionDisasCopy_Disasm); menu->addAction(ui->actionDisasCopy_Disasm);
menu->addSeparator();
menu->addAction(ui->actionDisplayOptions);
ui->disasTextEdit_2->setContextMenuPolicy(Qt::CustomContextMenu); ui->disasTextEdit_2->setContextMenuPolicy(Qt::CustomContextMenu);
} }

View File

@ -134,6 +134,8 @@ private slots:
void on_actionHideDisasm_side_panel_triggered(); void on_actionHideDisasm_side_panel_triggered();
void on_actionHideHexdump_side_panel_triggered(); void on_actionHideHexdump_side_panel_triggered();
void on_actionHideGraph_side_panel_triggered(); void on_actionHideGraph_side_panel_triggered();
void on_actionDisplayOptions_triggered();
void on_disasButton_clicked(); void on_disasButton_clicked();
void on_graphButton_clicked(); void on_graphButton_clicked();
void on_hexButton_clicked(); void on_hexButton_clicked();

View File

@ -2823,6 +2823,11 @@ QToolTip {
<string>Copy bytes</string> <string>Copy bytes</string>
</property> </property>
</action> </action>
<action name="actionDisplayOptions">
<property name="text">
<string>Display Options</string>
</property>
</action>
<action name="actionDisasCopy_Disasm"> <action name="actionDisasCopy_Disasm">
<property name="text"> <property name="text">
<string>Copy disasm</string> <string>Copy disasm</string>