cutter/src/dialogs/FlagDialog.cpp

34 lines
735 B
C++
Raw Normal View History

2017-10-01 19:09:42 +00:00
#include "FlagDialog.h"
#include "ui_FlagDialog.h"
#include <QIntValidator>
#include "core/Cutter.h"
FlagDialog::FlagDialog(RVA offset, QWidget *parent) :
QDialog(parent),
2017-10-02 09:41:28 +00:00
ui(new Ui::FlagDialog),
offset(offset)
{
ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
auto size_validator = new QIntValidator(ui->sizeEdit);
size_validator->setBottom(1);
ui->sizeEdit->setValidator(size_validator);
}
2017-10-02 09:41:28 +00:00
FlagDialog::~FlagDialog() {}
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
}