#include "newversionwidget.h"
#include "ui_newversionwidget.h"

NewVersionWidget::NewVersionWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::NewVersionWidget)
{
    ui->setupUi(this);
    setWindowFlag(Qt::SubWindow);
    setAttribute(Qt::WA_ShowModal,true);
}

void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QString prevName)
{
    this->versionSelectWidget = versionSelectWidget;
    ui->prevVerValue->setText(prevName);
}


void NewVersionWidget::on_createButton_clicked()
{
    if(ui->lineEdit->text() != "")
    {
        versionSelectWidget->sendCopyEmit(ui->lineEdit->text());
    }
}

void NewVersionWidget::on_cancelButton_clicked()
{
    hide();
}

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