mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: add server notify
This commit is contained in:
@@ -12,11 +12,12 @@ VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer)
|
||||
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController)
|
||||
{
|
||||
connect(this,&VersionSelectWidget::sigSendSwitchVersion,sendSystem,&SendSystem::sendChangeVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendCopyVersion,sendSystem,&SendSystem::sendCopyVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendDeleteVersion,sendSystem,&SendSystem::sendDeleteVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||
this->versionContainer = versionContainer;
|
||||
hide();
|
||||
}
|
||||
@@ -62,7 +63,7 @@ void VersionSelectWidget::sendCopyEmit(QString newName)
|
||||
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
showWarning(tr("Версия не выбрана"));
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,7 +71,7 @@ void VersionSelectWidget::sendCopyEmit(QString newName)
|
||||
|
||||
if (matchIndex > 0)
|
||||
{
|
||||
showWarning(tr("Версия с таким именем уже существует"));
|
||||
sigSendNotify(tr("Версия с таким именем уже существует"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,21 +83,21 @@ void VersionSelectWidget::on_DeleteVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
showWarning(tr("Версия не выбрана"));
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedVersion->getViewName() == baseNamePackage)
|
||||
{
|
||||
showWarning(tr("Нельзя удалить базовый пакет"));
|
||||
return;
|
||||
}
|
||||
// if (selectedVersion->getViewName() == baseNamePackage)
|
||||
// {
|
||||
// showWarning(tr("Нельзя удалить базовый пакет"));
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (selectedVersion->getViewName() == versionContainer->getServerVersion())
|
||||
{
|
||||
showWarning(tr("Нельзя удалить активную версию"));
|
||||
return;
|
||||
}
|
||||
// if (selectedVersion->getViewName() == versionContainer->getServerVersion())
|
||||
// {
|
||||
// showWarning(tr("Нельзя удалить активную версию"));
|
||||
// return;
|
||||
// }
|
||||
emit sigSendDeleteVersion(selectedVersion);
|
||||
}
|
||||
|
||||
@@ -104,7 +105,7 @@ void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
showWarning(tr("Версия не выбрана"));
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,14 +114,7 @@ void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
||||
emit sigSendSwitchVersion(selectedVersion);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::showWarning(QString text)
|
||||
{
|
||||
QMessageBox warning;
|
||||
warning.setText(text);
|
||||
warning.setIcon(QMessageBox::Warning);
|
||||
warning.setWindowTitle(tr("Ошибка"));
|
||||
warning.exec();
|
||||
}
|
||||
|
||||
|
||||
VersionSelectWidget::~VersionSelectWidget()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user