diff --git a/src/dialogs/EditStringDialog.cpp b/src/dialogs/EditStringDialog.cpp index 5f6f2e74..9f14d636 100644 --- a/src/dialogs/EditStringDialog.cpp +++ b/src/dialogs/EditStringDialog.cpp @@ -3,20 +3,17 @@ EditStringDialog::EditStringDialog(QWidget *parent) : QDialog(parent) - , ui(new Ui::EditStringDialog) + , ui(new Ui::EditStringDialog{}) { ui->setupUi(this); ui->spinBox_size->setMinimum(0); ui->lineEdit_address->setMinimumWidth(150); - ui->pushButton_ok->setFocus(); + ui->spinBox_size->setFocus(); ui->comboBox_type->addItems({"Auto", "ASCII/Latin1", "UTF-8"}); connect(ui->checkBox_autoSize, &QCheckBox::toggled, ui->spinBox_size, &QSpinBox::setDisabled); } -EditStringDialog::~EditStringDialog() -{ - delete ui; -} +EditStringDialog::~EditStringDialog() { } void EditStringDialog::setStringStartAddress(uint64_t address) { diff --git a/src/dialogs/EditStringDialog.h b/src/dialogs/EditStringDialog.h index 78a48652..72fabd8d 100644 --- a/src/dialogs/EditStringDialog.h +++ b/src/dialogs/EditStringDialog.h @@ -1,6 +1,7 @@ #ifndef EDITSTRINGDIALOG_H #define EDITSTRINGDIALOG_H +#include #include namespace Ui { @@ -52,7 +53,7 @@ public: StringType getStringType() const; private: - Ui::EditStringDialog *ui; + std::unique_ptr ui; }; #endif // EDITSTRINGDIALOG_H diff --git a/src/dialogs/EditStringDialog.ui b/src/dialogs/EditStringDialog.ui index c6fa8623..d265fb1d 100644 --- a/src/dialogs/EditStringDialog.ui +++ b/src/dialogs/EditStringDialog.ui @@ -23,17 +23,23 @@ Edit string + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + - - - - Address: - - - @@ -54,23 +60,23 @@ + + + + Address: + + + - - - - - - - 150 - 0 + 24 @@ -78,9 +84,16 @@ + + + + + + + - + Auto @@ -89,29 +102,22 @@ - - - - Cancel - - - - - - - OK - - - + + spinBox_size + checkBox_autoSize + comboBox_type + lineEdit_address + dialogButtonBox + - pushButton_cancel - clicked() + dialogButtonBox + accepted() EditStringDialog - reject() + accept() 51 @@ -124,10 +130,10 @@ - pushButton_ok - clicked() + dialogButtonBox + rejected() EditStringDialog - accept() + reject() 143 diff --git a/src/menus/DisassemblyContextMenu.cpp b/src/menus/DisassemblyContextMenu.cpp index 91b7541a..d9ea3e5d 100644 --- a/src/menus/DisassemblyContextMenu.cpp +++ b/src/menus/DisassemblyContextMenu.cpp @@ -248,7 +248,7 @@ void DisassemblyContextMenu::addSetAsMenu() initAction(&actionSetAsStringRemove, tr("Remove"), SLOT(on_actionSetAsStringRemove_triggered())); initAction(&actionSetAsStringAdvanced, tr("Advanced"), - SLOT(on_actionSetAsStringAdvanced_triggered())); + SLOT(on_actionSetAsStringAdvanced_triggered()), getSetAsStringAdvanced()); setAsString->addAction(&actionSetAsStringAuto); @@ -604,6 +604,10 @@ QKeySequence DisassemblyContextMenu::getSetAsStringSequence() const return {Qt::Key_A}; } +QKeySequence DisassemblyContextMenu::getSetAsStringAdvanced() const +{ + return {Qt::SHIFT + Qt::Key_A}; +} QKeySequence DisassemblyContextMenu::getSetToDataSequence() const { diff --git a/src/menus/DisassemblyContextMenu.h b/src/menus/DisassemblyContextMenu.h index cfe660eb..bfffe912 100644 --- a/src/menus/DisassemblyContextMenu.h +++ b/src/menus/DisassemblyContextMenu.h @@ -89,6 +89,7 @@ private: QKeySequence getCopyAddressSequence() const; QKeySequence getSetToCodeSequence() const; QKeySequence getSetAsStringSequence() const; + QKeySequence getSetAsStringAdvanced() const; QKeySequence getSetToDataSequence() const; QKeySequence getSetToDataExSequence() const; QKeySequence getAddFlagSequence() const;