cutter/src/dialogs/FlagDialog.cpp
ncyellow ae35ac9d08 Minor Header Optimizations (#1429)
1. remove unnecessary includes. compile optimization
2. add more const for getter functions
2019-04-06 14:04:55 +02:00

34 lines
735 B
C++

#include "FlagDialog.h"
#include "ui_FlagDialog.h"
#include <QIntValidator>
#include "core/Cutter.h"
FlagDialog::FlagDialog(RVA offset, QWidget *parent) :
QDialog(parent),
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);
}
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();
}