#include "adduniversedialog.h"
#include "ui_adduniversedialog.h"

AddUniverseDialog::AddUniverseDialog(QWidget *parent, uint16_t universe,
                                     QString title)
  : QDialog(parent)
  , ui(new Ui::AddUniverseDialog)
{
  ui->setupUi(this);
  ui->spinBox->setValue(universe);

  setWindowTitle(title.isEmpty() ? tr("Add Universe") : title);

  connect(this, &QDialog::accepted,
          this, &AddUniverseDialog::requestAddition);
}

AddUniverseDialog::~AddUniverseDialog()
{
  delete ui;
}

void AddUniverseDialog::requestAddition() {
  emit additionRequested(ui->spinBox->value());
}
