2018-02-12 20:12:13 +00:00
|
|
|
#ifndef EDITINSTRUCTIONDIALOG_H
|
|
|
|
#define EDITINSTRUCTIONDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QKeyEvent>
|
|
|
|
#include <memory>
|
|
|
|
|
2018-03-21 20:32:32 +00:00
|
|
|
namespace Ui {
|
|
|
|
class EditInstructionDialog;
|
2018-02-12 20:12:13 +00:00
|
|
|
}
|
|
|
|
|
2018-10-23 05:06:26 +00:00
|
|
|
enum InstructionEditMode {
|
|
|
|
EDIT_NONE, EDIT_BYTES, EDIT_TEXT
|
|
|
|
};
|
|
|
|
|
2018-02-12 20:12:13 +00:00
|
|
|
class EditInstructionDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-10-23 05:06:26 +00:00
|
|
|
explicit EditInstructionDialog(QWidget *parent, InstructionEditMode isEditingBytes);
|
2018-02-12 20:12:13 +00:00
|
|
|
~EditInstructionDialog();
|
|
|
|
|
|
|
|
QString getInstruction();
|
|
|
|
void setInstruction(const QString &instruction);
|
2018-09-14 17:20:54 +00:00
|
|
|
|
2018-02-12 20:12:13 +00:00
|
|
|
private slots:
|
|
|
|
void on_buttonBox_accepted();
|
|
|
|
|
|
|
|
void on_buttonBox_rejected();
|
|
|
|
|
2018-09-21 21:44:14 +00:00
|
|
|
void updatePreview(const QString &input);
|
|
|
|
|
2018-02-12 20:12:13 +00:00
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::EditInstructionDialog> ui;
|
2018-10-23 05:06:26 +00:00
|
|
|
InstructionEditMode editMode; // true if editing intruction **bytes**; false if editing instruction **text**
|
2018-02-12 20:12:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // EDITINSTRUCTIONDIALOG_H
|