mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
51 lines
1.0 KiB
C++
51 lines
1.0 KiB
C++
#include "dialognewversion.h"
|
|
#include "ui_dialognewversion.h"
|
|
|
|
DialogNewVersion::DialogNewVersion(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::DialogNewVersion),
|
|
validator(nullptr)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
validator = new QRegExpValidator(QRegExp("^[A-Za-z0-9]{20}$"));
|
|
ui->lineEdit->setValidator(validator);
|
|
|
|
setMinimumSize(200, 100);
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
setWindowTitle(tr("New version"));
|
|
}
|
|
|
|
DialogNewVersion::~DialogNewVersion()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void DialogNewVersion::initialize(QString prevName)
|
|
{
|
|
ui->prevVerValue->setText(prevName);
|
|
}
|
|
|
|
QString DialogNewVersion::getNewName()
|
|
{
|
|
return ui->lineEdit->text();
|
|
}
|
|
|
|
void DialogNewVersion::on_createButton_clicked()
|
|
{
|
|
if(ui->lineEdit->text() != "")
|
|
{
|
|
accept();
|
|
}
|
|
}
|
|
|
|
void DialogNewVersion::on_cancelButton_clicked()
|
|
{
|
|
close();
|
|
}
|
|
|
|
void DialogNewVersion::on_lineEdit_inputRejected()
|
|
{
|
|
QToolTip::showText(QCursor::pos(),tr("Only Latin letters and numbers"));
|
|
}
|