2017-07-11 11:05:42 +00:00
|
|
|
#include "flagdialog.h"
|
2017-09-27 19:46:38 +00:00
|
|
|
#include "ui_flagdialog.h"
|
2017-07-11 11:05:42 +00:00
|
|
|
|
2017-09-25 12:55:41 +00:00
|
|
|
FlagDialog::FlagDialog(CutterCore *core, RVA offset, QWidget *parent) :
|
2017-07-11 11:05:42 +00:00
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::FlagDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
|
|
|
|
|
|
|
this->core = core;
|
|
|
|
this->offset = offset;
|
|
|
|
|
|
|
|
auto size_validator = new QIntValidator(ui->sizeEdit);
|
|
|
|
size_validator->setBottom(1);
|
|
|
|
ui->sizeEdit->setValidator(size_validator);
|
|
|
|
}
|
|
|
|
|
|
|
|
FlagDialog::~FlagDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FlagDialog::on_buttonBox_accepted()
|
|
|
|
{
|
|
|
|
QString name = ui->nameEdit->text();
|
|
|
|
RVA size = ui->sizeEdit->text().toULongLong();
|
|
|
|
core->addFlag(offset, name, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void FlagDialog::on_buttonBox_rejected()
|
|
|
|
{
|
|
|
|
close();
|
2017-09-25 12:55:41 +00:00
|
|
|
}
|